From 0b279e72da34bffcda298d454cc9ba6e1bebdc65 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 4 Nov 2021 00:12:12 -0500 Subject: [PATCH] Update: Add "success" color context and initialize color "set" in programs. There is an "error" and a "warning" but no "success". Make this complete by adding "success". The programs aren't initializing the "set". Attempting to use these always results in no color context. Fix this by initializing these in each program. The output context also needs to be initialized just like the error and warning. --- level_0/f_color/c/color-common.h | 43 +++++++++++++++------- level_0/f_color/c/color.c | 15 +++++--- level_2/fll_execute/c/execute.h | 34 ++++++++--------- level_2/fll_execute/c/private-execute.h | 8 ++-- level_2/fll_program/c/program.c | 1 + level_3/byte_dump/c/byte_dump.c | 9 ++++- level_3/control/c/control.c | 9 ++++- level_3/controller/c/controller.c | 9 ++++- level_3/fake/c/fake.c | 9 ++++- level_3/firewall/c/firewall.c | 9 ++++- .../fss_basic_list_read/c/fss_basic_list_read.c | 9 ++++- .../fss_basic_list_write/c/fss_basic_list_write.c | 9 ++++- level_3/fss_basic_read/c/fss_basic_read.c | 9 ++++- level_3/fss_basic_write/c/fss_basic_write.c | 9 ++++- .../c/fss_embedded_list_read.c | 9 ++++- .../c/fss_embedded_list_write.c | 9 ++++- .../c/fss_extended_list_read.c | 9 ++++- .../c/fss_extended_list_write.c | 9 ++++- level_3/fss_extended_read/c/fss_extended_read.c | 9 ++++- level_3/fss_extended_write/c/fss_extended_write.c | 9 ++++- level_3/fss_identify/c/fss_identify.c | 9 ++++- level_3/fss_status_code/c/fss_status_code.c | 9 ++++- level_3/iki_read/c/iki_read.c | 9 ++++- level_3/iki_write/c/iki_write.c | 9 ++++- level_3/status_code/c/status_code.c | 9 ++++- 25 files changed, 221 insertions(+), 60 deletions(-) diff --git a/level_0/f_color/c/color-common.h b/level_0/f_color/c/color-common.h index a058012..104e652 100644 --- a/level_0/f_color/c/color-common.h +++ b/level_0/f_color/c/color-common.h @@ -16,8 +16,16 @@ extern "C" { #endif +/** + * Color max size represents the maximum length of the resulting color string. + * + * This color max size does not include the terminating null. + * + * A color max size terminated represents the max size with the terminating null. + */ #ifndef _di_f_color_max_size_ - #define F_color_max_size_d 7 + #define F_color_max_size_d 7 + #define F_color_max_size_terminated_d 8 #endif // _di_f_color_max_size_ #ifndef _di_f_color_types_t_ @@ -382,6 +390,7 @@ extern "C" { * notable: Color context associated with "notable". * important: Color context associated with "important". * standout: Color context associated with "standout". + * success: Color context associated with "success". * normal: Color context associated with "normal". * normal_reset: Color context associated with "normal_reset". */ @@ -393,13 +402,14 @@ extern "C" { f_color_set_t notable; f_color_set_t important; f_color_set_t standout; + f_color_set_t success; 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_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, f_color_set_t_initialize } - #define macro_f_color_set_context_t_initialize(warning, error, title, notable, important, standout, normal, normal_reset) { warning, error, title, notable, important, standout, normal, normal_reset } + #define macro_f_color_set_context_t_initialize(warning, error, title, notable, important, standout, success, normal, normal_reset) { warning, error, title, notable, important, standout, success, normal, normal_reset } #define macro_f_color_set_context_t_clear(set) \ macro_f_color_set_t_clear(set.warning) \ @@ -408,6 +418,7 @@ extern "C" { macro_f_color_set_t_clear(set.notable) \ macro_f_color_set_t_clear(set.important) \ macro_f_color_set_t_clear(set.standout) \ + macro_f_color_set_t_clear(set.success) \ macro_f_color_set_t_clear(set.normal) \ macro_f_color_set_t_clear(set.normal_reset) @@ -428,6 +439,7 @@ extern "C" { * notable: Color context associated with "notable". * important: Color context associated with "important". * standout: Color context associated with "standout". + * success: Color context associated with "success". * normal: Color context associated with "normal". * normal_reset: Color context associated with "normal_reset". */ @@ -444,11 +456,12 @@ extern "C" { f_string_dynamic_t notable; f_string_dynamic_t important; f_string_dynamic_t standout; + f_string_dynamic_t success; 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_d, 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_color_context_t_initialize { f_color_t_initialize_linux, f_color_format_t_initialize_linux, F_color_mode_none_d, 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, f_string_dynamic_t_initialize } #define macro_f_color_context_t_clear(context) \ macro_f_color_t_clear(context.list) \ @@ -460,19 +473,21 @@ extern "C" { macro_f_string_dynamic_t_clear(context.notable) \ macro_f_string_dynamic_t_clear(context.important) \ macro_f_string_dynamic_t_clear(context.standout) \ + macro_f_string_dynamic_t_clear(context.success) \ macro_f_string_dynamic_t_clear(context.normal) \ macro_f_string_dynamic_t_clear(context.normal_reset) #define macro_f_color_context_t_new(status, context) \ - macro_f_string_dynamic_t_resize(status, context.reset, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.warning, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.error, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.title, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.notable, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.important, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.standout, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.normal, F_color_max_size_d + 1) \ - if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.normal_reset, F_color_max_size_d + 1) + macro_f_string_dynamic_t_resize(status, context.reset, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.warning, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.error, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.title, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.notable, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.important, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.standout, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.success, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.normal, F_color_max_size_terminated_d) \ + if (F_status_is_error_not(status)) macro_f_string_dynamic_t_resize(status, context.normal_reset, F_color_max_size_terminated_d) #define macro_f_color_context_t_delete_simple(context) \ macro_f_string_dynamic_t_delete_simple(context.reset) \ @@ -482,6 +497,7 @@ extern "C" { macro_f_string_dynamic_t_delete_simple(context.notable) \ macro_f_string_dynamic_t_delete_simple(context.important) \ macro_f_string_dynamic_t_delete_simple(context.standout) \ + macro_f_string_dynamic_t_delete_simple(context.success) \ macro_f_string_dynamic_t_delete_simple(context.normal) \ macro_f_string_dynamic_t_delete_simple(context.normal_reset) \ macro_f_color_context_t_clear(context) @@ -494,6 +510,7 @@ extern "C" { macro_f_string_dynamic_t_destroy_simple(context.notable, size) \ macro_f_string_dynamic_t_destroy_simple(context.important, size) \ macro_f_string_dynamic_t_destroy_simple(context.standout, size) \ + macro_f_string_dynamic_t_destroy_simple(context.success, size) \ macro_f_string_dynamic_t_destroy_simple(context.normal) \ macro_f_string_dynamic_t_destroy_simple(context.normal_reset) \ macro_f_color_context_t_clear(context) diff --git a/level_0/f_color/c/color.c b/level_0/f_color/c/color.c index 56eee24..4e0ae16 100644 --- a/level_0/f_color/c/color.c +++ b/level_0/f_color/c/color.c @@ -35,11 +35,11 @@ extern "C" { } if (F_status_is_error_not(status)) { - status = macro_fl_color_save_1(&context->notable, context->format, context->list.bold); + status = macro_fl_color_save_2(&context->success, context->format, context->list.bold, context->list.green); } if (F_status_is_error_not(status)) { - status = macro_fl_color_save_1(&context->standout, context->format, context->list.purple); + status = macro_fl_color_save_1(&context->notable, context->format, context->list.bold); } if (use_light_colors) { @@ -52,11 +52,11 @@ extern "C" { } if (F_status_is_error_not(status)) { - context->mode = F_color_mode_light_d; + status = macro_fl_color_save_1(&context->standout, context->format, context->list.purple); } if (F_status_is_error_not(status)) { - status = macro_fl_color_save_1(&context->standout, context->format, context->list.purple); + context->mode = F_color_mode_light_d; } } else { @@ -69,11 +69,11 @@ extern "C" { } if (F_status_is_error_not(status)) { - context->mode = F_color_mode_dark_d; + status = macro_fl_color_save_1(&context->standout, context->format, context->list.green); } if (F_status_is_error_not(status)) { - status = macro_fl_color_save_1(&context->standout, context->format, context->list.green); + context->mode = F_color_mode_dark_d; } } @@ -96,6 +96,9 @@ extern "C" { context->set.standout.before = &context->standout; context->set.standout.after = &context->reset; + context->set.success.before = &context->success; + context->set.success.after = &context->reset; + context->set.normal.before = &context->normal; context->set.normal.after = &context->reset; diff --git a/level_2/fll_execute/c/execute.h b/level_2/fll_execute/c/execute.h index f82ce22..e80b280 100644 --- a/level_2/fll_execute/c/execute.h +++ b/level_2/fll_execute/c/execute.h @@ -73,13 +73,13 @@ extern "C" { * * Errors (with error bit) from: macro_f_string_dynamics_t_resize(). * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see macro_f_string_dynamics_t_resize() * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -118,12 +118,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -164,12 +164,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -196,12 +196,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -224,12 +224,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -262,12 +262,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -302,12 +302,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -332,12 +332,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() */ @@ -466,7 +466,7 @@ extern "C" { * Errors (with error bit) from: f_thread_signal_mask(). * Errors (with error bit) from: fl_environment_path_explode_dynamic(). * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate_after(). * * @see close() diff --git a/level_2/fll_execute/c/private-execute.h b/level_2/fll_execute/c/private-execute.h index 09d6df1..874219e 100644 --- a/level_2/fll_execute/c/private-execute.h +++ b/level_2/fll_execute/c/private-execute.h @@ -31,12 +31,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() * @see fll_execute_arguments_add() @@ -72,12 +72,12 @@ extern "C" { * F_none on success. * * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_delete(). + * Errors (with error bit) from: f_string_dynamic_resize(). * Errors (with error bit) from: f_string_dynamic_terminate(). * Errors (with error bit) from: f_string_dynamics_increase(). * * @see f_string_append() - * @see f_string_dynamic_delete() + * @see f_string_dynamic_resize() * @see f_string_dynamic_terminate() * @see f_string_dynamics_increase() * @see fll_execute_arguments_add_parameter() diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index b41a670..0767017 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -122,6 +122,7 @@ extern "C" { context->set.notable = f_color_set_empty_s; context->set.important = f_color_set_empty_s; context->set.standout = f_color_set_empty_s; + context->set.success = f_color_set_empty_s; context->set.normal = f_color_set_empty_s; context->set.normal_reset = f_color_set_empty_s; diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 5c81bfc..40961db 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -85,7 +85,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -93,7 +100,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index 8ae92cc..5828881 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -45,7 +45,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -53,7 +60,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/controller/c/controller.c b/level_3/controller/c/controller.c index 354392c..86e7555 100644 --- a/level_3/controller/c/controller.c +++ b/level_3/controller/c/controller.c @@ -70,7 +70,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -78,7 +85,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index 8865385..f29568a 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -96,7 +96,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -104,7 +111,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 6102237..65f92b2 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -57,7 +57,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -65,7 +72,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 31cefbb..2b636b4 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 @@ -130,7 +130,14 @@ extern "C" { status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -138,7 +145,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 3bf697e..639d4fc 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 @@ -69,7 +69,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -77,7 +84,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 1c5d3fa..9b24223 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -130,7 +130,14 @@ extern "C" { status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -138,7 +145,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 45e226c..bc95f79 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -69,7 +69,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -77,7 +84,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index 357d7d4..205e9eb 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -130,7 +130,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -138,7 +145,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index fcd97e6..f76382e 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -72,7 +72,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -80,7 +87,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 c1fd33b..29f18ff 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 @@ -130,7 +130,14 @@ extern "C" { status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -138,7 +145,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index c8e0c34..e375446 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -72,7 +72,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -80,7 +87,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 dbff56a..acb5811 100644 --- a/level_3/fss_extended_read/c/fss_extended_read.c +++ b/level_3/fss_extended_read/c/fss_extended_read.c @@ -129,7 +129,14 @@ extern "C" { status = fll_program_parameter_process(*arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -137,7 +144,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 c3abe92..2a26795 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -69,7 +69,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -77,7 +84,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/fss_identify/c/fss_identify.c b/level_3/fss_identify/c/fss_identify.c index b096fe8..84e7f86 100644 --- a/level_3/fss_identify/c/fss_identify.c +++ b/level_3/fss_identify/c/fss_identify.c @@ -70,7 +70,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -78,7 +85,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } 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 b7704e9..e98c17f 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -51,7 +51,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -59,7 +66,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index 1027962..7935a96 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -78,7 +78,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -86,7 +93,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index e6fc94e..3bca0e0 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -61,7 +61,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -69,7 +76,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index f463f7d..9d2a099 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -51,7 +51,14 @@ extern "C" { status = fll_program_parameter_process(arguments, parameters, choices, F_true, &main->remaining, &main->context); + main->output.set = &main->context.set; + main->error.set = &main->context.set; + main->warning.set = &main->context.set; + if (main->context.set.error.before) { + main->output.context = f_color_set_empty_s; + main->output.notable = main->context.set.notable; + main->error.context = main->context.set.error; main->error.notable = main->context.set.notable; @@ -59,7 +66,7 @@ extern "C" { main->warning.notable = main->context.set.notable; } else { - f_color_set_t *sets[] = { &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; + f_color_set_t *sets[] = { &main->output.context, &main->output.notable, &main->error.context, &main->error.notable, &main->warning.context, &main->warning.notable, 0 }; fll_program_parameter_process_empty(&main->context, sets); } -- 1.8.3.1