From 15b6f3ddcf602fd77a7b12bc325b377982f91532 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 19 Sep 2020 17:06:43 -0500 Subject: [PATCH] Refactor: color management system. Change the behavior so that fewer arguments are needed for color printing. This introduces a structure where the color codes are now in sets of "before" and "after". This set of two color codes are now passed to the color print functions, thereby reducing the number of arguments needed. --- level_0/f_color/c/color.h | 370 ++++++++++++++---- level_0/f_fss/c/fss.h | 20 +- level_0/f_iki/c/iki.h | 4 +- level_0/f_string/c/string_common.h | 4 +- level_1/fl_color/c/color.c | 158 ++++++-- level_1/fl_color/c/color.h | 160 ++------ level_1/fl_directory/c/directory.h | 28 +- level_1/fl_directory/c/private-directory.h | 2 +- level_1/fl_fss/c/fss_basic.h | 20 +- level_1/fl_fss/c/fss_basic_list.h | 20 +- level_1/fl_fss/c/fss_extended.h | 20 +- level_1/fl_fss/c/fss_extended_list.h | 20 +- level_1/fl_fss/c/private-fss.h | 10 +- level_1/fl_print/c/print.h | 12 +- level_1/fl_string/c/string.h | 34 +- level_1/fl_utf/c/utf.h | 18 +- level_2/fll_file/c/file.c | 58 +-- level_2/fll_file/c/file.h | 12 +- level_2/fll_fss/c/fss.h | 48 +-- level_2/fll_fss/c/fss_status.h | 2 +- level_2/fll_fss/c/private-fss.h | 2 +- level_2/fll_iki/c/iki.h | 16 +- level_2/fll_iki/c/private-iki.h | 8 +- level_2/fll_program/c/program.c | 102 ++--- level_2/fll_program/c/program.h | 50 +-- level_3/byte_dump/c/byte_dump.c | 114 +++--- level_3/byte_dump/c/byte_dump.h | 6 +- level_3/byte_dump/c/private-byte_dump.c | 192 +++++----- level_3/byte_dump/c/private-byte_dump.h | 2 +- level_3/fake/c/fake.c | 34 +- level_3/fake/c/fake.h | 6 +- level_3/fake/c/private-build.c | 208 +++++----- level_3/fake/c/private-clean.c | 6 +- level_3/fake/c/private-fake.c | 98 ++--- level_3/fake/c/private-make.c | 374 +++++++++--------- level_3/fake/c/private-make.h | 4 +- level_3/fake/c/private-print.c | 424 ++++++++++----------- level_3/fake/c/private-skeleton.c | 20 +- level_3/firewall/c/firewall.c | 56 +-- level_3/firewall/c/firewall.h | 6 +- level_3/firewall/c/private-firewall.c | 112 +++--- level_3/firewall/c/private-firewall.h | 2 +- .../fss_basic_list_read/c/fss_basic_list_read.c | 108 +++--- .../fss_basic_list_read/c/fss_basic_list_read.h | 6 +- .../c/private-fss_basic_list_read.c | 186 ++++----- .../c/private-fss_basic_list_read.h | 4 +- .../fss_basic_list_write/c/fss_basic_list_write.c | 30 +- .../fss_basic_list_write/c/fss_basic_list_write.h | 6 +- level_3/fss_basic_read/c/fss_basic_read.c | 108 +++--- level_3/fss_basic_read/c/fss_basic_read.h | 6 +- level_3/fss_basic_read/c/private-fss_basic_read.c | 186 ++++----- level_3/fss_basic_read/c/private-fss_basic_read.h | 4 +- level_3/fss_basic_write/c/fss_basic_write.c | 30 +- level_3/fss_basic_write/c/fss_basic_write.h | 6 +- .../c/fss_extended_list_read.c | 108 +++--- .../c/fss_extended_list_read.h | 6 +- .../c/private-fss_extended_list_read.c | 186 ++++----- .../c/private-fss_extended_list_read.h | 4 +- level_3/fss_extended_read/c/fss_extended_read.c | 108 +++--- level_3/fss_extended_read/c/fss_extended_read.h | 6 +- .../c/private-fss_extended_read.c | 186 ++++----- .../c/private-fss_extended_read.h | 4 +- level_3/fss_extended_write/c/fss_extended_write.c | 30 +- level_3/fss_extended_write/c/fss_extended_write.h | 6 +- level_3/fss_status_code/c/fss_status_code.c | 36 +- level_3/fss_status_code/c/fss_status_code.h | 6 +- .../fss_status_code/c/private-fss_status_code.c | 20 +- .../fss_status_code/c/private-fss_status_code.h | 12 +- level_3/iki_read/c/iki_read.c | 142 +++---- level_3/iki_read/c/iki_read.h | 6 +- level_3/iki_read/c/private-iki_read.c | 216 +++++------ level_3/iki_read/c/private-iki_read.h | 6 +- level_3/iki_write/c/iki_write.c | 68 ++-- level_3/iki_write/c/iki_write.h | 6 +- level_3/iki_write/c/private-iki_write.c | 158 ++++---- level_3/iki_write/c/private-iki_write.h | 4 +- level_3/init/c/init.c | 10 +- level_3/init/c/init.h | 6 +- level_3/init/c/private-init.c | 60 +-- level_3/status_code/c/private-status_code.c | 20 +- level_3/status_code/c/private-status_code.h | 12 +- level_3/status_code/c/status_code.c | 36 +- level_3/status_code/c/status_code.h | 6 +- 83 files changed, 2607 insertions(+), 2409 deletions(-) diff --git a/level_0/f_color/c/color.h b/level_0/f_color/c/color.h index 5f233aa..70df15d 100644 --- a/level_0/f_color/c/color.h +++ b/level_0/f_color/c/color.h @@ -47,65 +47,6 @@ extern "C" { #define f_color_mode_light 3 #endif // _di_f_color_mode_t_ -/** - * The purpose behind these data types are not to dynamically allocate data. - * instead, they are intended to only point to existing data, so these should neither be allocated nor deallocated. - */ -#ifndef _di_f_color_control_t_ - typedef struct { - const int8_t *blink; - const int8_t *bold; - const int8_t *conceal; - const int8_t *reverse; - const int8_t *underline; - } f_color_control_t; - - #define f_color_control_t_initialize_names { "blink", "bold", "conceal", "reverse", "underline" } -#endif // _di_f_color_control_t_ - -/** - * strong represents emphasis. - */ -#ifndef _di_f_color_standard_io_t_ - typedef struct { - const int8_t *error; - const int8_t *message; - const int8_t *warning; - const int8_t *strong_error; - const int8_t *strong_message; - const int8_t *strong_warning; - } f_color_standard_io_t; - - #define f_color_standard_io_t_initialize_names { "error", "message", "warning", "strong_error", "strong_message", "strong_warning" } -#endif // _di_f_color_standard_io_t_ - -/** - * alert = some form of alert such as 'Not Implemented Yet'. - * command = color for a specific command, such as '-h'. - * comment = not quite important text, but still should be seen. - * emphasize = make sure something stands out to emphasize it. - * standard = the normal text color. - * syntax = color for syntax, such as '[' and '<'. - * title = name printed. - * topic = topic such as 'Usage'. - * version = version printed. - */ -#ifndef _di_f_color_help_t_ - typedef struct { - const int8_t *alert; - const int8_t *command; - const int8_t *comment; - const int8_t *emphasize; - const int8_t *standard; - const int8_t *syntax; - const int8_t *title; - const int8_t *topic; - const int8_t *version; - } f_color_help_t; - - #define f_color_help_t_initialize_names { "alert", "command", "comment", "emphasize", "standard", "syntax", "title", "topic", "version" } -#endif // _di_f_color_help_t_ - #ifndef _di_f_color_format_t_ typedef struct { const int8_t *begin; @@ -115,6 +56,21 @@ extern "C" { #define f_color_format_t_initialize_linux { "\033[", "m", ";" } #define f_color_format_t_initialize_xterminal { "\033[", "m", ";" } + + #define f_macro_color_format_t_clear(format) \ + format.begin = 0; \ + format.end = 0; \ + format.medium = 0; + + #define f_macro_color_format_t_set_linux(format) \ + format.begin = "\033["; \ + format.end = "m"; \ + format.medium = ";"; + + #define f_macro_color_format_t_set_xterminal(format) \ + format.begin = "\033["; \ + format.end = "m"; \ + format.medium = ";"; #endif // _di_f_color_format_t_ /** @@ -170,22 +126,298 @@ extern "C" { #define f_color_t_initialize_linux { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47" } #define f_color_t_initialize_xterminal { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "90", "91", "92", "93", "94", "95", "96", "97", "100", "101", "102", "103", "104", "105", "106", "107" } + + #define f_macro_color_t_clear(color) \ + color.reset = 0; \ + color.bold = 0; \ + color.underline = 0; \ + color.blink = 0; \ + color.reverse = 0; \ + color.conceal = 0; \ + color.black = 0; \ + color.red = 0; \ + color.green = 0; \ + color.yellow = 0; \ + color.blue = 0; \ + color.purple = 0; \ + color.teal = 0; \ + color.white = 0; \ + color.black_bg = 0; \ + color.red_bg = 0; \ + color.green_bg = 0; \ + color.yellow_bg = 0; \ + color.blue_bg = 0; \ + color.purple_bg = 0; \ + color.teal_bg = 0; \ + color.white_bg = 0; \ + color.bright_black = 0; \ + color.bright_red = 0; \ + color.bright_green = 0; \ + color.bright_yellow = 0; \ + color.bright_blue = 0; \ + color.bright_purple = 0; \ + color.bright_teal = 0; \ + color.bright_white = 0; \ + color.bright_black_bg = 0; \ + color.bright_red_bg = 0; \ + color.bright_green_bg = 0; \ + color.bright_yellow_bg = 0; \ + color.bright_blue_bg = 0; \ + color.bright_purple_bg = 0; \ + color.bright_teal_bg = 0; \ + color.bright_white_bg = 0; + + #define f_macro_color_t_set_linux(color) \ + color.reset = "0"; \ + color.bold = "1"; \ + color.underline = "4"; \ + color.blink = "5"; \ + color.reverse = "7"; \ + color.conceal = "8"; \ + color.black = "30"; \ + color.red = "31"; \ + color.green = "32"; \ + color.yellow = "33"; \ + color.blue = "34"; \ + color.purple = "35"; \ + color.teal = "36"; \ + color.white = "37"; \ + color.black_bg = "40"; \ + color.red_bg = "41"; \ + color.green_bg = "42"; \ + color.yellow_bg = "43"; \ + color.blue_bg = "44"; \ + color.purple_bg = "45"; \ + color.teal_bg = "46"; \ + color.white_bg = "47"; \ + color.bright_black = "30"; \ + color.bright_red = "31"; \ + color.bright_green = "32"; \ + color.bright_yellow = "33"; \ + color.bright_blue = "34"; \ + color.bright_purple = "35"; \ + color.bright_teal = "36"; \ + color.bright_white = "37"; \ + color.bright_black_bg = "40"; \ + color.bright_red_bg = "41"; \ + color.bright_green_bg = "42"; \ + color.bright_yellow_bg = "43"; \ + color.bright_blue_bg = "44"; \ + color.bright_purple_bg = "45"; \ + color.bright_teal_bg = "46"; \ + color.bright_white_bg = "47"; + + #define f_macro_color_t_set_xterminal(color) \ + color.reset = "0"; \ + color.bold = "1"; \ + color.underline = "4"; \ + color.blink = "5"; \ + color.reverse = "7"; \ + color.conceal = "8"; \ + color.black = "30"; \ + color.red = "31"; \ + color.green = "32"; \ + color.yellow = "33"; \ + color.blue = "34"; \ + color.purple = "35"; \ + color.teal = "36"; \ + color.white = "37"; \ + color.black_bg = "40"; \ + color.red_bg = "41"; \ + color.green_bg = "42"; \ + color.yellow_bg = "43"; \ + color.blue_bg = "44"; \ + color.purple_bg = "45"; \ + color.teal_bg = "46"; \ + color.white_bg = "47"; \ + color.bright_black = "90"; \ + color.bright_red = "91"; \ + color.bright_green = "92"; \ + color.bright_yellow = "93"; \ + color.bright_blue = "94"; \ + color.bright_purple= "95"; \ + color.bright_teal = "96"; \ + color.bright_white = "97"; \ + color.bright_black_bg = "100"; \ + color.bright_red_bg = "101"; \ + color.bright_green_bg = "102"; \ + color.bright_yellow_bg = "103"; \ + color.bright_blue_bg = "104"; \ + color.bright_purple_bg = "105"; \ + color.bright_teal_bg = "106"; \ + color.bright_white_bg = "107"; #endif // _di_f_color_t_ /** - * Provide global default global instances of f_color_t structures. + * Provide a set of two colors, a before and an after. * - * Supported instances: - * - f_color_format_linux: ideal for linux console. - * - f_color_format_xterminal: ideal for linux x-terminal. + * This is intended to be used for printing, such that the printed code is prefixed with the "before" and postfixed with the "after". + * + * before: A pointer to the dynamic string representing the before color to assign, set to NULL to disable. + * after: A pointer to the dynamic string representing the after color to assign, set to NULL to disable. */ -#ifndef _di_f_color_default_ - static const f_color_format_t f_color_format_linux = f_color_format_t_initialize_linux; - static const f_color_format_t f_color_format_xterminal = f_color_format_t_initialize_xterminal; +#ifndef _di_f_color_set_t_ + typedef struct { + const f_string_dynamic_t *before; + const f_string_dynamic_t *after; + } f_color_set_t; + + #define f_color_set_t_initialize { 0, 0 } + + #define f_macro_color_set_t_clear(set) \ + set.before = 0; \ + set.after = 0; +#endif // _di_f_color_set_t_ + +/** + * Provide a set of color contexts. + * + * This is intended to be used for printing, such that the printed code is prefixed with the "before" and postfixed with the "after", for each context. + * + * warning: Color context associated with "warning". + * error: Color context associated with "error". + * title: Color context associated with "title". + * notable: Color context associated with "notable". + * important: Color context associated with "important". + * standout: Color context associated with "standout". + * normal: Color context associated with "normal". + * normal_reset: Color context associated with "normal_reset". + */ +#ifndef _di_f_color_set_context_t_ + typedef struct { + f_color_set_t warning; + f_color_set_t error; + f_color_set_t title; + f_color_set_t notable; + f_color_set_t important; + f_color_set_t standout; + f_color_set_t normal; + f_color_set_t normal_reset; + } f_color_set_context_t; + + #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_clear(set) \ + f_macro_color_set_t_clear(set.warning); \ + f_macro_color_set_t_clear(set.error); \ + f_macro_color_set_t_clear(set.title); \ + f_macro_color_set_t_clear(set.notable); \ + f_macro_color_set_t_clear(set.important); \ + f_macro_color_set_t_clear(set.standout); \ + f_macro_color_set_t_clear(set.normal); \ + f_macro_color_set_t_clear(set.normal_reset); + +#endif // _di_f_color_set_context_t_ + +/** + * Provide a color context structure. + * + * This is intended to be used for printing, and this provides a management structure for all color context related data. + * + * list: A list of colors, each with their specific color code string. + * format: The color code formatting strings. + * mode: A code representing the color mode. + * set: A collection of color context sets for direct use in color printing. + * warning: Color context associated with "warning". + * error: Color context associated with "error". + * title: Color context associated with "title". + * notable: Color context associated with "notable". + * important: Color context associated with "important". + * standout: Color context associated with "standout". + * normal: Color context associated with "normal". + * normal_reset: Color context associated with "normal_reset". + */ +#ifndef _di_f_color_context_t_ + typedef struct { + f_color_t list; + f_color_format_t format; + f_color_mode_t mode; + f_color_set_context_t set; + f_string_dynamic_t reset; + f_string_dynamic_t warning; + f_string_dynamic_t error; + f_string_dynamic_t title; + f_string_dynamic_t notable; + f_string_dynamic_t important; + f_string_dynamic_t standout; + f_string_dynamic_t normal; + f_string_dynamic_t normal_reset; + } f_color_context_t; + + #define f_color_context_t_initialize { f_color_t_initialize_linux, f_color_format_t_initialize_linux, f_color_mode_none, f_color_set_context_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } + + #define f_macro_color_context_t_clear(context) \ + f_macro_color_t_clear(context.list); \ + f_macro_color_format_t_clear(context.format); \ + context.mode = f_color_mode_none; \ + f_macro_color_set_context_t_clear(context.set); \ + f_macro_string_dynamic_t_clear(context.error); \ + f_macro_string_dynamic_t_clear(context.title); \ + f_macro_string_dynamic_t_clear(context.notable); \ + f_macro_string_dynamic_t_clear(context.important); \ + f_macro_string_dynamic_t_clear(context.standout); \ + f_macro_string_dynamic_t_clear(context.normal); \ + f_macro_string_dynamic_t_clear(context.normal_reset); + + #define f_macro_color_context_t_new(status, context) \ + f_macro_string_dynamic_t_new(status, context.reset, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.warning, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.error, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.title, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.notable, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.important, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.standout, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.normal, f_color_max_size + 1); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_new(status, context.normal_reset, f_color_max_size + 1); + + #define f_macro_color_context_t_delete(status, context) \ + f_macro_string_dynamic_t_delete(status, context.reset); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.warning); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.error); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.title); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.notable); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.important); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.standout); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.normal); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, context.normal_reset); \ + if (F_status_is_error_not(status)) f_macro_color_context_t_clear(context); + + #define f_macro_color_context_t_destroy(status, context, size) \ + f_macro_string_dynamic_t_destroy(status, context.reset); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.warning, size); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.error, size); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.title, size); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.notable, size); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.important, size); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.standout, size); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.normal); \ + if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, context.normal_reset); \ + if (F_status_is_error_not(status)) f_macro_color_context_t_clear(context); + + #define f_macro_color_context_t_delete_simple(context) \ + f_macro_string_dynamic_t_delete_simple(context.reset); \ + f_macro_string_dynamic_t_delete_simple(context.warning); \ + f_macro_string_dynamic_t_delete_simple(context.error); \ + f_macro_string_dynamic_t_delete_simple(context.title); \ + f_macro_string_dynamic_t_delete_simple(context.notable); \ + f_macro_string_dynamic_t_delete_simple(context.important); \ + f_macro_string_dynamic_t_delete_simple(context.standout); \ + f_macro_string_dynamic_t_delete_simple(context.normal); \ + f_macro_string_dynamic_t_delete_simple(context.normal_reset); \ + f_macro_color_context_t_clear(context); - static const f_color_t f_color_linux = f_color_t_initialize_linux; - static const f_color_t f_color_xterminal = f_color_t_initialize_xterminal; -#endif // _di_f_color_default_ + #define f_macro_color_context_t_destroy_simple(context, size) \ + f_macro_string_dynamic_t_destroy_simple(context.reset); \ + f_macro_string_dynamic_t_destroy_simple(context.warning, size); \ + f_macro_string_dynamic_t_destroy_simple(context.error, size); \ + f_macro_string_dynamic_t_destroy_simple(context.title, size); \ + f_macro_string_dynamic_t_destroy_simple(context.notable, size); \ + f_macro_string_dynamic_t_destroy_simple(context.important, size); \ + f_macro_string_dynamic_t_destroy_simple(context.standout, size); \ + f_macro_string_dynamic_t_destroy_simple(context.normal); \ + f_macro_string_dynamic_t_destroy_simple(context.normal_reset); \ + f_macro_color_context_t_clear(context); +#endif // _di_fl_color_context_t_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 430301f..686d507 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -95,7 +95,7 @@ extern "C" { * F_false if the character in the buffer is not a graph character. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_graph(). + * Errors (with error bit) from: f_utf_is_graph(). * * @see f_utf_is_graph() */ @@ -118,8 +118,8 @@ extern "C" { * F_false if the character in the buffer is not a space character. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_control(). - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_control() * @see f_utf_is_whitespace() @@ -143,8 +143,8 @@ extern "C" { * F_false if the character in the buffer is not a space character. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_control(). - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_zero_width() */ @@ -195,9 +195,9 @@ extern "C" { * F_incomplete_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_control(). - * Errors from (with error bit): f_utf_is_whitespace(). - * Errors from (with error bit): f_utf_is_zero_width(). + * Errors (with error bit) from: f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_zero_width(). * * @see f_utf_is_control() * @see f_utf_is_whitespace() @@ -229,8 +229,8 @@ extern "C" { * F_incomplete_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_graph(). - * Errors from (with error bit): f_utf_is_zero_width(). + * Errors (with error bit) from: f_utf_is_graph(). + * Errors (with error bit) from: f_utf_is_zero_width(). * * @see f_utf_is_graph() * @see f_utf_is_zero_width() diff --git a/level_0/f_iki/c/iki.h b/level_0/f_iki/c/iki.h index 807aacb..7a5d00b 100644 --- a/level_0/f_iki/c/iki.h +++ b/level_0/f_iki/c/iki.h @@ -80,7 +80,7 @@ extern "C" { * F_false on success and string is not a valid object name. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_word(). + * Errors (with error bit) from: f_utf_is_word(). */ #ifndef _di_f_iki_object_is_ extern f_return_status f_iki_object_is(const f_string_static_t object); @@ -99,7 +99,7 @@ extern "C" { * F_false on success and string is not a valid object name. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_word(). + * Errors (with error bit) from: f_utf_is_word(). */ #ifndef _di_f_iki_object_partial_is_ extern f_return_status f_iki_object_partial_is(const f_string_static_t object, const f_string_range_t range); diff --git a/level_0/f_string/c/string_common.h b/level_0/f_string/c/string_common.h index 4dc2d98..0c5188d 100644 --- a/level_0/f_string/c/string_common.h +++ b/level_0/f_string/c/string_common.h @@ -61,7 +61,9 @@ extern "C" { #endif // _di_f_array_t_length_printf_ /** - * define the basic string type. + * Define the basic string type. + * + * Dynamic allocation macros are provided, but it is recommended to utilize the f_string_dynamic_t for dynamic allocation. */ #ifndef _di_f_string_t_ typedef char *f_string_t; diff --git a/level_1/fl_color/c/color.c b/level_1/fl_color/c/color.c index e573936..2c4498c 100644 --- a/level_1/fl_color/c/color.c +++ b/level_1/fl_color/c/color.c @@ -114,14 +114,14 @@ extern "C" { #endif // _di_fl_color_save_ #ifndef _di_fl_color_print_ - f_return_status fl_color_print(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...) { + f_return_status fl_color_print(FILE *file, const f_color_set_t set, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (start_color.used) { - f_status_t status = f_print_dynamic(file, start_color); + if (set.before) { + f_status_t status = f_print_dynamic(file, *set.before); if (F_status_is_error(status)) return status; } @@ -133,8 +133,8 @@ extern "C" { va_end(ap); - if (end_color.used) { - f_status_t status = f_print_dynamic(file, end_color); + if (set.after) { + f_status_t status = f_print_dynamic(file, *set.after); if (F_status_is_error(status)) return status; } @@ -144,17 +144,21 @@ extern "C" { #endif // _di_fl_color_print_ #ifndef _di_fl_color_print2_ - f_return_status fl_color_print2(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...) { + f_return_status fl_color_print2(FILE *file, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (start_color.used) { - f_status_t status = f_print_dynamic(file, start_color); + f_status_t status = F_none; + + if (set.before) { + status = f_print_dynamic(file, *set.before); if (F_status_is_error(status)) return status; + } - status = f_print_dynamic(file, extra_color); + if (extra.before) { + status = f_print_dynamic(file, *extra.before); if (F_status_is_error(status)) return status; } @@ -166,8 +170,13 @@ extern "C" { va_end(ap); - if (end_color.used) { - f_status_t status = f_print_dynamic(file, end_color); + if (set.after) { + status = f_print_dynamic(file, *set.after); + if (F_status_is_error(status)) return status; + } + + if (extra.after) { + status = f_print_dynamic(file, *extra.after); if (F_status_is_error(status)) return status; } @@ -176,14 +185,14 @@ extern "C" { #endif // _di_fl_color_print2_ #ifndef _di_fl_color_print_line_ - f_return_status fl_color_print_line(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...) { + f_return_status fl_color_print_line(FILE *file, const f_color_set_t set, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (start_color.used) { - f_status_t status = f_print_dynamic(file, start_color); + if (set.before) { + f_status_t status = f_print_dynamic(file, *set.before); if (F_status_is_error(status)) return status; } @@ -195,8 +204,8 @@ extern "C" { va_end(ap); - if (end_color.used) { - f_status_t status = f_print_dynamic(file, end_color); + if (set.after) { + f_status_t status = f_print_dynamic(file, *set.after); if (F_status_is_error(status)) return status; } @@ -208,17 +217,21 @@ extern "C" { #endif // _di_fl_color_print_line_ #ifndef _di_fl_color_print2_line_ - f_return_status fl_color_print2_line(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...) { + f_return_status fl_color_print2_line(FILE *file, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...) { #ifndef _di_level_1_parameter_checking_ if (file == 0) return F_status_set_error(F_parameter); if (string == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - if (start_color.used) { - f_status_t status = f_print_dynamic(file, start_color); + f_status_t status = F_none; + + if (set.before) { + status = f_print_dynamic(file, *set.before); if (F_status_is_error(status)) return status; + } - status = f_print_dynamic(file, extra_color); + if (extra.before) { + status = f_print_dynamic(file, *extra.before); if (F_status_is_error(status)) return status; } @@ -230,8 +243,13 @@ extern "C" { va_end(ap); - if (end_color.used) { - f_status_t status = f_print_dynamic(file, end_color); + if (set.after) { + status = f_print_dynamic(file, *set.after); + if (F_status_is_error(status)) return status; + } + + if (extra.after) { + status = f_print_dynamic(file, *extra.after); if (F_status_is_error(status)) return status; } @@ -254,7 +272,7 @@ extern "C" { #endif // _di_fl_color_print_code_ #ifndef _di_fl_color_load_context_ - f_return_status fl_color_load_context(fl_color_context_t *context, const bool use_light_colors) { + f_return_status fl_color_load_context(f_color_context_t *context, const bool use_light_colors) { #ifndef _di_level_1_parameter_checking_ if (context == 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ @@ -266,37 +284,93 @@ extern "C" { int8_t *environment = getenv("TERM"); if (!environment || strncmp(environment, "linux", 6) == 0) { - context->color_list = f_color_linux; + f_macro_color_t_set_linux(context->list); } else { - context->color_list = f_color_xterminal; + f_macro_color_t_set_xterminal(context->list); } } - // load the colors + status = fl_macro_color_save_1(&context->reset, context->format, context->list.reset); + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_1(&context->warning, context->format, context->list.yellow); + } + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_2(&context->error, context->format, context->list.bold, context->list.red); + } + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_1(&context->notable, context->format, context->list.bold); + } + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_1(&context->standout, context->format, context->list.purple); + } + if (use_light_colors) { - status = fl_macro_color_save_1(&context->reset, context->color_format, context->color_list.reset); + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_2(&context->title, context->format, context->list.bold, context->list.blue); + } - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->warning, context->color_format, context->color_list.yellow); - if (F_status_is_error_not(status)) status = fl_macro_color_save_2(&context->error, context->color_format, context->color_list.bold, context->color_list.red); - if (F_status_is_error_not(status)) status = fl_macro_color_save_2(&context->title, context->color_format, context->color_list.bold, context->color_list.blue); - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->notable, context->color_format, context->color_list.bold); - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->important, context->color_format, context->color_list.blue); - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->standout, context->color_format, context->color_list.purple); + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_1(&context->important, context->format, context->list.blue); + } - context->mode = f_color_mode_light; + if (F_status_is_error_not(status)) { + context->mode = f_color_mode_light; + } + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_1(&context->standout, context->format, context->list.purple); + } } else { - status = fl_macro_color_save_1(&context->reset, context->color_format, context->color_list.reset); + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_2(&context->title, context->format, context->list.bold, context->list.yellow); + } + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_2(&context->important, context->format, context->list.bold, context->list.green); + } + + if (F_status_is_error_not(status)) { + context->mode = f_color_mode_dark; + } + + if (F_status_is_error_not(status)) { + status = fl_macro_color_save_1(&context->standout, context->format, context->list.green); + } + } + + if (F_status_is_error_not(status)) { + context->set.warning.before = &context->warning; + context->set.warning.after = &context->reset; + + context->set.error.before = &context->error; + context->set.error.after = &context->reset; + + context->set.title.before = &context->title; + context->set.title.after = &context->reset; + + context->set.notable.before = &context->notable; + context->set.notable.after = &context->reset; + + context->set.important.before = &context->important; + context->set.important.after = &context->reset; + + context->set.standout.before = &context->standout; + context->set.standout.after = &context->reset; + + context->set.normal.before = &context->normal; + context->set.normal.after = &context->reset; - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->warning, context->color_format, context->color_list.yellow); - if (F_status_is_error_not(status)) status = fl_macro_color_save_2(&context->error, context->color_format, context->color_list.bold, context->color_list.red); - if (F_status_is_error_not(status)) status = fl_macro_color_save_2(&context->title, context->color_format, context->color_list.bold, context->color_list.yellow); - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->notable, context->color_format, context->color_list.bold); - if (F_status_is_error_not(status)) status = fl_macro_color_save_2(&context->important, context->color_format, context->color_list.bold, context->color_list.green); - if (F_status_is_error_not(status)) status = fl_macro_color_save_1(&context->standout, context->color_format, context->color_list.green); + context->set.warning.before = &context->warning; + context->set.warning.after = &context->reset; - context->mode = f_color_mode_dark; + context->set.normal_reset.before = &context->normal_reset; + context->set.normal_reset.after = &context->reset; } return status; diff --git a/level_1/fl_color/c/color.h b/level_1/fl_color/c/color.h index d40d9b1..67890ec 100644 --- a/level_1/fl_color/c/color.h +++ b/level_1/fl_color/c/color.h @@ -28,102 +28,6 @@ extern "C" { #endif -#ifndef _di_fl_color_context_t_ - typedef struct { - f_color_t color_list; - f_color_format_t color_format; - f_color_mode_t mode; - f_string_dynamic_t reset; - f_string_dynamic_t warning; - f_string_dynamic_t error; - f_string_dynamic_t title; - f_string_dynamic_t notable; - f_string_dynamic_t important; - f_string_dynamic_t standout; - f_string_dynamic_t normal; - f_string_dynamic_t normal_reset; - } fl_color_context_t; - - #define fl_color_context_t_initialize { f_color_t_initialize_linux, f_color_format_t_initialize_linux, f_color_mode_none, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } - - #define fl_macro_color_context_t_new(status, color_context) \ - f_macro_string_dynamic_t_new(status, color_context.reset, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.warning, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.error, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.title, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.notable, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.important, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.standout, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.normal, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.normal_reset, f_color_max_size + 1); - - #define fl_macro_color_context_t_delete(status, color_context) \ - f_macro_string_dynamic_t_delete(status, color_context.reset); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.warning); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.error); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.title); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.notable); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.important); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.standout); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.normal); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_delete(status, color_context.normal_reset); - - #define fl_macro_color_context_t_destroy(status, color_context, size) \ - f_macro_string_dynamic_t_destroy(status, color_context.reset); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.warning, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.error, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.title, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.notable, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.important, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.standout, size); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.normal); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_destroy(status, color_context.normal_reset); - - #define fl_macro_color_context_t_delete_simple(color_context) \ - f_macro_string_dynamic_t_delete_simple(color_context.reset); \ - f_macro_string_dynamic_t_delete_simple(color_context.warning); \ - f_macro_string_dynamic_t_delete_simple(color_context.error); \ - f_macro_string_dynamic_t_delete_simple(color_context.title); \ - f_macro_string_dynamic_t_delete_simple(color_context.notable); \ - f_macro_string_dynamic_t_delete_simple(color_context.important); \ - f_macro_string_dynamic_t_delete_simple(color_context.standout); \ - f_macro_string_dynamic_t_delete_simple(color_context.normal); \ - f_macro_string_dynamic_t_delete_simple(color_context.normal_reset); - - #define fl_macro_color_context_t_destroy_simple(color_context, size) \ - f_macro_string_dynamic_t_destroy_simple(color_context.reset); \ - f_macro_string_dynamic_t_destroy_simple(color_context.warning, size); \ - f_macro_string_dynamic_t_destroy_simple(color_context.error, size); \ - f_macro_string_dynamic_t_destroy_simple(color_context.title, size); \ - f_macro_string_dynamic_t_destroy_simple(color_context.notable, size); \ - f_macro_string_dynamic_t_destroy_simple(color_context.important, size); \ - f_macro_string_dynamic_t_destroy_simple(color_context.standout, size); \ - f_macro_string_dynamic_t_destroy_simple(color_context.normal); \ - f_macro_string_dynamic_t_destroy_simple(color_context.normal_reset); - - #define fl_macro_color_context_t_resize(status, color_context) \ - f_macro_string_dynamic_t_resize(status, color_context.reset, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.warning, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.error, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.title, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.notable, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.important, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.standout, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.normal, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.normal_reset, f_color_max_size + 1); - - #define fl_macro_color_context_t_adjust(status, color_context) \ - f_macro_string_dynamic_t_adjust(status, color_context.reset, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.warning, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.error, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.title, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.notable, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.important, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.standout, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.normal, f_color_max_size + 1); \ - if (F_status_is_error_not(status)) f_macro_string_dynamic_t_resize(status, color_context.normal_reset, f_color_max_size + 1); -#endif // _di_fl_color_context_t_ - /** * Given some file or standard io, and push color information to that file or standard io. * @@ -200,12 +104,8 @@ extern "C" { * * @param file * The file or standard io. - * @param format - * The color format parts. - * @param start_color - * The color code to place at the beginning of the string, set to 0 to disable. - * @param stop_color - * The color code to place at the end of the string, set to 0 to disable. + * @param set + * The color set used for printing. * @param string * The string to print to the file or standard io. * @param ... @@ -215,10 +115,10 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_print_dynamic(). + * Errors (with error bit) from: f_print_dynamic(). */ #ifndef _di_fl_color_print_ - extern f_return_status fl_color_print(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...); + extern f_return_status fl_color_print(FILE *file, const f_color_set_t set, const f_string_t string, ...); #endif // _di_fl_color_print_ /** @@ -231,14 +131,10 @@ extern "C" { * * @param file * The file or standard io. - * @param format - * The color format parts. - * @param start_color - * The color code to place at the beginning of the string, set to 0 to disable. - * @param extra_color - * The color code to place immediately following the start_color, set to 0 to disable. - * @param stop_color - * The color code to place at the end of the string, set to 0 to disable. + * @param set + * The color set used for printing. + * @param extra + * The a second color set used for printing, which gets appended after set.before and set.after, respectively. * @param string * The string to print to the file or standard io. * @param ... @@ -248,10 +144,10 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_print_dynamic(). + * Errors (with error bit) from: f_print_dynamic(). */ #ifndef _di_fl_color_print2_ - extern f_return_status fl_color_print2(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...); + extern f_return_status fl_color_print2(FILE *file, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...); #endif // _di_fl_color_print2_ /** @@ -261,12 +157,8 @@ extern "C" { * * @param file * The file or standard io. - * @param format - * The color format parts. - * @param start_color - * The color code to place at the beginning of the string, set to 0 to disable. - * @param stop_color - * The color code to place at the end of the string, set to 0 to disable. + * @param set + * The color set used for printing. * @param string * The string to print to the file or standard io. * @param ... @@ -276,10 +168,10 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_print_dynamic(). + * Errors (with error bit) from: f_print_dynamic(). */ #ifndef _di_fl_color_print_line_ - extern f_return_status fl_color_print_line(FILE *file, const f_string_static_t start_color, const f_string_static_t end_color, const f_string_t string, ...); + extern f_return_status fl_color_print_line(FILE *file, const f_color_set_t set, const f_string_t string, ...); #endif // _di_fl_color_print_line_ /** @@ -292,14 +184,10 @@ extern "C" { * * @param file * The file or standard io. - * @param format - * The color format parts. - * @param start_color - * The color code to place at the beginning of the string, set to 0 to disable. - * @param extra_color - * The color code to place immediately following the start_color, set to 0 to disable. - * @param stop_color - * The color code to place at the end of the string, set to 0 to disable. + * @param set + * The color set used for printing. + * @param extra + * The a second color set used for printing, which gets appended after set.before and set.after, respectively. * @param string * The string to print to the file or standard io. * @param ... @@ -309,10 +197,10 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_print_dynamic(). + * Errors (with error bit) from: f_print_dynamic(). */ #ifndef _di_fl_color_print2_line_ - extern f_return_status fl_color_print2_line(FILE *file, const f_string_static_t start_color, const f_string_static_t extra_color, const f_string_static_t end_color, const f_string_t string, ...); + extern f_return_status fl_color_print2_line(FILE *file, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...); #endif // _di_fl_color_print2_line_ /** @@ -329,7 +217,7 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_print_dynamic(). + * Errors (with error bit) from: f_print_dynamic(). */ #ifndef _di_fl_color_print_code_ extern f_return_status fl_color_print_code(FILE *file, const f_string_static_t color); @@ -341,11 +229,13 @@ extern "C" { * This will handle the difference betweem xorg terminals and linux consoles. * If you wish to use non-standard colors either redefine this function or don't use it. * + * The default/fallback behavior is f_color_xterminal. + * * @param context * The color context the load the color codes into. * @param use_light_colors * Set to F_true to use colors for light backgrounds. - * Set to F_false to use colors forr dark backgrounds. + * Set to F_false to use colors for dark backgrounds. * * @return * F_none on success. @@ -353,7 +243,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_fl_color_load_context_ - extern f_return_status fl_color_load_context(fl_color_context_t *context, const bool use_light_colors); + extern f_return_status fl_color_load_context(f_color_context_t *context, const bool use_light_colors); #endif // _di_fl_color_load_context_ #ifdef __cplusplus diff --git a/level_1/fl_directory/c/directory.h b/level_1/fl_directory/c/directory.h index 0fe6b09..3b229c0 100644 --- a/level_1/fl_directory/c/directory.h +++ b/level_1/fl_directory/c/directory.h @@ -117,11 +117,11 @@ extern "C" { * F_none on success. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * - * Errors from (with error bit): f_directory_create(). - * Errors from (with error bit): f_directory_exists(). - * Errors from (with error bit): f_file_mode_set(). - * Errors from (with error bit): f_file_role_change(). - * Errors from (with error bit): f_file_stat(). + * Errors (with error bit) from: f_directory_create(). + * Errors (with error bit) from: f_directory_exists(). + * Errors (with error bit) from: f_file_mode_set(). + * Errors (with error bit) from: f_file_role_change(). + * Errors (with error bit) from: f_file_stat(). * * @see f_file_clone() */ @@ -162,7 +162,7 @@ extern "C" { * F_none on success. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * - * Errors from (with error bit): f_directory_exists(). + * Errors (with error bit) from: f_directory_exists(). * * @see f_file_clone() */ @@ -199,11 +199,11 @@ extern "C" { * F_none on success. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * - * Errors from (with error bit): f_directory_create(). - * Errors from (with error bit): f_directory_exists(). - * Errors from (with error bit): f_file_mode_set(). - * Errors from (with error bit): f_file_role_change(). - * Errors from (with error bit): f_file_stat(). + * Errors (with error bit) from: f_directory_create(). + * Errors (with error bit) from: f_directory_exists(). + * Errors (with error bit) from: f_file_mode_set(). + * Errors (with error bit) from: f_file_role_change(). + * Errors (with error bit) from: f_file_stat(). * * @see f_file_copy() */ @@ -242,7 +242,7 @@ extern "C" { * F_none on success. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * - * Errors from (with error bit): f_directory_exists(). + * Errors (with error bit) from: f_directory_exists(). * * @see f_file_copy() */ @@ -337,7 +337,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * - * Errors from (with error bit): f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_control(). */ #ifndef _di_fl_directory_path_push_ extern f_return_status fl_directory_path_push(const f_string_t source, f_string_length_t length, f_string_dynamic_t *destination); @@ -363,7 +363,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * - * Errors from (with error bit): f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_control(). */ #ifndef _di_fl_directory_path_push_dynamic_ extern f_return_status fl_directory_path_push_dynamic(const f_string_static_t source, f_string_dynamic_t *destination); diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index ef6fdcf..31432f7 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -192,7 +192,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if appended string length is too large to store in the buffer. * - * Errors from (with error bit): f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_control(). * * @see fl_directory_path_push() * @see fl_directory_path_push_dynamic() diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index d2fe451..fb14fba 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -68,10 +68,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_object_read_ extern f_return_status fl_fss_basic_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted); @@ -111,10 +111,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_content_read_ extern f_return_status fl_fss_basic_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found); @@ -148,7 +148,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_object_write_ extern f_return_status fl_fss_basic_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination); @@ -177,7 +177,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_content_write_ extern f_return_status fl_fss_basic_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination); diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index 5c465cd..e612b52 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -66,10 +66,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_list_object_read_ extern f_return_status fl_fss_basic_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found); @@ -109,10 +109,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_list_content_read_ extern f_return_status fl_fss_basic_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found); @@ -143,7 +143,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_list_object_write_ extern f_return_status fl_fss_basic_list_object_write(const f_string_static_t object, f_string_range_t *range, f_string_dynamic_t *destination); @@ -173,7 +173,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_basic_list_content_write_ extern f_return_status fl_fss_basic_list_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination); diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index 38c0e1d..ad77be1 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -68,10 +68,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_object_read_ extern f_return_status fl_fss_extended_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found, f_fss_quoted_t *quoted); @@ -114,10 +114,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_content_read_ extern f_return_status fl_fss_extended_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_content_t *found, f_fss_quoteds_t *quoteds); @@ -151,7 +151,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_object_write_ extern f_return_status fl_fss_extended_object_write(const f_string_static_t object, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination); @@ -184,7 +184,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_content_write_ extern f_return_status fl_fss_extended_content_write(const f_string_static_t content, const f_fss_quoted_t quoted, f_string_range_t *range, f_string_dynamic_t *destination); diff --git a/level_1/fl_fss/c/fss_extended_list.h b/level_1/fl_fss/c/fss_extended_list.h index f3611e2..3aa9d0a 100644 --- a/level_1/fl_fss/c/fss_extended_list.h +++ b/level_1/fl_fss/c/fss_extended_list.h @@ -66,10 +66,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_list_object_read_ extern f_return_status fl_fss_extended_list_object_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_object_t *found); @@ -113,10 +113,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_list_content_read_ extern f_return_status fl_fss_extended_list_content_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *found); @@ -147,7 +147,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_list_object_write_ extern f_return_status fl_fss_extended_list_object_write(const f_string_static_t object, f_string_range_t *range, f_string_dynamic_t *destination); @@ -177,7 +177,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). */ #ifndef _di_fl_fss_extended_list_content_write_ extern f_return_status fl_fss_extended_list_content_write(const f_string_static_t content, f_string_range_t *range, f_string_dynamic_t *destination); diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h index 1e22af8..3485d43 100644 --- a/level_1/fl_fss/c/private-fss.h +++ b/level_1/fl_fss/c/private-fss.h @@ -54,10 +54,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). - * Errors from (with error bit): f_fss_is_graph(). - * Errors from (with error bit): f_fss_is_space(). - * Errors from (with error bit): f_fss_skip_past_space(). + * Errors (with error bit) from: f_utf_buffer_increment(). + * Errors (with error bit) from: f_fss_is_graph(). + * Errors (with error bit) from: f_fss_is_space(). + * Errors (with error bit) from: f_fss_skip_past_space(). * * @see fl_fss_basic_object_read() * @see fl_fss_extended_object_read() @@ -92,7 +92,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): f_utf_buffer_increment(). + * Errors (with error bit) from: f_utf_buffer_increment(). * * @see fl_fss_basic_object_write() * @see fl_fss_extended_object_write() diff --git a/level_1/fl_print/c/print.h b/level_1/fl_print/c/print.h index 3940711..0683a3a 100644 --- a/level_1/fl_print/c/print.h +++ b/level_1/fl_print/c/print.h @@ -46,7 +46,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). */ #ifndef _di_fl_print_trim_string_ extern f_return_status fl_print_trim_string(FILE *output, const f_string_t string, const f_string_length_t length); @@ -73,7 +73,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). */ #ifndef _di_fl_print_trim_string_dynamic_ extern f_return_status fl_print_trim_string_dynamic(FILE *output, const f_string_static_t buffer); @@ -102,7 +102,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). */ #ifndef _di_fl_print_trim_string_dynamic_partial_ extern f_return_status fl_print_trim_string_dynamic_partial(FILE *output, const f_string_static_t buffer, const f_string_range_t range); @@ -130,7 +130,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). */ #ifndef _di_fl_print_trim_utf_string_ extern f_return_status fl_print_trim_utf_string(FILE *output, const f_utf_string_t string, const f_utf_string_length_t length); @@ -157,7 +157,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). */ #ifndef _di_fl_print_trim_utf_string_dynamic_ extern f_return_status fl_print_trim_utf_string_dynamic(FILE *output, const f_utf_string_static_t buffer); @@ -186,7 +186,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). */ #ifndef _di_fl_print_trim_utf_string_dynamic_partial_ extern f_return_status fl_print_trim_utf_string_dynamic_partial(FILE *output, const f_utf_string_static_t buffer, const f_utf_string_range_t range); diff --git a/level_1/fl_string/c/string.h b/level_1/fl_string/c/string.h index 757115b..e186c98 100644 --- a/level_1/fl_string/c/string.h +++ b/level_1/fl_string/c/string.h @@ -174,7 +174,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -307,7 +307,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -332,7 +332,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -361,7 +361,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -668,7 +668,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -699,7 +699,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -728,7 +728,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -1221,7 +1221,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_char_to_character(). + * Errors (with error bit) from: f_utf_char_to_character(). * * @see f_utf_char_to_character() */ @@ -1251,7 +1251,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_graph(). + * Errors (with error bit) from: f_utf_is_graph(). * * @see f_utf_is_graph() */ @@ -1281,7 +1281,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_graph(). + * Errors (with error bit) from: f_utf_is_graph(). * * @see f_utf_is_graph() */ @@ -1334,7 +1334,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_char_to_character(). + * Errors (with error bit) from: f_utf_char_to_character(). * * @see f_utf_char_to_character() */ @@ -1719,7 +1719,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -1749,7 +1749,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -1799,7 +1799,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_char_to_character(). + * Errors (with error bit) from: f_utf_char_to_character(). * * @see f_utf_char_to_character() */ @@ -1828,7 +1828,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_graph(). + * Errors (with error bit) from: f_utf_is_graph(). * * @see f_utf_is_graph() */ @@ -1858,7 +1858,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_whitespace(). * * @see f_utf_is_whitespace() */ @@ -1909,7 +1909,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if character is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_char_to_character(). + * Errors (with error bit) from: f_utf_char_to_character(). * * @see f_utf_char_to_character() */ diff --git a/level_1/fl_utf/c/utf.h b/level_1/fl_utf/c/utf.h index a7f201d..f4be6b5 100644 --- a/level_1/fl_utf/c/utf.h +++ b/level_1/fl_utf/c/utf.h @@ -175,7 +175,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). * * @see f_utf_character_is_whitespace() */ @@ -306,7 +306,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). * * @see f_utf_character_is_whitespace() */ @@ -567,7 +567,7 @@ extern "C" { * F_equal_to_not when both strings do not equal. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). * * @see f_utf_character_is_whitespace() */ @@ -1016,7 +1016,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_graph(). + * Errors (with error bit) from: f_utf_character_is_graph(). * * @see f_utf_character_is_graph() */ @@ -1044,7 +1044,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_graph(). + * Errors (with error bit) from: f_utf_character_is_graph(). * * @see f_utf_character_is_graph() */ @@ -1411,7 +1411,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). * * @see f_utf_character_is_whitespace() */ @@ -1441,7 +1441,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_utf_character_is_whitespace(). + * Errors (with error bit) from: f_utf_character_is_whitespace(). * * @see f_utf_character_is_whitespace() */ @@ -1516,7 +1516,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_graph(). + * Errors (with error bit) from: f_utf_character_is_graph(). * * @see f_utf_character_is_graph() */ @@ -1547,7 +1547,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) if a character in the string is an invalid UTF-8 character. * - * Errors from (with error bit): f_utf_character_is_graph(). + * Errors (with error bit) from: f_utf_character_is_graph(). * * @see f_utf_character_is_graph() */ diff --git a/level_2/fll_file/c/file.c b/level_2/fll_file/c/file.c index bde11f1..e99cedb 100644 --- a/level_2/fll_file/c/file.c +++ b/level_2/fll_file/c/file.c @@ -6,55 +6,55 @@ extern "C" { #endif #ifndef _di_fll_file_error_print_ - f_return_status fll_file_error_print(FILE *file, const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { + f_return_status fll_file_error_print(FILE *file, const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(file, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(file, context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_file_closed) { - fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: The file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "' is no longer open."); + fl_color_print(file, context.set.error, "INTERNAL ERROR: The file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "' is no longer open."); } else if (status == F_file_seek) { - fl_color_print(file, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: A seek error occurred while accessing the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else if (status == F_file_read) { - fl_color_print(file, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: A read error occurred while accessing the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else if (status == F_file_found_not) { - fl_color_print(file, context.error, context.reset, "ERROR: Unable to find the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: Unable to find the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else if (status == F_file_open) { - fl_color_print(file, context.error, context.reset, "ERROR: Unable to open the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: Unable to open the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else if (status == F_file_descriptor) { - fl_color_print(file, context.error, context.reset, "ERROR: File descriptor error while trying to open the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: File descriptor error while trying to open the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else if (status == F_parameter) { - fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(file, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(file, context.error, context.reset, "."); + fl_color_print(file, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(file, context.set.notable, "%s()", function_name); + fl_color_print_line(file, context.set.error, "."); } else if (status == F_number_overflow) { - fl_color_print(file, context.error, context.reset, "ERROR: Integer overflow while trying to buffer the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: Integer overflow while trying to buffer the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else if (status == F_number_underflow) { - fl_color_print(file, context.error, context.reset, "ERROR: Integer underflow while trying to buffer the file '"); - fl_color_print(file, context.notable, context.reset, "%s", file_name); - fl_color_print_line(file, context.error, context.reset, "'."); + fl_color_print(file, context.set.error, "ERROR: Integer underflow while trying to buffer the file '"); + fl_color_print(file, context.set.notable, "%s", file_name); + fl_color_print_line(file, context.set.error, "'."); } else { return F_false; diff --git a/level_2/fll_file/c/file.h b/level_2/fll_file/c/file.h index 4511d7f..9b1a741 100644 --- a/level_2/fll_file/c/file.h +++ b/level_2/fll_file/c/file.h @@ -50,7 +50,7 @@ extern "C" { * F_false if no error message was printed. */ #ifndef _di_fll_file_error_print_ - extern f_return_status fll_file_error_print(FILE *file, const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status); + extern f_return_status fll_file_error_print(FILE *file, const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status); #endif // _di_fll_file_error_print_ /** @@ -129,11 +129,11 @@ extern "C" { * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached). * F_failure (with error bit) for any other error, failures might be populated with individual status codes. * - * Errors from (with error bit): f_directory_remove_custom(). - * Errors from (with error bit): f_file_is(). - * Errors from (with error bit): f_file_remove(). - * Errors from (with error bit): f_file_rename(). - * Errors from (with error bit): fl_directory_clone(). + * Errors (with error bit) from: f_directory_remove_custom(). + * Errors (with error bit) from: f_file_is(). + * Errors (with error bit) from: f_file_remove(). + * Errors (with error bit) from: f_file_rename(). + * Errors (with error bit) from: fl_directory_clone(). * * @see f_directory_remove() * @see f_directory_remove_custom() diff --git a/level_2/fll_fss/c/fss.h b/level_2/fll_fss/c/fss.h index 44a9915..d929b28 100644 --- a/level_2/fll_fss/c/fss.h +++ b/level_2/fll_fss/c/fss.h @@ -45,7 +45,7 @@ extern "C" { * FL_fss_accepted_invalid (with warning bit) if header is technically invalid but can be identified. * FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header. * - * Errors from (with error bit): fl_conversion_string_to_hexidecimal_unsigned(). + * Errors (with error bit) from: fl_conversion_string_to_hexidecimal_unsigned(). */ #ifndef _di_fll_fss_identify_ extern f_return_status fll_fss_identify(const f_string_static_t buffer, f_fss_header_t *header); @@ -67,9 +67,9 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header. * - * Errors from (with error bit): fl_conversion_string_to_hexidecimal_unsigned(). - * Errors from (with error bit): f_file_read_until(). - * Errors from (with error bit): f_file_seek(). + * Errors (with error bit) from: fl_conversion_string_to_hexidecimal_unsigned(). + * Errors (with error bit) from: f_file_read_until(). + * Errors (with error bit) from: f_file_seek(). * * @see f_file_read_until() */ @@ -111,8 +111,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_append_nulless() @@ -157,8 +157,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_append_nulless() @@ -205,8 +205,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_append_nulless() @@ -255,8 +255,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_append_nulless() @@ -308,8 +308,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_map_mash_ extern f_return_status fll_fss_snatch_map_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_maps_t *values[], f_array_lengths_t *indexs[]); @@ -359,8 +359,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_mash_nulless() @@ -412,8 +412,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_mash_nulless() @@ -462,8 +462,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_mash_nulless(). */ #ifndef _di_fll_fss_snatch_mash_ extern f_return_status fll_fss_snatch_mash(const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, const f_string_t names[], const f_string_length_t lengths[], const f_string_length_t size, const f_string_t glue, const f_string_length_t glue_length, f_string_dynamic_t *values[], f_array_length_t *indexs[]); @@ -510,8 +510,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_append_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_mash_nulless() @@ -554,8 +554,8 @@ extern "C" { * F_data_not when there is no buffer, objects or contents to process. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_compare_trim(). - * Errors from (with error bit): fl_string_dynamic_partial_mash_nulless(). + * Errors (with error bit) from: fl_string_compare_trim(). + * Errors (with error bit) from: fl_string_dynamic_partial_mash_nulless(). * * @see fl_string_compare_trim() * @see fl_string_dynamic_partial_append_nulless() diff --git a/level_2/fll_fss/c/fss_status.h b/level_2/fll_fss/c/fss_status.h index 1fac9ba..fd3b46f 100644 --- a/level_2/fll_fss/c/fss_status.h +++ b/level_2/fll_fss/c/fss_status.h @@ -118,7 +118,7 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_status_to_string(). + * Errors (with error bit) from: fl_status_to_string(). * * @see fl_status_to_string() */ diff --git a/level_2/fll_fss/c/private-fss.h b/level_2/fll_fss/c/private-fss.h index 11ed7a5..75f90f7 100644 --- a/level_2/fll_fss/c/private-fss.h +++ b/level_2/fll_fss/c/private-fss.h @@ -31,7 +31,7 @@ extern "C" { * FL_fss_accepted_invalid (with warning bit) if header is technically invalid but can be identified. * FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header. * - * Errors from (with error bit): fl_conversion_string_to_hexidecimal_unsigned(). + * Errors (with error bit) from: fl_conversion_string_to_hexidecimal_unsigned(). * * @see fll_fss_identify() * @see fll_fss_identify_file() diff --git a/level_2/fll_iki/c/iki.h b/level_2/fll_iki/c/iki.h index 82537ef..897f6ba 100644 --- a/level_2/fll_iki/c/iki.h +++ b/level_2/fll_iki/c/iki.h @@ -52,8 +52,8 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_macro_string_dynamic_t_resize(). - * Errors from (with error bit): fl_string_dynamic_size_increase(). + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ #ifndef _di_fll_iki_content_escape_ extern f_return_status fll_iki_content_escape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *escaped); @@ -79,8 +79,8 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_macro_string_dynamic_t_resize(). - * Errors from (with error bit): fl_string_dynamic_size_increase(). + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ #ifndef _di_fll_iki_content_partial_escape_ extern f_return_status fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped); @@ -105,8 +105,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * - * Errors from (with error bit): f_macro_string_dynamic_t_resize(). - * Errors from (with error bit): fl_string_dynamic_size_increase(). + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ #ifndef _di_fll_iki_content_escape_un_ extern f_return_status fll_iki_content_escape_un(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped); @@ -133,8 +133,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * - * Errors from (with error bit): f_macro_string_dynamic_t_resize(). - * Errors from (with error bit): fl_string_dynamic_size_increase(). + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ #ifndef _di_fll_iki_content_partial_escape_un_ extern f_return_status fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped); diff --git a/level_2/fll_iki/c/private-iki.h b/level_2/fll_iki/c/private-iki.h index 9d8939a..84bd7c9 100644 --- a/level_2/fll_iki/c/private-iki.h +++ b/level_2/fll_iki/c/private-iki.h @@ -35,8 +35,8 @@ extern "C" { * F_none on success. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_macro_string_dynamic_t_resize(). - * Errors from (with error bit): fl_string_dynamic_size_increase(). + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ #if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_) extern f_return_status private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *escaped) f_gcc_attribute_visibility_internal; @@ -63,8 +63,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote. * - * Errors from (with error bit): f_macro_string_dynamic_t_resize(). - * Errors from (with error bit): fl_string_dynamic_size_increase(). + * Errors (with error bit) from: f_macro_string_dynamic_t_resize(). + * Errors (with error bit) from: fl_string_dynamic_size_increase(). */ #if !defined(_di_fll_iki_content_escape_un_) || !defined(_di_fll_iki_content_partial_escape_un_) extern f_return_status private_fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) f_gcc_attribute_visibility_internal; diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index 5aa6f4f..6b910dd 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -5,19 +5,19 @@ extern "C" { #endif #ifndef _di_fll_program_print_help_header_ - f_return_status fll_program_print_help_header(const fl_color_context_t context, const f_string_t name, const f_string_t version) { + f_return_status fll_program_print_help_header(const f_color_context_t context, const f_string_t name, const f_string_t version) { f_status_t status = F_none; printf("%c", f_string_eol[0]); - status = fl_color_print(f_type_output, context.title, context.reset, " %s", name); + status = fl_color_print(f_type_output, context.set.title, " %s", name); if (F_status_is_error(status)) return status; printf("%c", f_string_eol[0]); - status = fl_color_print(f_type_output, context.notable, context.reset, " Version %s", version); + status = fl_color_print(f_type_output, context.set.notable, " Version %s", version); if (F_status_is_error(status)) return status; printf("%c%c", f_string_eol[0], f_string_eol[0]); - status = fl_color_print(f_type_output, context.important, context.reset, " Available Options: "); + status = fl_color_print(f_type_output, context.set.important, " Available Options: "); if (F_status_is_error(status)) return status; return F_none; @@ -25,16 +25,16 @@ extern "C" { #endif // _di_fll_program_print_help_header_ #ifndef _di_fll_program_print_help_option_ - f_return_status fll_program_print_help_option(const fl_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) { + f_return_status fll_program_print_help_option(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) { f_status_t status = F_none; printf("%c", f_string_eol[0]); printf(" %s", symbol_short); - status = fl_color_print(f_type_output, context.standout, context.reset, option_short); + status = fl_color_print(f_type_output, context.set.standout, option_short); if (F_status_is_error(status)) return status; printf(", %s", symbol_long); - status = fl_color_print(f_type_output, context.standout, context.reset, option_long); + status = fl_color_print(f_type_output, context.set.standout, option_long); if (F_status_is_error(status)) return status; printf(" %s", description); @@ -44,12 +44,12 @@ extern "C" { #endif // _di_fll_program_print_help_option_ #ifndef _di_fll_program_print_help_option_long_ - f_return_status fll_program_print_help_option_long(const fl_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) { + f_return_status fll_program_print_help_option_long(const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) { f_status_t status = F_none; printf("%c", f_string_eol[0]); printf(" %s", symbol_long); - status = fl_color_print(f_type_output, context.standout, context.reset, option_long); + status = fl_color_print(f_type_output, context.set.standout, option_long); if (F_status_is_error(status)) return status; printf(" %s", description); @@ -59,9 +59,9 @@ extern "C" { #endif // _di_fll_program_print_help_option_long_ #ifndef _di_fll_program_print_help_option_other_ - f_return_status fll_program_print_help_option_other(const fl_color_context_t context, const f_string_t option_other, const f_string_t description) { + f_return_status fll_program_print_help_option_other(const f_color_context_t context, const f_string_t option_other, const f_string_t description) { printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.standout, context.reset, option_other); + fl_color_print(f_type_output, context.set.standout, option_other); printf(" %s", description); @@ -70,32 +70,32 @@ extern "C" { #endif // _di_fll_program_print_help_option_other_ #ifndef _di_fll_program_print_help_usage_ - f_return_status fll_program_print_help_usage(const fl_color_context_t context, const f_string_t name, const f_string_t parameters) { + f_return_status fll_program_print_help_usage(const f_color_context_t context, const f_string_t name, const f_string_t parameters) { f_status_t status = F_none; printf("%c%c", f_string_eol[0], f_string_eol[0]); - status = fl_color_print(f_type_output, context.important, context.reset, " Usage:"); + status = fl_color_print(f_type_output, context.set.important, " Usage:"); if (F_status_is_error(status)) return status; printf("%c ", f_string_eol[0]); - status = fl_color_print(f_type_output, context.standout, context.reset, name); + status = fl_color_print(f_type_output, context.set.standout, name); if (F_status_is_error(status)) return status; printf(" "); - status = fl_color_print(f_type_output, context.notable, context.reset, "["); + status = fl_color_print(f_type_output, context.set.notable, "["); if (F_status_is_error(status)) return status; printf(" options "); - status = fl_color_print(f_type_output, context.notable, context.reset, "]"); + status = fl_color_print(f_type_output, context.set.notable, "]"); if (F_status_is_error(status)) return status; if (parameters[0] != '\0') { printf(" "); - status = fl_color_print(f_type_output, context.notable, context.reset, "["); + status = fl_color_print(f_type_output, context.set.notable, "["); if (F_status_is_error(status)) return status; printf(" %s ", parameters); - status = fl_color_print(f_type_output, context.notable, context.reset, "]"); + status = fl_color_print(f_type_output, context.set.notable, "]"); if (F_status_is_error(status)) return status; } @@ -112,7 +112,7 @@ extern "C" { #endif // _di_fll_program_print_version_ #ifndef _di_fll_program_parameter_process_ - f_return_status fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context) { + f_return_status fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, f_color_context_t *context) { f_status_t status = F_none; status = f_console_parameter_process(arguments, parameters, remaining); @@ -121,32 +121,32 @@ extern "C" { status = F_status_set_fine(status); if (status == F_data_not) { - fl_color_print_line(f_type_error, context->error, context->reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass."); + fl_color_print_line(f_type_error, context->set.error, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass."); // @todo there is a way to identify which parameter is incorrect // to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0 // nothing can be 0 as that represents the program name, unless argv[] is improperly created } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); - fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process"); - fl_color_print_line(f_type_error, context->error, context->reset, ")."); + fl_color_print(f_type_error, context->set.error, "CRITICAL ERROR: Unable to allocate memory while calling "); + fl_color_print(f_type_error, context->set.notable, "f_console_parameter_process"); + fl_color_print_line(f_type_error, context->set.error, ")."); } else if (status == F_utf) { - fl_color_print(f_type_error, context->error, context->reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling "); - fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()"); - fl_color_print_line(f_type_error, context->error, context->reset, "."); + fl_color_print(f_type_error, context->set.error, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling "); + fl_color_print(f_type_error, context->set.notable, "f_console_parameter_process()"); + fl_color_print_line(f_type_error, context->set.error, "."); } else if (status == F_parameter) { - fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()"); - fl_color_print_line(f_type_error, context->error, context->reset, "."); + fl_color_print(f_type_error, context->set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context->set.notable, "f_console_parameter_process()"); + fl_color_print_line(f_type_error, context->set.error, "."); } else { - fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context->notable, context->reset, "%u", status); - fl_color_print(f_type_error, context->error, context->reset, ") has occurred while calling "); - fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()"); - fl_color_print_line(f_type_error, context->error, context->reset, "."); + fl_color_print(f_type_error, context->set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context->set.notable, "%u", status); + fl_color_print(f_type_error, context->set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context->set.notable, "f_console_parameter_process()"); + fl_color_print_line(f_type_error, context->set.error, "."); } return F_status_set_error(status); @@ -169,21 +169,21 @@ extern "C" { status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); - fl_color_print(f_type_error, context->notable, context->reset, "%s", function); - fl_color_print_line(f_type_error, context->error, context->reset, ")."); + fl_color_print(f_type_error, context->set.error, "CRITICAL ERROR: Unable to allocate memory while calling "); + fl_color_print(f_type_error, context->set.notable, "%s", function); + fl_color_print_line(f_type_error, context->set.error, ")."); } else if (status == F_parameter) { - fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context->notable, context->reset, "%s", function); - fl_color_print_line(f_type_error, context->error, context->reset, "()."); + fl_color_print(f_type_error, context->set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context->set.notable, "%s", function); + fl_color_print_line(f_type_error, context->set.error, "()."); } else { - fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context->notable, context->reset, "%u", status); - fl_color_print(f_type_error, context->error, context->reset, ") has occurred while calling "); - fl_color_print(f_type_error, context->notable, context->reset, "%s", function); - fl_color_print_line(f_type_error, context->error, context->reset, "()."); + fl_color_print(f_type_error, context->set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context->set.notable, "%u", status); + fl_color_print(f_type_error, context->set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context->set.notable, "%s", function); + fl_color_print_line(f_type_error, context->set.error, "()."); } return F_status_set_error(status); @@ -193,12 +193,12 @@ extern "C" { if (decision != choices.id[0]) { f_status_t allocation_status = F_none; - fl_macro_color_context_t_new(allocation_status, (*context)); + f_macro_color_context_t_new(allocation_status, (*context)); if (F_status_is_error(allocation_status)) { - fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling "); - fl_color_print(f_type_error, context->notable, context->reset, "fl_macro_color_context_t_new"); - fl_color_print_line(f_type_error, context->error, context->reset, "()."); + fl_color_print(f_type_error, context->set.error, "CRITICAL ERROR: Unable to allocate memory while calling "); + fl_color_print(f_type_error, context->set.notable, "f_macro_color_context_t_new"); + fl_color_print_line(f_type_error, context->set.error, "()."); return allocation_status; } @@ -214,7 +214,7 @@ extern "C" { #endif // _di_fll_program_parameter_process_ #ifndef _di_fll_program_parameter_process_quietly_ - f_return_status fll_program_parameter_process_quietly(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context) { + f_return_status fll_program_parameter_process_quietly(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, f_color_context_t *context) { f_status_t status = F_none; status = f_console_parameter_process(arguments, parameters, remaining); @@ -235,7 +235,7 @@ extern "C" { if (decision != choices.id[0]) { f_status_t allocation_status = F_none; - fl_macro_color_context_t_new(allocation_status, (*context)); + f_macro_color_context_t_new(allocation_status, (*context)); if (F_status_is_error(allocation_status)) return allocation_status; diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index 440a729..b2a36f4 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -42,12 +42,12 @@ extern "C" { * @return * F_none on success. * - * Errors from (with error bit): fl_color_print(). + * Errors (with error bit) from: fl_color_print(). * * @param fl_color_print() */ #ifndef _di_fll_program_print_help_header_ - extern f_return_status fll_program_print_help_header(const fl_color_context_t context, const f_string_t name, const f_string_t version); + extern f_return_status fll_program_print_help_header(const f_color_context_t context, const f_string_t name, const f_string_t version); #endif // _di_fll_program_print_help_header_ /** @@ -69,12 +69,12 @@ extern "C" { * @return * F_none on success. * - * Errors from (with error bit): fl_color_print(). + * Errors (with error bit) from: fl_color_print(). * * @param fl_color_print() */ #ifndef _di_fll_program_print_help_option_ - extern f_return_status fll_program_print_help_option(const fl_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); + extern f_return_status fll_program_print_help_option(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); #endif // _di_fll_program_print_help_option_ /** @@ -92,12 +92,12 @@ extern "C" { * @return * F_none on success. * - * Errors from (with error bit): fl_color_print(). + * Errors (with error bit) from: fl_color_print(). * * @param fl_color_print() */ #ifndef _di_fll_program_print_help_option_long_ - extern f_return_status fll_program_print_help_option_long(const fl_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description); + extern f_return_status fll_program_print_help_option_long(const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description); #endif // _di_fll_program_print_help_option_long_ /** @@ -113,12 +113,12 @@ extern "C" { * @return * F_none on success. * - * Errors from (with error bit): fl_color_print(). + * Errors (with error bit) from: fl_color_print(). * * @param fl_color_print() */ #ifndef _di_fll_program_print_help_option_other_ - extern f_return_status fll_program_print_help_option_other(const fl_color_context_t context, const f_string_t option_other, const f_string_t description); + extern f_return_status fll_program_print_help_option_other(const f_color_context_t context, const f_string_t option_other, const f_string_t description); #endif // _di_fll_program_print_help_option_other_ /** @@ -135,12 +135,12 @@ extern "C" { * @return * F_none on success. * - * Errors from (with error bit): fl_color_print(). + * Errors (with error bit) from: fl_color_print(). * * @param fl_color_print() */ #ifndef _di_fll_program_print_help_usage_ - extern f_return_status fll_program_print_help_usage(const fl_color_context_t context, const f_string_t name, const f_string_t parameters); + extern f_return_status fll_program_print_help_usage(const f_color_context_t context, const f_string_t name, const f_string_t parameters); #endif // _di_fll_program_print_help_usage_ /** @@ -179,10 +179,10 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_console_parameter_prioritize_left(). - * Errors from (with error bit): f_console_parameter_prioritize_right(). - * Errors from (with error bit): f_console_parameter_process(). - * Errors from (with error bit): fl_color_load_context(). + * Errors (with error bit) from: f_console_parameter_prioritize_left(). + * Errors (with error bit) from: f_console_parameter_prioritize_right(). + * Errors (with error bit) from: f_console_parameter_process(). + * Errors (with error bit) from: fl_color_load_context(). * * @see f_console_parameter_prioritize_left() * @see f_console_parameter_prioritize_right() @@ -190,7 +190,7 @@ extern "C" { * @see fl_color_load_context() */ #ifndef _di_fll_program_parameter_process_ - extern f_return_status fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context); + extern f_return_status fll_program_parameter_process(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, f_color_context_t *context); #endif // _di_fll_program_parameter_process_ /** * Perform basic parameter loading, including initialization of color context but does not print errors. @@ -215,10 +215,10 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): f_console_parameter_prioritize_left(). - * Errors from (with error bit): f_console_parameter_prioritize_right(). - * Errors from (with error bit): f_console_parameter_process(). - * Errors from (with error bit): fl_color_load_context(). + * Errors (with error bit) from: f_console_parameter_prioritize_left(). + * Errors (with error bit) from: f_console_parameter_prioritize_right(). + * Errors (with error bit) from: f_console_parameter_process(). + * Errors (with error bit) from: fl_color_load_context(). * * @see f_console_parameter_prioritize_left() * @see f_console_parameter_prioritize_right() @@ -226,7 +226,7 @@ extern "C" { * @see fl_color_load_context() */ #ifndef _di_fll_program_parameter_process_quietly_ - extern f_return_status fll_program_parameter_process_quietly(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, fl_color_context_t *context); + extern f_return_status fll_program_parameter_process_quietly(const f_console_arguments_t arguments, f_console_parameters_t parameters, const f_console_parameter_ids_t choices, const bool right, f_string_lengths_t *remaining, f_color_context_t *context); #endif // _di_fll_program_parameter_process_quietly_ /** @@ -251,7 +251,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_append(). + * Errors (with error bit) from: fl_string_append(). * * @see fl_string_append() */ @@ -281,7 +281,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if the combined string is too large. * - * Errors from (with error bit): fl_string_mash(). + * Errors (with error bit) from: fl_string_mash(). * * @see fl_string_mash() */ @@ -308,7 +308,7 @@ extern "C" { * F_memory_reallocation (with error bit) on memory reallocation error. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_string_rip(). + * Errors (with error bit) from: fl_string_rip(). * * @see fl_string_rip() */ @@ -340,8 +340,8 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_string_too_large (with error bit) if the combined string is too large. * - * Errors from (with error bit): fl_string_dynamic_mash(). - * Errors from (with error bit): fl_string_rip(). + * Errors (with error bit) from: fl_string_dynamic_mash(). + * Errors (with error bit) from: fl_string_rip(). * * @see fl_string_dynamic_mash() * @see fl_string_rip() diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 6b016f9..44a0987 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_byte_dump_print_help_ - f_return_status byte_dump_print_help(const fl_color_context_t context) { + f_return_status byte_dump_print_help(const f_color_context_t context) { fll_program_print_help_header(context, byte_dump_name_long, byte_dump_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -43,13 +43,13 @@ extern "C" { fll_program_print_help_usage(context, byte_dump_name, "filename(s)"); printf(" When using the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_text); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_text); printf(" option, some UTF-8 characters may be replaced by your instance and cause display alignment issues."); printf("%c%c", f_string_eol[0], f_string_eol[0]); printf(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder); printf(" option is used)."); printf("%c%c", f_string_eol[0], f_string_eol[0]); @@ -59,7 +59,7 @@ extern "C" { printf("%c%c", f_string_eol[0], f_string_eol[0]); printf(" When "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); printf(" is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range."); printf("%c%c", f_string_eol[0], f_string_eol[0]); @@ -162,9 +162,9 @@ extern "C" { } else if (data->remaining.used > 0 || data->process_pipe) { if (data->parameters[byte_dump_parameter_width].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width); + fl_color_print_line(f_type_error, data->context.set.error, "' was specified, but no value was given."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -177,13 +177,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status) || number < 1 || number >= 0xfb) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number between "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "0"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " and "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "251"); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width); + fl_color_print(f_type_error, data->context.set.error, "' value can only be a number between "); + fl_color_print(f_type_error, data->context.set.notable, "0"); + fl_color_print(f_type_error, data->context.set.error, " and "); + fl_color_print(f_type_error, data->context.set.notable, "251"); + fl_color_print_line(f_type_error, data->context.set.error, "."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -193,9 +193,9 @@ extern "C" { } if (data->parameters[byte_dump_parameter_first].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); + fl_color_print_line(f_type_error, data->context.set.error, "' was specified, but no value was given."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -208,13 +208,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status) || number > f_number_t_size_unsigned) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "0"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " and "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_number_t_size_unsigned); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); + fl_color_print(f_type_error, data->context.set.error, "' value can only be a number (inclusively) between "); + fl_color_print(f_type_error, data->context.set.notable, "0"); + fl_color_print(f_type_error, data->context.set.error, " and "); + fl_color_print(f_type_error, data->context.set.notable, "%llu", f_number_t_size_unsigned); + fl_color_print_line(f_type_error, data->context.set.error, "."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -224,9 +224,9 @@ extern "C" { } if (data->parameters[byte_dump_parameter_last].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); + fl_color_print_line(f_type_error, data->context.set.error, "' was specified, but no value was given."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -239,13 +239,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range); if (F_status_is_error(status) || number < 0 || number > f_number_t_size_unsigned) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "0"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " and "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_number_t_size_unsigned); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); + fl_color_print(f_type_error, data->context.set.error, "' value can only be a number (inclusively) between "); + fl_color_print(f_type_error, data->context.set.notable, "0"); + fl_color_print(f_type_error, data->context.set.error, " and "); + fl_color_print(f_type_error, data->context.set.notable, "%llu", f_number_t_size_unsigned); + fl_color_print_line(f_type_error, data->context.set.error, "."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -256,11 +256,11 @@ extern "C" { if (data->parameters[byte_dump_parameter_first].result == f_console_result_additional && data->parameters[byte_dump_parameter_last].result == f_console_result_additional) { if (data->first > data->last) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' value cannot be greater than the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' value."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first); + fl_color_print(f_type_error, data->context.set.error, "' value cannot be greater than the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last); + fl_color_print_line(f_type_error, data->context.set.error, "' value."); byte_dump_delete_data(data); return F_status_set_error(status); @@ -276,25 +276,25 @@ extern "C" { file.id = f_type_descriptor_input; printf("%c", f_string_eol[0]); - fl_color_print(f_type_output, data->context.title, data->context.reset, "Piped Byte Dump: (in "); + fl_color_print(f_type_output, data->context.set.title, "Piped Byte Dump: (in "); if (data->mode == byte_dump_mode_hexidecimal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Hexidecimal"); + fl_color_print(f_type_output, data->context.set.title, "Hexidecimal"); } else if (data->mode == byte_dump_mode_duodecimal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Duodecimal"); + fl_color_print(f_type_output, data->context.set.title, "Duodecimal"); } else if (data->mode == byte_dump_mode_octal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Octal"); + fl_color_print(f_type_output, data->context.set.title, "Octal"); } else if (data->mode == byte_dump_mode_binary) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Binary"); + fl_color_print(f_type_output, data->context.set.title, "Binary"); } else if (data->mode == byte_dump_mode_decimal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Decimal"); + fl_color_print(f_type_output, data->context.set.title, "Decimal"); } - fl_color_print_line(f_type_output, data->context.title, data->context.reset, ")"); + fl_color_print_line(f_type_output, data->context.set.title, ")"); status = byte_dump_file(*data, "-", file); @@ -339,27 +339,27 @@ extern "C" { } printf("%c", f_string_eol[0]); - fl_color_print(f_type_output, data->context.title, data->context.reset, "Byte Dump of: "); - fl_color_print(f_type_output, data->context.notable, data->context.reset, "%s", arguments.argv[data->remaining.array[counter]]); - fl_color_print(f_type_output, data->context.title, data->context.reset, " (in "); + fl_color_print(f_type_output, data->context.set.title, "Byte Dump of: "); + fl_color_print(f_type_output, data->context.set.notable, "%s", arguments.argv[data->remaining.array[counter]]); + fl_color_print(f_type_output, data->context.set.title, " (in "); if (data->mode == byte_dump_mode_hexidecimal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Hexidecimal"); + fl_color_print(f_type_output, data->context.set.title, "Hexidecimal"); } else if (data->mode == byte_dump_mode_duodecimal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Duodecimal"); + fl_color_print(f_type_output, data->context.set.title, "Duodecimal"); } else if (data->mode == byte_dump_mode_octal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Octal"); + fl_color_print(f_type_output, data->context.set.title, "Octal"); } else if (data->mode == byte_dump_mode_binary) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Binary"); + fl_color_print(f_type_output, data->context.set.title, "Binary"); } else if (data->mode == byte_dump_mode_decimal) { - fl_color_print(f_type_output, data->context.title, data->context.reset, "Decimal"); + fl_color_print(f_type_output, data->context.set.title, "Decimal"); } - fl_color_print_line(f_type_output, data->context.title, data->context.reset, ")"); + fl_color_print_line(f_type_output, data->context.set.title, ")"); status = byte_dump_file(*data, arguments.argv[data->remaining.array[counter]], file); @@ -376,7 +376,7 @@ extern "C" { } } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more filenames."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify one or more filenames."); status = F_status_set_error(F_parameter); } @@ -394,7 +394,7 @@ extern "C" { } // for f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/byte_dump/c/byte_dump.h b/level_3/byte_dump/c/byte_dump.h index b7fdef1..9a369af 100644 --- a/level_3/byte_dump/c/byte_dump.h +++ b/level_3/byte_dump/c/byte_dump.h @@ -211,7 +211,7 @@ extern "C" { uint8_t mode; uint8_t presentation; - fl_color_context_t context; + f_color_context_t context; } byte_dump_data_t; #define byte_dump_data_t_initialize \ @@ -224,7 +224,7 @@ extern "C" { 8, \ byte_dump_mode_hexidecimal, \ byte_dump_presentation_normal, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_byte_dump_data_t_ @@ -238,7 +238,7 @@ extern "C" { * F_none on success. */ #ifndef _di_byte_dump_print_help_ - extern f_return_status byte_dump_print_help(const fl_color_context_t context); + extern f_return_status byte_dump_print_help(const f_color_context_t context); #endif // _di_byte_dump_print_help_ /** diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 7c97efb..cba1cc4 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -206,17 +206,17 @@ extern "C" { fflush(f_type_output); if (found_invalid_utf) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "Invalid UTF-8 codes were detected for file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", file_name); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "Invalid UTF-8 codes were detected for file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, data.context.set.error, "'."); printf("%c", f_string_eol[0]); } if (size < 0) { // @todo: determine what the error from read() is and display it. - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: read() failed for '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", file_name); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: read() failed for '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, data.context.set.error, "'."); printf("%c", f_string_eol[0]); status = F_status_set_error(F_failure); } @@ -249,7 +249,7 @@ extern "C" { } if (cell->column == 0) { - fl_color_print(f_type_output, data.context.notable, data.context.reset, "%016X ", (uint64_t) cell->row); + fl_color_print(f_type_output, data.context.set.notable, "%016X ", (uint64_t) cell->row); if (*offset > 0) { uint8_t offset_to_print = *offset; @@ -299,7 +299,7 @@ extern "C" { if (cell->column < data.width) { if (data.mode == byte_dump_mode_hexidecimal) { if (invalid[character_current]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, " %02x", (uint8_t) byte); + fl_color_print(f_type_output, data.context.set.error, " %02x", (uint8_t) byte); } else { printf(" %02x", (uint8_t) byte); @@ -342,7 +342,7 @@ extern "C" { } else if (data.mode == byte_dump_mode_octal) { if (invalid[character_current]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, " %03o", (uint8_t) byte); + fl_color_print(f_type_output, data.context.set.error, " %03o", (uint8_t) byte); } else { printf(" %03o", (uint8_t) byte); @@ -361,7 +361,7 @@ extern "C" { binary_string[7] = (byte & 0x01) ? '1' : '0'; if (invalid[character_current]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, " %s", binary_string); + fl_color_print(f_type_output, data.context.set.error, " %s", binary_string); } else { printf(" %s", binary_string); @@ -369,7 +369,7 @@ extern "C" { } else if (data.mode == byte_dump_mode_decimal) { if (invalid[character_current]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, " %3d", (uint8_t) byte); + fl_color_print(f_type_output, data.context.set.error, " %3d", (uint8_t) byte); } else { printf(" %3d", (uint8_t) byte); @@ -434,7 +434,7 @@ extern "C" { uint8_t width_utf = 0; bool printed = F_false; - fl_color_print(f_type_output, data.context.notable, data.context.reset, " %s ", byte_dump_character_wall); + fl_color_print(f_type_output, data.context.set.notable, " %s ", byte_dump_character_wall); if (*offset > 0) { @@ -453,7 +453,7 @@ extern "C" { } while (*offset > 0 && j < data.width) { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", placeholder); (*offset)--; j++; } // while @@ -472,13 +472,13 @@ extern "C" { if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { for (; j < previous->bytes && j < data.width; j++) { if (previous->invalid) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder); } else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) { printf("."); } else { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder); } } // for } @@ -503,111 +503,111 @@ extern "C" { width_utf = f_macro_utf_byte_width_is(output); if (invalid[i]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_incomplete); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_incomplete); } else if (output >= 0 && output <= 32 || output == 127) { if (data.presentation == byte_dump_presentation_normal) { if (output == 0) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_null); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_null); } else if (output == 1) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_start_of_header); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_start_of_header); } else if (output == 2) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_start_of_text); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_start_of_text); } else if (output == 3) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_text); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_text); } else if (output == 4) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_transmission); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_transmission); } else if (output == 5) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_enquiry); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_enquiry); } else if (output == 6) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_acknowledge); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_acknowledge); } else if (output == 7) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_bell); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_bell); } else if (output == 8) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_backspace); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_backspace); } else if (output == 9) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_tab); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_tab); } else if (output == 10) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_new_line); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_new_line); } else if (output == 11) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_tab_vertical); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_tab_vertical); } else if (output == 12) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_form_feed); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_form_feed); } else if (output == 13) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_carriage_return); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_carriage_return); } else if (output == 14) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_shift_out); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_shift_out); } else if (output == 15) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_shift_in); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_shift_in); } else if (output == 16) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_data_link_escape); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_data_link_escape); } else if (output == 17) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_1); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_1); } else if (output == 18) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_2); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_2); } else if (output == 19) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_3); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_3); } else if (output == 20) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_4); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_4); } else if (output == 21) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_negative_acknowledge); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_negative_acknowledge); } else if (output == 22) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_synchronous_idle); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_synchronous_idle); } else if (output == 23) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_transmission_block); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_transmission_block); } else if (output == 24) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_cancel); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_cancel); } else if (output == 25) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_medium); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_medium); } else if (output == 26) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_substitute); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_substitute); } else if (output == 27) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_escape); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_escape); } else if (output == 28) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_file_separator); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_file_separator); } else if (output == 29) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_group_separator); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_group_separator); } else if (output == 30) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_record_separator); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_record_separator); } else if (output == 31) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_unit_separator); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_unit_separator); } else if (output == 32) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_space); } else if (output == 127) { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_delete); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_delete); } } else if (data.presentation == byte_dump_presentation_simple) { @@ -622,7 +622,7 @@ extern "C" { printf("."); } else { - fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space); + fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_space); } } else if (f_utf_character_is_zero_width(characters.string[i]) == F_true) { @@ -630,7 +630,7 @@ extern "C" { printf("."); } else if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder); } else { printf(" "); @@ -639,7 +639,7 @@ extern "C" { else if (f_utf_character_is_control(characters.string[i]) == F_true) { // print a space (or '.') for control characters. if (data.presentation == byte_dump_presentation_classic) { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "."); + fl_color_print(f_type_output, data.context.set.warning, "."); } else { printf(" "); @@ -677,10 +677,10 @@ extern "C" { else if (width_utf == 1) { // print invalid placeholder for invalid UTF-8 widths. if (invalid[i]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_incomplete); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_incomplete); } else { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_incomplete); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_incomplete); } } else if (width_utf > 0) { @@ -743,13 +743,13 @@ extern "C" { if (width_utf > 1 && j + 1 < data.width) { if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { if (invalid[i]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder); } else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) { printf("."); } else { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder); } } else { @@ -761,13 +761,13 @@ extern "C" { if (width_utf > 2 && j + 1 < data.width) { if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { if (invalid[i]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder); } else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) { printf("."); } else { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder); } } else { @@ -779,13 +779,13 @@ extern "C" { if (width_utf > 3 && j + 1 < data.width) { if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { if (invalid[i]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder); } else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) { printf("."); } else { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder); } } else { @@ -802,13 +802,13 @@ extern "C" { if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { for (; j < data.width; j++) { if (invalid[j]) { - fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder); } else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) { printf("."); } else { - fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder); + fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder); } } // for } @@ -818,76 +818,76 @@ extern "C" { } // for } - fl_color_print(f_type_output, data.context.notable, data.context.reset, " |"); + fl_color_print(f_type_output, data.context.set.notable, " |"); printf("%c", f_string_eol[0]); } #endif // _di_byte_dump_file_ #ifndef _di_byte_dump_print_file_error_ - void byte_dump_print_file_error(const fl_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) { + void byte_dump_print_file_error(const f_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) { if (status == F_false) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to find file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to find file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_parameter) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ", function, file_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print(f_type_error, context.error, context.reset, "() for the file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ", function, file_name); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print(f_type_error, context.set.error, "() for the file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_name) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid filename '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid filename '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_memory_out) { - fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to access file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to access file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_number_overflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to access file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Overflow while trying to access file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_directory) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to access file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid directory while trying to access file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_access_denied) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to access file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Access denied while trying to access file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } if (status == F_loop) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to access file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Loop while trying to access file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); return; } - fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") occurred for file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") occurred for file '"); + fl_color_print(f_type_error, context.set.notable, "%s", file_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } #endif // _di_byte_dump_print_file_error_ diff --git a/level_3/byte_dump/c/private-byte_dump.h b/level_3/byte_dump/c/private-byte_dump.h index ab7468c..7ec2643 100644 --- a/level_3/byte_dump/c/private-byte_dump.h +++ b/level_3/byte_dump/c/private-byte_dump.h @@ -155,7 +155,7 @@ extern "C" { * F_false if error has not been printed. */ #ifndef _di_byte_dump_print_file_error_ - extern void byte_dump_print_file_error(const fl_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void byte_dump_print_file_error(const f_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_byte_dump_print_file_error_ #ifdef __cplusplus diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index acadef5..37804a4 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -11,7 +11,7 @@ extern "C" { #endif #ifndef _di_fake_print_help_ - f_return_status fake_print_help(const fl_color_context_t context) { + f_return_status fake_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fake_name_long, fake_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -39,7 +39,7 @@ extern "C" { printf("%c%c", f_string_eol[0], f_string_eol[0]); - fl_color_print(f_type_output, context.important, context.reset, " Special Options: "); + fl_color_print(f_type_output, context.set.important, " Special Options: "); fll_program_print_help_option_long(context, fake_long_documents_disabled, f_console_symbol_long_enable, " Forcibly do not build documents files."); fll_program_print_help_option_long(context, fake_long_documents_enabled, f_console_symbol_long_enable, " Forcibly do build documents files."); @@ -50,7 +50,7 @@ extern "C" { printf("%c%c", f_string_eol[0], f_string_eol[0]); - fl_color_print(f_type_output, context.important, context.reset, " Operations: "); + fl_color_print(f_type_output, context.set.important, " Operations: "); fll_program_print_help_option_other(context, fake_other_operation_build, " Build or compile the code based on build settings file."); fll_program_print_help_option_other(context, fake_other_operation_clean, " Delete all build files."); @@ -60,33 +60,33 @@ extern "C" { fll_program_print_help_usage(context, fake_name, "operation"); printf(" When performing the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s", fake_other_operation_build); + fl_color_print(f_type_output, context.set.notable, "%s", fake_other_operation_build); printf(" operation, the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); printf(" parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global."); printf("%c", f_string_eol[0]); printf(" For example, when a "); - fl_color_print(f_type_output, context.notable, context.reset, "%s", fake_long_mode); + fl_color_print(f_type_output, context.set.notable, "%s", fake_long_mode); printf(" of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level')."); printf("%c%c", f_string_eol[0], f_string_eol[0]); printf(" When specifying the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s", fake_long_fakefile); + fl_color_print(f_type_output, context.set.notable, "%s", fake_long_fakefile); printf(" or the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s", fake_long_settings); + fl_color_print(f_type_output, context.set.notable, "%s", fake_long_settings); printf(" parameters, the filenames are relative to the data build directory, unless a path is used."); printf("%c", f_string_eol[0]); printf(" For example, with '"); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); + fl_color_print(f_type_output, context.set.notable, "%s%s my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); printf("' the fakefile at '"); - fl_color_print(f_type_output, context.notable, context.reset, "./%s%smy_fakefile", fake_default_path_data, fake_default_path_build); + fl_color_print(f_type_output, context.set.notable, "./%s%smy_fakefile", fake_default_path_data, fake_default_path_build); printf(" would be used, however with '"); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s ./my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); + fl_color_print(f_type_output, context.set.notable, "%s%s ./my_fakefile", f_console_symbol_long_enable, fake_long_fakefile); printf("' the fakefile at '"); - fl_color_print(f_type_output, context.notable, context.reset, "./my_fakefile", fake_default_path_data, fake_default_path_build); + fl_color_print(f_type_output, context.set.notable, "./my_fakefile", fake_default_path_data, fake_default_path_build); printf(" would be used."); printf("%c%c", f_string_eol[0], f_string_eol[0]); @@ -303,9 +303,9 @@ extern "C" { else if (F_status_is_error(status)) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The operation '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", operations_name); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' failed."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The operation '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", operations_name); + fl_color_print_line(f_type_error, data->context.set.error, "' failed."); } break; @@ -325,7 +325,7 @@ extern "C" { else { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify an operation."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify an operation."); fprintf(f_type_error, "%c", f_string_eol[0]); } @@ -402,7 +402,7 @@ extern "C" { f_macro_string_dynamic_t_delete_simple(data->file_documents_readme); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fake/c/fake.h b/level_3/fake/c/fake.h index d4c227c..14d8454 100644 --- a/level_3/fake/c/fake.h +++ b/level_3/fake/c/fake.h @@ -434,7 +434,7 @@ extern "C" { f_string_dynamic_t file_documents_readme; - fl_color_context_t context; + f_color_context_t context; } fake_data_t; #define fake_data_t_initialize \ @@ -490,7 +490,7 @@ extern "C" { f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fake_data_t_ @@ -504,7 +504,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fake_print_help_ - extern f_return_status fake_print_help(const fl_color_context_t context); + extern f_return_status fake_print_help(const f_color_context_t context); #endif // _di_fake_print_help_ /** diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index c38521c..39cd976 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -169,7 +169,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Copying %s.", label); + fl_color_print_line(f_type_output, data.context.set.important, "Copying %s.", label); } f_macro_string_dynamic_t_new(*status, path_source, source.used); @@ -342,7 +342,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Creating base build directories."); + fl_color_print_line(f_type_output, data.context.set.important, "Creating base build directories."); } for (uint8_t i = 0; i < 15; i++) { @@ -586,9 +586,9 @@ extern "C" { if (F_status_set_fine(*status) == F_failure) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to execute script: "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Failed to execute script: "); + fl_color_print(f_type_error, data.context.set.notable, "%s", path.string); + fl_color_print_line(f_type_error, data.context.set.error, "."); } } else { @@ -653,7 +653,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling shared library."); + fl_color_print_line(f_type_output, data.context.set.important, "Compiling shared library."); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -960,7 +960,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static library."); + fl_color_print_line(f_type_output, data.context.set.important, "Compiling static library."); } f_string_dynamic_t file_name = f_string_dynamic_t_initialize; @@ -1128,11 +1128,11 @@ extern "C" { if (names.used + data_build.setting.environment.used > f_array_length_t_size) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The values for the setting '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_build_setting_name_environment); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' of setting file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' is too large."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The values for the setting '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", fake_build_setting_name_environment); + fl_color_print(f_type_error, data.context.set.error, "' of setting file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", data.file_data_build_settings.string); + fl_color_print_line(f_type_error, data.context.set.error, "' is too large."); } f_macro_string_dynamic_t_delete_simple(part); @@ -1317,11 +1317,11 @@ extern "C" { for (uint8_t i = 0; i < 1; i++) { if (settings[i]->used == 0) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The setting '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", names[i]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' is required but is not specified in the settings file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", setting_file.used ? path_file : data.file_data_build_settings.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The setting '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", names[i]); + fl_color_print(f_type_error, data.context.set.error, "' is required but is not specified in the settings file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", setting_file.used ? path_file : data.file_data_build_settings.string); + fl_color_print_line(f_type_error, data.context.set.error, "'."); failed = F_true; } @@ -1546,11 +1546,11 @@ extern "C" { if (found == F_false) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The specified mode '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", modes->array[i].string); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' is not a valid mode, according to '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The specified mode '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", modes->array[i].string); + fl_color_print(f_type_error, data.context.set.error, "' is not a valid mode, according to '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path_file); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } error_printed = F_true; @@ -1599,9 +1599,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { // @todo update FSS functions to return which setting index the problem happened on. fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: A setting in the build setting file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' is too long."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: A setting in the build setting file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path_file); + fl_color_print_line(f_type_error, data.context.set.error, "' is too long."); } } else if (!error_printed) { @@ -1791,13 +1791,13 @@ extern "C" { if (settings_single_source[i]->used > 1) { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may only have a single property, only using the first: '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_source[i]->array[0].string); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the setting '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_single_name[i]); + 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: '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_single_source[i]->array[0].string); + fl_color_print_line(f_type_warning, data.context.set.warning, "'."); } } @@ -1813,17 +1813,17 @@ extern "C" { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may be either '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_common_setting_bool_yes); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' or '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_common_setting_bool_no); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', defaulting to '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_common_setting_bool_yes); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the setting '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_single_name[i]); + 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 be either '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_common_setting_bool_yes); + fl_color_print(f_type_warning, data.context.set.warning, "' or '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_common_setting_bool_no); + fl_color_print(f_type_warning, data.context.set.warning, "', defaulting to '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_common_setting_bool_yes); + fl_color_print_line(f_type_warning, data.context.set.warning, "'."); } } } @@ -1842,19 +1842,19 @@ extern "C" { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may only be one of '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_language_bash); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_language_c); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', or '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_language_cpp); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', defaulting to '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_language_c); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the setting '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_single_name[i]); + 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 one of '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_language_bash); + fl_color_print(f_type_warning, data.context.set.warning, "', '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_language_c); + fl_color_print(f_type_warning, data.context.set.warning, "', or '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_language_cpp); + fl_color_print(f_type_warning, data.context.set.warning, "', defaulting to '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_language_c); + fl_color_print_line(f_type_warning, data.context.set.warning, "'."); } } } @@ -1873,19 +1873,19 @@ extern "C" { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may only be one of '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_major); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_minor); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', or '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_micro); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', defaulting to '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_major); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the setting '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_single_name[i]); + 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 one of '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_version_major); + fl_color_print(f_type_warning, data.context.set.warning, "', '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_version_minor); + fl_color_print(f_type_warning, data.context.set.warning, "', or '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_version_micro); + fl_color_print(f_type_warning, data.context.set.warning, "', defaulting to '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", fake_build_version_major); + fl_color_print_line(f_type_warning, data.context.set.warning, "'."); } } } @@ -2006,20 +2006,20 @@ extern "C" { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.error, data.context.reset, "WARNING: the parameters '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled); - fl_color_print(f_type_warning, data.context.error, data.context.reset, "' and '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_shared_enabled); - fl_color_print(f_type_warning, data.context.error, data.context.reset, "' contradict, defaulting to '"); + fl_color_print(f_type_warning, data.context.set.error, "WARNING: the parameters '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled); + fl_color_print(f_type_warning, data.context.set.error, "' and '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_enabled); + fl_color_print(f_type_warning, data.context.set.error, "' contradict, defaulting to '"); if (setting->build_shared) { - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_shared_enabled); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_enabled); } else { - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled); } - fl_color_print_line(f_type_warning, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_warning, data.context.set.error, "'."); } } else { @@ -2045,20 +2045,20 @@ extern "C" { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.error, data.context.reset, "WARNING: the parameters '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled); - fl_color_print(f_type_warning, data.context.error, data.context.reset, "' and '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled); - fl_color_print(f_type_warning, data.context.error, data.context.reset, "' contradict, defaulting to '"); + fl_color_print(f_type_warning, data.context.set.error, "WARNING: the parameters '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled); + fl_color_print(f_type_warning, data.context.set.error, "' and '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled); + fl_color_print(f_type_warning, data.context.set.error, "' contradict, defaulting to '"); if (setting->build_static) { - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled); } else { - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled); + fl_color_print(f_type_warning, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled); } - fl_color_print_line(f_type_warning, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_warning, data.context.set.error, "'."); } } else { @@ -2075,20 +2075,20 @@ extern "C" { if (setting->build_shared == F_false && setting->build_static == F_false) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The build settings '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_build_setting_name_build_shared); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' and '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_build_setting_name_build_static); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' cannot both be false when using the language '"); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The build settings '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", fake_build_setting_name_build_shared); + fl_color_print(f_type_error, data.context.set.error, "' and '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", fake_build_setting_name_build_static); + fl_color_print(f_type_error, data.context.set.error, "' cannot both be false when using the language '"); if (setting->build_language == fake_build_language_type_c) { - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_build_language_c); + fl_color_print(f_type_error, data.context.set.notable, "%s", fake_build_language_c); } else { - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_build_language_cpp); + fl_color_print(f_type_error, data.context.set.notable, "%s", fake_build_language_cpp); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } *status = F_status_set_error(F_failure); @@ -2237,7 +2237,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static objects."); + fl_color_print_line(f_type_output, data.context.set.important, "Compiling static objects."); } f_string_dynamic_t file_name = f_string_dynamic_t_initialize; @@ -2317,9 +2317,9 @@ extern "C" { if (*status == F_false) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination_path.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' exists but is not a directory."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The path '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "' exists but is not a directory."); } *status = F_status_set_error(F_failure); @@ -2331,9 +2331,9 @@ extern "C" { if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found_not) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination_path.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The path '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "' could not be created, a parent directory does not exist."); } else { fake_print_error_file(data, F_status_set_fine(*status), "f_directory_create", destination_path.string, "create", F_false, F_true); @@ -2437,7 +2437,7 @@ extern "C" { if (F_status_is_fine(status)) { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print(f_type_output, data.context.important, data.context.reset, "Building project%c", data_build.setting.project_name.used ? ' ' : 0); + fl_color_print(f_type_output, data.context.set.important, "Building project%c", data_build.setting.project_name.used ? ' ' : 0); if (data_build.setting.project_name.used) { fl_color_print_code(f_type_output, data.context.notable); @@ -2445,7 +2445,7 @@ extern "C" { fl_color_print_code(f_type_output, data.context.reset); } - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "."); + fl_color_print_line(f_type_output, data.context.set.important, "."); } } @@ -2561,7 +2561,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling shared program."); + fl_color_print_line(f_type_output, data.context.set.important, "Compiling shared program."); } f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -2660,7 +2660,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Compiling static program."); + fl_color_print_line(f_type_output, data.context.set.important, "Compiling static program."); } 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 a5a6d3f..aef18b1 100644 --- a/level_3/fake/c/private-clean.c +++ b/level_3/fake/c/private-clean.c @@ -15,9 +15,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print(f_type_output, data.context.important, data.context.reset, "Deleting all files within build directory '"); - fl_color_print(f_type_output, data.context.notable, data.context.reset, "%s", data.path_build.string); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "'."); + fl_color_print(f_type_output, data.context.set.important, "Deleting all files within build directory '"); + fl_color_print(f_type_output, data.context.set.notable, "%s", data.path_build.string); + fl_color_print_line(f_type_output, data.context.set.important, "'."); } if (fake_signal_received(data)) { diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index 298c3e8..fe2e631 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -61,9 +61,9 @@ extern "C" { if (F_status_set_fine(*status) == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to find program '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", program.used ? program.string : ""); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' for executing."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Failed to find program '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", program.used ? program.string : ""); + fl_color_print_line(f_type_error, data.context.set.error, "' for executing."); } } else { @@ -642,9 +642,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to process the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_process); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to process the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -653,11 +653,11 @@ extern "C" { if (status == F_false) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_process); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameters value '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", arguments.argv[location]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' contains non-word, non-dash, and non-plus characters."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process); + fl_color_print(f_type_error, data->context.set.error, "' parameters value '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", arguments.argv[location]); + fl_color_print_line(f_type_error, data->context.set.error, "' contains non-word, non-dash, and non-plus characters."); } return F_status_set_error(F_parameter); @@ -671,9 +671,9 @@ extern "C" { if (status == F_status_set_error(F_string_too_large)) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' is too long."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); + fl_color_print_line(f_type_error, data->context.set.error, "' is too long."); } } else { @@ -690,9 +690,9 @@ extern "C" { if (length == 0 || status == F_data_not) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' must not be empty and must not contain only whitespace."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); + fl_color_print_line(f_type_error, data->context.set.error, "' must not be empty and must not contain only whitespace."); } } } @@ -767,9 +767,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to process parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to process parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -781,9 +781,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "f_macro_string_dynamic_t_new", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to load default for the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to load default for the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -801,9 +801,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to process the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_define); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to process the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -822,9 +822,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "f_utf_is_word", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to process the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_define); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to process the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -833,11 +833,11 @@ extern "C" { if (status == F_false) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_define); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameters value '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", data->define.array[i].string); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' contains non-word characters."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define); + fl_color_print(f_type_error, data->context.set.error, "' parameters value '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", data->define.array[i].string); + fl_color_print_line(f_type_error, data->context.set.error, "' contains non-word characters."); } return F_status_set_error(F_parameter); @@ -856,9 +856,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to process the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to process the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -877,9 +877,9 @@ extern "C" { if (F_status_is_error(status)) { if (fake_print_error(*data, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_unknown && data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to process the parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Failed to process the parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return status; @@ -888,11 +888,11 @@ extern "C" { if (status == F_false) { if (data->verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameters value '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", data->mode.array[i].string); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' contains non-word, non-dash, and non-plus characters."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode); + fl_color_print(f_type_error, data->context.set.error, "' parameters value '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", data->mode.array[i].string); + fl_color_print_line(f_type_error, data->context.set.error, "' contains non-word, non-dash, and non-plus characters."); } return F_status_set_error(F_parameter); @@ -930,7 +930,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ALERT: An appropriate exit signal has been received, now aborting."); + fl_color_print_line(f_type_error, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting."); } return F_true; @@ -1003,9 +1003,9 @@ extern "C" { } else if (parameters_required[i]) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: No valid path for the (required) directory parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' was found."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: No valid path for the (required) directory parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]); + fl_color_print_line(f_type_error, data.context.set.error, "' was found."); return F_status_set_error(F_directory_found_not); } diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 382e503..ecbbe4b 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -64,9 +64,9 @@ extern "C" { else if (status == F_exist_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The group name '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", buffer.string); - fl_color_print_line(print.to, print.context, data.context.reset, "' was not found."); + fl_color_print(print.to, print.context, "%s: The group name '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%s", buffer.string); + fl_color_print_line(print.to, print.context, "' was not found."); } return F_status_set_error(F_failure); @@ -81,9 +81,9 @@ extern "C" { else if (number > f_type_size_32_unsigned) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The number '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", number); - fl_color_print_line(print.to, print.context, data.context.reset, "' is too large."); + fl_color_print(print.to, print.context, "%s: The number '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%llu", number); + fl_color_print_line(print.to, print.context, "' is too large."); } } @@ -105,9 +105,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { if (F_status_set_fine(status) == F_syntax) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The mode '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", buffer.string); - fl_color_print_line(print.to, print.context, data.context.reset, "' is invalid."); + fl_color_print(print.to, print.context, "%s: The mode '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%s", buffer.string); + fl_color_print_line(print.to, print.context, "' is invalid."); } else { fake_print_message(data, status, "f_file_mode_from_string", F_true, print); @@ -142,9 +142,9 @@ extern "C" { else if (status == F_exist_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The user name '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", buffer.string); - fl_color_print_line(print.to, print.context, data.context.reset, "' was not found."); + fl_color_print(print.to, print.context, "%s: The user name '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%s", buffer.string); + fl_color_print_line(print.to, print.context, "' was not found."); } return F_status_set_error(F_failure); @@ -159,9 +159,9 @@ extern "C" { else if (number > f_type_size_32_unsigned) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The number '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", number); - fl_color_print_line(print.to, print.context, data.context.reset, "' is too large."); + fl_color_print(print.to, print.context, "%s: The number '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%llu", number); + fl_color_print_line(print.to, print.context, "' is too large."); } } @@ -190,9 +190,9 @@ extern "C" { if (!data_make->buffer.used) { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the fakefile '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", data.file_data_build_fakefile.string); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' is empty."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the fakefile '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", data.file_data_build_fakefile.string); + fl_color_print(f_type_warning, data.context.set.warning, "' is empty."); } return; @@ -305,11 +305,11 @@ extern "C" { if (missing_main) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The fakefile '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_fakefile.string); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' is missing the required '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_make_section_main); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' object."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The fakefile '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", data.file_data_build_fakefile.string); + fl_color_print(f_type_error, data.context.set.error, "' is missing the required '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", fake_make_section_main); + fl_color_print_line(f_type_error, data.context.set.error, "' object."); } *status = F_status_set_error(F_failure); @@ -436,16 +436,16 @@ extern "C" { } else if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: The environment name '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", name_define.string); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "' is already added."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: The environment name '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", name_define.string); + fl_color_print_line(f_type_warning, data.context.set.warning, "' is already added."); } } else if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: The environment name '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", name_define.string); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "' is invalid, ignoring."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: The environment name '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", name_define.string); + fl_color_print_line(f_type_warning, data.context.set.warning, "' is invalid, ignoring."); } name_define.used = 0; @@ -696,13 +696,13 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Invalid characters in the define setting name '"); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Invalid characters in the define setting name '"); fl_color_print_code(f_type_error, data.context.notable); f_print_dynamic(f_type_error, define.array[i].name); fl_color_print_code(f_type_error, data.context.reset); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed."); + fl_color_print_line(f_type_error, data.context.set.error, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed."); } *status = F_status_set_error(F_failure); @@ -1019,7 +1019,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Making project."); + fl_color_print_line(f_type_output, data.context.set.important, "Making project."); } f_status_t status = F_none; @@ -1079,12 +1079,12 @@ extern "C" { if (data_make.setting_make.fail == fake_make_operation_fail_type_exit) { data_make.print.prefix = fake_make_print_error; - data_make.print.context = data.context.error; + data_make.print.context = data.context.set.error; data_make.print.to = f_type_error; } else if (data_make.setting_make.fail == fake_make_operation_fail_type_warn) { data_make.print.prefix = fake_make_print_warning; - data_make.print.context = data.context.warning; + data_make.print.context = data.context.set.warning; data_make.print.to = f_type_warning; } else { @@ -1102,11 +1102,11 @@ extern "C" { if (F_status_is_error(status_path) && data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: Failed change back to orignal path '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", data_make.path.stack.array[0].string); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', status code = "); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%llu", F_status_set_fine(status_path)); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: Failed change back to orignal path '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", data_make.path.stack.array[0].string); + fl_color_print(f_type_warning, data.context.set.warning, "', status code = "); + fl_color_print(f_type_warning, data.context.set.notable, "%llu", F_status_set_fine(status_path)); + fl_color_print_line(f_type_warning, data.context.set.warning, "."); } } @@ -1861,13 +1861,13 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print(f_type_output, data.context.important, data.context.reset, "Processing Section '"); + fl_color_print(f_type_output, data.context.set.important, "Processing Section '"); fl_color_print_code(f_type_output, data.context.notable); f_print_dynamic_partial(f_type_output, data_make->buffer, section->name); fl_color_print_code(f_type_output, data.context.reset); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "'."); + fl_color_print_line(f_type_output, data.context.set.important, "'."); } if (!section->objects.used) { @@ -2116,7 +2116,7 @@ extern "C" { if (F_status_set_fine(*status) == F_signal_abort && section_stack->used == 0) { data_make->setting_make.fail = fake_make_operation_fail_type_exit; data_make->print.prefix = fake_make_print_error; - data_make->print.context = data.context.error; + data_make->print.context = data.context.set.error; data_make->print.to = f_type_error; } @@ -2183,9 +2183,9 @@ extern "C" { } fprintf(data_make->print.to, "%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Incomplete '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", type_name); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' at end of section."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Incomplete '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", type_name); + fl_color_print_line(data_make->print.to, data_make->print.context, "' at end of section."); } fake_print_message_section_operation_failed(data, data_make->buffer, section->name, section->objects.array[section->objects.used - 1], data_make->print); @@ -2484,9 +2484,9 @@ extern "C" { if (F_status_set_fine(*status) == F_file_found_not) { if (data.verbosity == fake_verbosity_verbose) { fprintf(f_type_warning, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "' was not found."); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the file '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(f_type_warning, data.context.set.warning, "' was not found."); } *status = F_none; @@ -2559,7 +2559,7 @@ extern "C" { // forcing exit forces fail mode. data_make->setting_make.fail = fake_make_operation_fail_type_exit; data_make->print.prefix = fake_make_print_error; - data_make->print.context = data.context.error; + data_make->print.context = data.context.set.error; data_make->print.to = f_type_error; } else { @@ -2578,13 +2578,13 @@ extern "C" { if (fl_string_dynamic_compare_string(fake_make_operation_argument_exit, arguments.array[0], fake_make_operation_argument_exit_length) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_type_exit; data_make->print.prefix = fake_make_print_error; - data_make->print.context = data.context.error; + data_make->print.context = data.context.set.error; data_make->print.to = f_type_error; } else if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn, arguments.array[0], fake_make_operation_argument_warn_length) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_type_warn; data_make->print.prefix = fake_make_print_warning; - data_make->print.context = data.context.warning; + data_make->print.context = data.context.set.warning; data_make->print.to = f_type_warning; } else if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore, arguments.array[0], fake_make_operation_argument_ignore_length) == F_equal_to) { @@ -3132,14 +3132,14 @@ extern "C" { printf("%c", f_string_eol[0]); if ((i == 1 && number_left > f_number_t_size_unsigned) || (i > 1 && number_right > f_number_t_size_unsigned)) { - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The number '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%c%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' may only be between the ranges -%llu to %llu.", f_number_t_size_unsigned, f_number_t_size_unsigned); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The number '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%c%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' may only be between the ranges -%llu to %llu.", f_number_t_size_unsigned, f_number_t_size_unsigned); } else { - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Invalid or unsupported number provided '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Invalid or unsupported number provided '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } } } @@ -3684,9 +3684,9 @@ extern "C" { if (F_status_set_fine(status) == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { fprintf(data_make->print.to, "%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find program '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", program.string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' for executing."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find program '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", program.string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' for executing."); } } else if (F_status_set_fine(status) != F_failure) { @@ -3757,9 +3757,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { fprintf(data_make->print.to, "%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed with return code '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", data_make->setting_make.parameter.array[0].value.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed with return code '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", data_make->setting_make.parameter.array[0].value.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } if (data_make->setting_make.fail == fake_make_operation_fail_type_exit) { @@ -3825,7 +3825,7 @@ extern "C" { if (arguments.used == 0) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -3835,9 +3835,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { fprintf(data_make->print.to, "%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: No indexer has been specified, cannot perform '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, fake_make_operation_index); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' section operation."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: No indexer has been specified, cannot perform '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, fake_make_operation_index); + fl_color_print_line(data_make->print.to, data_make->print.context, "' section operation."); } *status = F_status_set_error(F_failure); @@ -3851,7 +3851,7 @@ extern "C" { if (arguments.used > 1) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -3862,9 +3862,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported break type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported break type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -3879,7 +3879,7 @@ extern "C" { if (arguments.used > 1) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -3898,9 +3898,9 @@ extern "C" { if (status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", path_file); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(status_file); @@ -3912,9 +3912,9 @@ extern "C" { else if (!status_file) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a regular file."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", path_file); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a regular file."); } *status = F_status_set_error(F_failure); @@ -3923,7 +3923,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Filename argument must not be an empty string.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Filename argument must not be an empty string.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -3937,7 +3937,7 @@ extern "C" { if (arguments.used) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -3947,7 +3947,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Must not attempt to pop project root off of path stack.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Must not attempt to pop project root off of path stack.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -3975,9 +3975,9 @@ extern "C" { if (f_file_exists(arguments.array[i].string) != F_true) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -3991,9 +3991,9 @@ extern "C" { if (status_file == F_false || status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The last file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[arguments.used - 1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a valid directory."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a valid directory."); } *status = F_status_set_error(F_failure); @@ -4013,9 +4013,9 @@ extern "C" { if (status_file == F_false) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The last file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[arguments.used - 1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a valid directory."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a valid directory."); } *status = F_status_set_error(F_failure); @@ -4026,7 +4026,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4039,7 +4039,7 @@ extern "C" { if (arguments.used == 0) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4047,9 +4047,9 @@ extern "C" { else if (data_make->setting_build.build_compiler.used) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { fprintf(data_make->print.to, "%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: No compiler has been specified, cannot perform '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, fake_make_operation_compile); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' section operation."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: No compiler has been specified, cannot perform '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, fake_make_operation_compile); + fl_color_print_line(data_make->print.to, data_make->print.context, "' section operation."); } *status = F_status_set_error(F_failure); @@ -4076,9 +4076,9 @@ extern "C" { if (f_file_exists(arguments.array[i].string) != F_true) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4092,9 +4092,9 @@ extern "C" { if (status_file == F_false || status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The last file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[arguments.used - 1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a valid directory."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a valid directory."); } *status = F_status_set_error(F_failure); @@ -4114,9 +4114,9 @@ extern "C" { if (status_file == F_false) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The last file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[arguments.used - 1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a valid directory."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a valid directory."); } *status = F_status_set_error(F_failure); @@ -4127,7 +4127,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4153,7 +4153,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4169,7 +4169,7 @@ extern "C" { if (*status == F_none) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Define name must not be an empty string.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Define name must not be an empty string.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4177,13 +4177,13 @@ extern "C" { else if (*status == F_false) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { fprintf(data_make->print.to, "%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Invalid characters in the define setting name '", data_make->print.prefix); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Invalid characters in the define setting name '", data_make->print.prefix); fl_color_print_code(data_make->print.to, data.context.notable); f_print_dynamic(data_make->print.to, arguments.array[0]); fl_color_print_code(data_make->print.to, data.context.reset); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed."); + fl_color_print_line(data_make->print.to, data_make->print.context, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed."); } *status = F_status_set_error(F_failure); @@ -4192,7 +4192,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4205,9 +4205,9 @@ extern "C" { if (*operation_if == fake_make_operation_if_type_else_true || *operation_if == fake_make_operation_if_type_else_false) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Must not be used after another '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "else"); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' section operation."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not be used after another '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "else"); + fl_color_print_line(data_make->print.to, data_make->print.context, "' section operation."); } *status = F_status_set_error(F_failure); @@ -4219,9 +4219,9 @@ 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.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Must not be used inside an ", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "if"); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' section operation."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not be used inside an ", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "if"); + fl_color_print_line(data_make->print.to, data_make->print.context, "' section operation."); } *status = F_status_set_error(F_failure); @@ -4233,7 +4233,7 @@ 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.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has no preceding if condition.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has no preceding if condition.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4245,7 +4245,7 @@ extern "C" { if (arguments.used) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4259,7 +4259,7 @@ extern "C" { if (arguments.used > 1) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4270,9 +4270,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported exit type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported exit type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4291,9 +4291,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported fail type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported fail type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4304,7 +4304,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4323,9 +4323,9 @@ extern "C" { if (status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(status_file); @@ -4344,7 +4344,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4356,9 +4356,9 @@ 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.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Must not be used after another '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "if"); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' section operation."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not be used after another '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "if"); + fl_color_print_line(data_make->print.to, data_make->print.context, "' section operation."); } *status = F_status_set_error(F_failure); @@ -4448,9 +4448,9 @@ extern "C" { if (i == 14) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported if type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported if type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4464,7 +4464,7 @@ extern "C" { if (arguments.used > if_type_minimum[i]) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4481,9 +4481,9 @@ extern "C" { 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.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported mode type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported mode type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4555,9 +4555,9 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported file type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported file type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } type_file |= 0x80; @@ -4625,9 +4625,9 @@ extern "C" { 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.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported define type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported define type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4641,7 +4641,7 @@ extern "C" { if (arguments.used < 3) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4654,7 +4654,7 @@ extern "C" { if (arguments.used < 3) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4698,14 +4698,14 @@ extern "C" { printf("%c", f_string_eol[0]); if (number > f_number_t_size_unsigned) { - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The number '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%c%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' may only be between the ranges -%llu to %llu.", f_number_t_size_unsigned, f_number_t_size_unsigned); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The number '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%c%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' may only be between the ranges -%llu to %llu.", f_number_t_size_unsigned, f_number_t_size_unsigned); } else { - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Invalid or unsupported number provided '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Invalid or unsupported number provided '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } } } @@ -4718,7 +4718,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4731,7 +4731,7 @@ extern "C" { if (arguments.used > 2) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4760,7 +4760,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4787,9 +4787,9 @@ extern "C" { if (f_file_exists(arguments.array[i].string) != F_true) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[i].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4803,9 +4803,9 @@ extern "C" { if (status_file == F_false || status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The last file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[arguments.used - 1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a valid directory."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a valid directory."); } *status = F_status_set_error(F_failure); @@ -4825,9 +4825,9 @@ extern "C" { if (status_file == F_false) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The last file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[arguments.used - 1].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a valid directory."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a valid directory."); } *status = F_status_set_error(F_failure); @@ -4838,7 +4838,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4851,7 +4851,7 @@ extern "C" { if (arguments.used > 1) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4867,21 +4867,21 @@ extern "C" { if (id_section == data_make->fakefile.used) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: No operation section named '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' was found."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: No operation section named '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' was found."); } else { for (f_array_length_t i = 0; i < section_stack->used; i++) { if (section_stack->array[i] == id_section) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The section operation '", data_make->print.prefix); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The section operation '", data_make->print.prefix); fl_color_print_code(data_make->print.to, data.context.notable); f_print_dynamic_partial(data_make->print.to, data_make->buffer, data_make->fakefile.array[id_section].name); fl_color_print_code(data_make->print.to, data.context.reset); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' is already in the operation stack, recursion is not allowed."); + fl_color_print_line(data_make->print.to, data_make->print.context, "' is already in the operation stack, recursion is not allowed."); *status = F_status_set_error(F_failure); break; @@ -4892,7 +4892,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4904,7 +4904,7 @@ extern "C" { if (arguments.used > 1) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Has too many arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Has too many arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4916,9 +4916,9 @@ extern "C" { if (status_file == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Failed to find file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(status_file); @@ -4933,9 +4933,9 @@ extern "C" { else if (!status_file) { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: The file '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "' must be a directory file."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: The file '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "' must be a directory file."); } *status = F_status_set_error(F_failure); @@ -4944,14 +4944,14 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Filename argument must not be an empty string.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Filename argument must not be an empty string.", data_make->print.prefix); } } } else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); @@ -4967,9 +4967,9 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print(data_make->print.to, data_make->print.context, data.context.reset, "%s: Unsupported file type '", data_make->print.prefix); - fl_color_print(data_make->print.to, data.context.notable, data.context.reset, "%s", arguments.array[0].string); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "'."); + fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported file type '", data_make->print.prefix); + fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string); + fl_color_print_line(data_make->print.to, data_make->print.context, "'."); } *status = F_status_set_error(F_failure); @@ -4992,7 +4992,7 @@ extern "C" { else { if (data.verbosity != fake_verbosity_quiet && data_make->print.to) { printf("%c", f_string_eol[0]); - fl_color_print_line(data_make->print.to, data_make->print.context, data.context.reset, "%s: Requires more arguments.", data_make->print.prefix); + fl_color_print_line(data_make->print.to, data_make->print.context, "%s: Requires more arguments.", data_make->print.prefix); } *status = F_status_set_error(F_failure); diff --git a/level_3/fake/c/private-make.h b/level_3/fake/c/private-make.h index 68eab52..4777664 100644 --- a/level_3/fake/c/private-make.h +++ b/level_3/fake/c/private-make.h @@ -351,14 +351,14 @@ extern "C" { #ifndef _di_fake_make_print_t_ typedef struct { const char *prefix; - f_string_static_t context; + f_color_set_t context; FILE *to; } fake_make_print_t; #define fake_make_print_t_initialize { \ 0, \ - f_string_static_t_initialize, \ + f_color_set_t_initialize, \ 0, \ } diff --git a/level_3/fake/c/private-print.c b/level_3/fake/c/private-print.c index cae6bdc..e578863 100644 --- a/level_3/fake/c/private-print.c +++ b/level_3/fake/c/private-print.c @@ -11,7 +11,7 @@ extern "C" { #ifndef _di_fake_print_error_ f_return_status fake_print_error(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback) { - const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.error, f_type_error); + const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.set.error, f_type_error); return fake_print_message(data, status, function, fallback, print); } @@ -23,24 +23,24 @@ extern "C" { if (status == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to find '"); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Failed to find '"); if (f_file_exists(source) == F_true) { - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } else { - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); } - fl_color_print(f_type_error, data.context.error, data.context.reset, "' while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "' while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -49,17 +49,17 @@ extern "C" { if (status == F_parameter) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", function); - fl_color_print(f_type_error, data.context.error, data.context.reset, "() to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, data.context.set.notable, "%s", function); + fl_color_print(f_type_error, data.context.set.error, "() to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -68,15 +68,15 @@ extern "C" { if (status == F_name) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Invalid name for '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Invalid name for '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' or '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' or '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -85,15 +85,15 @@ extern "C" { if (status == F_memory_out) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -103,15 +103,15 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Overflow while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Overflow while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -120,15 +120,15 @@ extern "C" { if (status == F_directory) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Invalid directory while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Invalid directory while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -137,15 +137,15 @@ extern "C" { if (status == F_access_denied) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Access denied while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Access denied while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -154,15 +154,15 @@ extern "C" { if (status == F_loop) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Loop while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Loop while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -171,15 +171,15 @@ extern "C" { if (status == F_prohibited) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Prohibited by system while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Prohibited by system while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -188,15 +188,15 @@ extern "C" { if (status == F_directory_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Failed to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' due to an invalid directory in the path."); + fl_color_print_line(f_type_error, data.context.set.error, "' due to an invalid directory in the path."); } return F_false; @@ -205,15 +205,15 @@ extern "C" { if (status == F_failure) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Failed to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_false; @@ -221,17 +221,17 @@ extern "C" { if (fake_print_error(data, status, function, F_false) == F_unknown && fallback && data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", status); - fl_color_print(f_type_error, data.context.error, data.context.reset, ") occurred while trying to %s '", operation); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", source); + fl_color_print(f_type_error, data.context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, data.context.set.notable, "%llu", status); + fl_color_print(f_type_error, data.context.set.error, ") occurred while trying to %s '", operation); + fl_color_print(f_type_error, data.context.set.notable, "%s", source); if (destination) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "' %s '", how); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", destination); + fl_color_print(f_type_error, data.context.set.error, "' %s '", how); + fl_color_print(f_type_error, data.context.set.notable, "%s", destination); } - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print_line(f_type_error, data.context.set.error, "'."); } return F_true; @@ -240,7 +240,7 @@ extern "C" { #ifndef _di_fake_print_error_file_ bool fake_print_error_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) { - const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.error, f_type_error); + const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.set.error, f_type_error); return fake_print_message_file(data, status, function, name, operation, is_file, fallback, print); } @@ -252,11 +252,11 @@ extern "C" { if (status == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%d", range.start); - fl_color_print(f_type_error, data.context.error, data.context.reset, " of setting file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "')."); + fl_color_print(f_type_error, data.context.set.error, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at "); + fl_color_print(f_type_error, data.context.set.notable, "%d", range.start); + fl_color_print(f_type_error, data.context.set.error, " of setting file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path_file); + fl_color_print_line(f_type_error, data.context.set.error, "')."); } return F_false; @@ -265,11 +265,11 @@ extern "C" { if (status == F_status_set_error(F_incomplete_utf_stop)) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%d", range.start); - fl_color_print(f_type_error, data.context.error, data.context.reset, " of setting file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "')."); + fl_color_print(f_type_error, data.context.set.error, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at "); + fl_color_print(f_type_error, data.context.set.notable, "%d", range.start); + fl_color_print(f_type_error, data.context.set.error, " of setting file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path_file); + fl_color_print_line(f_type_error, data.context.set.error, "')."); } return F_false; @@ -277,11 +277,11 @@ extern "C" { if (fake_print_error(data, status, function, F_false) == F_unknown && fallback && data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", status); - fl_color_print(f_type_error, data.context.error, data.context.reset, ") in function "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", function); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "()."); + fl_color_print(f_type_error, data.context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, data.context.set.notable, "%llu", status); + fl_color_print(f_type_error, data.context.set.error, ") in function "); + fl_color_print(f_type_error, data.context.set.notable, "%s", function); + fl_color_print_line(f_type_error, data.context.set.error, "()."); } return F_true; @@ -294,10 +294,10 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' was specified, but no value was given."); + fl_color_print_line(f_type_error, data.context.set.error, "' was specified, but no value was given."); } #endif // _di_fake_print_error_parameter_missing_value_ @@ -307,10 +307,10 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' specified too many times."); + fl_color_print_line(f_type_error, data.context.set.error, "' specified too many times."); } #endif // _di_fake_print_error_parameter_too_many_ @@ -320,15 +320,15 @@ extern "C" { if (status == F_parameter) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Invalid parameter", print.prefix); + fl_color_print(print.to, print.context, "%s: Invalid parameter", print.prefix); if (function) { - fl_color_print(print.to, print.context, data.context.reset, " when calling function "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", function); - fl_color_print_line(print.to, print.context, data.context.reset, "()."); + fl_color_print(print.to, print.context, " when calling function "); + fl_color_print(print.to, data.context.set.notable, "%s", function); + fl_color_print_line(print.to, print.context, "()."); } else { - fl_color_print_line(print.to, print.context, data.context.reset, "."); + fl_color_print_line(print.to, print.context, "."); } } @@ -338,15 +338,15 @@ extern "C" { if (status == F_memory_allocation || status == F_memory_reallocation) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Unable to allocate memory", print.prefix); + fl_color_print(print.to, print.context, "%s: Unable to allocate memory", print.prefix); if (function) { - fl_color_print(print.to, print.context, data.context.reset, " in function "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", function); - fl_color_print_line(print.to, print.context, data.context.reset, "()."); + fl_color_print(print.to, print.context, " in function "); + fl_color_print(print.to, data.context.set.notable, "%s", function); + fl_color_print_line(print.to, print.context, "()."); } else { - fl_color_print_line(print.to, print.context, data.context.reset, "."); + fl_color_print_line(print.to, print.context, "."); } } @@ -355,17 +355,17 @@ extern "C" { if (fallback && data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "UNKNOWN %s: (", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", status); - fl_color_print(print.to, print.context, data.context.reset, ")"); + fl_color_print(print.to, print.context, "UNKNOWN %s: (", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%llu", status); + fl_color_print(print.to, print.context, ")"); if (function) { - fl_color_print(print.to, print.context, data.context.reset, " in function "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", function); - fl_color_print_line(print.to, print.context, data.context.reset, "()."); + fl_color_print(print.to, print.context, " in function "); + fl_color_print(print.to, data.context.set.notable, "%s", function); + fl_color_print_line(print.to, print.context, "()."); } else { - fl_color_print_line(print.to, print.context, data.context.reset, "."); + fl_color_print_line(print.to, print.context, "."); } } @@ -380,9 +380,9 @@ extern "C" { if (status == F_file_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Failed to find %s '", print.prefix, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Failed to find %s '", print.prefix, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -391,9 +391,9 @@ extern "C" { if (status == F_file_found) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The %s '", print.prefix, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "' already exists."); + fl_color_print(print.to, print.context, "%s: The %s '", print.prefix, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "' already exists."); } return F_false; @@ -402,9 +402,9 @@ extern "C" { if (status == F_directory_empty_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The %s '", print.prefix, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "' is not empty."); + fl_color_print(print.to, print.context, "%s: The %s '", print.prefix, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "' is not empty."); } return F_false; @@ -413,11 +413,11 @@ extern "C" { if (status == F_parameter) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "INTERNAL %s: Invalid parameter when calling ", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", function); - fl_color_print(print.to, print.context, data.context.reset, "() for the %s '", file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "INTERNAL %s: Invalid parameter when calling ", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%s", function); + fl_color_print(print.to, print.context, "() for the %s '", file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -426,9 +426,9 @@ extern "C" { if (status == F_name) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Invalid %s name '", print.prefix, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Invalid %s name '", print.prefix, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -437,9 +437,9 @@ extern "C" { if (status == F_memory_out) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "CRITICAL %s: Unable to allocate memory, while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "CRITICAL %s: Unable to allocate memory, while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -448,9 +448,9 @@ extern "C" { if (status == F_number_overflow) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Overflow while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Overflow while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -459,9 +459,9 @@ extern "C" { if (status == F_directory) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Invalid directory while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Invalid directory while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -470,9 +470,9 @@ extern "C" { if (status == F_access_denied) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Access denied while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Access denied while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -481,9 +481,9 @@ extern "C" { if (status == F_loop) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Loop while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Loop while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -492,9 +492,9 @@ extern "C" { if (status == F_prohibited) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Prohibited by system while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Prohibited by system while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -503,9 +503,9 @@ extern "C" { if (status == F_access_owner) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Currrent user is not allowed to use the given owner while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Currrent user is not allowed to use the given owner while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -514,9 +514,9 @@ extern "C" { if (status == F_access_group) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Currrent user is not allowed to use the given group while trying to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Currrent user is not allowed to use the given group while trying to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -526,9 +526,9 @@ extern "C" { if (status == F_directory_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "' due to an invalid directory in the path."); + fl_color_print(print.to, print.context, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "' due to an invalid directory in the path."); } return F_false; @@ -538,9 +538,9 @@ extern "C" { if (status == F_directory_found_not) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "' due to an invalid directory in the path."); + fl_color_print(print.to, print.context, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "' due to an invalid directory in the path."); } return F_false; @@ -549,9 +549,9 @@ extern "C" { if (status == F_failure) { if (data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_false; @@ -560,11 +560,11 @@ extern "C" { if (fake_print_error(data, status, function, F_false) == F_unknown && fallback && data.verbosity != fake_verbosity_quiet) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "UNKNOWN %s: (", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", status); - fl_color_print(print.to, print.context, data.context.reset, ") occurred while trying to %s %s '", operation, file_or_directory); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", name); - fl_color_print_line(print.to, print.context, data.context.reset, "'."); + fl_color_print(print.to, print.context, "UNKNOWN %s: (", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%llu", status); + fl_color_print(print.to, print.context, ") occurred while trying to %s %s '", operation, file_or_directory); + fl_color_print(print.to, data.context.set.notable, "%s", name); + fl_color_print_line(print.to, print.context, "'."); } return F_true; @@ -580,21 +580,21 @@ extern "C" { f_fss_count_lines(buffer, operation_name.start, &line); fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The section operation '", print.prefix); + fl_color_print(print.to, print.context, "%s: The section operation '", print.prefix); fl_color_print_code(print.to, data.context.notable); f_print_dynamic_partial(print.to, buffer, operation_name); fl_color_print_code(print.to, data.context.reset); - fl_color_print(print.to, print.context, data.context.reset, "' from section '"); + fl_color_print(print.to, print.context, "' from section '"); fl_color_print_code(print.to, data.context.notable); f_print_dynamic_partial(print.to, buffer, section_name); fl_color_print_code(print.to, data.context.reset); - fl_color_print(print.to, print.context, data.context.reset, "' on line "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", line); - fl_color_print_line(print.to, print.context, data.context.reset, " failed."); + fl_color_print(print.to, print.context, "' on line "); + fl_color_print(print.to, data.context.set.notable, "%llu", line); + fl_color_print_line(print.to, print.context, " failed."); } #endif // _di_fake_print_message_section_operation_failed_ @@ -604,9 +604,9 @@ extern "C" { if (F_status_set_fine(status) == F_false) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The path '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", path); - fl_color_print_line(print.to, print.context, data.context.reset, "' is outside the project root."); + fl_color_print(print.to, print.context, "%s: The path '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%s", path); + fl_color_print_line(print.to, print.context, "' is outside the project root."); } else { fake_print_error_file(data, status, function, path, "determine real path of", F_true, F_true); @@ -620,17 +620,17 @@ extern "C" { if (status == F_buffer_too_large) { fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: Maximum stack size reached while processing path '", print.prefix); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", path); - fl_color_print(print.to, print.context, data.context.reset, "'"); + fl_color_print(print.to, print.context, "%s: Maximum stack size reached while processing path '", print.prefix); + fl_color_print(print.to, data.context.set.notable, "%s", path); + fl_color_print(print.to, print.context, "'"); if (function) { - fl_color_print(print.to, print.context, data.context.reset, " while calling "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%s", function); - fl_color_print(print.to, print.context, data.context.reset, "()"); + fl_color_print(print.to, print.context, " while calling "); + fl_color_print(print.to, data.context.set.notable, "%s", function); + fl_color_print(print.to, print.context, "()"); } - fl_color_print_line(print.to, print.context, data.context.reset, "."); + fl_color_print_line(print.to, print.context, "."); } else { fake_print_message_file(data, status, function, path, "change path to", F_false, F_true, print); @@ -647,23 +647,23 @@ extern "C" { f_fss_count_lines(buffer, operation_name.start, &line); fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The section operation '", print.prefix); + fl_color_print(print.to, print.context, "%s: The section operation '", print.prefix); fl_color_print_code(print.to, data.context.notable); f_print_dynamic_partial(print.to, buffer, operation_name); fl_color_print_code(print.to, data.context.reset); - fl_color_print(print.to, print.context, data.context.reset, "' from section '"); + fl_color_print(print.to, print.context, "' from section '"); fl_color_print_code(print.to, data.context.notable); f_print_dynamic_partial(print.to, buffer, section_name); fl_color_print_code(print.to, data.context.reset); - fl_color_print(print.to, print.context, data.context.reset, "' on line "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", line); - fl_color_print(print.to, print.context, data.context.reset, " cannot be processed because the max stack depth of "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", stack_max); - fl_color_print_line(print.to, print.context, data.context.reset, " has been reached."); + fl_color_print(print.to, print.context, "' on line "); + fl_color_print(print.to, data.context.set.notable, "%llu", line); + fl_color_print(print.to, print.context, " cannot be processed because the max stack depth of "); + fl_color_print(print.to, data.context.set.notable, "%llu", stack_max); + fl_color_print_line(print.to, print.context, " has been reached."); } #endif // _di_fake_print_message_section_operation_stack_max_ @@ -676,21 +676,21 @@ extern "C" { f_fss_count_lines(buffer, operation_name.start, &line); fprintf(print.to, "%c", f_string_eol[0]); - fl_color_print(print.to, print.context, data.context.reset, "%s: The section operation '", print.prefix); + fl_color_print(print.to, print.context, "%s: The section operation '", print.prefix); fl_color_print_code(print.to, data.context.notable); f_print_dynamic_partial(print.to, buffer, operation_name); fl_color_print_code(print.to, data.context.reset); - fl_color_print(print.to, print.context, data.context.reset, "' from section '"); + fl_color_print(print.to, print.context, "' from section '"); fl_color_print_code(print.to, data.context.notable); f_print_dynamic_partial(print.to, buffer, section_name); fl_color_print_code(print.to, data.context.reset); - fl_color_print(print.to, print.context, data.context.reset, "' on line "); - fl_color_print(print.to, data.context.notable, data.context.reset, "%llu", line); - fl_color_print_line(print.to, print.context, data.context.reset, " is not a known operation name."); + fl_color_print(print.to, print.context, "' on line "); + fl_color_print(print.to, data.context.set.notable, "%llu", line); + fl_color_print_line(print.to, print.context, " is not a known operation name."); } #endif // _di_fake_print_message_section_operation_unknown_ @@ -700,17 +700,17 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the fakefile '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' has empty content for the '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_name); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' object '"); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the fakefile '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file); + fl_color_print(f_type_warning, data.context.set.warning, "' has empty content for the '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_name); + fl_color_print(f_type_warning, data.context.set.warning, "' object '"); fl_color_print_code(f_type_warning, data.context.notable); f_print_dynamic_partial(f_type_warning, buffer, range_object); fl_color_print_code(f_type_warning, data.context.reset); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'."); + fl_color_print_line(f_type_warning, data.context.set.warning, "'."); } #endif // _di_fake_print_warning_settings_content_empty_ @@ -720,23 +720,23 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the fakefile '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' has an invalid content '"); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the fakefile '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file); + fl_color_print(f_type_warning, data.context.set.warning, "' has an invalid content '"); fl_color_print_code(f_type_warning, data.context.notable); f_print_dynamic_partial(f_type_warning, buffer, range_content); fl_color_print_code(f_type_warning, data.context.reset); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' for the '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_name); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' object '"); + fl_color_print(f_type_warning, data.context.set.warning, "' for the '"); + fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_name); + fl_color_print(f_type_warning, data.context.set.warning, "' object '"); fl_color_print_code(f_type_warning, data.context.notable); f_print_dynamic_partial(f_type_warning, buffer, range_object); fl_color_print_code(f_type_warning, data.context.reset); - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'."); + fl_color_print_line(f_type_warning, data.context.set.warning, "'."); } #endif // _di_fake_print_warning_settings_content_invalid_ @@ -746,12 +746,12 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", name_object); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the setting '"); + 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_line(f_type_warning, data.context.warning, data.context.reset, "' may only have a single property, only using the first."); + fl_color_print_line(f_type_warning, data.context.set.warning, "' may only have a single property, only using the first."); } #endif // _di_fake_print_warning_settings_content_multiple_ @@ -761,12 +761,12 @@ extern "C" { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the %s object '", label); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", name_object); - fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '"); - fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", path_file); + fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the %s object '", 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_line(f_type_warning, data.context.warning, data.context.reset, "' may only be specified once, only using the first."); + fl_color_print_line(f_type_warning, data.context.set.warning, "' may only be specified once, only using the first."); } #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 ee3a85d..1cb8d1d 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -20,7 +20,7 @@ extern "C" { if (data.verbosity != fake_verbosity_quiet) { printf("%c", f_string_eol[0]); - fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Generating skeleton structure."); + fl_color_print_line(f_type_output, data.context.set.important, "Generating skeleton structure."); } { @@ -174,9 +174,9 @@ extern "C" { if (status == F_false) { if (data.verbosity != fake_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' exists but is not a directory."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The path '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path.string); + fl_color_print_line(f_type_error, data.context.set.error, "' exists but is not a directory."); } return F_status_set_warning(F_failure); @@ -187,9 +187,9 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The path '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path.string); + fl_color_print_line(f_type_error, data.context.set.error, "' could not be created, a parent directory does not exist."); } else { fake_print_error_file(data, F_status_set_fine(status), "f_directory_create", path.string, "create", F_false, F_true); @@ -258,9 +258,9 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_file_found_not) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The file '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The file '"); + fl_color_print(f_type_error, data.context.set.notable, "%s", path.string); + fl_color_print_line(f_type_error, data.context.set.error, "' could not be created, a parent directory does not exist."); } else { fake_print_error_file(data, F_status_set_fine(status), "f_file_create", path.string, "create", F_true, F_true); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 9309ba3..8fc4110 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -12,7 +12,7 @@ extern "C" { #endif #ifndef _di_firewall_print_help_ - f_return_status firewall_print_help(const fl_color_context_t context) { + f_return_status firewall_print_help(const f_color_context_t context) { fll_program_print_help_header(context, firewall_name_long, firewall_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -26,26 +26,26 @@ extern "C" { #endif // _en_firewall_debug_ printf("%c%c", f_string_eol[0], f_string_eol[0]); - fl_color_print(f_type_output, context.important, context.reset, " Available Commands: "); + fl_color_print(f_type_output, context.set.important, " Available Commands: "); printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.standout, context.reset, firewall_command_start); + fl_color_print(f_type_output, context.set.standout, firewall_command_start); printf(" Turn on the firewall"); printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.standout, context.reset, firewall_command_stop); + fl_color_print(f_type_output, context.set.standout, firewall_command_stop); printf(" Turn off the firewall"); printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.standout, context.reset, firewall_command_restart); + fl_color_print(f_type_output, context.set.standout, firewall_command_restart); printf(" Turn off and then turn on the firewall"); printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.standout, context.reset, firewall_command_lock); + fl_color_print(f_type_output, context.set.standout, firewall_command_lock); printf(" Prevent all communication"); printf("%c ", f_string_eol[0]); - fl_color_print(f_type_output, context.standout, context.reset, firewall_command_show); + fl_color_print(f_type_output, context.set.standout, firewall_command_show); printf(" Show active firewall settings"); fll_program_print_help_usage(context, firewall_name, "command"); @@ -162,7 +162,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_line(f_type_warning, data->context.warning, data->context.reset, "WARNING: '%s' is not a valid show option", arguments.argv[data->remaining.array[counter]]); + fl_color_print_line(f_type_warning, data->context.set.warning, "WARNING: '%s' is not a valid show option", arguments.argv[data->remaining.array[counter]]); } else { show_ports = F_true; @@ -181,16 +181,16 @@ extern "C" { f_macro_string_dynamics_resize(status, parameters, 7); if (F_status_is_error(status)) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); firewall_delete_local_data(&local); firewall_delete_data(data); return status; } if (show_nat) { - fl_color_print(f_type_output, data->context.standout, data->context.reset, "=========================== "); - fl_color_print(f_type_output, data->context.title, data->context.reset, "NAT"); - fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " ============================"); + fl_color_print(f_type_output, data->context.set.standout, "=========================== "); + fl_color_print(f_type_output, data->context.set.title, "NAT"); + fl_color_print_line(f_type_output, data->context.set.standout, " ============================"); fflush(f_type_output); parameters.used = 6; @@ -216,9 +216,9 @@ extern "C" { } if (F_status_is_error_not(status) && show_mangle) { - fl_color_print(f_type_output, data->context.standout, data->context.reset, "========================== "); - fl_color_print(f_type_output, data->context.title, data->context.reset, "MANGLE"); - fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " =========================="); + fl_color_print(f_type_output, data->context.set.standout, "========================== "); + fl_color_print(f_type_output, data->context.set.title, "MANGLE"); + fl_color_print_line(f_type_output, data->context.set.standout, " =========================="); fflush(f_type_output); parameters.used = 6; @@ -244,9 +244,9 @@ extern "C" { } if (F_status_is_error_not(status) && show_ports) { - fl_color_print(f_type_output, data->context.standout, data->context.reset, "========================== "); - fl_color_print(f_type_output, data->context.title, data->context.reset, "FILTER"); - fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " =========================="); + fl_color_print(f_type_output, data->context.set.standout, "========================== "); + fl_color_print(f_type_output, data->context.set.title, "FILTER"); + fl_color_print_line(f_type_output, data->context.set.standout, " =========================="); fflush(f_type_output); parameters.used = 4; @@ -271,10 +271,10 @@ extern "C" { status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables); fprintf(f_type_error, " "); f_string_length_t i = 0; @@ -321,13 +321,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_data_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Could not find any network devices"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Could not find any network devices"); } else if (status == F_failure) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to read the device directory '%s'", network_devices); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to read the device directory '%s'", network_devices); } firewall_delete_local_data(&local); @@ -410,7 +410,7 @@ extern "C" { return status; } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform lock request because the lock instructions are missing from: %s.", network_path firewall_file_other); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to perform lock request because the lock instructions are missing from: %s.", network_path firewall_file_other); firewall_delete_local_data(&local); firewall_delete_data(data); @@ -450,7 +450,7 @@ extern "C" { } } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform stop request because the lock instructions are missing from: %s.", network_path firewall_file_other); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to perform stop request because the lock instructions are missing from: %s.", network_path firewall_file_other); firewall_delete_local_data(&local); firewall_delete_data(data); @@ -527,7 +527,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_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); firewall_delete_local_data(&local); firewall_delete_data(data); return status; @@ -639,7 +639,7 @@ extern "C" { firewall_delete_local_data(&local); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You did not pass a command"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You did not pass a command"); status = F_status_set_error(F_parameter); } } @@ -663,7 +663,7 @@ extern "C" { f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_string_dynamics_t_delete_simple(data->devices); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 89d63bd..88947c3 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -284,7 +284,7 @@ extern "C" { bool process_pipe; f_string_dynamics_t devices; - fl_color_context_t context; + f_color_context_t context; } firewall_data_t; #define firewall_data_t_initialize \ @@ -294,7 +294,7 @@ extern "C" { f_string_lengths_t_initialize, \ F_false, \ f_string_dynamics_t_initialize, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_firewall_data_t_ @@ -308,7 +308,7 @@ extern "C" { * F_none on success. */ #ifndef _di_firewall_print_help_ - extern f_return_status firewall_print_help(const fl_color_context_t context); + extern f_return_status firewall_print_help(const f_color_context_t context); #endif // _di_firewall_print_help_ /** diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index c940609..4b1073b 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_line(f_type_warning, data.context.warning, data.context.reset, "WARNING: At line %i, the object has no content", i); + fl_color_print_line(f_type_warning, data.context.set.warning, "WARNING: At line %i, the object has no content", i); } continue; @@ -585,24 +585,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_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { // the file does not have to exist - fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "WARNING: Cannot find the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_warning, data.context.set.warning, "WARNING: Cannot find the file '%.*s'", file_path.used, file_path.string); status = F_none; } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Unable to open the file '%.*s'", file_path.used, file_path.string); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: File descriptor error while trying to open the file '%.*s'", file_path.used, file_path.string); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } if (status != F_file_found_not) { @@ -620,25 +620,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_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read()"); } else if (status == F_number_overflow) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Integer overflow while trying to buffer the file '%.*s'", file_path.used, file_path.string); } else if (status == F_file_closed) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%.*s' is no longer open", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: The file '%.*s' is no longer open", file_path.used, file_path.string); } else if (status == F_file_seek) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: A seek error occurred while accessing the file '%.*s'", file_path.used, file_path.string); } else if (status == F_file_read) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: A read error occurred while accessing the file '%.*s'", file_path.used, file_path.string); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read()", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read()", status); } status = F_status_set_error(status); @@ -656,16 +656,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_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'", file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'", file_path.used, file_path.string); } 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_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'", status, file_path.used, file_path.string); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'", status, file_path.used, file_path.string); } status = F_status_set_error(status); @@ -698,7 +698,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con } if (F_status_is_error(status)) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); f_macro_string_dynamic_t_delete_simple(ip_list_action); } @@ -718,7 +718,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_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); break; } @@ -746,7 +746,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con status = fll_execute_program((f_string_t) current_tool, arguments, 0, &return_code); if (status == F_failure) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Failed to perform requested %s operation:", current_tool); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -766,7 +766,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con break; } else if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); // remove ip_argument from arguments string. f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]); @@ -816,7 +816,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con status = fll_execute_program(current_tool, arguments, 0, &return_code); if (status == F_failure) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Failed to perform requested %s operation:", current_tool); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -831,7 +831,7 @@ f_return_status firewall_perform_commands(const firewall_local_data_t local, con break; } else if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); break; } } @@ -1081,10 +1081,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_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables); } else if (tool == firewall_program_ip6tables) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_ip6tables); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to perform requested %s operation:", firewall_tool_ip6tables); } fprintf(f_type_error, " "); @@ -1105,10 +1105,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_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); } f_macro_string_dynamics_t_delete_simple(arguments); @@ -1165,7 +1165,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_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Failed to perform requested %s operation:", tools[i]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -1179,10 +1179,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_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); } return status; @@ -1223,7 +1223,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_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Failed to perform requested %s operation:", tools[i]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -1237,10 +1237,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_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); } return status; @@ -1302,7 +1302,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_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[j]); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Failed to perform requested %s operation:", tools[j]); fprintf(f_type_error, " "); fl_color_print_code(f_type_error, data.context.error); @@ -1316,10 +1316,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_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()"); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status); } return status; @@ -1341,26 +1341,26 @@ f_return_status firewall_buffer_rules(const f_string_t filename, const bool opti if (optional) { if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } else { if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'.", filename); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'.", filename); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'.", filename); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } @@ -1375,25 +1375,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_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read()."); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read()."); } else if (status == F_number_overflow) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename); } else if (status == F_file_closed) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: The file '%s' is no longer open.", filename); } else if (status == F_file_seek) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: A seek error occurred while accessing the file '%s'.", filename); } else if (status == F_file_read) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: A read error occurred while accessing the file '%s'.", filename); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read().", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read().", status); } return status; @@ -1410,16 +1410,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_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename); } else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: No relevant data was found within the file '%s'.", filename); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename); } return status; @@ -1440,13 +1440,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_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_failure) { // the error message has already been displayed. } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); } 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 ef2ccde..8d3e862 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_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); +// TODO: also report: fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); #define firewall_macro_append_argument_to_arguments(status, arguments, argument) \ if (arguments.used == arguments.size) { \ f_macro_string_dynamics_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 2998733..f3d6f9b 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_basic_list_read_print_help_ - f_return_status fss_basic_list_read_print_help(const fl_color_context_t context) { + f_return_status fss_basic_list_read_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_basic_list_read_name_long, fss_basic_list_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -29,7 +29,7 @@ extern "C" { fll_program_print_help_usage(context, fss_basic_list_read_name, "filename(s)"); - fl_color_print(f_type_output, context.important, context.reset, " Notes:"); + fl_color_print(f_type_output, context.set.important, " Notes:"); printf("%c", f_string_eol[0], f_string_eol[0]); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" When using the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); printf(" 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]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); printf(" ('-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]); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol[0]); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" Specify both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); printf(" and the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" When both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); printf(" and "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); printf(" parameter value.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" This program may support parameters, such as "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); printf(" or "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol[0]); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); @@ -148,45 +148,45 @@ extern "C" { } else if (data->remaining.used > 0 || data->process_pipe) { if (data->parameters[fss_basic_list_read_parameter_at].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_depth].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_name].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a string."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); @@ -194,22 +194,22 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_object].result == f_console_result_found) { if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); @@ -218,11 +218,11 @@ extern "C" { if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) { if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_basic_list_read_delete_data(data); return F_status_set_error(F_parameter); @@ -257,9 +257,9 @@ extern "C" { } if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter requires a positive number."); macro_fss_basic_list_read_depths_t_delete_simple(depths); fss_basic_list_read_delete_data(data); @@ -356,7 +356,7 @@ extern "C" { macro_fss_basic_list_read_depths_t_delete_simple(depths); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify one or more files."); status = F_status_set_error(F_parameter); } @@ -381,7 +381,7 @@ extern "C" { f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_list_read/c/fss_basic_list_read.h b/level_3/fss_basic_list_read/c/fss_basic_list_read.h index 15c40fc..971120f 100644 --- a/level_3/fss_basic_list_read/c/fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/fss_basic_list_read.h @@ -131,7 +131,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_basic_list_read_data_t; #define fss_basic_list_read_data_t_initialize \ @@ -143,7 +143,7 @@ extern "C" { f_string_quantity_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_basic_list_read_data_t_ @@ -157,7 +157,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_read_print_help_ - extern f_return_status fss_basic_list_read_print_help(const fl_color_context_t context); + extern f_return_status fss_basic_list_read_print_help(const f_color_context_t context); #endif // _di_fss_basic_list_read_print_help_ /** diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 29a1f78..2daaa6a 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 @@ -6,78 +6,78 @@ extern "C" { #endif #ifndef _di_fss_basic_list_read_print_file_error_ - void fss_basic_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { + void fss_basic_list_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } } #endif // _di_fss_basic_list_read_print_file_error_ #ifndef _di_fss_basic_list_read_print_number_argument_error_ - void fss_basic_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { + void fss_basic_list_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } else if (status == F_number) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is not a valid number for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_underflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too small for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_overflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too large for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_negative) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is negative, which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_positive) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); - fl_color_print(f_type_error, context.notable, context.reset, "+"); - fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' contains a '"); + fl_color_print(f_type_error, context.set.notable, "+"); + fl_color_print(f_type_error, context.set.error, "', which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_data_not) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "' must not be an empty string."); } else { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print(f_type_error, context.error, context.reset, "' with the value '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print(f_type_error, context.set.error, "' for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print(f_type_error, context.set.error, "' with the value '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print_line(f_type_error, context.set.error, "'."); } } #endif // _di_fss_basic_list_read_print_number_argument_error_ @@ -95,7 +95,7 @@ extern "C" { macro_fss_basic_list_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -175,12 +175,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_t_size) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Unable to process '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim); + fl_color_print_line(f_type_error, data.context.set.error, "' because the maximum buffer size was reached."); } else { f_string_t function = "fl_string_append"; @@ -189,20 +189,20 @@ extern "C" { function = "fl_string_rip"; } - fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code); - fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "."); + fl_color_print(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data.context.set.notable, "%u", status_code); + fl_color_print(f_type_error, data.context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data.context.set.notable, "%s()", function); + fl_color_print_line(f_type_error, data.context.set.error, "."); } return status; } if (depths->array[i].value_name.used == 0) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name); + fl_color_print_line(f_type_error, data.context.set.error, "' must not be an empty string."); return F_status_set_error(F_parameter); } @@ -213,22 +213,22 @@ extern "C" { for (f_array_length_t i = 0; i < depths->used; i++) { for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' may only be specified once for the parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth); + fl_color_print(f_type_error, data.context.set.error, "' may not have the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' before the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[j].depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } @@ -255,33 +255,33 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_basic_list_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_incomplete_utf_stop) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else if (status == F_incomplete_utf_eos) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data->context.set.notable, "%u", status); + fl_color_print(f_type_error, data->context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_basic_list_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return F_status_set_error(status); diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h index 59872ab..4fdd49c 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.h @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_list_read_print_file_error_ - extern void fss_basic_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_basic_list_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_list_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_list_read_print_number_argument_error_ - extern void fss_basic_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_basic_list_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_list_read_print_number_argument_error_ /** 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 d3a139d..799f049 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 @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fss_basic_list_write_print_help_ - f_return_status fss_basic_list_write_print_help(const fl_color_context_t context) { + f_return_status fss_basic_list_write_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_basic_list_write_name_long, fss_basic_list_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -70,19 +70,19 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'", "-"); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'", "-"); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -183,19 +183,19 @@ extern "C" { f_file_close(&output.id); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -210,13 +210,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_write()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()"); } else if (status == F_file_write) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -247,7 +247,7 @@ extern "C" { } // while f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.h b/level_3/fss_basic_list_write/c/fss_basic_list_write.h index bfebbda..356c93c 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.h +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.h @@ -99,7 +99,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_basic_list_write_data_t; #define fss_basic_list_write_data_t_initialize \ @@ -107,7 +107,7 @@ extern "C" { fss_basic_list_write_console_parameter_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_basic_list_write_data_t_ @@ -121,7 +121,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_list_write_print_help_ - extern f_return_status fss_basic_list_write_print_help(const fl_color_context_t context); + extern f_return_status fss_basic_list_write_print_help(const f_color_context_t context); #endif // _di_fss_basic_list_write_print_help_ /** diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 8a545ae..29fea78 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_basic_read_print_help_ - f_return_status fss_basic_read_print_help(const fl_color_context_t context) { + f_return_status fss_basic_read_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_basic_read_name_long, fss_basic_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -29,7 +29,7 @@ extern "C" { fll_program_print_help_usage(context, fss_basic_read_name, "filename(s)"); - fl_color_print(f_type_output, context.important, context.reset, " Notes:"); + fl_color_print(f_type_output, context.set.important, " Notes:"); printf("%c", f_string_eol[0], f_string_eol[0]); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" When using the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); printf(" 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]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); printf(" ('-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]); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol[0]); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" Specify both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); printf(" and the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" When both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); printf(" and "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); printf(" parameter value.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" This program may support parameters, such as "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); printf(" or "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol[0]); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); @@ -148,45 +148,45 @@ extern "C" { } else if (data->remaining.used > 0 || data->process_pipe) { if (data->parameters[fss_basic_read_parameter_at].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_depth].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_name].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a string."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); @@ -194,22 +194,22 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_object].result == f_console_result_found) { if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); @@ -218,11 +218,11 @@ extern "C" { if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) { if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_basic_read_delete_data(data); return F_status_set_error(F_parameter); @@ -257,9 +257,9 @@ extern "C" { } if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter requires a positive number."); macro_fss_basic_read_depths_t_delete_simple(depths); fss_basic_read_delete_data(data); @@ -359,7 +359,7 @@ extern "C" { macro_fss_basic_read_depths_t_delete_simple(depths); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify one or more files."); status = F_status_set_error(F_parameter); } @@ -384,7 +384,7 @@ extern "C" { f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_read/c/fss_basic_read.h b/level_3/fss_basic_read/c/fss_basic_read.h index 5799f94..4a50a37 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.h +++ b/level_3/fss_basic_read/c/fss_basic_read.h @@ -131,7 +131,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_basic_read_data_t; #define fss_basic_read_data_t_initialize \ @@ -143,7 +143,7 @@ extern "C" { f_string_quantity_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_basic_read_data_t_ @@ -157,7 +157,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_read_print_help_ - extern f_return_status fss_basic_read_print_help(const fl_color_context_t context); + extern f_return_status fss_basic_read_print_help(const f_color_context_t context); #endif // _di_fss_basic_read_print_help_ /** diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.c b/level_3/fss_basic_read/c/private-fss_basic_read.c index 3e2a40e..090a104 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 @@ -6,78 +6,78 @@ extern "C" { #endif #ifndef _di_fss_basic_read_print_file_error_ - void fss_basic_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { + void fss_basic_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } } #endif // _di_fss_basic_read_print_file_error_ #ifndef _di_fss_basic_read_print_number_argument_error_ - void fss_basic_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { + void fss_basic_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } else if (status == F_number) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is not a valid number for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_underflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too small for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_overflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too large for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_negative) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is negative, which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_positive) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); - fl_color_print(f_type_error, context.notable, context.reset, "+"); - fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' contains a '"); + fl_color_print(f_type_error, context.set.notable, "+"); + fl_color_print(f_type_error, context.set.error, "', which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_data_not) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "' must not be an empty string."); } else { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print(f_type_error, context.error, context.reset, "' with the value '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print(f_type_error, context.set.error, "' for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print(f_type_error, context.set.error, "' with the value '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print_line(f_type_error, context.set.error, "'."); } } #endif // _di_fss_basic_read_print_number_argument_error_ @@ -95,7 +95,7 @@ extern "C" { macro_fss_basic_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -175,12 +175,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_t_size) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Unable to process '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim); + fl_color_print_line(f_type_error, data.context.set.error, "' because the maximum buffer size was reached."); } else { f_string_t function = "fl_string_append"; @@ -189,20 +189,20 @@ extern "C" { function = "fl_string_rip"; } - fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code); - fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "."); + fl_color_print(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data.context.set.notable, "%u", status_code); + fl_color_print(f_type_error, data.context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data.context.set.notable, "%s()", function); + fl_color_print_line(f_type_error, data.context.set.error, "."); } return status; } if (depths->array[i].value_name.used == 0) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name); + fl_color_print_line(f_type_error, data.context.set.error, "' must not be an empty string."); return F_status_set_error(F_parameter); } @@ -213,22 +213,22 @@ extern "C" { for (f_array_length_t i = 0; i < depths->used; i++) { for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' may only be specified once for the parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth); + fl_color_print(f_type_error, data.context.set.error, "' may not have the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' before the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[j].depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } @@ -255,33 +255,33 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_basic_list_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_incomplete_utf_stop) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else if (status == F_incomplete_utf_eos) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data->context.set.notable, "%u", status); + fl_color_print(f_type_error, data->context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_basic_list_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return F_status_set_error(status); diff --git a/level_3/fss_basic_read/c/private-fss_basic_read.h b/level_3/fss_basic_read/c/private-fss_basic_read.h index b19ea9e..a314c07 100644 --- a/level_3/fss_basic_read/c/private-fss_basic_read.h +++ b/level_3/fss_basic_read/c/private-fss_basic_read.h @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_read_print_file_error_ - extern void fss_basic_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_basic_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_basic_read_print_number_argument_error_ - extern void fss_basic_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_basic_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_basic_read_print_number_argument_error_ /** 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 f820275..76e1a3a 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fss_basic_write_print_help_ - f_return_status fss_basic_write_print_help(const fl_color_context_t context) { + f_return_status fss_basic_write_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_basic_write_name_long, fss_basic_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -70,19 +70,19 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'", "-"); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'", "-"); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_macro_string_dynamic_t_delete_simple(input); @@ -172,19 +172,19 @@ extern "C" { f_file_close(&output.id); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -199,13 +199,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_write()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()"); } else if (status == F_file_write) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -235,7 +235,7 @@ extern "C" { } // for f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_basic_write/c/fss_basic_write.h b/level_3/fss_basic_write/c/fss_basic_write.h index b832253..bec56ef 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.h +++ b/level_3/fss_basic_write/c/fss_basic_write.h @@ -98,7 +98,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_basic_write_data; #define fss_basic_write_data_initialize \ @@ -106,7 +106,7 @@ extern "C" { fss_basic_write_console_parameter_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_basic_write_data_ @@ -120,7 +120,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_basic_write_print_help_ - extern f_return_status fss_basic_write_print_help(const fl_color_context_t context); + extern f_return_status fss_basic_write_print_help(const f_color_context_t context); #endif // _di_fss_basic_write_print_help_ /** diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.c b/level_3/fss_extended_list_read/c/fss_extended_list_read.c index 573e8d4..e377071 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 @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_print_help_ - f_return_status fss_extended_list_read_print_help(const fl_color_context_t context) { + f_return_status fss_extended_list_read_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_extended_list_read_name_long, fss_extended_list_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -29,7 +29,7 @@ extern "C" { fll_program_print_help_usage(context, fss_extended_list_read_name, "filename(s)"); - fl_color_print(f_type_output, context.important, context.reset, " Notes:"); + fl_color_print(f_type_output, context.set.important, " Notes:"); printf("%c", f_string_eol[0], f_string_eol[0]); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" When using the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); printf(" 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]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); printf(" ('-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]); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol[0]); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" Specify both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); printf(" and the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" When both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); printf(" and "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); printf(" parameter value.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" This program may support parameters, such as "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); printf(" or "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol[0]); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); @@ -148,45 +148,45 @@ extern "C" { } else if (data->remaining.used > 0 || data->process_pipe) { if (data->parameters[fss_extended_list_read_parameter_at].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_depth].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_name].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a string."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); @@ -194,22 +194,22 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_object].result == f_console_result_found) { if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); @@ -218,11 +218,11 @@ extern "C" { if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) { if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_extended_list_read_delete_data(data); return F_status_set_error(F_parameter); @@ -242,9 +242,9 @@ extern "C" { } if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter requires a positive number."); macro_fss_extended_list_read_depths_t_delete_simple(depths); fss_extended_list_read_delete_data(data); @@ -341,7 +341,7 @@ extern "C" { macro_fss_extended_list_read_depths_t_delete_simple(depths); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify one or more files."); status = F_status_set_error(F_parameter); } @@ -366,7 +366,7 @@ extern "C" { f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_extended_list_read/c/fss_extended_list_read.h b/level_3/fss_extended_list_read/c/fss_extended_list_read.h index a960362..af7e76f 100644 --- a/level_3/fss_extended_list_read/c/fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/fss_extended_list_read.h @@ -130,7 +130,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_extended_list_read_data_t; #define fss_extended_list_read_data_t_initialize \ @@ -141,7 +141,7 @@ extern "C" { f_string_quantity_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_extended_list_read_data_t_ @@ -155,7 +155,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_list_read_print_help_ - extern f_return_status fss_extended_list_read_print_help(const fl_color_context_t context); + extern f_return_status fss_extended_list_read_print_help(const f_color_context_t context); #endif // _di_fss_extended_list_read_print_help_ /** diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index bef4661..4989d21 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 @@ -6,78 +6,78 @@ extern "C" { #endif #ifndef _di_fss_extended_list_read_print_file_error_ - void fss_extended_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { + void fss_extended_list_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } } #endif // _di_fss_extended_list_read_print_file_error_ #ifndef _di_fss_extended_list_read_print_number_argument_error_ - void fss_extended_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { + void fss_extended_list_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } else if (status == F_number) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is not a valid number for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_underflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too small for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_overflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too large for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_negative) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is negative, which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_positive) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); - fl_color_print(f_type_error, context.notable, context.reset, "+"); - fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' contains a '"); + fl_color_print(f_type_error, context.set.notable, "+"); + fl_color_print(f_type_error, context.set.error, "', which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_data_not) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "' must not be an empty string."); } else { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print(f_type_error, context.error, context.reset, "' with the value '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print(f_type_error, context.set.error, "' for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print(f_type_error, context.set.error, "' with the value '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print_line(f_type_error, context.set.error, "'."); } } #endif // _di_fss_extended_list_read_print_number_argument_error_ @@ -95,7 +95,7 @@ extern "C" { macro_fss_extended_list_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -175,12 +175,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_t_size) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Unable to process '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim); + fl_color_print_line(f_type_error, data.context.set.error, "' because the maximum buffer size was reached."); } else { f_string_t function = "fl_string_append"; @@ -189,20 +189,20 @@ extern "C" { function = "fl_string_rip"; } - fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code); - fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "."); + fl_color_print(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data.context.set.notable, "%u", status_code); + fl_color_print(f_type_error, data.context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data.context.set.notable, "%s()", function); + fl_color_print_line(f_type_error, data.context.set.error, "."); } return status; } if (depths->array[i].value_name.used == 0) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name); + fl_color_print_line(f_type_error, data.context.set.error, "' must not be an empty string."); return F_status_set_error(F_parameter); } @@ -213,22 +213,22 @@ extern "C" { for (f_array_length_t i = 0; i < depths->used; i++) { for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' may only be specified once for the parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth); + fl_color_print(f_type_error, data.context.set.error, "' may not have the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' before the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[j].depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } @@ -255,33 +255,33 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_extended_list_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_incomplete_utf_stop) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else if (status == F_incomplete_utf_eos) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data->context.set.notable, "%u", status); + fl_color_print(f_type_error, data->context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_extended_list_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return F_status_set_error(status); diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h index 3809e1c..caf8413 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.h @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_list_read_print_file_error_ - extern void fss_extended_list_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_extended_list_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_list_read_print_number_argument_error_ - extern void fss_extended_list_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_extended_list_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_list_read_print_number_argument_error_ /** 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 7878e2c..fb6da2a 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_extended_read_print_help_ - f_return_status fss_extended_read_print_help(const fl_color_context_t context) { + f_return_status fss_extended_read_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_extended_read_name_long, fss_extended_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -29,7 +29,7 @@ extern "C" { fll_program_print_help_usage(context, fss_extended_read_name, "filename(s)"); - fl_color_print(f_type_output, context.important, context.reset, " Notes:"); + fl_color_print(f_type_output, context.set.important, " Notes:"); printf("%c", f_string_eol[0], f_string_eol[0]); @@ -38,27 +38,27 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" When using the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol[0]); printf(" 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]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); printf(": An object index at the specified depth.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol[0]); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); printf(": An object name at the specified depth.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol[0]); printf(" ('-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]); printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol[0]); @@ -66,53 +66,53 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); printf(" selects a content index at a given depth.%c", f_string_eol[0]); printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" Specify both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); printf(" and the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); printf(" parameters to get the total objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" When both "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); printf(" and "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); printf(" parameters are specified (at the same depth), the "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); printf(" parameter value will be treated as a position relative to the specified "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); printf(" parameter value.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" This program may support parameters, such as "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); printf(" or "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); printf(", even if not supported by the standard.%c", f_string_eol[0]); printf(" This is done to help ensure consistency for scripting.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol[0]); printf(" For parameters like "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); printf(" The parameter "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); @@ -148,45 +148,45 @@ extern "C" { } else if (data->remaining.used > 0 || data->process_pipe) { if (data->parameters[fss_extended_read_parameter_at].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_depth].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_name].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a string."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); @@ -194,22 +194,22 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_object].result == f_console_result_found) { if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); } if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); @@ -218,11 +218,11 @@ extern "C" { if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) { if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); fss_extended_read_delete_data(data); return F_status_set_error(F_parameter); @@ -257,9 +257,9 @@ extern "C" { } if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter requires a positive number."); macro_fss_extended_read_depths_t_delete_simple(depths); fss_extended_read_delete_data(data); @@ -358,7 +358,7 @@ extern "C" { macro_fss_extended_read_depths_t_delete_simple(depths); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify one or more files."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify one or more files."); status = F_status_set_error(F_parameter); } @@ -383,7 +383,7 @@ extern "C" { f_macro_string_dynamic_t_delete_simple(data->buffer); f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_extended_read/c/fss_extended_read.h b/level_3/fss_extended_read/c/fss_extended_read.h index 8d896e1..cc374fd 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.h +++ b/level_3/fss_extended_read/c/fss_extended_read.h @@ -131,7 +131,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_extended_read_data_t; #define fss_extended_read_data_initialize \ @@ -143,7 +143,7 @@ extern "C" { f_string_quantity_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_extended_read_data_t_ @@ -157,7 +157,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_read_print_help_ - extern f_return_status fss_extended_read_print_help(const fl_color_context_t context); + extern f_return_status fss_extended_read_print_help(const f_color_context_t context); #endif // _di_fss_extended_read_print_help_ /** diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.c b/level_3/fss_extended_read/c/private-fss_extended_read.c index f8844de..1f4255b 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 @@ -6,78 +6,78 @@ extern "C" { #endif #ifndef _di_fss_extended_read_print_file_error_ - void fss_extended_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { + void fss_extended_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) { if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } } #endif // _di_fss_extended_read_print_file_error_ #ifndef _di_fss_extended_read_print_number_argument_error_ - void fss_extended_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { + void fss_extended_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) { if (status == F_parameter) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print_line(f_type_error, context.set.error, "."); } else if (status == F_number) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is not a valid number for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_underflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too small for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_overflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too large for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_negative) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is negative, which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_positive) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); - fl_color_print(f_type_error, context.notable, context.reset, "+"); - fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' contains a '"); + fl_color_print(f_type_error, context.set.notable, "+"); + fl_color_print(f_type_error, context.set.error, "', which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_data_not) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print_line(f_type_error, context.set.error, "' must not be an empty string."); } else { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name); - fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name); - fl_color_print(f_type_error, context.error, context.reset, "' with the value '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function_name); + fl_color_print(f_type_error, context.set.error, "' for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name); + fl_color_print(f_type_error, context.set.error, "' with the value '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print_line(f_type_error, context.set.error, "'."); } } #endif // _di_fss_extended_read_print_number_argument_error_ @@ -95,7 +95,7 @@ extern "C" { macro_fss_extended_read_depths_t_new(status, (*depths), depth_size); if (F_status_is_error(status)) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); return status; } @@ -175,12 +175,12 @@ extern "C" { // @todo: move error printing into common function. if (status_code == F_memory_allocation || status_code == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status_code == f_string_length_t_size) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: Unable to process '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim); + fl_color_print_line(f_type_error, data.context.set.error, "' because the maximum buffer size was reached."); } else { f_string_t function = "fl_string_append"; @@ -189,20 +189,20 @@ extern "C" { function = "fl_string_rip"; } - fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code); - fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "."); + fl_color_print(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data.context.set.notable, "%u", status_code); + fl_color_print(f_type_error, data.context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data.context.set.notable, "%s()", function); + fl_color_print_line(f_type_error, data.context.set.error, "."); } return status; } if (depths->array[i].value_name.used == 0) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name); + fl_color_print_line(f_type_error, data.context.set.error, "' must not be an empty string."); return F_status_set_error(F_parameter); } @@ -213,22 +213,22 @@ extern "C" { for (f_array_length_t i = 0; i < depths->used; i++) { for (f_array_length_t j = i + 1; j < depths->used; j++) { if (depths->array[i].depth == depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' may only be specified once for the parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } else if (depths->array[i].depth > depths->array[j].depth) { - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth); - fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '"); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth); + fl_color_print(f_type_error, data.context.set.error, "' may not have the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth); + fl_color_print(f_type_error, data.context.set.error, "' before the value '"); + fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[j].depth); + fl_color_print_line(f_type_error, data.context.set.error, "'."); return F_status_set_error(F_parameter); } @@ -255,33 +255,33 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_extended_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_incomplete_utf_stop) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else if (status == F_incomplete_utf_eos) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, ")."); + fl_color_print(f_type_error, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at "); + fl_color_print(f_type_error, data->context.set.notable, "%d", input.start); + fl_color_print_line(f_type_error, data->context.set.error, ")."); } else { - fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error ("); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status); - fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_read()"); - fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'."); + fl_color_print(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error ("); + fl_color_print(f_type_error, data->context.set.notable, "%u", status); + fl_color_print(f_type_error, data->context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, data->context.set.notable, "fll_fss_extended_read()"); + fl_color_print(f_type_error, data->context.set.error, " for the file '"); + fl_color_print(f_type_error, data->context.set.notable, "%s", filename); + fl_color_print_line(f_type_error, data->context.set.error, "'."); } return F_status_set_error(status); diff --git a/level_3/fss_extended_read/c/private-fss_extended_read.h b/level_3/fss_extended_read/c/private-fss_extended_read.h index e3e721b..a8595b6 100644 --- a/level_3/fss_extended_read/c/private-fss_extended_read.h +++ b/level_3/fss_extended_read/c/private-fss_extended_read.h @@ -170,7 +170,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_read_print_file_error_ - extern void fss_extended_read_print_file_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_extended_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_read_print_file_error_ /** @@ -188,7 +188,7 @@ extern "C" { * The status code representing the error. */ #ifndef _di_fss_extended_read_print_number_argument_error_ - extern void fss_extended_read_print_number_argument_error(const fl_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; + extern void fss_extended_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) f_gcc_attribute_visibility_internal; #endif // _di_fss_extended_read_print_number_argument_error_ /** 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 01121e6..43c9d00 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _di_fss_extended_write_print_help_ - f_return_status fss_extended_write_print_help(const fl_color_context_t context) { + f_return_status fss_extended_write_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_extended_write_name_long, fss_extended_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -70,19 +70,19 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'", "-"); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'", "-"); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-"); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'", "-"); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_macro_string_dynamic_t_delete_simple(input); @@ -223,19 +223,19 @@ extern "C" { f_file_close(&output.id); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()"); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -250,13 +250,13 @@ extern "C" { status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_write()"); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()"); } else if (status == F_file_write) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]); } else { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); + fl_color_print_line(f_type_error, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()", status); } f_macro_string_dynamic_t_delete_simple(buffer); @@ -286,7 +286,7 @@ extern "C" { } // for f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_extended_write/c/fss_extended_write.h b/level_3/fss_extended_write/c/fss_extended_write.h index 6b3808f..7da895c 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.h +++ b/level_3/fss_extended_write/c/fss_extended_write.h @@ -98,7 +98,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_extended_write_data_t; #define fss_extended_write_data_t_initialize \ @@ -106,7 +106,7 @@ extern "C" { fss_extended_write_console_parameter_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_extended_write_data_t_ @@ -120,7 +120,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_extended_write_print_help_ - extern f_return_status fss_extended_write_print_help(const fl_color_context_t context); + extern f_return_status fss_extended_write_print_help(const f_color_context_t context); #endif // _di_fss_extended_write_print_help_ /** diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index 1f764c9..d49a448 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_fss_status_code_print_help_ - f_return_status fss_status_code_print_help(const fl_color_context_t context) { + f_return_status fss_status_code_print_help(const f_color_context_t context) { fll_program_print_help_header(context, fss_status_code_name_long, fss_status_code_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -60,39 +60,39 @@ extern "C" { if (data->parameters[fss_status_code_parameter_is_error].result == f_console_result_found) { if (data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error); + fl_color_print(f_type_error, data->context.set.error, "' cannot be used with the parameter "); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning); + fl_color_print_line(f_type_error, data->context.set.error, "."); fss_status_code_delete_data(data); return F_status_set_error(status); } else if (data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error); + fl_color_print(f_type_error, data->context.set.error, "' cannot be used with the parameter "); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine); + fl_color_print_line(f_type_error, data->context.set.error, "."); fss_status_code_delete_data(data); return F_status_set_error(status); } } else if (data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found && data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning); + fl_color_print(f_type_error, data->context.set.error, "' cannot be used with the parameter "); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine); + fl_color_print_line(f_type_error, data->context.set.error, "."); fss_status_code_delete_data(data); return F_status_set_error(status); } if (data->remaining.used == 0 && !data->process_pipe) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify an error code."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify an error code."); fss_status_code_delete_data(data); return F_status_set_error(F_parameter); @@ -162,7 +162,7 @@ extern "C" { } // while f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/fss_status_code/c/fss_status_code.h b/level_3/fss_status_code/c/fss_status_code.h index a5b9776..f812500 100644 --- a/level_3/fss_status_code/c/fss_status_code.h +++ b/level_3/fss_status_code/c/fss_status_code.h @@ -100,7 +100,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } fss_status_code_data_t; #define fss_status_code_data_t_initialize \ @@ -108,7 +108,7 @@ extern "C" { fss_status_code_console_parameter_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_fss_status_code_data_t_ @@ -122,7 +122,7 @@ extern "C" { * F_none on success. */ #ifndef _di_fss_status_code_print_help_ - extern f_return_status fss_status_code_print_help(const fl_color_context_t context); + extern f_return_status fss_status_code_print_help(const f_color_context_t context); #endif // _di_fss_status_code_print_help_ /** diff --git a/level_3/fss_status_code/c/private-fss_status_code.c b/level_3/fss_status_code/c/private-fss_status_code.c index d82d659..1383730 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 @@ -55,13 +55,13 @@ extern "C" { status = fl_conversion_string_to_number_unsigned(value, &number, range); if (status == F_none) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid name"); + fl_color_print_line(f_type_output, data.context.set.error, "invalid name"); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid data"); + fl_color_print_line(f_type_output, data.context.set.error, "invalid data"); return status; } @@ -78,10 +78,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown name"); + fl_color_print_line(f_type_output, data.context.set.error, "unknown name"); } else { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert"); + fl_color_print_line(f_type_output, data.context.set.error, "failed to convert"); } return status; @@ -89,7 +89,7 @@ extern "C" { } if (status == F_data) { - fl_color_print_line(f_type_output, data.context.warning, data.context.reset, "unknown code"); + fl_color_print_line(f_type_output, data.context.set.warning, "unknown code"); return F_none; } @@ -116,10 +116,10 @@ extern "C" { if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_data) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown code"); + fl_color_print_line(f_type_output, data.context.set.error, "unknown code"); } else { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert"); + fl_color_print_line(f_type_output, data.context.set.error, "failed to convert"); } return status; @@ -138,17 +138,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_line(f_type_output, data.context.error, data.context.reset, "out of range"); + fl_color_print_line(f_type_output, data.context.set.error, "out of range"); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); + fl_color_print_line(f_type_output, data.context.set.error, "out of range"); } else { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid number"); + fl_color_print_line(f_type_output, data.context.set.error, "invalid number"); } return status; diff --git a/level_3/fss_status_code/c/private-fss_status_code.h b/level_3/fss_status_code/c/private-fss_status_code.h index 67fb467..092bb5c 100644 --- a/level_3/fss_status_code/c/private-fss_status_code.h +++ b/level_3/fss_status_code/c/private-fss_status_code.h @@ -29,7 +29,7 @@ extern "C" { * F_number_overflow (with error bit) on integer overflow. * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. * - * Errors from (with error bit): fss_status_code_convert_number(). + * Errors (with error bit) from: fss_status_code_convert_number(). * * @see fss_status_code_convert_number() */ @@ -49,8 +49,8 @@ extern "C" { * F_none on success. * F_data_not if string is empty. * - * Errors from (with error bit): fl_console_parameter_to_number_unsigned(). - * Errors from (with error bit): fll_fss_status_from_string(). + * Errors (with error bit) from: fl_console_parameter_to_number_unsigned(). + * Errors (with error bit) from: fll_fss_status_from_string(). * * @see fl_console_parameter_to_number_unsigned() * @see fll_fss_status_from_string() @@ -76,8 +76,8 @@ extern "C" { * F_number_overflow (with error bit) on integer overflow. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fll_fss_status_from_string(). - * Errors from (with error bit): fss_status_code_convert_number(). + * Errors (with error bit) from: fll_fss_status_from_string(). + * Errors (with error bit) from: fss_status_code_convert_number(). * * @see fll_fss_status_from_string() * @see fss_status_code_convert_number() @@ -106,7 +106,7 @@ extern "C" { * F_number_overflow (with error bit) on integer overflow. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_console_parameter_to_number_unsigned(). + * Errors (with error bit) from: fl_console_parameter_to_number_unsigned(). * * @see fl_console_parameter_to_number_unsigned() */ diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 3229389..f1d4f52 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_iki_read_print_help_ - f_return_status iki_read_print_help(const fl_color_context_t context) { + f_return_status iki_read_print_help(const f_color_context_t context) { fll_program_print_help_header(context, iki_read_name_long, iki_read_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -37,7 +37,7 @@ extern "C" { fll_program_print_help_usage(context, iki_read_name, "filename(s)"); - fl_color_print(f_type_output, context.important, context.reset, " Notes:"); + fl_color_print(f_type_output, context.set.important, " Notes:"); printf("%c", f_string_eol[0], f_string_eol[0]); @@ -46,29 +46,29 @@ extern "C" { printf("%c", f_string_eol[0]); printf(" The "); - fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); + fl_color_print(f_type_output, context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); printf(" option, requires 3 additional parameters: "); - fl_color_print(f_type_output, context.notable, context.reset, "<"); + fl_color_print(f_type_output, context.set.notable, "<"); printf("%s", iki_read_substitution_vocabulary); - fl_color_print(f_type_output, context.notable, context.reset, ">"); + fl_color_print(f_type_output, context.set.notable, ">"); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "<"); + fl_color_print(f_type_output, context.set.notable, "<"); printf("%s", iki_read_substitution_replace); - fl_color_print(f_type_output, context.notable, context.reset, ">"); + fl_color_print(f_type_output, context.set.notable, ">"); printf(" "); - fl_color_print(f_type_output, context.notable, context.reset, "<"); + fl_color_print(f_type_output, context.set.notable, "<"); printf("%s", iki_read_substitution_with); - fl_color_print(f_type_output, context.notable, context.reset, ">"); + fl_color_print(f_type_output, context.set.notable, ">"); printf(".%c", f_string_eol[0]); - fl_color_print(f_type_output, context.notable, context.reset, " %s", iki_read_substitution_vocabulary); + fl_color_print(f_type_output, context.set.notable, " %s", iki_read_substitution_vocabulary); printf(": The name of the vocabulary whose content is to be substituted.%c", f_string_eol[0]); - fl_color_print(f_type_output, context.notable, context.reset, " %s", iki_read_substitution_replace); + fl_color_print(f_type_output, context.set.notable, " %s", iki_read_substitution_replace); printf(": The content matching this exact string will be substituted.%c", f_string_eol[0]); - fl_color_print(f_type_output, context.notable, context.reset, " %s", iki_read_substitution_with); + fl_color_print(f_type_output, context.set.notable, " %s", iki_read_substitution_with); printf(": The new string to use as the substitute.%c", f_string_eol[0]); printf("%c", f_string_eol[0]); @@ -125,11 +125,11 @@ extern "C" { if (data->parameters[iki_read_parameter_verbose].result == f_console_result_found) { if (data->parameters[iki_read_parameter_quiet].result == f_console_result_found) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, f_console_standard_long_verbose); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, f_console_standard_long_quiet); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, f_console_standard_long_verbose); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, f_console_standard_long_quiet); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); status = F_status_set_error(F_parameter); } @@ -148,9 +148,9 @@ extern "C" { if (data->parameters[iki_read_parameter_at].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_at); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); } status = F_status_set_error(F_parameter); @@ -173,11 +173,11 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_at); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -187,9 +187,9 @@ extern "C" { if (data->parameters[iki_read_parameter_line].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_line); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_line); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a positive number."); } status = F_status_set_error(F_parameter); @@ -213,9 +213,9 @@ extern "C" { if (data->parameters[iki_read_parameter_name].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_name); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_name); + fl_color_print_line(f_type_error, data->context.set.error, "' requires a string."); } status = F_status_set_error(F_parameter); @@ -225,9 +225,9 @@ extern "C" { if (data->parameters[iki_read_parameter_substitute].result == f_console_result_found || data->parameters[iki_read_parameter_substitute].additional.used % 3 != 0) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires 3 strings."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); + fl_color_print_line(f_type_error, data->context.set.error, "' requires 3 strings."); } status = F_status_set_error(F_parameter); @@ -236,11 +236,11 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -251,11 +251,11 @@ extern "C" { if (data->parameters[iki_read_parameter_object].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_object); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -264,11 +264,11 @@ extern "C" { if (data->parameters[iki_read_parameter_content].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_content); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -277,11 +277,11 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -293,11 +293,11 @@ extern "C" { if (data->parameters[iki_read_parameter_content].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_content); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -306,11 +306,11 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -330,11 +330,11 @@ extern "C" { if (data->parameters[iki_read_parameter_total].result == f_console_result_found) { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_whole); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_read_long_total); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_whole); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); } status = F_status_set_error(F_parameter); @@ -417,7 +417,7 @@ extern "C" { else { if (data->verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: you failed to specify one or more files."); } status = F_status_set_error(F_parameter); @@ -449,7 +449,7 @@ extern "C" { f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_string_dynamic_t_delete_simple(data->buffer); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/iki_read/c/iki_read.h b/level_3/iki_read/c/iki_read.h index d47119b..76026d5 100644 --- a/level_3/iki_read/c/iki_read.h +++ b/level_3/iki_read/c/iki_read.h @@ -248,7 +248,7 @@ extern "C" { iki_read_substitutions_t replacements; - fl_color_context_t context; + f_color_context_t context; } iki_read_data_t; #define iki_read_data_t_initialize \ @@ -262,7 +262,7 @@ extern "C" { 0, \ f_string_dynamic_t_initialize, \ iki_read_substitutions_t_initialize, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_iki_read_data_t_ @@ -276,7 +276,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_read_print_help_ - extern f_return_status iki_read_print_help(const fl_color_context_t context); + extern f_return_status iki_read_print_help(const f_color_context_t context); #endif // _di_iki_read_print_help_ /** diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 0c87df5..381877d 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -6,14 +6,14 @@ extern "C" { #endif #ifndef _di_iki_read_print_error_ - f_return_status iki_read_print_error(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) { + f_return_status iki_read_print_error(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) { if (status == F_parameter) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid parameter when calling function "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid parameter when calling function "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -22,9 +22,9 @@ extern "C" { if (status == F_memory_allocation || status == F_memory_reallocation) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Unable to allocate memory in function "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Unable to allocate memory in function "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -33,9 +33,9 @@ extern "C" { if (status == F_buffer_too_large) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Maximum buffer limit reached while processing "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Maximum buffer limit reached while processing "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -44,9 +44,9 @@ extern "C" { if (status == F_string_too_large) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Maximum string limit reached while processing "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Maximum string limit reached while processing "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -54,11 +54,11 @@ extern "C" { if (fallback && verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") in function "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") in function "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_unknown; @@ -66,15 +66,15 @@ extern "C" { #endif // _di_iki_read_print_error_ #ifndef _di_iki_read_print_error_file_ - bool iki_read_print_error_file(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) { + bool iki_read_print_error_file(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) { const f_string_t file_or_directory = is_file ? "file" : "directory"; if (status == F_file_found_not) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to find %s '", file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to find %s '", file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -83,9 +83,9 @@ extern "C" { if (status == F_file_found) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The %s '", file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' already exists."); + fl_color_print(f_type_error, context.set.error, "ERROR: The %s '", file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' already exists."); } return F_false; @@ -94,11 +94,11 @@ extern "C" { if (status == F_parameter) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print(f_type_error, context.error, context.reset, "() for the %s '", file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print(f_type_error, context.set.error, "() for the %s '", file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -107,9 +107,9 @@ extern "C" { if (status == F_name) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid %s name '", file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid %s name '", file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -118,9 +118,9 @@ extern "C" { if (status == F_memory_out) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -129,9 +129,9 @@ extern "C" { if (status == F_number_overflow) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -140,9 +140,9 @@ extern "C" { if (status == F_directory) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -151,9 +151,9 @@ extern "C" { if (status == F_access_denied) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -162,9 +162,9 @@ extern "C" { if (status == F_loop) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Loop while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -173,9 +173,9 @@ extern "C" { if (status == F_prohibited) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Prohibited by system while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Prohibited by system while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -185,9 +185,9 @@ extern "C" { if (status == F_directory_found_not) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' due to an invalid directory in the path."); } return F_false; @@ -197,9 +197,9 @@ extern "C" { if (status == F_directory_found_not) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' due to an invalid directory in the path."); } return F_false; @@ -208,9 +208,9 @@ extern "C" { if (status == F_failure) { if (verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -219,11 +219,11 @@ extern "C" { if (iki_read_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != iki_read_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") occurred while trying to %s %s '", operation, file_or_directory); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") occurred while trying to %s %s '", operation, file_or_directory); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_true; @@ -231,68 +231,68 @@ extern "C" { #endif // _di_iki_read_print_error_file_ #ifndef _di_iki_read_print_error_number_argument_ - void iki_read_print_error_number_argument(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) { + void iki_read_print_error_number_argument(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) { if (verbosity == iki_read_verbosity_quiet) return; fprintf(f_type_error, "%c", f_string_eol[0]); if (status == F_parameter) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function); - fl_color_print_line(f_type_error, context.error, context.reset, "."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function); + fl_color_print_line(f_type_error, context.set.error, "."); } else if (status == F_number) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is not a valid number for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_underflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too small for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_overflow) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is too large for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_negative) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' is negative, which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_number_positive) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print(f_type_error, context.error, context.reset, "' contains a '"); - fl_color_print(f_type_error, context.notable, context.reset, "+"); - fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: The argument '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print(f_type_error, context.set.error, "' contains a '"); + fl_color_print(f_type_error, context.set.notable, "+"); + fl_color_print(f_type_error, context.set.error, "', which is not allowed for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print_line(f_type_error, context.set.error, "'."); } else if (status == F_data_not) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string."); + fl_color_print(f_type_error, context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print_line(f_type_error, context.set.error, "' must not be an empty string."); } else { - fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s()", function); - fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter); - fl_color_print(f_type_error, context.error, context.reset, "' with the value '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", argument); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") has occurred while calling "); + fl_color_print(f_type_error, context.set.notable, "%s()", function); + fl_color_print(f_type_error, context.set.error, "' for the parameter '"); + fl_color_print(f_type_error, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter); + fl_color_print(f_type_error, context.set.error, "' with the value '"); + fl_color_print(f_type_error, context.set.notable, "%s", argument); + fl_color_print_line(f_type_error, context.set.error, "'."); } } #endif // _di_iki_read_print_error_number_argument_ diff --git a/level_3/iki_read/c/private-iki_read.h b/level_3/iki_read/c/private-iki_read.h index bb2f207..034cc6a 100644 --- a/level_3/iki_read/c/private-iki_read.h +++ b/level_3/iki_read/c/private-iki_read.h @@ -31,7 +31,7 @@ extern "C" { * F_unknown is returned if the status code has no print message. */ #ifndef _di_iki_read_print_error_ - extern f_return_status iki_read_print_error(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal; + extern f_return_status iki_read_print_error(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_print_error_ /** @@ -61,7 +61,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_iki_read_print_error_file_ - extern bool iki_read_print_error_file(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; + extern bool iki_read_print_error_file(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_print_error_file_ /** @@ -85,7 +85,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_iki_read_print_error_number_argument_ - extern void iki_read_print_error_number_argument(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) f_gcc_attribute_visibility_internal; + extern void iki_read_print_error_number_argument(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) f_gcc_attribute_visibility_internal; #endif // _di_iki_read_print_error_number_argument_ /** diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index 0dc541f..2cb9979 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_iki_write_print_help_ - f_return_status iki_write_print_help(const fl_color_context_t context) { + f_return_status iki_write_print_help(const f_color_context_t context) { fll_program_print_help_header(context, iki_write_name_long, iki_write_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -27,12 +27,12 @@ extern "C" { fll_program_print_help_usage(context, iki_write_name, "filename(s)"); - fl_color_print(f_type_output, context.important, context.reset, " Notes:"); + fl_color_print(f_type_output, context.set.important, " Notes:"); printf("%c", f_string_eol[0], f_string_eol[0]); printf(" This program will accept object and content strings to generate an IKI string, such as: "); - fl_color_print(f_type_output, context.notable, context.reset, "object:\"content\""); + fl_color_print(f_type_output, context.set.notable, "object:\"content\""); printf(".%c", f_string_eol[0]); printf(" Each object must have a content (and each content must have an object).%c", f_string_eol[0]); @@ -88,11 +88,11 @@ extern "C" { if (data->parameters[iki_write_parameter_verbose].result == f_console_result_found) { if (data->parameters[iki_write_parameter_quiet].result == f_console_result_found) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, f_console_standard_long_verbose); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, f_console_standard_long_quiet); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: Cannot specify the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, f_console_standard_long_verbose); + fl_color_print(f_type_error, data->context.set.error, "' parameter with the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, f_console_standard_long_quiet); + fl_color_print_line(f_type_error, data->context.set.error, "' parameter."); status = F_status_set_error(F_parameter); } @@ -115,9 +115,9 @@ extern "C" { if (data->parameters[iki_write_parameter_file].result == f_console_result_additional) { if (data->parameters[iki_write_parameter_file].additional.used > 1) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_file); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' may only be specified once."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file); + fl_color_print_line(f_type_error, data->context.set.error, "' may only be specified once."); } status = F_status_set_error(F_parameter); @@ -135,9 +135,9 @@ extern "C" { } else if (data->parameters[iki_write_parameter_file].result == f_console_result_found) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_file); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file); + fl_color_print_line(f_type_error, data->context.set.error, "' was specified, but no value was given."); } status = F_status_set_error(F_parameter); @@ -146,9 +146,9 @@ extern "C" { if (F_status_is_fine(status) && data->parameters[iki_write_parameter_object].result == f_console_result_found) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_object); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object); + fl_color_print_line(f_type_error, data->context.set.error, "' was specified, but no value was given."); } status = F_status_set_error(F_parameter); @@ -156,9 +156,9 @@ extern "C" { if (F_status_is_fine(status) && data->parameters[iki_write_parameter_content].result == f_console_result_found) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_content); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content); + fl_color_print_line(f_type_error, data->context.set.error, "' was specified, but no value was given."); } status = F_status_set_error(F_parameter); @@ -168,11 +168,11 @@ extern "C" { 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->verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: No data provided, either pipe the data or use the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_object); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' and the '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_content); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameters."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: No data provided, either pipe the data or use the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object); + fl_color_print(f_type_error, data->context.set.error, "' and the '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content); + fl_color_print_line(f_type_error, data->context.set.error, "' parameters."); } status = F_status_set_error(F_parameter); @@ -182,11 +182,11 @@ extern "C" { if (F_status_is_fine(status)) { if (data->parameters[iki_write_parameter_object].additional.used != data->parameters[iki_write_parameter_content].additional.used) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameters '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_content); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' and '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, iki_write_long_object); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' must be specified the same number of times."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameters '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content); + fl_color_print(f_type_error, data->context.set.error, "' and '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object); + fl_color_print_line(f_type_error, data->context.set.error, "' must be specified the same number of times."); } status = F_status_set_error(F_parameter); @@ -242,7 +242,7 @@ extern "C" { if (!buffer.used) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: The pipe has no content."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: The pipe has no content."); } status = F_status_set_error(F_parameter); @@ -268,7 +268,7 @@ extern "C" { if (object_ended && previous == range.start) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: The pipe has incorrectly placed newlines."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: The pipe has incorrectly placed newlines."); } status = F_status_set_error(F_parameter); @@ -325,7 +325,7 @@ extern "C" { if (F_status_is_fine(status) && object_ended) { if (data->verbosity != iki_write_verbosity_quiet) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: The pipe has an object without content."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: The pipe has an object without content."); } status = F_status_set_error(F_parameter); @@ -396,7 +396,7 @@ extern "C" { f_macro_string_lengths_t_delete_simple(data->remaining); f_macro_string_dynamic_t_delete_simple(data->buffer); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/iki_write/c/iki_write.h b/level_3/iki_write/c/iki_write.h index becd244..d6ddf00 100644 --- a/level_3/iki_write/c/iki_write.h +++ b/level_3/iki_write/c/iki_write.h @@ -128,7 +128,7 @@ extern "C" { f_string_dynamic_t buffer; - fl_color_context_t context; + f_color_context_t context; } iki_write_data_t; #define iki_write_data_t_initialize \ @@ -138,7 +138,7 @@ extern "C" { F_false, \ 0, \ f_string_dynamic_t_initialize, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_iki_write_data_t_ @@ -152,7 +152,7 @@ extern "C" { * F_none on success. */ #ifndef _di_iki_write_print_help_ - extern f_return_status iki_write_print_help(const fl_color_context_t context); + extern f_return_status iki_write_print_help(const f_color_context_t context); #endif // _di_iki_write_print_help_ /** diff --git a/level_3/iki_write/c/private-iki_write.c b/level_3/iki_write/c/private-iki_write.c index 7a68204..49f4ac8 100644 --- a/level_3/iki_write/c/private-iki_write.c +++ b/level_3/iki_write/c/private-iki_write.c @@ -6,14 +6,14 @@ extern "C" { #endif #ifndef _di_iki_write_print_error_ - f_return_status iki_write_print_error(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) { + f_return_status iki_write_print_error(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) { if (status == F_parameter) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid parameter when calling function "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid parameter when calling function "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -22,9 +22,9 @@ extern "C" { if (status == F_memory_allocation || status == F_memory_reallocation) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Unable to allocate memory in function "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Unable to allocate memory in function "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -33,9 +33,9 @@ extern "C" { if (status == F_buffer_too_large) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Maximum buffer limit reached while processing "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Maximum buffer limit reached while processing "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -44,9 +44,9 @@ extern "C" { if (status == F_string_too_large) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Maximum string limit reached while processing "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "ERROR: Maximum string limit reached while processing "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_none; @@ -54,11 +54,11 @@ extern "C" { if (fallback && verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") in function "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print_line(f_type_error, context.error, context.reset, "()."); + fl_color_print(f_type_error, context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") in function "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print_line(f_type_error, context.set.error, "()."); } return F_unknown; @@ -66,7 +66,7 @@ extern "C" { #endif // _di_iki_write_print_error_ #ifndef _di_iki_write_print_error_file_ - bool iki_write_print_error_file(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const uint8_t type, const bool fallback) { + bool iki_write_print_error_file(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const uint8_t type, const bool fallback) { f_string_t type_name = "file"; if (type == 1) { @@ -79,9 +79,9 @@ extern "C" { if (status == F_file_found_not) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to find %s '", type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to find %s '", type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -89,9 +89,9 @@ extern "C" { if (status == F_file_closed) { if (verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: The %s '", type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' is no longer open."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: The %s '", type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' is no longer open."); } return F_false; @@ -99,9 +99,9 @@ extern "C" { if (status == F_file_seek) { if (verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: A seek error occurred while accessing the file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: A seek error occurred while accessing the file '"); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -109,9 +109,9 @@ extern "C" { if (status == F_file_read) { if (verbosity != iki_write_verbosity_quiet) { - fl_color_print(f_type_error, context.error, context.reset, "ERROR: A read error occurred while accessing the file '"); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: A read error occurred while accessing the file '"); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -120,9 +120,9 @@ extern "C" { if (status == F_file_found) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: The %s '", type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' already exists."); + fl_color_print(f_type_error, context.set.error, "ERROR: The %s '", type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' already exists."); } return F_false; @@ -131,11 +131,11 @@ extern "C" { if (status == F_parameter) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling "); - fl_color_print(f_type_error, context.notable, context.reset, "%s", function); - fl_color_print(f_type_error, context.error, context.reset, "() for the %s '", type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "INTERNAL ERROR: Invalid parameter when calling "); + fl_color_print(f_type_error, context.set.notable, "%s", function); + fl_color_print(f_type_error, context.set.error, "() for the %s '", type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -144,9 +144,9 @@ extern "C" { if (status == F_name) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid %s name '", type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid %s name '", type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -155,9 +155,9 @@ extern "C" { if (status == F_memory_out) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -166,9 +166,9 @@ extern "C" { if (status == F_number_overflow) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Overflow while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -177,9 +177,9 @@ extern "C" { if (status == F_directory) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Invalid directory while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -188,9 +188,9 @@ extern "C" { if (status == F_access_denied) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Access denied while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -199,9 +199,9 @@ extern "C" { if (status == F_loop) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Loop while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -210,9 +210,9 @@ extern "C" { if (status == F_prohibited) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Prohibited by system while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Prohibited by system while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -222,9 +222,9 @@ extern "C" { if (status == F_directory_found_not) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' due to an invalid directory in the path."); } return F_false; @@ -234,9 +234,9 @@ extern "C" { if (status == F_directory_found_not) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "' due to an invalid directory in the path."); } return F_false; @@ -245,9 +245,9 @@ extern "C" { if (status == F_failure) { if (verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "ERROR: Failed to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "ERROR: Failed to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_false; @@ -256,11 +256,11 @@ extern "C" { if (iki_write_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: ("); - fl_color_print(f_type_error, context.notable, context.reset, "%llu", status); - fl_color_print(f_type_error, context.error, context.reset, ") occurred while trying to %s %s '", operation, type_name); - fl_color_print(f_type_error, context.notable, context.reset, "%s", name); - fl_color_print_line(f_type_error, context.error, context.reset, "'."); + fl_color_print(f_type_error, context.set.error, "UNKNOWN ERROR: ("); + fl_color_print(f_type_error, context.set.notable, "%llu", status); + fl_color_print(f_type_error, context.set.error, ") occurred while trying to %s %s '", operation, type_name); + fl_color_print(f_type_error, context.set.notable, "%s", name); + fl_color_print_line(f_type_error, context.set.error, "'."); } return F_true; @@ -273,9 +273,9 @@ extern "C" { if (!object.used) { if (data.verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The object is missing, it must not have a length of "); - fl_color_print(f_type_error, data.context.notable, data.context.reset, "0"); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "."); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The object is missing, it must not have a length of "); + fl_color_print(f_type_error, data.context.set.notable, "0"); + fl_color_print_line(f_type_error, data.context.set.error, "."); } return F_status_set_error(F_failure); @@ -286,13 +286,13 @@ extern "C" { if (status == F_false) { if (data.verbosity != iki_write_verbosity_quiet) { fprintf(f_type_error, "%c", f_string_eol[0]); - fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The object '"); + fl_color_print(f_type_error, data.context.set.error, "ERROR: The object '"); fl_color_print_code(f_type_error, data.context.notable); f_print_dynamic(f_type_error, object); fl_color_print_code(f_type_error, data.context.reset); - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' is not a valid IKI object."); + fl_color_print_line(f_type_error, data.context.set.error, "' is not a valid IKI object."); } return F_status_set_error(F_failure); diff --git a/level_3/iki_write/c/private-iki_write.h b/level_3/iki_write/c/private-iki_write.h index 88bccdb..0f51e10 100644 --- a/level_3/iki_write/c/private-iki_write.h +++ b/level_3/iki_write/c/private-iki_write.h @@ -31,7 +31,7 @@ extern "C" { * F_unknown is returned if the status code has no print message. */ #ifndef _di_iki_write_print_error_ - extern f_return_status iki_write_print_error(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal; + extern f_return_status iki_write_print_error(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_iki_write_print_error_ /** @@ -59,7 +59,7 @@ extern "C" { * F_false is returned on successful print of known errors. */ #ifndef _di_iki_write_print_error_file_ - extern bool iki_write_print_error_file(const fl_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const uint8_t type, const bool fallback) f_gcc_attribute_visibility_internal; + extern bool iki_write_print_error_file(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const uint8_t type, const bool fallback) f_gcc_attribute_visibility_internal; #endif // _di_iki_write_print_error_file_ /** diff --git a/level_3/init/c/init.c b/level_3/init/c/init.c index c97abc4..c7a49ca 100644 --- a/level_3/init/c/init.c +++ b/level_3/init/c/init.c @@ -24,7 +24,7 @@ extern "C" { #endif // _di_init_print_version_ #ifndef _di_init_print_help_ - f_return_status init_print_help(const fl_color_context_t context) { + f_return_status init_print_help(const f_color_context_t context) { fll_program_print_help_header(context, init_name_long, init_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -120,13 +120,13 @@ extern "C" { pid_t pid_services = clone(init_handler_child_services, stack_memory.services + init_stack_size_small_services, init_flags_clone, stack_memory.services); if (pid_services < 0) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to clone services process (errno = %i).", errno); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to clone services process (errno = %i).", errno); } pid_t pid_control_file = clone(init_handler_child_control_file, stack_memory.control_file + init_stack_size_control_file, init_flags_clone, stack_memory.control_file); if (pid_control_file < 0) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to clone control via file process (errno = %i).", errno); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Failed to clone control via file process (errno = %i).", errno); } */ @@ -154,11 +154,11 @@ extern "C" { continue; } else if (errno != EINTR) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: sigwaitinfo() failed (errno = %i).", errno); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: sigwaitinfo() failed (errno = %i).", errno); signal_problem_count++; if (signal_problem_count > problem_count_max_signal_size) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Max signal problem count has been reached, sleeping for a period of time.", errno); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: Max signal problem count has been reached, sleeping for a period of time.", errno); sleep(init_panic_signal_sleep_seconds); signal_problem_count = 0; } diff --git a/level_3/init/c/init.h b/level_3/init/c/init.h index 20b28f1..7576642 100644 --- a/level_3/init/c/init.h +++ b/level_3/init/c/init.h @@ -225,7 +225,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } init_data_t; #define init_data_initialize \ @@ -233,7 +233,7 @@ extern "C" { init_console_parameter_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } typedef struct { @@ -287,7 +287,7 @@ extern "C" { * F_none on success. */ #ifndef _di_init_print_help_ - extern f_return_status init_print_help(const fl_color_context_t context); + extern f_return_status init_print_help(const f_color_context_t context); #endif // _di_init_print_help_ /** diff --git a/level_3/init/c/private-init.c b/level_3/init/c/private-init.c index 315f2ef..c74e1ad 100644 --- a/level_3/init/c/private-init.c +++ b/level_3/init/c/private-init.c @@ -17,21 +17,21 @@ if (optional) { if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } else { if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()."); } else if (status == F_file_found_not) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to find the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Unable to find the file '%s'.", filename); } else if (status == F_file_open) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Unable to open the file '%s'.", filename); } else if (status == F_file_descriptor) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: File descriptor error while trying to open the file '%s'.", filename); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status); } } @@ -49,19 +49,19 @@ status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until()."); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until()."); } else if (status == F_number_overflow) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename); } else if (status == F_file_closed) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: The file '%s' is no longer open.", filename); } else if (status == F_file_seek) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: A seek error occurred while accessing the file '%s'.", filename); } else if (status == F_file_read) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: A read error occurred while accessing the file '%s'.", filename); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read_until().", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read_until().", status); } return F_status_set_error(status); @@ -77,13 +77,13 @@ status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename); } else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", filename); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: No relevant data was found within the file '%s'.", filename); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename); } return F_status_set_error(status); @@ -107,11 +107,11 @@ status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_failure) { // the error message has already been displayed. } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); } f_macro_fss_objects_t_delete_simple(local->rule_objects); @@ -495,13 +495,13 @@ status = F_status_set_fine(status); if (status == F_parameter) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file); } else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file); + fl_color_print_line(f_type_error, data.context.set.error, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file); } else if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file); } f_macro_string_dynamic_t_delete(buffer); @@ -526,10 +526,10 @@ if (F_status_is_error(status_process)) { if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status); } // @todo: init_delete_data((*data)); @@ -552,11 +552,11 @@ status = F_status_set_fine(status); if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, data.context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else if (status == F_failure) { // the error message has already been displayed. } else { - fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); + fl_color_print_line(f_type_error, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status); } f_macro_fss_objects_t_delete_simple((*rule_objects)); @@ -566,10 +566,10 @@ } else { if (status == F_memory_allocation || status == F_memory_reallocation) { - fl_color_print_line(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory."); + fl_color_print_line(f_type_error, context.set.error, "CRITICAL ERROR: Unable to allocate memory."); } else { - fl_color_print_line(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status); + fl_color_print_line(f_type_error, context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status); } } diff --git a/level_3/status_code/c/private-status_code.c b/level_3/status_code/c/private-status_code.c index a70ce9e..0df91e1 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_line(f_type_output, data.context.error, data.context.reset, "invalid name"); + fl_color_print_line(f_type_output, data.context.set.error, "invalid name"); return F_status_set_error(F_parameter); } if (status == F_data_not || F_status_set_fine(status) == F_parameter) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid data"); + fl_color_print_line(f_type_output, data.context.set.error, "invalid data"); 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_line(f_type_output, data.context.error, data.context.reset, "unknown name"); + fl_color_print_line(f_type_output, data.context.set.error, "unknown name"); } else { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert"); + fl_color_print_line(f_type_output, data.context.set.error, "failed to convert"); } return status; } if (status == F_data) { - fl_color_print_line(f_type_output, data.context.warning, data.context.reset, "unknown code"); + fl_color_print_line(f_type_output, data.context.set.warning, "unknown code"); 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_line(f_type_output, data.context.error, data.context.reset, "unknown code"); + fl_color_print_line(f_type_output, data.context.set.error, "unknown code"); } else { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert"); + fl_color_print_line(f_type_output, data.context.set.error, "failed to convert"); } 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_line(f_type_output, data.context.error, data.context.reset, "out of range"); + fl_color_print_line(f_type_output, data.context.set.error, "out of range"); return status; } if (F_status_is_error(status)) { if (F_status_set_fine(status) == F_number_negative) { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range"); + fl_color_print_line(f_type_output, data.context.set.error, "out of range"); } else { - fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid number"); + fl_color_print_line(f_type_output, data.context.set.error, "invalid number"); } return status; diff --git a/level_3/status_code/c/private-status_code.h b/level_3/status_code/c/private-status_code.h index dd57ab3..5e06aea 100644 --- a/level_3/status_code/c/private-status_code.h +++ b/level_3/status_code/c/private-status_code.h @@ -29,7 +29,7 @@ extern "C" { * F_number_overflow (with error bit) on integer overflow. * F_incomplete_utf (with error bit) if an incomplete UTF-8 fragment is found. * - * Errors from (with error bit): fss_status_code_convert_number(). + * Errors (with error bit) from: fss_status_code_convert_number(). * * @see fss_status_code_convert_number() */ @@ -49,8 +49,8 @@ extern "C" { * F_none on success. * F_data_not if string is empty. * - * Errors from (with error bit): fl_console_parameter_to_number_unsigned(). - * Errors from (with error bit): fll_fss_status_from_string(). + * Errors (with error bit) from: fl_console_parameter_to_number_unsigned(). + * Errors (with error bit) from: fll_fss_status_from_string(). * * @see fl_console_parameter_to_number_unsigned() * @see fll_fss_status_from_string() @@ -76,8 +76,8 @@ extern "C" { * F_number_overflow (with error bit) on integer overflow. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fll_fss_status_from_string(). - * Errors from (with error bit): fss_status_code_convert_number(). + * Errors (with error bit) from: fll_fss_status_from_string(). + * Errors (with error bit) from: fss_status_code_convert_number(). * * @see fll_fss_status_from_string() * @see fss_status_code_convert_number() @@ -106,7 +106,7 @@ extern "C" { * F_number_overflow (with error bit) on integer overflow. * F_parameter (with error bit) if a parameter is invalid. * - * Errors from (with error bit): fl_console_parameter_to_number_unsigned(). + * Errors (with error bit) from: fl_console_parameter_to_number_unsigned(). * * @see fl_console_parameter_to_number_unsigned() */ diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index f9033d5..be7d2e7 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -6,7 +6,7 @@ extern "C" { #endif #ifndef _di_status_code_print_help_ - f_return_status status_code_print_help(const fl_color_context_t context) { + f_return_status status_code_print_help(const f_color_context_t context) { fll_program_print_help_header(context, status_code_name_long, status_code_version); fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message."); @@ -62,39 +62,39 @@ extern "C" { if (data->parameters[status_code_parameter_is_error].result == f_console_result_found) { if (data->parameters[status_code_parameter_is_warning].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_error); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error); + fl_color_print(f_type_error, data->context.set.error, "' cannot be used with the parameter "); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning); + fl_color_print_line(f_type_error, data->context.set.error, "."); status_code_delete_data(data); return F_status_set_error(status); } else if (data->parameters[status_code_parameter_is_fine].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_error); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error); + fl_color_print(f_type_error, data->context.set.error, "' cannot be used with the parameter "); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine); + fl_color_print_line(f_type_error, data->context.set.error, "."); status_code_delete_data(data); return F_status_set_error(status); } } else if (data->parameters[status_code_parameter_is_warning].result == f_console_result_found && data->parameters[status_code_parameter_is_fine].result == f_console_result_found) { - fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '"); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning); - fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter "); - fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine); - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "."); + fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '"); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning); + fl_color_print(f_type_error, data->context.set.error, "' cannot be used with the parameter "); + fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine); + fl_color_print_line(f_type_error, data->context.set.error, "."); status_code_delete_data(data); return F_status_set_error(status); } if (data->remaining.used == 0 && !data->process_pipe) { - fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You failed to specify a status code."); + fl_color_print_line(f_type_error, data->context.set.error, "ERROR: You failed to specify a status code."); status_code_delete_data(data); return F_status_set_error(F_parameter); @@ -164,7 +164,7 @@ extern "C" { } // while f_macro_string_lengths_t_delete_simple(data->remaining); - fl_macro_color_context_t_delete_simple(data->context); + f_macro_color_context_t_delete_simple(data->context); return F_none; } diff --git a/level_3/status_code/c/status_code.h b/level_3/status_code/c/status_code.h index b38f1d0..ec0695d 100644 --- a/level_3/status_code/c/status_code.h +++ b/level_3/status_code/c/status_code.h @@ -99,7 +99,7 @@ extern "C" { f_string_lengths_t remaining; bool process_pipe; - fl_color_context_t context; + f_color_context_t context; } status_code_data_t; #define status_code_data_t_initialize \ @@ -107,7 +107,7 @@ extern "C" { status_code_console_parameter_t_initialize, \ f_string_lengths_t_initialize, \ F_false, \ - fl_color_context_t_initialize, \ + f_color_context_t_initialize, \ } #endif // _di_status_code_data_t_ @@ -121,7 +121,7 @@ extern "C" { * F_none on success. */ #ifndef _di_status_code_print_help_ - extern f_return_status status_code_print_help(const fl_color_context_t context); + extern f_return_status status_code_print_help(const f_color_context_t context); #endif // _di_status_code_print_help_ /** -- 1.8.3.1