From f866d2b218c37b872a5cff1f380c8c89708d8d17 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 22 Feb 2023 23:07:58 -0600 Subject: [PATCH] Progress: Continue Featureless Make, focusing on printing. There is still more to go, but the printing changes is nearing the end. Other minor clean ups in directory code. --- build/stand_alone/fake.settings | 5 +- level_0/f_directory/c/directory.c | 90 ++++----------- level_0/f_directory/c/private-directory.c | 4 +- level_1/fl_print/c/print/common.h | 8 +- level_3/fake/c/main/build.c | 4 +- level_3/fake/c/main/build/library.c | 33 +++--- level_3/fake/c/main/build/object.c | 9 +- level_3/fake/c/main/build/objects.c | 29 ++--- level_3/fake/c/main/build/print-error.c | 32 ++++++ level_3/fake/c/main/build/print-error.h | 63 ++++++++++ level_3/fake/c/main/build/print-verbose.c | 21 ++++ level_3/fake/c/main/build/print-verbose.h | 41 +++++++ level_3/fake/c/main/build/print.c | 99 ++++++++++++++++ level_3/fake/c/main/build/print.h | 184 ++++++++++++++++++++++++++++++ level_3/fake/c/main/build/program.c | 9 +- level_3/fake/c/main/build/skeleton.c | 10 +- level_3/fake/c/main/clean.c | 4 +- level_3/fake/c/main/fake.c | 8 +- level_3/fake/c/main/fake/print.c | 10 -- level_3/fake/c/main/fake/print.h | 23 ---- level_3/fake/c/main/print.c | 54 +++++---- level_3/fake/c/main/print.h | 79 +++++++++++-- level_3/fake/c/main/skeleton/print.c | 10 -- level_3/fake/c/main/skeleton/print.h | 19 --- level_3/fake/data/build/settings | 10 +- 25 files changed, 623 insertions(+), 235 deletions(-) create mode 100644 level_3/fake/c/main/build/print-error.c create mode 100644 level_3/fake/c/main/build/print-error.h create mode 100644 level_3/fake/c/main/build/print-verbose.c create mode 100644 level_3/fake/c/main/build/print-verbose.h delete mode 100644 level_3/fake/c/main/fake/print.c delete mode 100644 level_3/fake/c/main/fake/print.h delete mode 100644 level_3/fake/c/main/skeleton/print.c delete mode 100644 level_3/fake/c/main/skeleton/print.h diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index 61673a7..3e6e208 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -68,12 +68,11 @@ build_sources_program fll/level_2/print.c build_sources_program fll/level_2/program.c fll/level_2/program/common.c fll/level_2/program/print.c fll/level_2/private-program.c build_sources_program program/fake/main/build.c program/fake/main/clean.c program/fake/main/common.c program/fake/main/fake.c program/fake/main/make.c program/fake/main/print.c program/fake/main/print-error.c program/fake/main/print-warning.c program/fake/main/skeleton.c -build_sources_program program/fake/main/build/library.c program/fake/main/build/load.c program/fake/main/build/object.c program/fake/main/build/objects.c program/fake/main/build/print.c program/fake/main/build/program.c program/fake/main/build/skeleton.c +build_sources_program program/fake/main/build/library.c program/fake/main/build/load.c program/fake/main/build/object.c program/fake/main/build/objects.c program/fake/main/build/print.c program/fake/main/build/print-error.c program/fake/main/build/print-verbose.c program/fake/main/build/program.c program/fake/main/build/skeleton.c build_sources_program program/fake/main/clean/print.c build_sources_program program/fake/main/common/define.c program/fake/main/common/enumeration.c program/fake/main/common/print.c program/fake/main/common/string.c program/fake/main/common/type.c -build_sources_program program/fake/main/fake/path_generate.c program/fake/main/fake/print.c +build_sources_program program/fake/main/fake/path_generate.c build_sources_program program/fake/main/make/load_fakefile.c program/fake/main/make/load_parameters.c program/fake/main/make/operate_block.c program/fake/main/make/operate.c program/fake/main/make/operate_process.c program/fake/main/make/operate_process_type.c program/fake/main/make/operate_validate.c program/fake/main/make/operate_validate_type.c program/fake/main/make/print.c program/fake/main/make/print-error.c program/fake/main/make/print-verbose.c program/fake/main/make/print-warning.c -build_sources_program program/fake/main/skeleton/print.c build_sources_program program/fake/main/main.c diff --git a/level_0/f_directory/c/directory.c b/level_0/f_directory/c/directory.c index dea80e4..fda3476 100644 --- a/level_0/f_directory/c/directory.c +++ b/level_0/f_directory/c/directory.c @@ -8,9 +8,7 @@ extern "C" { #ifndef _di_f_directory_create_ f_status_t f_directory_create(const f_string_static_t path, const mode_t mode) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; return private_f_directory_create(path, mode); } @@ -19,9 +17,7 @@ extern "C" { #ifndef _di_f_directory_create_at_ f_status_t f_directory_create_at(const int at_id, const f_string_static_t path, const mode_t mode) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; return private_f_directory_create_at(at_id, path, mode); } @@ -30,9 +26,7 @@ extern "C" { #ifndef _di_f_directory_exists_ f_status_t f_directory_exists(const f_string_static_t path) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct stat file_stat; @@ -51,9 +45,7 @@ extern "C" { return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) { - return F_true; - } + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; return F_false; } @@ -62,9 +54,7 @@ extern "C" { #ifndef _di_f_directory_exists_at_ f_status_t f_directory_exists_at(const int at_id, const f_string_static_t path, const int flag) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct stat file_stat; @@ -84,9 +74,7 @@ extern "C" { return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) { - return F_true; - } + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; return F_false; } @@ -95,9 +83,7 @@ extern "C" { #ifndef _di_f_directory_is_ f_status_t f_directory_is(const f_string_static_t path) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct stat file_stat; @@ -116,9 +102,7 @@ extern "C" { return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) { - return F_true; - } + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; return F_false; } @@ -127,9 +111,7 @@ extern "C" { #ifndef _di_f_directory_is_at_ f_status_t f_directory_is_at(const int at_id, const f_string_static_t path, const int flag) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct stat file_stat; @@ -149,9 +131,7 @@ extern "C" { return F_status_set_error(F_file_stat); } - if ((file_stat.st_mode & S_IFMT) == S_IFDIR) { - return F_true; - } + if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true; return F_false; } @@ -163,9 +143,7 @@ extern "C" { if (!names) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct dirent **listing = 0; f_status_t status = F_none; @@ -228,13 +206,8 @@ extern "C" { f_memory_delete(1, sizeof(struct dirent *), (void *) &listing); } - if (F_status_is_error(status)) { - return status; - } - - if (!length) { - return F_directory_empty; - } + if (F_status_is_error(status)) return status; + if (!length) return F_directory_empty; return F_none; } @@ -246,9 +219,7 @@ extern "C" { if (!id) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; int flag = F_directory_flag_directory_d | F_directory_flag_close_execute_d | F_directory_flag_path_d; @@ -287,9 +258,7 @@ extern "C" { if (!id) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; int flag = F_directory_flag_directory_d | F_directory_flag_close_execute_d | F_directory_flag_path_d; @@ -329,9 +298,7 @@ extern "C" { if (depth_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; int result = 0; @@ -345,9 +312,7 @@ extern "C" { else { // Not recursively deleting and the path is requested to be preserved, so there is nothing to delete. - if (preserve) { - return F_none; - } + if (preserve) return F_none; result = remove(path.string); } @@ -383,9 +348,7 @@ extern "C" { if (depth_max < 0) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; int result = 0; @@ -399,9 +362,7 @@ extern "C" { else { // Not recursively deleting and the path is requested to be preserved, so there is nothing to delete. - if (preserve) { - return F_none; - } + if (preserve) return F_none; result = remove(path.string); } @@ -434,19 +395,14 @@ extern "C" { #ifndef _di_f_directory_touch_ f_status_t f_directory_touch(const f_string_static_t path, const mode_t mode) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct stat file_stat; memset(&file_stat, 0, sizeof(struct stat)); if (stat(path.string, &file_stat) < 0) { - if (errno == ENOENT) { - return private_f_directory_create(path, mode); - } - + if (errno == ENOENT) return private_f_directory_create(path, mode); if (errno == EACCES) return F_status_set_error(F_access_denied); if (errno == EFAULT) return F_status_set_error(F_buffer); if (errno == ELOOP) return F_status_set_error(F_loop); @@ -481,9 +437,7 @@ extern "C" { #ifndef _di_f_directory_touch_at_ f_status_t f_directory_touch_at(const int at_id, const f_string_static_t path, const mode_t mode, const int flag) { - if (!path.used) { - return F_data_not; - } + if (!path.used) return F_data_not; struct stat file_stat; diff --git a/level_0/f_directory/c/private-directory.c b/level_0/f_directory/c/private-directory.c index a007138..218650b 100644 --- a/level_0/f_directory/c/private-directory.c +++ b/level_0/f_directory/c/private-directory.c @@ -61,9 +61,7 @@ extern "C" { #if !defined(_di_f_directory_remove_) int private_f_directory_remove_recursively(const char * const path, const struct stat *file_stat, int type, struct FTW *entity) { - if (!entity->level) { - return 0; - } + if (!entity->level) return 0; return remove(path); } diff --git a/level_1/fl_print/c/print/common.h b/level_1/fl_print/c/print/common.h index ef39aad..fc965be 100644 --- a/level_1/fl_print/c/print/common.h +++ b/level_1/fl_print/c/print/common.h @@ -83,7 +83,13 @@ extern "C" { } #define macro_fl_print_t_initialize(to, verbosity, prefix, suffix, context, notable, set) { \ - to, verbosity, prefix, suffix, context, notable, set \ + to, \ + verbosity, \ + prefix, \ + suffix, \ + context, \ + notable, \ + set, \ } #define macro_fl_print_t_initialize_debug() macro_fl_print_t_initialize(macro_f_file_t_initialize2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, fl_print_debug_s, f_string_static_t_initialize, f_color_set_t_initialize, f_color_set_t_initialize, 0) diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index 908f5a3..f161ccc 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -827,7 +827,9 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { f_file_stream_lock(data->main->message.to); - fl_print_format("%r%[Building%] ", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important); + fake_print_line_first_unlocked(data->setting, data->main->message); + + fl_print_format("%[Building%] ", data->main->message.to, data->main->context.set.important, data->main->context.set.important); fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, data_build.setting.build_name, data->main->context.set.notable); fl_print_format("%[ using '%]", data->main->message.to, data->main->context.set.important, data->main->context.set.important); fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, data->setting->settings, data->main->context.set.notable); diff --git a/level_3/fake/c/main/build/library.c b/level_3/fake/c/main/build/library.c index 29f9834..ba2109e 100644 --- a/level_3/fake/c/main/build/library.c +++ b/level_3/fake/c/main/build/library.c @@ -1,5 +1,6 @@ #include "../fake.h" #include "../build.h" +#include "print.h" #ifdef __cplusplus extern "C" { @@ -22,9 +23,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling shared library.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_library_shared(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -326,10 +325,10 @@ extern "C" { *status = f_file_link(parameter_file_name_major, parameter_file_path); - if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) { - fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->message.to, parameter_file_path, parameter_file_name_major, f_string_eol_s); + if (F_status_is_error_not(*status)) { + fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_major); } - else if (F_status_is_error(*status)) { + else { if (F_status_set_fine(*status) == F_file_found) { fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); @@ -357,10 +356,10 @@ extern "C" { *status = f_file_link(parameter_file_name_minor, parameter_file_path); - if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) { - fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->message.to, parameter_file_path, parameter_file_name_minor, f_string_eol_s); + if (F_status_is_error_not(*status)) { + fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_minor); } - else if (F_status_is_error(*status)) { + else { fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), F_status_set_fine(*status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e); return 0; @@ -380,10 +379,10 @@ extern "C" { *status = f_file_link(parameter_file_name_micro, parameter_file_path); - if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) { - fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->message.to, parameter_file_path, parameter_file_name_micro, f_string_eol_s); + if (F_status_is_error_not(*status)) { + fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_micro); } - else if (F_status_is_error(*status)) { + else { if (F_status_set_fine(*status) == F_file_found) { fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); @@ -408,10 +407,10 @@ extern "C" { *status = f_file_link(parameter_file_name_nano, parameter_file_path); - if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) { - fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->message.to, parameter_file_path, parameter_file_name_nano, f_string_eol_s); + if (F_status_is_error_not(*status)) { + fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_nano); } - else if (F_status_is_error(*status)) { + else { if (F_status_set_fine(*status) == F_file_found) { fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); @@ -438,9 +437,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling static library.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_library_static(data->setting, data->main->message); f_string_dynamic_t file_name = f_string_dynamic_t_initialize; f_string_dynamic_t source_path = f_string_dynamic_t_initialize; diff --git a/level_3/fake/c/main/build/object.c b/level_3/fake/c/main/build/object.c index d2a58c4..d38e654 100644 --- a/level_3/fake/c/main/build/object.c +++ b/level_3/fake/c/main/build/object.c @@ -1,6 +1,7 @@ #include "../fake.h" #include "../build.h" #include "object.h" +#include "print.h" #ifdef __cplusplus extern "C" { @@ -23,9 +24,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling shared object.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_object_shared(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -94,9 +93,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling static object.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_object_static(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; diff --git a/level_3/fake/c/main/build/objects.c b/level_3/fake/c/main/build/objects.c index c1ea63f1..ee71d0f 100644 --- a/level_3/fake/c/main/build/objects.c +++ b/level_3/fake/c/main/build/objects.c @@ -1,6 +1,9 @@ #include "../fake.h" #include "../build.h" #include "objects.h" +#include "print.h" +#include "print-error.h" +#include "print-verbose.h" #ifdef __cplusplus extern "C" { @@ -12,9 +15,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_library.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling objects for static library.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_object_static_library(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -99,15 +100,7 @@ extern "C" { *status = f_directory_exists(destination_path); if (*status == F_false) { - if (data->main->error.verbosity > f_console_verbosity_quiet_e) { - f_file_stream_lock(data->main->error.to); - - fl_print_format("%r%[%QThe path '%]", data->main->error.to, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context); - fl_print_format("%[%Q%]", data->main->error.to, data->main->error.notable, destination_path, data->main->error.notable); - fl_print_format("%[' exists but is not a directory.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s); - - f_file_stream_unlock(data->main->error.to); - } + fake_build_print_error_exist_not_directory(data->setting, data->main->message, destination_path); *status = F_status_set_error(F_failure); @@ -119,13 +112,7 @@ extern "C" { if (F_status_is_error(*status)) { if (F_status_set_fine(*status) == F_file_found_not) { - f_file_stream_lock(data->main->error.to); - - fl_print_format("%r%[%QThe path '%]", data->main->error.to, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context); - fl_print_format("%[%Q%]", data->main->error.to, data->main->error.notable, destination_path, data->main->error.notable); - fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s); - - f_file_stream_unlock(data->main->error.to); + fake_build_print_error_cannot_create_due_to_parent(data->setting, data->main->message, destination_path); } else { fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_directory_create), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e); @@ -134,9 +121,7 @@ extern "C" { break; } - if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { - fll_print_format("Directory '%Q' created.%r", data->main->message.to, destination_path, f_string_eol_s); - } + fake_build_print_verbose_create_directory(data->setting, data->main->message, destination_path); } if (F_status_is_error(*status)) { diff --git a/level_3/fake/c/main/build/print-error.c b/level_3/fake/c/main/build/print-error.c new file mode 100644 index 0000000..5950a43 --- /dev/null +++ b/level_3/fake/c/main/build/print-error.c @@ -0,0 +1,32 @@ +#include "../fake.h" +#include "print-verbose.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_build_print_error_cannot_create_due_to_parent_ + f_status_t fake_build_print_error_cannot_create_due_to_parent(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { + + if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + + fake_print_context_wrapped_variable(setting, print, "The path ", path, " could not be created, a parent directory is invalid or does not exist"); + + return F_none; + } +#endif // _di_fake_build_print_error_cannot_create_due_to_parent_ + +#ifndef _di_fake_build_print_error_exist_not_directory_ + f_status_t fake_build_print_error_exist_not_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { + + if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + + fake_print_context_wrapped_variable(setting, print, "The path ", path, " exists but is not a directory"); + + return F_none; + } +#endif // _di_fake_build_print_error_exist_not_directory_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/main/build/print-error.h b/level_3/fake/c/main/build/print-error.h new file mode 100644 index 0000000..a1903fe --- /dev/null +++ b/level_3/fake/c/main/build/print-error.h @@ -0,0 +1,63 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + */ +#ifndef _PRIVATE_build_print_error_h +#define _PRIVATE_build_print_error_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print error message about not creating path due to a parent directory not existing or is otherwise invalid. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * @param path + * The path that cannot be created. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_context_wrapped_variable() + */ +#ifndef _di_fake_build_print_error_cannot_create_due_to_parent_ + extern f_status_t fake_build_print_error_cannot_create_due_to_parent(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); +#endif // _di_fake_build_print_error_cannot_create_due_to_parent_ + +/** + * Print error message about not creating path due to a parent directory not existing or is otherwise invalid. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * @param path + * The path that cannot be created. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_context_wrapped_variable() + */ +#ifndef _di_fake_build_print_error_exist_not_directory_ + extern f_status_t fake_build_print_error_exist_not_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); +#endif // _di_fake_build_print_error_exist_not_directory_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_build_print_error_h diff --git a/level_3/fake/c/main/build/print-verbose.c b/level_3/fake/c/main/build/print-verbose.c new file mode 100644 index 0000000..9228afe --- /dev/null +++ b/level_3/fake/c/main/build/print-verbose.c @@ -0,0 +1,21 @@ +#include "../fake.h" +#include "print-verbose.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_build_print_verbose_create_directory_ + f_status_t fake_build_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t directory) { + + if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + + fake_print_simple_variable(setting, print, "Created directory ", directory); + + return F_none; + } +#endif // _di_fake_build_print_verbose_create_directory_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/main/build/print-verbose.h b/level_3/fake/c/main/build/print-verbose.h new file mode 100644 index 0000000..1acdf10 --- /dev/null +++ b/level_3/fake/c/main/build/print-verbose.h @@ -0,0 +1,41 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + */ +#ifndef _PRIVATE_build_print_verbose_h +#define _PRIVATE_build_print_verbose_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print verbose message about creating a directory. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * @param directory + * The directory created. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_simple() + */ +#ifndef _di_fake_build_print_verbose_create_directory_ + extern f_status_t fake_build_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t directory); +#endif // _di_fake_build_print_verbose_create_directory_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_build_print_verbose_h diff --git a/level_3/fake/c/main/build/print.c b/level_3/fake/c/main/build/print.c index 9dcac6e..ad975ec 100644 --- a/level_3/fake/c/main/build/print.c +++ b/level_3/fake/c/main/build/print.c @@ -5,6 +5,105 @@ extern "C" { #endif +#ifndef _di_fake_build_print_compile_library_shared_ + f_status_t fake_build_print_compile_library_shared(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling shared library"); + + return F_none; + } +#endif // _di_fake_build_print_compile_library_shared_ + +#ifndef _di_fake_build_print_compile_library_static_ + f_status_t fake_build_print_compile_library_static(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling static library"); + + return F_none; + } +#endif // _di_fake_build_print_compile_library_static_ + +#ifndef _di_fake_build_print_compile_object_shared_ + f_status_t fake_build_print_compile_object_shared(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling shared object"); + + return F_none; + } +#endif // _di_fake_build_print_compile_object_shared_ + +#ifndef _di_fake_build_print_compile_object_static_ + f_status_t fake_build_print_compile_object_static(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling static object"); + + return F_none; + } +#endif // _di_fake_build_print_compile_object_static_ + +#ifndef _di_fake_build_print_compile_object_static_library_ + f_status_t fake_build_print_compile_object_static_library(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling objects for static library"); + + return F_none; + } +#endif // _di_fake_build_print_compile_object_static_library_ + +#ifndef _di_fake_build_print_compile_program_shared_ + f_status_t fake_build_print_compile_program_shared(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling shared program"); + + return F_none; + } +#endif // _di_fake_build_print_compile_program_shared_ + +#ifndef _di_fake_build_print_compile_program_static_ + f_status_t fake_build_print_compile_program_static(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Compiling static program"); + + return F_none; + } +#endif // _di_fake_build_print_compile_program_static_ + +#ifndef _di_fake_build_print_linked_file_ + f_status_t fake_build_print_linked_file(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t from, const f_string_static_t to) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_wrapped_variables(setting, print, "Linked file ", from, " to ", to, 0); + + return F_none; + } +#endif // _di_fake_build_print_linked_file_ + +#ifndef _di_fake_build_print_skeleton_build_base_ + f_status_t fake_build_print_skeleton_build_base(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_important_simple(setting, print, "Creating base build directories"); + + return F_none; + } +#endif // _di_fake_build_print_skeleton_build_base_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main/build/print.h b/level_3/fake/c/main/build/print.h index 779a1a0..11b2ce4 100644 --- a/level_3/fake/c/main/build/print.h +++ b/level_3/fake/c/main/build/print.h @@ -12,6 +12,190 @@ extern "C" { #endif +/** + * Print message when compiling a shared library. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_library_shared_ + extern f_status_t fake_build_print_compile_library_shared(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_library_shared_ + +/** + * Print message when compiling a static library. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_library_static_ + extern f_status_t fake_build_print_compile_library_static(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_library_static_ + +/** + * Print message when compiling a shared object. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_object_shared_ + extern f_status_t fake_build_print_compile_object_shared(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_object_shared_ + +/** + * Print message when compiling a static object. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_object_static_ + extern f_status_t fake_build_print_compile_object_static(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_object_static_ + +/** + * Print message when compiling a static object for a library. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_object_static_library_ + extern f_status_t fake_build_print_compile_object_static_library(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_object_static_library_ + +/** + * Print message when compiling a shared program. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_program_shared_ + extern f_status_t fake_build_print_compile_program_shared(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_program_shared_ + +/** + * Print message when compiling a static program. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_compile_program_static_ + extern f_status_t fake_build_print_compile_program_static(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_compile_program_static_ + +/** + * Print message when compiling a shared library. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * @param from + * The link source. + * @param to + * The link destination. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_wrapped_variables() + */ +#ifndef _di_fake_build_print_linked_file_ + extern f_status_t fake_build_print_linked_file(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t from, const f_string_static_t to); +#endif // _di_fake_build_print_linked_file_ + +/** + * Print message when building base skeleton directories. + * + * @param setting + * The main program settings. + * + * This does not alter setting.status. + * @param print + * Designates the how and where to print. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * @see fake_print_important_simple() + */ +#ifndef _di_fake_build_print_skeleton_build_base_ + extern f_status_t fake_build_print_skeleton_build_base(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_build_print_skeleton_build_base_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main/build/program.c b/level_3/fake/c/main/build/program.c index 7507fa1..11d2b4d 100644 --- a/level_3/fake/c/main/build/program.c +++ b/level_3/fake/c/main/build/program.c @@ -1,6 +1,7 @@ #include "../fake.h" #include "../build.h" #include "program.h" +#include "print.h" #ifdef __cplusplus extern "C" { @@ -23,9 +24,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling shared program.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_program_shared(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; @@ -117,9 +116,7 @@ extern "C" { if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Compiling static program.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_compile_program_static(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; diff --git a/level_3/fake/c/main/build/skeleton.c b/level_3/fake/c/main/build/skeleton.c index 54b1925..1927573 100644 --- a/level_3/fake/c/main/build/skeleton.c +++ b/level_3/fake/c/main/build/skeleton.c @@ -1,6 +1,8 @@ #include "../fake.h" #include "../build.h" #include "skeleton.h" +#include "print.h" +#include "print-verbose.h" #ifdef __cplusplus extern "C" { @@ -49,9 +51,7 @@ extern "C" { path_headers, }; - if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Creating base build directories.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); - } + fake_build_print_skeleton_build_base(data->setting, data->main->message); bool created = F_false; f_array_length_t j = 0; @@ -111,8 +111,8 @@ extern "C" { return; } - if (created && data->main->error.verbosity >= f_console_verbosity_verbose_e) { - fll_print_format("Created directory '%Q'.%r", data->main->message.to, directorys[i], f_string_eol_s); + if (created) { + fake_build_print_verbose_create_directory(data->setting, data->main->message, directorys[i]); } } // for diff --git a/level_3/fake/c/main/clean.c b/level_3/fake/c/main/clean.c index 5edac3d..7ffed96 100644 --- a/level_3/fake/c/main/clean.c +++ b/level_3/fake/c/main/clean.c @@ -11,7 +11,9 @@ extern "C" { if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { f_file_stream_lock(data->main->message.to); - fl_print_format("%r%[Deleting all files within build directory '%]", data->main->message.to, f_string_eol_s, data->main->context.set.important, data->main->context.set.important); + fake_print_line_first_unlocked(data->setting, data->main->message); + + fl_print_format("%[Deleting all files within build directory '%]", data->main->message.to, data->main->context.set.important, data->main->context.set.important); fl_print_format("%[%Q%]", data->main->message.to, data->main->context.set.notable, data->setting->build, data->main->context.set.notable); fl_print_format("%['.%]%r", data->main->message.to, data->main->context.set.important, data->main->context.set.important, f_string_eol_s); diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index 0ff025b..24491ff 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -284,7 +284,9 @@ extern "C" { if (data->main->error.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(data->main->error.to); - fl_print_format("%r%[%QFailed to find program '%]", data->main->error.to, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context); + fake_print_line_first_unlocked(data->setting, data->main->error); + + fl_print_format("%[%QFailed to find program '%]", data->main->error.to, data->main->error.context, data->main->error.prefix, data->main->error.context); fl_print_format("%[%Q%]", data->main->error.to, data->main->error.notable, program, data->main->error.notable); fl_print_format("%[' for executing.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s); @@ -513,7 +515,9 @@ extern "C" { else if (requireds[i] == F_true) { f_file_stream_lock(data->main->error.to); - fl_print_format("%r%[%QNo valid path for the (required) directory parameter '%]", data->main->error.to, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context); + fake_print_line_first_unlocked(data->setting, data->main->error); + + fl_print_format("%[%QNo valid path for the (required) directory parameter '%]", data->main->error.to, data->main->error.context, data->main->error.prefix, data->main->error.context); fl_print_format("%[%r%r%]", data->main->error.to, data->main->error.notable, f_console_symbol_long_normal_s, names[i], data->main->error.notable); fl_print_format("%[' was found.%]%r", data->main->error.to, data->main->error.context, data->main->error.context, f_string_eol_s); diff --git a/level_3/fake/c/main/fake/print.c b/level_3/fake/c/main/fake/print.c deleted file mode 100644 index 9dcac6e..0000000 --- a/level_3/fake/c/main/fake/print.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "../fake.h" -#include "print.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_3/fake/c/main/fake/print.h b/level_3/fake/c/main/fake/print.h deleted file mode 100644 index bf45bcc..0000000 --- a/level_3/fake/c/main/fake/print.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Featureless Make - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - * - * Provides the print functionality for the fake program. - * - * This is to be specifically included by the fake program sources and not anywhere else. - */ -#ifndef _fake_fake_print_h -#define _fake_fake_print_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _fake_fake_print_h diff --git a/level_3/fake/c/main/print.c b/level_3/fake/c/main/print.c index 446ed9c..10672b2 100644 --- a/level_3/fake/c/main/print.c +++ b/level_3/fake/c/main/print.c @@ -169,14 +169,19 @@ extern "C" { } #endif // _di_fake_print_help_ +#ifndef _di_fake_print_important_simple_ + void fake_print_important_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message) { + + const fl_print_t custom = macro_fl_print_t_initialize(print.to, print.verbosity, f_string_empty_s, f_string_empty_s, print.set->important, print.set->notable, print.set); + + fake_print_context_simple(setting, custom, message); + } +#endif // _di_fake_print_important_simple_ + #ifndef _di_fake_print_line_first_locked_ f_status_t fake_print_line_first_locked(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; - - if (F_status_is_error_not(setting->status)) { - if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; - } + if (!setting) return F_output_not; if (setting->flag & fake_main_flag_print_first_e) { fll_print_dynamic_raw(setting->line_first, print.to); @@ -194,11 +199,7 @@ extern "C" { #ifndef _di_fake_print_line_first_unlocked_ f_status_t fake_print_line_first_unlocked(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; - - if (F_status_is_error_not(setting->status)) { - if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; - } + if (!setting) return F_output_not; if (setting->flag & fake_main_flag_print_first_e) { fll_print_dynamic_raw(setting->line_first, print.to); @@ -216,11 +217,7 @@ extern "C" { #ifndef _di_fake_print_line_last_locked_ f_status_t fake_print_line_last_locked(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; - - if (F_status_is_error_not(setting->status)) { - if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; - } + if (!setting) return F_output_not; fll_print_dynamic_raw(setting->line_last, print.to); @@ -231,11 +228,7 @@ extern "C" { #ifndef _di_fake_print_line_last_unlocked_ f_status_t fake_print_line_last_unlocked(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; - - if (F_status_is_error_not(setting->status)) { - if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; - } + if (!setting) return F_output_not; f_print_dynamic_raw(setting->line_last, print.to); @@ -315,7 +308,7 @@ extern "C" { fake_print_line_first_unlocked(setting, print); - fll_print_format("%S '%[%Q%]'.%r", print.to, message, print.set->notable, variable, print.set->notable, f_string_eol_s); + fll_print_format("%S'%[%Q%]'.%r", print.to, message, print.set->notable, variable, print.set->notable, f_string_eol_s); f_file_stream_unlock(print.to); } @@ -334,6 +327,25 @@ extern "C" { } #endif // _di_fake_print_wrapped_variable_ +#ifndef _di_fake_print_wrapped_variables_ + void fake_print_wrapped_variables(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t first, const f_string_t between, const f_string_static_t second, const f_string_t after) { + + if (!setting) return; + + f_file_stream_lock(print.to); + + fake_print_line_first_unlocked(setting, print); + + fl_print_format("%S'", print.to, before); + fl_print_format("%[%Q%]", print.to, print.notable, first, print.notable); + fl_print_format("'%S'", print.to, between); + fl_print_format("%[%Q%]", print.to, print.notable, second, print.notable); + fl_print_format("'%S.%r", print.to, after, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_wrapped_variables_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main/print.h b/level_3/fake/c/main/print.h index cf19cca..8712eeb 100644 --- a/level_3/fake/c/main/print.h +++ b/level_3/fake/c/main/print.h @@ -15,8 +15,8 @@ extern "C" { /** * Print a simple context message with prefix and a single string message. * - * This is primarily used by numerous error print functions to reduce code. - * This is not used for any error print functions that has complex format structures. + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. * * @param setting * The main program settings. @@ -41,8 +41,8 @@ extern "C" { /** * Print a variable context message with a before string, an after string, and a string variable. * - * This is primarily used by numerous context print functions to reduce code. - * This is not used for any context print functions that has complex format structures. + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. * * @param setting * The main program settings. @@ -75,8 +75,8 @@ extern "C" { /** * Print a parameter context message with a before string, an after string, a string symbol, and a parameter name. * - * This is primarily used by numerous context print functions to reduce code. - * This is not used for any context print functions that has complex format structures. + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. * * @param setting * The main program settings. @@ -113,8 +113,8 @@ extern "C" { /** * Print a wrapped context message with a before string, an after string, and a string variable. * - * This is primarily used by numerous context print functions to reduce code. - * This is not used for any context print functions that has complex format structures. + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. * * @param setting * The main program settings. @@ -147,8 +147,8 @@ extern "C" { /** * Print a wrapped context message with a before string, a middle strng, an after string, and two string variables. * - * This is primarily used by numerous context print functions to reduce code. - * This is not used for any context print functions that has more format structures. + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. * * @param setting * The main program settings. @@ -200,6 +200,28 @@ extern "C" { #endif // _di_fake_print_help_ /** + * Print a simple message with context set to important but without prefix and suffix. + * + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. + * + * @param setting + * The main program settings. + * (Must be of type fake_setting_t.) + * + * This does not alter setting.status. + * @param print + * The output structure to print to. + * @param message + * The string to print. + * + * @see fake_print_context_simple() + */ +#ifndef _di_fake_print_important_simple_ + extern void fake_print_important_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message); +#endif // _di_fake_print_important_simple_ + +/** * Print first new line, unless verbosity says otherwise. * * This is generally either the first line in the program or the first line printed before an error message. @@ -399,6 +421,43 @@ extern "C" { extern void fake_print_wrapped_variable(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t variable, const f_string_t after); #endif // _di_fake_print_wrapped_variable_ +/** + * Print a wrapped message with a before string, a middle strng, an after string, and two string variables. + * + * This is primarily used by numerous print functions to reduce code. + * This is not used for any print functions that has complex format structures. + * + * @param setting + * The main program settings. + * (Must be of type fake_setting_t.) + * + * This does not alter setting.status. + * @param print + * The output structure to print to. + * @param before + * The string being printed before the variable. + * Likely should have a space added at the end of the string. + * @param first + * The string representing the first variable. + * @param between + * The string being printed before the variable. + * Likely should have a space added at the start and end of the string. + * @param second + * The string representing the second variable. + * @param after + * The string being printed after the variable. + * Likely should have a space added at the start of the string. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + * + * @see fake_print_line_first_unlocked() + */ +#ifndef _di_fake_print_wrapped_variables_ + extern void fake_print_wrapped_variables(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t first, const f_string_t between, const f_string_static_t second, const f_string_t after); +#endif // _di_fake_print_wrapped_variables_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fake/c/main/skeleton/print.c b/level_3/fake/c/main/skeleton/print.c deleted file mode 100644 index 9dcac6e..0000000 --- a/level_3/fake/c/main/skeleton/print.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "../fake.h" -#include "print.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif diff --git a/level_3/fake/c/main/skeleton/print.h b/level_3/fake/c/main/skeleton/print.h deleted file mode 100644 index 66c9d2c..0000000 --- a/level_3/fake/c/main/skeleton/print.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: Featureless Make - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - */ -#ifndef _PRIVATE_skeleton_print_h -#define _PRIVATE_skeleton_print_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _PRIVATE_skeleton_print_h diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index 564be7d..ebfcf37 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -28,22 +28,20 @@ build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library main/build.c main/clean.c main/common.c main/fake.c main/make.c main/print.c main/print-error.c main/print-warning.c main/skeleton.c -build_sources_library main/build/library.c main/build/load.c main/build/object.c main/build/objects.c main/build/print.c main/build/program.c main/build/skeleton.c +build_sources_library main/build/library.c main/build/load.c main/build/object.c main/build/objects.c main/build/print.c main/build/print-error.c main/build/print-verbose.c main/build/program.c main/build/skeleton.c build_sources_library main/clean/print.c build_sources_library main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c -build_sources_library main/fake/path_generate.c main/fake/print.c +build_sources_library main/fake/path_generate.c build_sources_library main/make/load_fakefile.c main/make/load_parameters.c main/make/operate_block.c main/make/operate.c main/make/operate_process.c main/make/operate_process_type.c main/make/operate_validate.c main/make/operate_validate_type.c main/make/print.c main/make/print-error.c main/make/print-verbose.c main/make/print-warning.c -build_sources_library main/skeleton/print.c build_sources_program main/main.c build_sources_headers main/build.h main/clean.h main/common.h main/fake.h main/make.h main/print.h main/print-error.h main/print-warning.h main/skeleton.h -build_sources_headers main/build/library.h main/build/load.h main/build/object.h main/build/objects.h main/build/print.h main/build/program.h main/build/skeleton.h +build_sources_headers main/build/library.h main/build/load.h main/build/object.h main/build/objects.h main/build/print.h main/build/print-error.h main/build/print-verbose.h main/build/program.h main/build/skeleton.h build_sources_headers main/clean/print.h build_sources_headers main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h -build_sources_headers main/fake/path_generate.h main/fake/print.h +build_sources_headers main/fake/path_generate.h build_sources_headers main/make/load_fakefile.h main/make/load_parameters.h main/make/operate_block.h main/make/operate.h main/make/operate_process.h main/make/operate_process_type.h main/make/operate_validate.h main/make/operate_validate_type.h main/make/print.h main/make/print-error.h main/make/print-verbose.h main/make/print-warning.h -build_sources_headers main/skeleton/print.h build_sources_documentation man -- 1.8.3.1