There is still more to go, but the printing changes is nearing the end.
Other minor clean ups in directory code.
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
#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);
}
#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);
}
#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;
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;
}
#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;
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;
}
#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;
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;
}
#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;
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;
}
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;
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;
}
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;
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;
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;
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);
}
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;
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);
}
#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);
#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;
#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);
}
}
#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)
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);
#include "../fake.h"
#include "../build.h"
+#include "print.h"
#ifdef __cplusplus
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;
*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);
*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;
*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);
*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);
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;
#include "../fake.h"
#include "../build.h"
#include "object.h"
+#include "print.h"
#ifdef __cplusplus
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;
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;
#include "../fake.h"
#include "../build.h"
#include "objects.h"
+#include "print.h"
+#include "print-error.h"
+#include "print-verbose.h"
#ifdef __cplusplus
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;
*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);
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);
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)) {
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
--- /dev/null
+#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
--- /dev/null
+/**
+ * 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
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
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
#include "../fake.h"
#include "../build.h"
#include "program.h"
+#include "print.h"
#ifdef __cplusplus
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;
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;
#include "../fake.h"
#include "../build.h"
#include "skeleton.h"
+#include "print.h"
+#include "print-verbose.h"
#ifdef __cplusplus
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;
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
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);
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);
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);
+++ /dev/null
-#include "../fake.h"
-#include "print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * 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
}
#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);
#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);
#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);
#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);
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);
}
}
#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
/**
* 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.
/**
* 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.
/**
* 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.
/**
* 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.
/**
* 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.
#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.
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
+++ /dev/null
-#include "../fake.h"
-#include "print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * 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
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