From: Kevin Day Date: Sun, 5 Mar 2023 03:52:34 +0000 (-0600) Subject: Progress: Continue program work, wrapping up side-track work and diving back into... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=8c9d09a5675297df980282fd656b3bc29c5209e5;p=fll Progress: Continue program work, wrapping up side-track work and diving back into fake. Update projects to have a print directory in a similar manner as a common directory. The previously completed and working programs should now be working again. The side-track changes that I set out to complete in regards to them is now complete. There is a huge amount of work ahead in regards to Featureless Make. Continue forward step by step. --- diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index 3f155ed..23e6131 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -67,11 +67,11 @@ build_sources_program fll/level_2/path.c 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/print-verbose.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/print-error.c program/fake/main/build/print-verbose.c program/fake/main/build/print-warning.c program/fake/main/build/program.c program/fake/main/build/skeleton.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/context.c program/fake/main/print/error.c program/fake/main/print/operation.c program/fake/main/print/warning.c program/fake/main/print/verbose.c program/fake/main/skeleton.c +build_sources_program program/fake/main/build/enumeration.c 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/compile.c program/fake/main/build/print/error.c program/fake/main/build/print/verbose.c program/fake/main/build/print/warning.c program/fake/main/build/program.c program/fake/main/build/skeleton.c program/fake/main/build/string.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 -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/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/main.c diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index cd542f9..418443e 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -1,31 +1,14 @@ #include "fake.h" -#include "build.h" -#include "build/library.h" -#include "build/load.h" -#include "build/object.h" -#include "build/objects.h" -#include "build/print.h" -#include "build/program.h" -#include "build/skeleton.h" -#include "print.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_fake_build_s_ -const f_string_static_t fake_build_documentation_files_s = macro_f_string_static_t_initialize(FAKE_build_documentation_files_s, 0, FAKE_build_documentation_files_s_length); - const f_string_static_t fake_build_header_files_s = macro_f_string_static_t_initialize(FAKE_build_header_files_s, 0, FAKE_build_header_files_s_length); - const f_string_static_t fake_build_header_files_shared_s = macro_f_string_static_t_initialize(FAKE_build_header_files_shared_s, 0, FAKE_build_header_files_shared_s_length); - const f_string_static_t fake_build_header_files_static_s = macro_f_string_static_t_initialize(FAKE_build_header_files_static_s, 0, FAKE_build_header_files_static_s_length); - const f_string_static_t fake_build_scripts_s = macro_f_string_static_t_initialize(FAKE_build_scripts_s, 0, FAKE_build_scripts_s_length); - const f_string_static_t fake_build_setting_files_s = macro_f_string_static_t_initialize(FAKE_build_setting_files_s, 0, FAKE_build_setting_files_s_length); -#endif // _di_fake_build_s_ - #ifndef _di_fake_build_arguments_standard_add_ - void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments, f_status_t *status) { + void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments) { - if (F_status_is_error(*status)) return; + if (!data || !data_build || !arguments) return; + if (F_status_is_error(data->setting.state.status)) return; { f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s.used + data->path_build_libraries_shared.used; @@ -59,15 +42,15 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], arguments); - if (F_status_is_error(*status)) break; + data->setting.state.status = fll_execute_arguments_add(values[i], arguments); + if (F_status_is_error(data->setting.state.status)) return; } // for } - if (data->setting->work.used && F_status_is_error_not(*status)) { + if (data->setting->work.used) { f_string_static_t buffer = f_string_static_t_initialize; - if (F_status_is_error_not(*status)) { + { buffer.used = fake_build_parameter_library_include_s.used + data->path_work_includes.used; f_char_t buffer_string[buffer.used + 1]; @@ -77,10 +60,11 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static memcpy(buffer_string, fake_build_parameter_library_include_s.string, sizeof(f_char_t) * fake_build_parameter_library_include_s.used); memcpy(buffer_string + fake_build_parameter_library_include_s.used, data->path_work_includes.string, sizeof(f_char_t) * data->path_work_includes.used); - *status = fll_execute_arguments_add(buffer, arguments); + data->setting.state.status = fll_execute_arguments_add(buffer, arguments); + if (F_status_is_error(data->setting.state.status)) return; } - if (data_build->setting.search_shared && (is_shared || !data_build->setting.search_exclusive) && F_status_is_error_not(*status)) { + if (data_build->setting.search_shared && (is_shared || !data_build->setting.search_exclusive)) { buffer.used = fake_build_parameter_library_link_path_s.used + data->path_work_libraries_shared.used; f_char_t buffer_string[buffer.used + 1]; @@ -90,10 +74,11 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used); memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, data->path_work_libraries_shared.string, sizeof(f_char_t) * data->path_work_libraries_shared.used); - *status = fll_execute_arguments_add(buffer, arguments); + data->setting.state.status = fll_execute_arguments_add(buffer, arguments); + if (F_status_is_error(data->setting.state.status)) return; } - if (data_build->setting.search_static && (!is_shared || !data_build->setting.search_exclusive) && F_status_is_error_not(*status)) { + if (data_build->setting.search_static && (!is_shared || !data_build->setting.search_exclusive)) { buffer.used = fake_build_parameter_library_link_path_s.used + data->path_work_libraries_static.used; f_char_t buffer_string[buffer.used + 1]; @@ -103,256 +88,87 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used); memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, data->path_work_libraries_static.string, sizeof(f_char_t) * data->path_work_libraries_static.used); - *status = fll_execute_arguments_add(buffer, arguments); - } - } - - f_array_length_t i = 0; - - for (i = 0; i < data_build->setting.build_libraries.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.build_libraries.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.build_libraries.array[i], arguments); - } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.build_libraries_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.build_libraries_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.build_libraries_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.build_libraries_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.build_libraries_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.build_libraries_static.array[i], arguments); - } // for - } - - for (i = 0; i < data_build->setting.flags.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags.array[i], arguments); - } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.flags_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.flags_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_static.array[i], arguments); - } // for - } - - if (type == fake_build_type_library_e) { - for (i = 0; i < data_build->setting.flags_library.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_library.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_library.array[i], arguments); - } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.flags_library_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_library_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_library_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.flags_library_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_library_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_library_static.array[i], arguments); - } // for - } - } - else if (type == fake_build_type_object_e) { - for (i = 0; i < data_build->setting.flags_object.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_object.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_object.array[i], arguments); - } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.flags_object_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_object_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_object_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.flags_object_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_object_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_object_static.array[i], arguments); - } // for - } - } - else { - for (i = 0; i < data_build->setting.flags_program.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_program.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_program.array[i], arguments); - } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.flags_program_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_program_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_program_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.flags_program_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.flags_program_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.flags_program_static.array[i], arguments); - } // for + data->setting.state.status = fll_execute_arguments_add(buffer, arguments); + if (F_status_is_error(data->setting.state.status)) return; } } - for (i = 0; i < data_build->setting.defines.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines.array[i], arguments); - } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.defines_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.defines_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_static.array[i], arguments); - } // for - } - - if (type == fake_build_type_library_e) { - for (i = 0; i < data_build->setting.defines_library.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_library.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_library.array[i], arguments); - } // for + { + f_string_statics_t * const strings[] = { + &data_build->setting.build_libraries, + (is_shared) ? &data_build->setting.build_libraries_shared : &data_build->setting.build_libraries_static, + &data_build->setting.flags, + (is_shared) ? &data_build->setting.flags_shared : &data_build->setting.flags_static, + (type == fake_build_type_library_e) + ? &data_build->setting.flags_library + : (type == fake_build_type_object_e) + ? &data_build->setting.flags_object + : &data_build->setting.flags_program, + (type == fake_build_type_library_e) + ? (is_shared) + ? &data_build->setting.flags_library_shared + : &data_build->setting.flags_library_static + : (type == fake_build_type_object_e) + ? (is_shared) + ? &data_build->setting.flags_object_shared + : &data_build->setting.flags_object_static + : (is_shared) + ? &data_build->setting.flags_program_shared + : &data_build->setting.flags_program_static, + &data_build->setting.defines, + (is_shared) ? &data_build->setting.defines_shared : &data_build->setting.defines_static, + &data_build->setting.defines_library, + (type == fake_build_type_library_e) + ? &data_build->setting.defines_library + : (type == fake_build_type_object_e) + ? &data_build->setting.defines_object + : &data_build->setting.defines_program, + (type == fake_build_type_library_e) + ? (is_shared) + ? &data_build->setting.defines_library_shared + : &data_build->setting.defines_library_static + : (type == fake_build_type_object_e) + ? (is_shared) + ? &data_build->setting.defines_object_shared + : &data_build->setting.defines_object_static + : (is_shared) + ? &data_build->setting.defines_program_shared + : &data_build->setting.defines_program_static, + &data->setting->defines, + }; - if (is_shared) { - for (i = 0; i < data_build->setting.defines_library_shared.used && F_status_is_error_not(*status); ++i) { + f_array_length_t i = 0; - if (!data_build->setting.defines_library_shared.array[i].used) continue; + for (uint8_t s = 0; s < 12; ++s) { - *status = fll_execute_arguments_add(data_build->setting.defines_library_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.defines_library_static.used && F_status_is_error_not(*status); ++i) { + for (i = 0; i < strings[s]->used; ++i) { - if (!data_build->setting.defines_library_static.array[i].used) continue; + if (!strings[s]->array[i].used) continue; - *status = fll_execute_arguments_add(data_build->setting.defines_library_static.array[i], arguments); + data->setting.state.status = fll_execute_arguments_add(strings[s]->array[i], arguments); + if (F_status_is_error(data->setting.state.status)) return; } // for - } - } - else if (type == fake_build_type_object_e) { - for (i = 0; i < data_build->setting.defines_object.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_object.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_object.array[i], arguments); } // for - - if (is_shared) { - for (i = 0; i < data_build->setting.defines_object_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_object_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_object_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.defines_object_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_object_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_object_static.array[i], arguments); - } // for - } } - else { - for (i = 0; i < data_build->setting.defines_program.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_program.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_program.array[i], arguments); - } // for - if (is_shared) { - for (i = 0; i < data_build->setting.defines_program_shared.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_program_shared.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_program_shared.array[i], arguments); - } // for - } - else { - for (i = 0; i < data_build->setting.defines_program_static.used && F_status_is_error_not(*status); ++i) { - - if (!data_build->setting.defines_program_static.array[i].used) continue; - - *status = fll_execute_arguments_add(data_build->setting.defines_program_static.array[i], arguments); - } // for - } - } - - for (i = 0; i < data->setting->defines.used && F_status_is_error_not(*status); ++i) { - - if (!data->setting->defines.array[i].used) continue; - - *status = fll_execute_arguments_add(data->setting->defines.array[i], arguments); - } // for + data->setting.state.status = F_none; } #endif // _di_fake_build_arguments_standard_add_ #ifndef _di_fake_build_copy_ - void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status) { + void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return; + if (!data) return; + if (F_status_is_error(data->setting.state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting.state.status == F_child) return; - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); - return; + return; + } } f_directory_statuss_t failures = f_directory_statuss_t_initialize; @@ -365,10 +181,10 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static fll_print_format("%r%[Copying %Q.%]%r", data->main->message.to, f_string_eol_s, data->main->context.set.important, label, data->main->context.set.important, f_string_eol_s); } - *status = f_string_dynamic_resize(source.used, &path_source); + data->setting.state.status = f_string_dynamic_resize(source.used, &path_source); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_resize)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_resize)); f_string_dynamic_resize(0, &path_source); @@ -392,7 +208,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static if (fll_program_standard_signal_received(data->main)) { fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); break; } @@ -404,71 +220,72 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static path_source.used = source.used; - *status = f_string_dynamic_append_nulless(files.array[i], &path_source); + data->setting.state.status = f_string_dynamic_append_nulless(files.array[i], &path_source); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_append_nulless)); break; } - *status = f_directory_is(path_source); + data->setting.state.status = f_directory_is(path_source); - if (*status == F_true) { + if (data->setting.state.status == F_true) { destination_directory.used = 0; - *status = f_string_dynamic_append_nulless(destination, &destination_directory); + data->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_directory); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_append_nulless)); break; } - *status = f_file_name_base(path_source, &destination_directory); + data->setting.state.status = f_file_name_base(path_source, &destination_directory); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_file_name_base)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_file_name_base)); break; } - *status = fl_directory_copy(path_source, destination_directory, mode, recurse); + data->setting.state.status = fl_directory_copy(path_source, destination_directory, mode, recurse); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting.state.status)) { if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { for (f_array_length_t j = 0; j < failures.used; ++j) { - fake_print_error_build_operation_file(data->setting, data->main->error, *status, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); + + fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } // for - if (F_status_set_fine(*status) != F_failure) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fl_directory_copy)); + if (F_status_set_fine(data->setting.state.status) != F_failure) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(fl_directory_copy)); } } else if (data->main->error.verbosity > f_console_verbosity_quiet_e) { - fake_print_error_build_operation_file(data->setting, data->main->error, *status, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); + fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } break; } } - else if (*status == F_false) { + else if (data->setting.state.status == F_false) { destination_file.used = 0; destination_directory.used = 0; - *status = f_string_dynamic_append_nulless(destination, &destination_file); + data->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_file); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_append_nulless)); break; } if (perserve_offset && perserve_offset < path_source.used) { - *status = f_string_dynamic_append_nulless(destination, &destination_directory); + data->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_directory); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -476,44 +293,44 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static buffer.string = path_source.string + perserve_offset; buffer.used = path_source.used - perserve_offset; - *status = f_file_name_directory(buffer, &destination_directory); + data->setting.state.status = f_file_name_directory(buffer, &destination_directory); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_file_name_directory)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_file_name_directory)); break; } - *status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d); + data->setting.state.status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d); - if (F_status_is_error(*status)) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, data->setting.state.status, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e); break; } - *status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file); + data->setting.state.status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_append)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_append)); break; } } else { - *status = f_file_name_base(path_source, &destination_file); + data->setting.state.status = f_file_name_base(path_source, &destination_file); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_file_name_base)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_file_name_base)); break; } } - *status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, f_file_stat_flag_reference_e); + data->setting.state.status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, f_file_stat_flag_reference_e); - if (F_status_is_error(*status)) { - fake_print_error_build_operation_file(data->setting, data->main->error, *status, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_build_operation_file(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); break; } @@ -522,13 +339,13 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static fll_print_format("Copied file '%Q' to '%Q'.%r", data->main->message.to, path_source, destination_file, f_string_eol_s); } } - else if (F_status_is_error(*status)) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e); + else if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e); break; } - *status = F_none; + data->setting.state.status = F_none; } // for macro_f_directory_statuss_t_delete_simple(failures); @@ -539,24 +356,23 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static f_string_dynamic_resize(0, &destination_file); f_string_dynamic_resize(0, &destination_directory); - if (F_status_is_error_not(*status)) { - fake_build_touch(data, file_stage, status); - } + fake_build_touch(data, file_stage); } #endif // _di_fake_build_copy_ #ifndef _di_fake_build_execute_process_script_ - int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) { + int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (!data) return; + if (F_status_is_error(data->setting.state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting.state.status == F_child) return data->main->child; if (!process_script.used) return 0; f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fll_execute_arguments_add(fake_other_operation_build_s, &arguments); + data->setting.state.status = fll_execute_arguments_add(fake_other_operation_build_s, &arguments); // Ensure console color mode is passed to the scripts so that they can also react to color mode. - if (F_status_is_error_not(*status) && data->main->context.mode != f_color_mode_none_e) { + if (F_status_is_error_not(data->setting.state.status) && data->main->context.mode != f_color_mode_none_e) { f_string_static_t argument = f_string_static_t_initialize; argument.used = f_console_symbol_short_inverse_s.used + f_console_standard_short_dark_s.used; @@ -576,11 +392,11 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_no_color_s.string, sizeof(f_char_t) * f_console_standard_short_no_color_s.used); } - *status = fll_execute_arguments_add(argument, &arguments); + data->setting.state.status = fll_execute_arguments_add(argument, &arguments); } // Ensure verbosity level is passed to the scripts so that they can also react to requested verbosity. - if (F_status_is_error_not(*status) && data->main->error.verbosity != f_console_verbosity_normal_e) { + if (F_status_is_error_not(data->setting.state.status) && data->main->error.verbosity != f_console_verbosity_normal_e) { f_string_static_t argument = f_string_static_t_initialize; argument.used = f_console_symbol_short_inverse_s.used + f_console_standard_short_quiet_s.used; @@ -603,11 +419,11 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static memcpy(argument_string + f_console_symbol_short_inverse_s.used, f_console_standard_short_debug_s.string, sizeof(f_char_t) * f_console_standard_short_debug_s.used); } - *status = fll_execute_arguments_add(argument, &arguments); + data->setting.state.status = fll_execute_arguments_add(argument, &arguments); } - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); f_string_dynamics_resize(0, &arguments); @@ -620,12 +436,12 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static if (data->setting->defines.used) { for (f_array_length_t i = 0; i < data->setting->defines.used; ++i) { - *status = f_string_dynamic_mash(f_string_space_s, data->setting->defines.array[i], &defines); - if (F_status_is_error(*status)) break; + data->setting.state.status = f_string_dynamic_mash(f_string_space_s, data->setting->defines.array[i], &defines); + if (F_status_is_error(data->setting.state.status)) break; } // for - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_mash)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_mash)); f_string_dynamic_resize(0, &defines); f_string_dynamics_resize(0, &arguments); @@ -670,12 +486,12 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static data->setting->work, }; - *status = fll_execute_arguments_add_parameter_set(prefixs, names, values, 9, &arguments); + data->setting.state.status = fll_execute_arguments_add_parameter_set(prefixs, names, values, 9, &arguments); f_string_dynamic_resize(0, &defines); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add_parameter_set)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add_parameter_set)); f_string_dynamics_resize(0, &arguments); @@ -686,15 +502,15 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static f_string_dynamic_t path = f_string_dynamic_t_initialize; if (process_script.string[0] != '/') { - *status = f_string_dynamic_append_nulless(data->path_data_build, &path); + data->setting.state.status = f_string_dynamic_append_nulless(data->path_data_build, &path); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(process_script, &path); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(process_script, &path); } - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_append_nulless)); f_string_dynamic_resize(0, &path); f_string_dynamics_resize(0, &arguments); @@ -711,26 +527,26 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(FL_execute_parameter_option_path_d, 0, &data_build->environment, &signals, 0); - *status = fll_execute_program(path, arguments, ¶meter, 0, (void *) &return_code); + data->setting.state.status = fll_execute_program(path, arguments, ¶meter, 0, (void *) &return_code); f_string_dynamics_resize(0, &arguments); - if (fll_program_standard_signal_received(data->main)) { + if (!((++data->main->signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(data->main)) { fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); } - else if (*status != F_child) { - if (F_status_is_error(*status)) { - if (F_status_set_fine(*status) == F_failure) { + else if (data->setting.state.status != F_child) { + if (F_status_is_error(data->setting.state.status)) { + if (F_status_set_fine(data->setting.state.status) == F_failure) { fake_print_error_failure_script(data->setting, data->main->error, path); } else { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_program)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_program)); } } else { - fake_build_touch(data, file_stage, status); + fake_build_touch(data, file_stage); } } @@ -741,18 +557,21 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static #endif // _di_fake_build_execute_process_script_ #ifndef _di_fake_build_get_file_name_without_extension_ - f_status_t fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name) { + void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name) { + + if (!data) return; name->used = 0; + data->setting.state.status = F_none; - if (!path.used) return F_none; + if (!path.used) return; - f_status_t status = f_file_name_base(path, name); + data->setting.state.status = f_file_name_base(path, name); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_file_name_base)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base)); - return status; + return; } for (f_array_length_t i = name->used; i > 0; --i) { @@ -764,14 +583,15 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static } } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_build_get_file_name_without_extension_ #ifndef _di_fake_build_objects_add_ - f_status_t fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) { + void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) { + + if (!data || !data_build || !path || !generic || !specific || !arguments) return; - f_status_t status = F_none; f_array_length_t i = 0; f_array_length_t j = 0; @@ -797,25 +617,32 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static memcpy(source_string, path->string, sizeof(f_char_t) * path->used); memcpy(source_string + path->used, sources[i]->array[j].string, sizeof(f_char_t) * sources[i]->array[j].used); - status = fll_execute_arguments_add(source, arguments); - if (F_status_is_error(status)) return status; + data->setting.state.status = fll_execute_arguments_add(source, arguments); + if (F_status_is_error(data->setting.state.status)) return; } // for } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_build_objects_add_ #ifndef _di_fake_build_operate_ - f_status_t fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe) { + void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe) { - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!data) return; + + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - return F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); + + return; + } } - f_status_t status = F_none; + data->setting.state.status = F_none; + f_mode_t mode = f_mode_t_initialize; fake_build_data_t data_build = fake_build_data_t_initialize; @@ -823,14 +650,12 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static macro_f_mode_t_set_default_umask(mode, data->main->umask); - fake_build_load_setting(data, build_arguments, process_pipe, &data_build.setting, &status); + fake_build_load_setting(data, build_arguments, process_pipe, &data_build.setting); - if (F_status_is_fine(status)) { + if (F_status_is_fine(data->setting.state.status)) { 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); - 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); @@ -871,24 +696,24 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static } } - fake_build_load_stage(data, build_arguments && build_arguments->array[0].used ? build_arguments->array[0] : f_string_empty_s, &stage, &status); + fake_build_load_stage(data, build_arguments && build_arguments->array[0].used ? build_arguments->array[0] : f_string_empty_s, &stage); - fake_build_load_environment(data, &data_build, &data_build.environment, &status); + fake_build_load_environment(data, &data_build, &data_build.environment); - fake_build_skeleton(data, &data_build, mode.directory, stage.file_skeleton, &status); + fake_build_skeleton(data, &data_build, mode.directory, stage.file_skeleton); - data->main->child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre, &status); + data->main->child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre); - fake_build_copy(data, mode, fake_build_documentation_files_s, data->path_data_documentation, data->path_build_documentation, data_build.setting.build_sources_documentation, stage.file_sources_documentation, 0, &status); + fake_build_copy(data, mode, fake_build_documentation_files_s, data->path_data_documentation, data->path_build_documentation, data_build.setting.build_sources_documentation, stage.file_sources_documentation, 0); - fake_build_copy(data, mode, fake_build_setting_files_s, data->path_data_settings, data->path_build_settings, data_build.setting.build_sources_setting, stage.file_sources_settings, 0, &status); + fake_build_copy(data, mode, fake_build_setting_files_s, data->path_data_settings, data->path_build_settings, data_build.setting.build_sources_setting, stage.file_sources_settings, 0); if (data_build.setting.build_language == fake_build_language_bash_e) { - fake_build_object_script(data, &data_build, mode, stage.file_object_script, &status); + fake_build_object_script(data, &data_build, mode, stage.file_object_script); - fake_build_library_script(data, &data_build, mode, stage.file_library_script, &status); + fake_build_library_script(data, &data_build, mode, stage.file_library_script); - fake_build_program_script(data, &data_build, mode, stage.file_program_script, &status); + fake_build_program_script(data, &data_build, mode, stage.file_program_script); if (data_build.setting.build_script) { f_string_static_t source = f_string_static_t_initialize; @@ -904,7 +729,7 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static source.used += fake_path_part_script_s.used; source.string[source.used] = 0; - fake_build_copy(data, mode, fake_build_scripts_s, source, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status); + fake_build_copy(data, mode, fake_build_scripts_s, source, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0); } } else { @@ -932,33 +757,33 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static path_headers_string[path_headers.used] = 0; - fake_build_copy(data, mode, fake_build_header_files_s, source, path_headers, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status); + fake_build_copy(data, mode, fake_build_header_files_s, source, path_headers, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0); if (data_build.setting.build_shared) { - fake_build_copy(data, mode, fake_build_header_files_shared_s, source, path_headers, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status); + fake_build_copy(data, mode, fake_build_header_files_shared_s, source, path_headers, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0); } if (data_build.setting.build_static) { - fake_build_copy(data, mode, fake_build_header_files_static_s, source, path_headers, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status); + fake_build_copy(data, mode, fake_build_header_files_static_s, source, path_headers, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0); } } if (data_build.setting.build_shared) { - data->main->child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared, &status); + data->main->child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared); - data->main->child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared, &status); + data->main->child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared); - data->main->child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared, &status); + data->main->child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared); } if (data_build.setting.build_static) { - data->main->child = fake_build_object_static(data, &data_build, mode, stage.file_object_static, &status); + data->main->child = fake_build_object_static(data, &data_build, mode, stage.file_object_static); - data->main->child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static, &status); + data->main->child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static); - data->main->child = fake_build_library_static(data, &data_build, mode, stage.file_library_static, &status); + data->main->child = fake_build_library_static(data, &data_build, mode, stage.file_library_static); - data->main->child = fake_build_program_static(data, &data_build, mode, stage.file_program_static, &status); + data->main->child = fake_build_program_static(data, &data_build, mode, stage.file_program_static); } if (data_build.setting.build_script) { @@ -975,16 +800,14 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static source.used += fake_path_part_script_s.used; source.string[source.used] = 0; - fake_build_copy(data, mode, fake_build_scripts_s, source, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status); + fake_build_copy(data, mode, fake_build_scripts_s, source, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0); } } - fake_build_execute_process_script(data, &data_build, data_build.setting.process_post, stage.file_process_post, &status); + fake_build_execute_process_script(data, &data_build, data_build.setting.process_post, stage.file_process_post); macro_fake_build_main_delete_simple(data_build); macro_fake_build_stage_t_delete_simple(stage); - - return status; } #endif // _di_fake_build_operate_ @@ -1123,26 +946,29 @@ const f_string_static_t fake_build_documentation_files_s = macro_f_string_static #endif // _di_fake_build_sources_object_add_ #ifndef _di_fake_build_touch_ - void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file, f_status_t *status) { + void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file) { - if (F_status_is_error(*status)) return; + if (!data) return; + if (F_status_is_error(data->setting.state.status)) return; - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); - return; + return; + } } f_mode_t mode = f_mode_t_initialize; macro_f_mode_t_set_default_umask(mode, data->main->umask); - *status = f_file_touch(file, mode.regular, F_false); + data->setting.state.status = f_file_touch(file, mode.regular, F_false); - if (F_status_is_error(*status)) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e); } } #endif // _di_fake_build_touch_ diff --git a/level_3/fake/c/main/build.h b/level_3/fake/c/main/build.h index f0599bf..d386c8f 100644 --- a/level_3/fake/c/main/build.h +++ b/level_3/fake/c/main/build.h @@ -9,57 +9,23 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_h -#define _PRIVATE_build_h +#ifndef _fake_build_h +#define _fake_build_h #ifdef __cplusplus extern "C" { #endif -#ifndef _di_fake_build_s_ - #define FAKE_build_documentation_files_s "documentation files" - #define FAKE_build_header_files_s "header files" - #define FAKE_build_header_files_shared_s "shared header files" - #define FAKE_build_header_files_static_s "static header files" - #define FAKE_build_scripts_s "scripts" - #define FAKE_build_setting_files_s "setting files" - - #define FAKE_build_documentation_files_s_length 19 - #define FAKE_build_header_files_s_length 12 - #define FAKE_build_header_files_shared_s_length 19 - #define FAKE_build_header_files_static_s_length 19 - #define FAKE_build_scripts_s_length 7 - #define FAKE_build_setting_files_s_length 13 - - extern const f_string_static_t fake_build_documentation_files_s; - extern const f_string_static_t fake_build_header_files_s; - extern const f_string_static_t fake_build_header_files_shared_s; - extern const f_string_static_t fake_build_header_files_static_s; - extern const f_string_static_t fake_build_scripts_s; - extern const f_string_static_t fake_build_setting_files_s; -#endif // _di_fake_build_s_ - -/** - * Build Types. - * - * fake_build_type_*: - * - library: A library build type. - * - object: An object build type. - * - program: A program build type. - */ -#ifndef _di_fake_build_type_e_ - enum { - fake_build_type_library_e = 1, - fake_build_type_object_e, - fake_build_type_program_e, - }; -#endif // _di_fake_build_type_e_ - /** * Add the standard arguments for building a library/program. * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: fll_execute_arguments_add() * @param data_build * The build data. * @param is_shared @@ -69,13 +35,11 @@ extern "C" { * A build type from the fake_build_type_* enumeration. * @param arguments * The arguments array to append to. - * @param status - * The return status. * * @see fll_execute_arguments_add() */ #ifndef _di_fake_build_arguments_standard_add_ - extern void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments, f_status_t *status); + extern void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments); #endif // _di_fake_build_arguments_standard_add_ /** @@ -83,6 +47,21 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: f_directory_is() + * Errors (with error bit) from: f_file_copy() + * Errors (with error bit) from: f_file_name_base() + * Errors (with error bit) from: f_file_name_directory() + * Errors (with error bit) from: f_string_append() + * Errors (with error bit) from: f_string_dynamic_append_nulless() + * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: fl_directory_create() + * Errors (with error bit) from: fl_directory_copy() * @param mode * The modes for each file type. * @param label @@ -104,16 +83,20 @@ extern "C" { * * Example: 'sources/c/level_0/fss.h' with a preseve of 10, would result in the path of 'level_0/fss.h' being preserved. * Whereas a perserve_offset of 0 would result in a path of 'fss.h' being used (the 'level_0/' directory is not preserved). - * @param status - * The return status. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see f_directory_is() + * @see f_file_copy() + * @see f_file_name_base() + * @see f_file_name_directory() + * @see f_string_append() + * @see f_string_dynamic_append_nulless() + * @see f_string_dynamic_resize() + * @see fl_directory_create() + * @see fl_directory_copy() + * @see fll_program_print_signal_received() */ #ifndef _di_fake_build_copy_ - extern void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status); + extern void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset); #endif // _di_fake_build_copy_ /** @@ -121,6 +104,16 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: f_string_dynamic_append_nulless() + * Errors (with error bit) from: f_string_dynamic_mash() + * Errors (with error bit) from: fll_execute_arguments_add() + * Errors (with error bit) from: fll_execute_arguments_add_parameter_set() + * Errors (with error bit) from: fll_execute_program() + * Errors (with error bit) from: fake_build_touch() * @param data_build * The build data. * @param process_script @@ -128,17 +121,20 @@ extern "C" { * This is expected to be either setting.process_pre or setting.process_post. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. + * + * @see f_string_dynamic_append_nulless() + * @see f_string_dynamic_mash() + * @see fll_execute_arguments_add() + * @see fll_execute_arguments_add_parameter_set() + * @see fll_execute_program() + * @see fake_build_touch() */ #ifndef _di_fake_build_execute_process_script_ - extern int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status); + extern int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage); #endif // _di_fake_build_execute_process_script_ /** @@ -146,18 +142,20 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: f_file_name_base() * @param path * The file path to get the file name from. * @param name * The processed filename. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see f_file_name_base() */ #ifndef _di_fake_build_get_file_name_without_extension_ - extern f_status_t fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name); + extern void fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name); #endif // _di_fake_build_get_file_name_without_extension_ /** @@ -165,6 +163,11 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: fll_execute_arguments_add() * @param data_build * The build data. * @param path @@ -176,10 +179,7 @@ extern "C" { * @param arguments * The execute arguments array being updated. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see fll_execute_arguments_add() */ #ifndef _di_fake_build_objects_add_ extern f_status_t fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments); @@ -190,6 +190,29 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: fll_program_print_signal_received() + * Errors (with error bit) from: fake_build_copy() + * Errors (with error bit) from: fake_build_execute_process_script() + * Errors (with error bit) from: fake_build_library_script() + * Errors (with error bit) from: fake_build_library_shared() + * Errors (with error bit) from: fake_build_library_static() + * Errors (with error bit) from: fake_build_load_environment() + * Errors (with error bit) from: fake_build_load_setting() + * Errors (with error bit) from: fake_build_load_stage() + * Errors (with error bit) from: fake_build_object_script() + * Errors (with error bit) from: fake_build_object_shared() + * Errors (with error bit) from: fake_build_object_static() + * Errors (with error bit) from: fake_build_objects_static() + * Errors (with error bit) from: fake_build_program_script() + * Errors (with error bit) from: fake_build_program_shared() + * Errors (with error bit) from: fake_build_program_static() + * Errors (with error bit) from: fake_build_skeleton() * @param setting_file * The name of the settings file to use. * If setting_file.used is 0, then the default or program parameter supplied file is used. @@ -205,13 +228,26 @@ extern "C" { * If TRUE, then use the program input pipe. * If FALSE, then ignore the program input pipe. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see fll_program_print_signal_received() + * @see fake_build_copy() + * @see fake_build_execute_process_script() + * @see fake_build_library_script() + * @see fake_build_library_shared() + * @see fake_build_library_static() + * @see fake_build_load_environment() + * @see fake_build_load_setting() + * @see fake_build_load_stage() + * @see fake_build_object_script() + * @see fake_build_object_shared() + * @see fake_build_object_static() + * @see fake_build_objects_static() + * @see fake_build_program_script() + * @see fake_build_program_shared() + * @see fake_build_program_static() + * @see fake_build_skeleton() */ #ifndef _di_fake_build_operate_ - extern f_status_t fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe); + extern void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe); #endif // _di_fake_build_operate_ /** @@ -318,4 +354,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_h +#endif // _fake_build_h diff --git a/level_3/iki_read/c/main/common-type.c b/level_3/fake/c/main/build/enumeration.c similarity index 79% rename from level_3/iki_read/c/main/common-type.c rename to level_3/fake/c/main/build/enumeration.c index 827d0df..a84a048 100644 --- a/level_3/iki_read/c/main/common-type.c +++ b/level_3/fake/c/main/build/enumeration.c @@ -1,4 +1,4 @@ -#include "iki_read.h" +#include "../fake.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/build/enumeration.h b/level_3/fake/c/main/build/enumeration.h new file mode 100644 index 0000000..d60f610 --- /dev/null +++ b/level_3/fake/c/main/build/enumeration.h @@ -0,0 +1,92 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides build enumeration functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fake_build_enumeration_h +#define _fake_build_enumeration_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The build language enumerations. + * + * fake_build_language_*_e: + * - bash: The GNU Bash language. + * - c: The C language. + * - cpp: The C++ language. + * - zsh: The ZSH language (Similar to and somewhat compatible with GNU Bash). + */ +#ifndef _di_fake_build_language_e_ + enum { + fake_build_language_none_e = 0, + fake_build_language_bash_e, + fake_build_language_c_e, + fake_build_language_cpp_e, + fake_build_language_zsh_e, + }; // enum +#endif // _di_fake_build_language_e_ + +/** + * Build settings flag enumeration. + * + * data_build_setting_flag_*: + * - none: No flag set. + * - has_environment: Designate that the "environment" is specified in the "settings" Section of the Fakefile. + */ +#ifndef _di_fake_build_setting_flag_e_ + enum { + data_build_setting_flag_none_e = 0x0, + data_build_setting_flag_has_environment_e = 0x1, + }; // enum +#endif // _di_fake_build_setting_flag_e_ + +/** + * The program version enumerations. + * + * fake_build_version_*_e: + * - none: No version number. + * - major: The major version number. + * - minor: The minor version number. + * - micro: The micro version number (sometimes called the patch version number). + * - nano: The nano version number. + */ +#ifndef _di_fake_build_version_e_ + enum { + fake_build_version_none_e = 0, + fake_build_version_major_e, + fake_build_version_minor_e, + fake_build_version_micro_e, + fake_build_version_nano_e, + }; // enum +#endif // _di_fake_build_version_e_ + +/** + * Build Types. + * + * fake_build_type_*: + * - library: A library build type. + * - object: An object build type. + * - program: A program build type. + */ +#ifndef _di_fake_build_type_e_ + enum { + fake_build_type_library_e = 1, + fake_build_type_object_e, + fake_build_type_program_e, + }; // enum +#endif // _di_fake_build_type_e_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fake_build_enumeration_h diff --git a/level_3/fake/c/main/build/library.c b/level_3/fake/c/main/build/library.c index ba2109e..5c265f7 100644 --- a/level_3/fake/c/main/build/library.c +++ b/level_3/fake/c/main/build/library.c @@ -1,6 +1,4 @@ #include "../fake.h" -#include "../build.h" -#include "print.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/build/library.h b/level_3/fake/c/main/build/library.h index 6c775d2..5d25b07 100644 --- a/level_3/fake/c/main/build/library.h +++ b/level_3/fake/c/main/build/library.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_library_h -#define _PRIVATE_build_library_h +#ifndef _fake_build_library_h +#define _fake_build_library_h #ifdef __cplusplus extern "C" { @@ -97,4 +97,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_library_h +#endif // _fake_build_library_h diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index 0a72664..b19f275 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -1,17 +1,14 @@ #include "../fake.h" -#include "../print.h" -#include "load.h" -#include "print-error.h" -#include "print-warning.h" #ifdef __cplusplus extern "C" { #endif #ifndef _di_fake_build_load_environment_ - void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment, f_status_t * const status) { + void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment) { - if (F_status_is_error(*status)) return; + if (!data || !data_build || !environment) return; + if (F_status_is_error(data->setting.state.status)) return; // Reset the environment. for (f_array_length_t i = 0; i < environment->used; ++i) { @@ -31,10 +28,10 @@ extern "C" { for (uint8_t i = 0; i < 2; ++i) { - *status = fl_environment_load_name(variables[i], environment); + data->setting.state.status = fl_environment_load_name(variables[i], environment); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fl_environment_load_name)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fl_environment_load_name)); return; } @@ -55,31 +52,37 @@ extern "C" { f_file_stream_unlock(data->main->error.to); } - *status = F_status_set_error(F_array_too_large); + data->setting.state.status = F_status_set_error(F_array_too_large); return; } } - *status = fl_environment_load_names(data_build->setting.environment, environment); + data->setting.state.status = fl_environment_load_names(data_build->setting.environment, environment); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fl_environment_load_names)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fl_environment_load_names)); + } + else { + data->setting.state.status = F_none; } } #endif // _di_fake_build_load_environment_ #ifndef _di_fake_build_load_setting_ - void fake_build_load_setting(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe, fake_build_setting_t * const setting, f_status_t * const status) { + void fake_build_load_setting(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe, fake_build_setting_t * const setting) { - if (F_status_is_error(*status)) return; + if (!data || !setting) return; + if (F_status_is_error(data->setting.state.status)) return; - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); - return; + return; + } } // Strip the build settings name from the build arguments to generate a list of modes. @@ -127,52 +130,42 @@ extern "C" { f_fss_contents_t contents = f_fss_contents_t_initialize; if (process_pipe) { - *status = fake_pipe_buffer(data, &buffer); + fake_pipe_buffer(data, &buffer); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting.state.status)) { buffer.used = 0; } else { - *status = f_string_dynamic_append_assure(f_string_eol_s, &buffer); + data->setting.state.status = f_string_dynamic_append_assure(f_string_eol_s, &buffer); } } - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting.state.status)) { if (build_arguments && build_arguments->used || !process_pipe || (data->setting->flag & fake_main_flag_operation_e)) { - *status = fake_file_buffer(data, path_file, process_pipe ? F_false : F_true, &buffer); + fake_file_buffer(data, path_file, process_pipe ? F_false : F_true, &buffer); } } - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting.state.status)) { f_string_range_t range = macro_f_string_range_t_initialize2(buffer.used); f_fss_delimits_t delimits = f_fss_delimits_t_initialize; - f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0); - *status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0); + // @todo make sure data->setting.state.custom = (void *) data->main; + //f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data->main, 0); + + data->setting.state.status = fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &data->setting.state); - if (F_status_is_error(*status)) { - fake_print_error_fss(data->setting, data->main->error, *status, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_fss(data->setting, data->main->error, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true); } else { - *status = f_fss_apply_delimit(state, delimits, &buffer); + data->setting.state.status = f_fss_apply_delimit(state, delimits, &buffer); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_fss_apply_delimit)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_fss_apply_delimit)); } else { - fake_build_load_setting_process( - data, - F_true, - path_file, - modes_custom.used - ? &modes_custom - : 0, - buffer, - objects, - contents, - setting, - status - ); + fake_build_load_setting_process(data, F_true, path_file, modes_custom.used ? &modes_custom : 0, buffer, objects, contents, setting); } } @@ -186,7 +179,7 @@ extern "C" { } // Error when required settings are not specified. - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting.state.status)) { bool failed = F_false; f_string_static_t * const settings[] = { @@ -207,13 +200,15 @@ extern "C" { } // for if (failed) { - *status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); return; } + + data->setting.state.status = F_none; } - fake_build_load_setting_override(data, setting, status); + fake_build_load_setting_override(data, setting); } #endif // _di_fake_build_load_setting_ @@ -222,12 +217,14 @@ extern "C" { if (F_status_is_error(*status) && buffer.used) return; - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + *status = F_status_set_error(F_interrupt); - return; + return; + } } bool error_printed = F_false; @@ -1334,16 +1331,19 @@ extern "C" { #endif // _di_fake_build_load_setting_override_ #ifndef _di_fake_build_load_stage_ - void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage, f_status_t * const status) { + void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage) { - if (F_status_is_error(*status)) return; + if (!data || !stage) return; + if (F_status_is_error(data->setting.state.status)) return; - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); - return; + return; + } } const f_string_static_t names[] = { @@ -1386,51 +1386,53 @@ extern "C" { &stage->file_sources_settings, }; - *status = F_none; + data->setting.state.status = F_none; f_string_dynamic_t settings_file_base = f_string_dynamic_t_initialize; if (settings_file.used) { - *status = f_file_name_base(settings_file, &settings_file_base); + data->setting.state.status = f_file_name_base(settings_file, &settings_file_base); } else { - *status = f_file_name_base(data->file_data_build_settings, &settings_file_base); + data->setting.state.status = f_file_name_base(data->file_data_build_settings, &settings_file_base); } - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_file_name_base)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base)); return; } for (uint8_t i = 0; i < fake_build_stage_total_d; ++i) { - *status = f_string_dynamic_append_nulless(data->path_build_stage, values[i]); + data->setting.state.status = f_string_dynamic_append_nulless(data->path_build_stage, values[i]); - if (F_status_is_error_not(*status) && data->setting->process.used) { - *status = f_string_dynamic_append_nulless(data->setting->process, values[i]); + if (F_status_is_error_not(data->setting.state.status) && data->setting->process.used) { + data->setting.state.status = f_string_dynamic_append_nulless(data->setting->process, values[i]); + } - *status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(names[i], values[i]); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(names[i], values[i]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(settings_file_base, values[i]); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(settings_file_base, values[i]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(fake_build_stage_built_s, values[i]); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_built_s, values[i]); } - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } diff --git a/level_3/fake/c/main/build/load.h b/level_3/fake/c/main/build/load.h index 0cea8ca..7d8aea7 100644 --- a/level_3/fake/c/main/build/load.h +++ b/level_3/fake/c/main/build/load.h @@ -9,18 +9,53 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_load_h -#define _PRIVATE_build_load_h +#ifndef _fake_build_load_h +#define _fake_build_load_h #ifdef __cplusplus extern "C" { #endif /** + * Load the environment used when executing commands. + * + * @param data + * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * F_array_too_large (with error bit) if the environment variable values are too large. + * + * Errors (with error bit) from: fl_environment_load_name(). + * Errors (with error bit) from: fl_environment_load_names(). + * @param data_build + * The build data. + * @param environment + * The environment data. + * + * @see fl_environment_load_name() + * @see fl_environment_load_names() + */ +#ifndef _di_fake_build_load_environment_ + extern void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment); +#endif // _di_fake_build_load_environment_ + +/** * Find the build setting file, load it, validate it, and process it. * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: f_fss_apply_delimit(). + * Errors (with error bit) from: f_string_dynamic_append_assure(). + * Errors (with error bit) from: fll_fss_extended_read(). + * Errors (with error bit) from: fake_build_load_setting_process(). * @param build_arguments * (optional) A set of custom arguments to pass to the build. * The first argument represents the name of the settings file to use. @@ -35,16 +70,15 @@ extern "C" { * @param setting * All build related setting data from the build setting file are loaded into this. * These setting will have any specified mode property applied. - * @param status - * The return status. - * - * @return - * F_none on success. * - * Status codes (with error bit) are returned on any problem. + * @see f_fss_apply_delimit() + * @see f_string_dynamic_append_assure() + * @see fll_fss_extended_read() + * @see fll_program_print_signal_received() + * @see fake_build_load_setting_process() */ #ifndef _di_fake_build_load_setting_ - extern void fake_build_load_setting(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe, fake_build_setting_t * const setting, f_status_t * const status); + extern void fake_build_load_setting(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe, fake_build_setting_t * const setting); #endif // _di_fake_build_load_setting_ /** @@ -59,8 +93,6 @@ extern "C" { * @param setting * All build related setting data from the build setting file are loaded into this. * These setting will have any specified mode property applied. - * @param status - * The return status. * * @return * F_none on success. @@ -68,7 +100,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_build_load_setting_override_ - extern void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting, f_status_t * const status); + extern void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting); #endif // _di_fake_build_load_setting_override_ /** @@ -93,8 +125,6 @@ extern "C" { * @param setting * All build related setting data from the build setting file are loaded into this. * These setting will have any specified mode property applied. - * @param status - * The return status. * * @return * F_none on success. @@ -110,53 +140,37 @@ extern "C" { * @see fll_fss_snatch_apart() */ #ifndef _di_fake_build_load_setting_process_ - extern void fake_build_load_setting_process(fake_data_t * const data, const bool checks, const f_string_static_t path_file, const f_string_statics_t * const modes_custom, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting, f_status_t * const status); + extern void fake_build_load_setting_process(fake_data_t * const data, const bool checks, const f_string_static_t path_file, const f_string_statics_t * const modes_custom, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting); #endif // _di_fake_build_load_setting_process_ /** - * Load the environment used when executing commands. + * Load the stage file paths. * * @param data * The program data. - * @param data_build - * The build data. - * @param environment - * The environment data. - * @param status - * The return status. * - * @return - * F_none on success. + * This alters data.setting.state.status: + * F_none on success. * - * Status codes (with error bit) are returned on any problem. - */ -#ifndef _di_fake_build_load_environment_ - extern void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment, f_status_t * const status); -#endif // _di_fake_build_load_environment_ - -/** - * Load the stage file paths. + * F_interrupt (with error bit) on interrupt signal received. * - * @param data - * The program data. + * Errors (with error bit) from: f_file_name_base(). + * Errors (with error bit) from: f_string_dynamic_append_nulless(). * @param settings_file * The path to the settings file. * @param stage * All stage file paths. - * @param status - * The return status. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see f_file_name_base() + * @see f_string_dynamic_append_nulless() + * @see fll_program_print_signal_received() */ #ifndef _di_fake_build_load_stage_ - extern void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage, f_status_t * const status); + extern void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage); #endif // _di_fake_build_load_stage_ #ifdef __cplusplus } // extern "C" #endif -#endif // _PRIVATE_build_load_h +#endif // _fake_build_load_h diff --git a/level_3/fake/c/main/build/object.c b/level_3/fake/c/main/build/object.c index d38e654..4ff746d 100644 --- a/level_3/fake/c/main/build/object.c +++ b/level_3/fake/c/main/build/object.c @@ -1,7 +1,4 @@ #include "../fake.h" -#include "../build.h" -#include "object.h" -#include "print.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/build/object.h b/level_3/fake/c/main/build/object.h index 569a968..db5dade 100644 --- a/level_3/fake/c/main/build/object.h +++ b/level_3/fake/c/main/build/object.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_object_h -#define _PRIVATE_build_object_h +#ifndef _fake_build_object_h +#define _fake_build_object_h #ifdef __cplusplus extern "C" { @@ -103,4 +103,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_object_h +#endif // _fake_build_object_h diff --git a/level_3/fake/c/main/build/objects.c b/level_3/fake/c/main/build/objects.c index ee71d0f..c448108 100644 --- a/level_3/fake/c/main/build/objects.c +++ b/level_3/fake/c/main/build/objects.c @@ -1,9 +1,4 @@ #include "../fake.h" -#include "../build.h" -#include "objects.h" -#include "print.h" -#include "print-error.h" -#include "print-verbose.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/build/objects.h b/level_3/fake/c/main/build/objects.h index a7eb6bd..83baced 100644 --- a/level_3/fake/c/main/build/objects.h +++ b/level_3/fake/c/main/build/objects.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_objects_h -#define _PRIVATE_build_objects_h +#ifndef _fake_build_objects_h +#define _fake_build_objects_h #ifdef __cplusplus extern "C" { @@ -47,4 +47,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_objects_h +#endif // _fake_build_objects_h diff --git a/level_3/fake/c/main/build/print.c b/level_3/fake/c/main/build/print.c index ad975ec..8be2a24 100644 --- a/level_3/fake/c/main/build/print.c +++ b/level_3/fake/c/main/build/print.c @@ -1,91 +1,14 @@ #include "../fake.h" -#include "print.h" #ifdef __cplusplus 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; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; fake_print_wrapped_variables(setting, print, "Linked file ", from, " to ", to, 0); @@ -96,9 +19,10 @@ extern "C" { #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; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; - fake_print_important_simple(setting, print, "Creating base build directories"); + fake_print_context_important_simple(setting, print, "Creating base build directories"); return F_none; } diff --git a/level_3/fake/c/main/build/print.h b/level_3/fake/c/main/build/print.h index bb166dd..fc79de6 100644 --- a/level_3/fake/c/main/build/print.h +++ b/level_3/fake/c/main/build/print.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_print_h -#define _PRIVATE_build_print_h +#ifndef _fake_build_print_h +#define _fake_build_print_h #ifdef __cplusplus extern "C" { @@ -25,146 +25,6 @@ extern "C" { * This does not alter setting.state.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.state.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.state.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.state.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.state.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.state.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.state.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.state.status. - * @param print - * Designates the how and where to print. * @param from * The link source. * @param to @@ -174,6 +34,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_wrapped_variables() */ #ifndef _di_fake_build_print_linked_file_ @@ -194,7 +56,9 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * - * @see fake_print_important_simple() + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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); @@ -204,4 +68,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_print_h +#endif // _fake_build_print_h diff --git a/level_3/fake/c/main/build/print/compile.c b/level_3/fake/c/main/build/print/compile.c new file mode 100644 index 0000000..d502df6 --- /dev/null +++ b/level_3/fake/c/main/build/print/compile.c @@ -0,0 +1,93 @@ +#include "../../fake.h" + +#ifdef __cplusplus +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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_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) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + fake_print_context_important_simple(setting, print, "Compiling static program"); + + return F_none; + } +#endif // _di_fake_build_print_compile_program_static_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/main/build/print/compile.h b/level_3/fake/c/main/build/print/compile.h new file mode 100644 index 0000000..af4663d --- /dev/null +++ b/level_3/fake/c/main/build/print/compile.h @@ -0,0 +1,177 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides build print compile functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fake_build_print_compile_h +#define _fake_build_print_compile_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print message when compiling a shared library. + * + * @param setting + * The main program settings. + * + * This does not alter setting.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_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_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fake_build_print_compile_h diff --git a/level_3/fake/c/main/build/print-error.c b/level_3/fake/c/main/build/print/error.c similarity index 76% rename from level_3/fake/c/main/build/print-error.c rename to level_3/fake/c/main/build/print/error.c index 3174c80..05c35a0 100644 --- a/level_3/fake/c/main/build/print-error.c +++ b/level_3/fake/c/main/build/print/error.c @@ -1,5 +1,4 @@ -#include "../fake.h" -#include "print-verbose.h" +#include "../../fake.h" #ifdef __cplusplus extern "C" { @@ -8,7 +7,8 @@ extern "C" { #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; + if (!setting) return F_status_set_error(F_output_not); + if (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"); @@ -19,7 +19,8 @@ extern "C" { #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; + if (!setting) return F_status_set_error(F_output_not); + if (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"); @@ -30,7 +31,8 @@ extern "C" { #ifndef _di_fake_build_print_error_missing_required_setting_ f_status_t fake_build_print_error_missing_required_setting(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variables(setting, print, "The setting ", name, " is required but is not specified in the settings file ", path, 0); @@ -41,6 +43,9 @@ extern "C" { #ifndef _di_fake_build_print_error_mode_invalid_ f_status_t fake_build_print_error_mode_invalid(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t mode, const f_string_static_t path) { + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; + fake_print_context_wrapped_variables(setting, print, "The specified mode ", mode, " in the settings file ", path, " is not a valid mode"); return F_none; @@ -50,7 +55,8 @@ extern "C" { #ifndef _di_fake_build_print_error_setting_too_long_ f_status_t fake_build_print_error_setting_too_long(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; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "A setting in the settings file ", path, " is too long"); diff --git a/level_3/fake/c/main/build/print-error.h b/level_3/fake/c/main/build/print/error.h similarity index 91% rename from level_3/fake/c/main/build/print-error.h rename to level_3/fake/c/main/build/print/error.h index 0162701..12344b0 100644 --- a/level_3/fake/c/main/build/print-error.h +++ b/level_3/fake/c/main/build/print/error.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_print_error_h -#define _PRIVATE_build_print_error_h +#ifndef _fake_build_print_error_h +#define _fake_build_print_error_h #ifdef __cplusplus extern "C" { @@ -32,6 +32,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_build_print_error_cannot_create_due_to_parent_ @@ -54,6 +56,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_build_print_error_exist_not_directory_ @@ -78,6 +82,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variables() */ #ifndef _di_fake_build_print_error_missing_required_setting_ @@ -103,6 +109,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variables() */ #ifndef _di_fake_build_print_error_mode_invalid_ @@ -125,6 +133,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variables() */ #ifndef _di_fake_build_print_error_setting_too_long_ @@ -135,4 +145,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_print_error_h +#endif // _fake_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 similarity index 73% rename from level_3/fake/c/main/build/print-verbose.c rename to level_3/fake/c/main/build/print/verbose.c index 9228afe..7040616 100644 --- a/level_3/fake/c/main/build/print-verbose.c +++ b/level_3/fake/c/main/build/print/verbose.c @@ -1,5 +1,4 @@ -#include "../fake.h" -#include "print-verbose.h" +#include "../../fake.h" #ifdef __cplusplus extern "C" { @@ -8,7 +7,8 @@ extern "C" { #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; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_simple_variable(setting, print, "Created directory ", directory); diff --git a/level_3/fake/c/main/build/print-verbose.h b/level_3/fake/c/main/build/print/verbose.h similarity index 85% rename from level_3/fake/c/main/build/print-verbose.h rename to level_3/fake/c/main/build/print/verbose.h index da2266c..25856a6 100644 --- a/level_3/fake/c/main/build/print-verbose.h +++ b/level_3/fake/c/main/build/print/verbose.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_print_verbose_h -#define _PRIVATE_build_print_verbose_h +#ifndef _fake_build_print_verbose_h +#define _fake_build_print_verbose_h #ifdef __cplusplus extern "C" { @@ -32,6 +32,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_simple_variable() */ #ifndef _di_fake_build_print_verbose_create_directory_ @@ -42,4 +44,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_print_verbose_h +#endif // _fake_build_print_verbose_h diff --git a/level_3/fake/c/main/build/print-warning.c b/level_3/fake/c/main/build/print/warning.c similarity index 95% rename from level_3/fake/c/main/build/print-warning.c rename to level_3/fake/c/main/build/print/warning.c index ca7ea5c..d3d089d 100644 --- a/level_3/fake/c/main/build/print-warning.c +++ b/level_3/fake/c/main/build/print/warning.c @@ -1,5 +1,4 @@ -#include "../fake.h" -#include "print-warning.h" +#include "../../fake.h" #ifdef __cplusplus extern "C" { @@ -23,8 +22,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%r%[%QThe setting '%]", print.to, f_string_eol_s, print.context, print.prefix, print.context); fl_print_format("%[%r%]", print.to, print.notable, name, print.notable); fl_print_format("%[' in the file '%]", print.to, print.context, print.context); @@ -61,8 +58,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe setting '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable); fl_print_format("%[' in the file '%]", print.to, print.context, print.context); @@ -90,8 +85,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe setting '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, name, print.notable); fl_print_format("%[' in the file '%]", print.to, print.context, print.context); @@ -109,12 +102,11 @@ extern "C" { #ifndef _di_fake_build_print_warning_setting_version_may_only_be_ f_status_t fake_build_print_warning_setting_version_may_only_be(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_string_static_t path, const f_string_static_t default_to) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe setting '%]", print.to, f_string_eol_s, print.context, print.prefix, print.context); fl_print_format("%[%r%]", print.to, print.notable, name, print.notable); fl_print_format("%[' in the file '%]", print.to, print.context, print.context); diff --git a/level_3/fake/c/main/build/print-warning.h b/level_3/fake/c/main/build/print/warning.h similarity index 95% rename from level_3/fake/c/main/build/print-warning.h rename to level_3/fake/c/main/build/print/warning.h index 18e06da..97e0203 100644 --- a/level_3/fake/c/main/build/print-warning.h +++ b/level_3/fake/c/main/build/print/warning.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_print_warning_h -#define _PRIVATE_build_print_warning_h +#ifndef _fake_build_print_warning_h +#define _fake_build_print_warning_h #ifdef __cplusplus extern "C" { @@ -42,6 +42,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_parameters() */ #ifndef _di_fake_build_print_warning_parameters_contradict_ @@ -68,11 +70,11 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_build_print_warning_setting_boolean_may_only_be_ extern f_status_t fake_build_print_warning_setting_boolean_may_only_be(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_string_static_t path, const f_string_static_t default_to); @@ -98,6 +100,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_parameters() */ #ifndef _di_fake_build_print_error_settings_both_cannot_using_language_ @@ -127,8 +131,6 @@ extern "C" { * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_build_print_warning_setting_language_may_only_be_ extern f_status_t fake_build_print_warning_setting_language_may_only_be(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_string_static_t path, const f_string_static_t default_to); @@ -183,8 +185,6 @@ extern "C" { * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_build_print_warning_setting_version_may_only_be_ extern f_status_t fake_build_print_warning_setting_version_may_only_be(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name, const f_string_static_t path, const f_string_static_t default_to); @@ -194,4 +194,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_print_warning_h +#endif // _fake_build_print_warning_h diff --git a/level_3/fake/c/main/build/program.c b/level_3/fake/c/main/build/program.c index 11d2b4d..cb9ec32 100644 --- a/level_3/fake/c/main/build/program.c +++ b/level_3/fake/c/main/build/program.c @@ -1,7 +1,4 @@ #include "../fake.h" -#include "../build.h" -#include "program.h" -#include "print.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/build/program.h b/level_3/fake/c/main/build/program.h index c38310c..536e4d9 100644 --- a/level_3/fake/c/main/build/program.h +++ b/level_3/fake/c/main/build/program.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_program_h -#define _PRIVATE_build_program_h +#ifndef _fake_build_program_h +#define _fake_build_program_h #ifdef __cplusplus extern "C" { @@ -98,4 +98,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_build_program_h +#endif // _fake_build_program_h diff --git a/level_3/fake/c/main/build/skeleton.c b/level_3/fake/c/main/build/skeleton.c index 1927573..2ff78a1 100644 --- a/level_3/fake/c/main/build/skeleton.c +++ b/level_3/fake/c/main/build/skeleton.c @@ -1,17 +1,15 @@ #include "../fake.h" -#include "../build.h" -#include "skeleton.h" -#include "print.h" -#include "print-verbose.h" #ifdef __cplusplus extern "C" { #endif #ifndef _di_fake_build_skeleton_ - void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return; + if (!data || !data_build) return; + if (F_status_is_error(data->setting.state.status) || data->setting.state.status == F_child) return; + if (f_file_exists(file_stage, F_true) == F_true) return; f_string_static_t path_headers = f_string_static_t_initialize; path_headers.used = data->path_build_includes.used + data_build->setting.path_headers.used; @@ -66,47 +64,57 @@ extern "C" { if (f_path_separator_s.used && directorys[i].string[j] != f_path_separator_s.string[0]) continue; + if (!((++main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + + data->setting.state.status = F_status_set_error(F_interrupt); + + return; + } + } + directorys[i].string[j] = 0; // @fixme this is an error because static strings might be in use. - *status = f_directory_exists(directorys[i]); + data->setting.state.status = f_directory_exists(directorys[i]); - if (F_status_is_error(*status) || *status == F_false) { + if (F_status_is_error(data->setting.state.status) || data->setting.state.status == F_false) { directorys[i].string[j] = f_path_separator_s.string[0]; break; } - if (*status == F_file_found_not) { - *status = f_directory_create(directorys[i], mode); + if (data->setting.state.status == F_file_found_not) { + data->setting.state.status = f_directory_create(directorys[i], mode); created = F_true; } directorys[i].string[j] = f_path_separator_s.string[0]; - if (F_status_is_error(*status)) break; + if (F_status_is_error(data->setting.state.status)) break; } // for - if (F_status_is_fine(*status) && directorys[i].used && f_path_separator_s.used && directorys[i].string[directorys[i].used - 1] != f_path_separator_s.string[0]) { - *status = f_directory_exists(directorys[i]); + if (F_status_is_fine(data->setting.state.status) && directorys[i].used && f_path_separator_s.used && directorys[i].string[directorys[i].used - 1] != f_path_separator_s.string[0]) { + data->setting.state.status = f_directory_exists(directorys[i]); - if (F_status_is_error_not(*status)) { - if (*status == F_false) { - *status = f_directory_create(directorys[i], mode); + if (F_status_is_error_not(data->setting.state.status)) { + if (data->setting.state.status == F_false) { + data->setting.state.status = f_directory_create(directorys[i], mode); created = F_true; } } } - if (F_status_is_error(*status)) { - if (F_status_set_fine(*status) == F_file_found) { - *status = F_none; + if (F_status_is_error(data->setting.state.status)) { + if (F_status_set_fine(data->setting.state.status) == F_file_found) { + data->setting.state.status = F_none; continue; } - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_directory_create), directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_create), directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e); return; } @@ -116,7 +124,11 @@ extern "C" { } } // for - fake_build_touch(data, file_stage, status); + fake_build_touch(data, file_stage); + + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = F_none; + } } #endif // _di_fake_build_skeleton_ diff --git a/level_3/fake/c/main/build/skeleton.h b/level_3/fake/c/main/build/skeleton.h index 572cb81..68b47d7 100644 --- a/level_3/fake/c/main/build/skeleton.h +++ b/level_3/fake/c/main/build/skeleton.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_build_skeleton_h -#define _PRIVATE_build_skeleton_h +#ifndef _fake_build_skeleton_h +#define _fake_build_skeleton_h #ifdef __cplusplus extern "C" { @@ -21,26 +21,33 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: f_directory_create(). + * Errors (with error bit) from: f_directory_exists(). + * Errors (with error bit) from: fake_build_touch(). * @param data_build * The build data. * @param mode * The directory mode. * @param file_stage * The specific stage file path. - * @param status - * The return status. - * - * @return - * F_none on success. * - * Status codes (with error bit) are returned on any problem. + * @see f_directory_create() + * @see f_directory_exists() + * @see fll_program_standard_signal_received() + * @see fake_build_touch() */ #ifndef _di_fake_build_skeleton_ - extern void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_skeleton_ #ifdef __cplusplus } // extern "C" #endif -#endif // _PRIVATE_build_skeleton_h +#endif // _fake_build_skeleton_h diff --git a/level_3/fake/c/main/build/string.c b/level_3/fake/c/main/build/string.c new file mode 100644 index 0000000..d6b8170 --- /dev/null +++ b/level_3/fake/c/main/build/string.c @@ -0,0 +1,170 @@ +#include "../fake.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_build_s_ +const f_string_static_t fake_build_documentation_files_s = macro_f_string_static_t_initialize(FAKE_build_documentation_files_s, 0, FAKE_build_documentation_files_s_length); + const f_string_static_t fake_build_header_files_s = macro_f_string_static_t_initialize(FAKE_build_header_files_s, 0, FAKE_build_header_files_s_length); + const f_string_static_t fake_build_header_files_shared_s = macro_f_string_static_t_initialize(FAKE_build_header_files_shared_s, 0, FAKE_build_header_files_shared_s_length); + const f_string_static_t fake_build_header_files_static_s = macro_f_string_static_t_initialize(FAKE_build_header_files_static_s, 0, FAKE_build_header_files_static_s_length); + const f_string_static_t fake_build_scripts_s = macro_f_string_static_t_initialize(FAKE_build_scripts_s, 0, FAKE_build_scripts_s_length); + const f_string_static_t fake_build_setting_files_s = macro_f_string_static_t_initialize(FAKE_build_setting_files_s, 0, FAKE_build_setting_files_s_length); +#endif // _di_fake_build_s_ + +#ifndef _di_fake_build_language_s_ + const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length); + const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length); + const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length); + const f_string_static_t fake_build_language_zsh_s = macro_f_string_static_t_initialize(FAKE_build_language_zsh_s, 0, FAKE_build_language_zsh_s_length); +#endif // _di_fake_build_language_s_ + +#ifndef _di_fake_build_version_s_ + const f_string_static_t fake_build_version_major_s = macro_f_string_static_t_initialize(FAKE_build_version_major_s, 0, FAKE_build_version_major_s_length); + const f_string_static_t fake_build_version_minor_s = macro_f_string_static_t_initialize(FAKE_build_version_minor_s, 0, FAKE_build_version_minor_s_length); + const f_string_static_t fake_build_version_micro_s = macro_f_string_static_t_initialize(FAKE_build_version_micro_s, 0, FAKE_build_version_micro_s_length); + const f_string_static_t fake_build_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_version_nano_s, 0, FAKE_build_version_nano_s_length); +#endif // _di_fake_build_version_s_ + +#ifndef _di_fake_build_setting_t_ + const f_string_static_t fake_build_setting_default_ar_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_ar_s, 0, FAKE_build_setting_default_ar_s_length); + const f_string_static_t fake_build_setting_default_gcc_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_gcc_s, 0, FAKE_build_setting_default_gcc_s_length); + const f_string_static_t fake_build_setting_default_version_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_version_s, 0, FAKE_build_setting_default_version_s_length); + const f_string_static_t fake_build_setting_default_version_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_version_prefix_s, 0, FAKE_build_setting_default_version_prefix_s_length); + const f_string_static_t fake_build_setting_default_yes_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_yes_s, 0, FAKE_build_setting_default_yes_s_length); + + const f_string_static_t fake_build_setting_name_build_compiler_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_compiler_s, 0, FAKE_build_setting_name_build_compiler_s_length); + const f_string_static_t fake_build_setting_name_build_indexer_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_indexer_s, 0, FAKE_build_setting_name_build_indexer_s_length); + const f_string_static_t fake_build_setting_name_build_indexer_arguments_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_indexer_arguments_s, 0, FAKE_build_setting_name_build_indexer_arguments_s_length); + const f_string_static_t fake_build_setting_name_build_language_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_language_s, 0, FAKE_build_setting_name_build_language_s_length); + const f_string_static_t fake_build_setting_name_build_libraries_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_s, 0, FAKE_build_setting_name_build_libraries_s_length); + const f_string_static_t fake_build_setting_name_build_libraries_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_shared_s, 0, FAKE_build_setting_name_build_libraries_shared_s_length); + const f_string_static_t fake_build_setting_name_build_libraries_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_static_s, 0, FAKE_build_setting_name_build_libraries_static_s_length); + const f_string_static_t fake_build_setting_name_build_name_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_name_s, 0, FAKE_build_setting_name_build_name_s_length); + const f_string_static_t fake_build_setting_name_build_objects_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_library_s, 0, FAKE_build_setting_name_build_objects_library_s_length); + const f_string_static_t fake_build_setting_name_build_objects_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_library_shared_s, 0, FAKE_build_setting_name_build_objects_library_shared_s_length); + const f_string_static_t fake_build_setting_name_build_objects_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_library_static_s, 0, FAKE_build_setting_name_build_objects_library_static_s_length); + const f_string_static_t fake_build_setting_name_build_objects_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_program_s, 0, FAKE_build_setting_name_build_objects_program_s_length); + const f_string_static_t fake_build_setting_name_build_objects_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_program_shared_s, 0, FAKE_build_setting_name_build_objects_program_shared_s_length); + const f_string_static_t fake_build_setting_name_build_objects_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_program_static_s, 0, FAKE_build_setting_name_build_objects_program_static_s_length); + const f_string_static_t fake_build_setting_name_build_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_script_s, 0, FAKE_build_setting_name_build_script_s_length); + const f_string_static_t fake_build_setting_name_build_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_shared_s, 0, FAKE_build_setting_name_build_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_documentation_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_documentation_s, 0, FAKE_build_setting_name_build_sources_documentation_s_length); + const f_string_static_t fake_build_setting_name_build_sources_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_s, 0, FAKE_build_setting_name_build_sources_headers_s_length); + const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_shared_s, 0, FAKE_build_setting_name_build_sources_headers_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_headers_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_static_s, 0, FAKE_build_setting_name_build_sources_headers_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_s, 0, FAKE_build_setting_name_build_sources_library_s_length); + const f_string_static_t fake_build_setting_name_build_sources_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_shared_s, 0, FAKE_build_setting_name_build_sources_library_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_static_s, 0, FAKE_build_setting_name_build_sources_library_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_object_s, 0, FAKE_build_setting_name_build_sources_object_s_length); + const f_string_static_t fake_build_setting_name_build_sources_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_object_shared_s, 0, FAKE_build_setting_name_build_sources_object_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_object_static_s, 0, FAKE_build_setting_name_build_sources_object_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_s, 0, FAKE_build_setting_name_build_sources_program_s_length); + const f_string_static_t fake_build_setting_name_build_sources_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_shared_s, 0, FAKE_build_setting_name_build_sources_program_shared_s_length); + const f_string_static_t fake_build_setting_name_build_sources_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_static_s, 0, FAKE_build_setting_name_build_sources_program_static_s_length); + const f_string_static_t fake_build_setting_name_build_sources_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_script_s, 0, FAKE_build_setting_name_build_sources_script_s_length); + const f_string_static_t fake_build_setting_name_build_sources_setting_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_setting_s, 0, FAKE_build_setting_name_build_sources_setting_s_length); + const f_string_static_t fake_build_setting_name_build_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_static_s, 0, FAKE_build_setting_name_build_static_s_length); + const f_string_static_t fake_build_setting_name_defines_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_s, 0, FAKE_build_setting_name_defines_s_length); + const f_string_static_t fake_build_setting_name_defines_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_s, 0, FAKE_build_setting_name_defines_library_s_length); + const f_string_static_t fake_build_setting_name_defines_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_shared_s, 0, FAKE_build_setting_name_defines_library_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_static_s, 0, FAKE_build_setting_name_defines_library_static_s_length); + const f_string_static_t fake_build_setting_name_defines_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_object_s, 0, FAKE_build_setting_name_defines_object_s_length); + const f_string_static_t fake_build_setting_name_defines_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_object_shared_s, 0, FAKE_build_setting_name_defines_object_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_object_static_s, 0, FAKE_build_setting_name_defines_object_static_s_length); + const f_string_static_t fake_build_setting_name_defines_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_s, 0, FAKE_build_setting_name_defines_program_s_length); + const f_string_static_t fake_build_setting_name_defines_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_shared_s, 0, FAKE_build_setting_name_defines_program_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_static_s, 0, FAKE_build_setting_name_defines_program_static_s_length); + const f_string_static_t fake_build_setting_name_defines_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_shared_s, 0, FAKE_build_setting_name_defines_shared_s_length); + const f_string_static_t fake_build_setting_name_defines_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_static_s, 0, FAKE_build_setting_name_defines_static_s_length); + const f_string_static_t fake_build_setting_name_environment_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_environment_s, 0, FAKE_build_setting_name_environment_s_length); + const f_string_static_t fake_build_setting_name_flags_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_s, 0, FAKE_build_setting_name_flags_s_length); + const f_string_static_t fake_build_setting_name_flags_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_s, 0, FAKE_build_setting_name_flags_library_s_length); + const f_string_static_t fake_build_setting_name_flags_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_shared_s, 0, FAKE_build_setting_name_flags_library_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_static_s, 0, FAKE_build_setting_name_flags_library_static_s_length); + const f_string_static_t fake_build_setting_name_flags_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_object_s, 0, FAKE_build_setting_name_flags_object_s_length); + const f_string_static_t fake_build_setting_name_flags_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_object_shared_s, 0, FAKE_build_setting_name_flags_object_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_object_static_s, 0, FAKE_build_setting_name_flags_object_static_s_length); + const f_string_static_t fake_build_setting_name_flags_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_s, 0, FAKE_build_setting_name_flags_program_s_length); + const f_string_static_t fake_build_setting_name_flags_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_shared_s, 0, FAKE_build_setting_name_flags_program_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_static_s, 0, FAKE_build_setting_name_flags_program_static_s_length); + const f_string_static_t fake_build_setting_name_flags_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_shared_s, 0, FAKE_build_setting_name_flags_shared_s_length); + const f_string_static_t fake_build_setting_name_flags_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_static_s, 0, FAKE_build_setting_name_flags_static_s_length); + const f_string_static_t fake_build_setting_name_has_path_standard_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_has_path_standard_s, 0, FAKE_build_setting_name_has_path_standard_s_length); + const f_string_static_t fake_build_setting_name_modes_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_modes_s, 0, FAKE_build_setting_name_modes_s_length); + const f_string_static_t fake_build_setting_name_modes_default_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_modes_default_s, 0, FAKE_build_setting_name_modes_default_s_length); + const f_string_static_t fake_build_setting_name_path_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_headers_s, 0, FAKE_build_setting_name_path_headers_s_length); + const f_string_static_t fake_build_setting_name_path_language_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_language_s, 0, FAKE_build_setting_name_path_language_s_length); + const f_string_static_t fake_build_setting_name_path_library_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_script_s, 0, FAKE_build_setting_name_path_library_script_s_length); + const f_string_static_t fake_build_setting_name_path_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_shared_s, 0, FAKE_build_setting_name_path_library_shared_s_length); + const f_string_static_t fake_build_setting_name_path_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_static_s, 0, FAKE_build_setting_name_path_library_static_s_length); + const f_string_static_t fake_build_setting_name_path_object_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_object_script_s, 0, FAKE_build_setting_name_path_object_script_s_length); + const f_string_static_t fake_build_setting_name_path_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_object_shared_s, 0, FAKE_build_setting_name_path_object_shared_s_length); + const f_string_static_t fake_build_setting_name_path_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_object_static_s, 0, FAKE_build_setting_name_path_object_static_s_length); + const f_string_static_t fake_build_setting_name_path_program_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_script_s, 0, FAKE_build_setting_name_path_program_script_s_length); + const f_string_static_t fake_build_setting_name_path_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_shared_s, 0, FAKE_build_setting_name_path_program_shared_s_length); + const f_string_static_t fake_build_setting_name_path_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_static_s, 0, FAKE_build_setting_name_path_program_static_s_length); + const f_string_static_t fake_build_setting_name_path_sources_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_sources_s, 0, FAKE_build_setting_name_path_sources_s_length); + const f_string_static_t fake_build_setting_name_path_sources_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_sources_object_s, 0, FAKE_build_setting_name_path_sources_object_s_length); + const f_string_static_t fake_build_setting_name_preserve_path_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_preserve_path_headers_s, 0, FAKE_build_setting_name_preserve_path_headers_s_length); + const f_string_static_t fake_build_setting_name_process_post_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_process_post_s, 0, FAKE_build_setting_name_process_post_s_length); + const f_string_static_t fake_build_setting_name_process_pre_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_process_pre_s, 0, FAKE_build_setting_name_process_pre_s_length); + const f_string_static_t fake_build_setting_name_search_exclusive_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_exclusive_s, 0, FAKE_build_setting_name_search_exclusive_s_length); + const f_string_static_t fake_build_setting_name_search_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_shared_s, 0, FAKE_build_setting_name_search_shared_s_length); + const f_string_static_t fake_build_setting_name_search_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_static_s, 0, FAKE_build_setting_name_search_static_s_length); + const f_string_static_t fake_build_setting_name_version_file_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_file_s, 0, FAKE_build_setting_name_version_file_s_length); + const f_string_static_t fake_build_setting_name_version_major_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_major_s, 0, FAKE_build_setting_name_version_major_s_length); + const f_string_static_t fake_build_setting_name_version_major_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_major_prefix_s, 0, FAKE_build_setting_name_version_major_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_micro_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_micro_s, 0, FAKE_build_setting_name_version_micro_s_length); + const f_string_static_t fake_build_setting_name_version_micro_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_micro_prefix_s, 0, FAKE_build_setting_name_version_micro_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_minor_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_minor_s, 0, FAKE_build_setting_name_version_minor_s_length); + const f_string_static_t fake_build_setting_name_version_minor_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_minor_prefix_s, 0, FAKE_build_setting_name_version_minor_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_nano_s, 0, FAKE_build_setting_name_version_nano_s_length); + const f_string_static_t fake_build_setting_name_version_nano_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_nano_prefix_s, 0, FAKE_build_setting_name_version_nano_prefix_s_length); + const f_string_static_t fake_build_setting_name_version_target_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_target_s, 0, FAKE_build_setting_name_version_target_s_length); +#endif // _di_fake_build_setting_t_ + +#ifndef _di_fake_build_stage_t_ + const f_string_static_t fake_build_stage_built_s = macro_f_string_static_t_initialize(FAKE_build_stage_built_s, 0, FAKE_build_stage_built_s_length); + const f_string_static_t fake_build_stage_library_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_library_script_s, 0, FAKE_build_stage_library_script_s_length); + const f_string_static_t fake_build_stage_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_library_shared_s, 0, FAKE_build_stage_library_shared_s_length); + const f_string_static_t fake_build_stage_library_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_library_static_s, 0, FAKE_build_stage_library_static_s_length); + const f_string_static_t fake_build_stage_object_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_object_script_s, 0, FAKE_build_stage_object_script_s_length); + const f_string_static_t fake_build_stage_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_object_shared_s, 0, FAKE_build_stage_object_shared_s_length); + const f_string_static_t fake_build_stage_object_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_object_static_s, 0, FAKE_build_stage_object_static_s_length); + const f_string_static_t fake_build_stage_objects_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_objects_static_s, 0, FAKE_build_stage_objects_static_s_length); + const f_string_static_t fake_build_stage_process_post_s = macro_f_string_static_t_initialize(FAKE_build_stage_process_post_s, 0, FAKE_build_stage_process_post_s_length); + const f_string_static_t fake_build_stage_process_pre_s = macro_f_string_static_t_initialize(FAKE_build_stage_process_pre_s, 0, FAKE_build_stage_process_pre_s_length); + const f_string_static_t fake_build_stage_program_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_program_script_s, 0, FAKE_build_stage_program_script_s_length); + const f_string_static_t fake_build_stage_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_program_shared_s, 0, FAKE_build_stage_program_shared_s_length); + const f_string_static_t fake_build_stage_program_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_program_static_s, 0, FAKE_build_stage_program_static_s_length); + const f_string_static_t fake_build_stage_separate_s = macro_f_string_static_t_initialize(FAKE_build_stage_separate_s, 0, FAKE_build_stage_separate_s_length); + const f_string_static_t fake_build_stage_skeleton_s = macro_f_string_static_t_initialize(FAKE_build_stage_skeleton_s, 0, FAKE_build_stage_skeleton_s_length); + const f_string_static_t fake_build_stage_sources_documentation_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_documentation_s, 0, FAKE_build_stage_sources_documentation_s_length); + const f_string_static_t fake_build_stage_sources_headers_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_headers_s, 0, FAKE_build_stage_sources_headers_s_length); + const f_string_static_t fake_build_stage_sources_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_script_s, 0, FAKE_build_stage_sources_script_s_length); + const f_string_static_t fake_build_stage_sources_settings_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_settings_s, 0, FAKE_build_stage_sources_settings_s_length); +#endif // _di_fake_build_stage_t_ + +#ifndef _di_fake_build_parameter_ + const f_string_static_t fake_build_parameter_library_include_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_include_s, 0, FAKE_build_parameter_library_include_s_length); + const f_string_static_t fake_build_parameter_library_link_file_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_link_file_s, 0, FAKE_build_parameter_library_link_file_s_length); + const f_string_static_t fake_build_parameter_library_link_path_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_link_path_s, 0, FAKE_build_parameter_library_link_path_s_length); + const f_string_static_t fake_build_parameter_library_name_prefix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_prefix_s, 0, FAKE_build_parameter_library_name_prefix_s_length); + const f_string_static_t fake_build_parameter_library_name_suffix_shared_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_suffix_shared_s, 0, FAKE_build_parameter_library_name_suffix_shared_s_length); + const f_string_static_t fake_build_parameter_library_name_suffix_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_suffix_static_s, 0, FAKE_build_parameter_library_name_suffix_static_s_length); + const f_string_static_t fake_build_parameter_library_output_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_output_s, 0, FAKE_build_parameter_library_output_s_length); + const f_string_static_t fake_build_parameter_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_shared_s, 0, FAKE_build_parameter_library_shared_s_length); + const f_string_static_t fake_build_parameter_library_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_static_s, 0, FAKE_build_parameter_library_static_s_length); + const f_string_static_t fake_build_parameter_library_shared_prefix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_shared_prefix_s, 0, FAKE_build_parameter_library_shared_prefix_s_length); + + const f_string_static_t fake_build_parameter_object_compile_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_compile_s, 0, FAKE_build_parameter_object_compile_s_length); + const f_string_static_t fake_build_parameter_object_name_suffix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_name_suffix_s, 0, FAKE_build_parameter_object_name_suffix_s_length); + const f_string_static_t fake_build_parameter_object_output_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_output_s, 0, FAKE_build_parameter_object_output_s_length); + const f_string_static_t fake_build_parameter_object_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_static_s, 0, FAKE_build_parameter_object_static_s_length); +#endif // _di_fake_build_parameter_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/main/build/string.h b/level_3/fake/c/main/build/string.h new file mode 100644 index 0000000..a4666f0 --- /dev/null +++ b/level_3/fake/c/main/build/string.h @@ -0,0 +1,494 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides build string functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fake_build_string_h +#define _fake_build_string_h + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_build_s_ + #define FAKE_build_documentation_files_s "documentation files" + #define FAKE_build_header_files_s "header files" + #define FAKE_build_header_files_shared_s "shared header files" + #define FAKE_build_header_files_static_s "static header files" + #define FAKE_build_scripts_s "scripts" + #define FAKE_build_setting_files_s "setting files" + + #define FAKE_build_documentation_files_s_length 19 + #define FAKE_build_header_files_s_length 12 + #define FAKE_build_header_files_shared_s_length 19 + #define FAKE_build_header_files_static_s_length 19 + #define FAKE_build_scripts_s_length 7 + #define FAKE_build_setting_files_s_length 13 + + extern const f_string_static_t fake_build_documentation_files_s; + extern const f_string_static_t fake_build_header_files_s; + extern const f_string_static_t fake_build_header_files_shared_s; + extern const f_string_static_t fake_build_header_files_static_s; + extern const f_string_static_t fake_build_scripts_s; + extern const f_string_static_t fake_build_setting_files_s; +#endif // _di_fake_build_s_ + +/** + * The build language strings. + * + * fake_build_language_*_s: + * - bash: The GNU Bash language. + * - c: The C language. + * - cpp: The C++ language. + * - zsh: The ZSH language (Similar to and somewhat compatible with GNU Bash). + */ +#ifndef _di_fake_build_language_s_ + #define FAKE_build_language_bash_s "bash" + #define FAKE_build_language_c_s "c" + #define FAKE_build_language_cpp_s "c++" + #define FAKE_build_language_zsh_s "zsh" + + #define FAKE_build_language_bash_s_length 4 + #define FAKE_build_language_c_s_length 1 + #define FAKE_build_language_cpp_s_length 3 + #define FAKE_build_language_zsh_s_length 3 + + extern const f_string_static_t fake_build_language_bash_s; + extern const f_string_static_t fake_build_language_c_s; + extern const f_string_static_t fake_build_language_cpp_s; + extern const f_string_static_t fake_build_language_zsh_s; +#endif // _di_fake_build_language_s_ + +/** + * The program version strings. + */ +#ifndef _di_fake_build_version_s_ + #define FAKE_build_version_major_s "major" + #define FAKE_build_version_minor_s "minor" + #define FAKE_build_version_micro_s "micro" + #define FAKE_build_version_nano_s "nano" + + #define FAKE_build_version_major_s_length 5 + #define FAKE_build_version_minor_s_length 5 + #define FAKE_build_version_micro_s_length 5 + #define FAKE_build_version_nano_s_length 4 + + extern const f_string_static_t fake_build_version_major_s; + extern const f_string_static_t fake_build_version_minor_s; + extern const f_string_static_t fake_build_version_micro_s; + extern const f_string_static_t fake_build_version_nano_s; +#endif // _di_fake_build_version_s_ + +#ifndef _di_fake_build_setting_s_ + #define FAKE_build_setting_default_ar_s "ar" + #define FAKE_build_setting_default_gcc_s "gcc" + #define FAKE_build_setting_default_version_s "0" + #define FAKE_build_setting_default_version_prefix_s "." + #define FAKE_build_setting_default_yes_s "yes" + + #define FAKE_build_setting_name_build_compiler_s "build_compiler" + #define FAKE_build_setting_name_build_indexer_s "build_indexer" + #define FAKE_build_setting_name_build_indexer_arguments_s "build_indexer_arguments" + #define FAKE_build_setting_name_build_language_s "build_language" + #define FAKE_build_setting_name_build_libraries_s "build_libraries" + #define FAKE_build_setting_name_build_libraries_shared_s "build_libraries_shared" + #define FAKE_build_setting_name_build_libraries_static_s "build_libraries_static" + #define FAKE_build_setting_name_build_name_s "build_name" + #define FAKE_build_setting_name_build_objects_library_s "build_objects_library" + #define FAKE_build_setting_name_build_objects_library_shared_s "build_objects_library_shared" + #define FAKE_build_setting_name_build_objects_library_static_s "build_objects_library_static" + #define FAKE_build_setting_name_build_objects_program_s "build_objects_program" + #define FAKE_build_setting_name_build_objects_program_shared_s "build_objects_program_shared" + #define FAKE_build_setting_name_build_objects_program_static_s "build_objects_program_static" + #define FAKE_build_setting_name_build_script_s "build_script" + #define FAKE_build_setting_name_build_shared_s "build_shared" + #define FAKE_build_setting_name_build_sources_documentation_s "build_sources_documentation" + #define FAKE_build_setting_name_build_sources_headers_s "build_sources_headers" + #define FAKE_build_setting_name_build_sources_headers_shared_s "build_sources_headers_shared" + #define FAKE_build_setting_name_build_sources_headers_static_s "build_sources_headers_static" + #define FAKE_build_setting_name_build_sources_library_s "build_sources_library" + #define FAKE_build_setting_name_build_sources_library_shared_s "build_sources_library_shared" + #define FAKE_build_setting_name_build_sources_library_static_s "build_sources_library_static" + #define FAKE_build_setting_name_build_sources_object_s "build_sources_object" + #define FAKE_build_setting_name_build_sources_object_shared_s "build_sources_object_shared" + #define FAKE_build_setting_name_build_sources_object_static_s "build_sources_object_static" + #define FAKE_build_setting_name_build_sources_program_s "build_sources_program" + #define FAKE_build_setting_name_build_sources_program_shared_s "build_sources_program_shared" + #define FAKE_build_setting_name_build_sources_program_static_s "build_sources_program_static" + #define FAKE_build_setting_name_build_sources_script_s "build_sources_script" + #define FAKE_build_setting_name_build_sources_setting_s "build_sources_setting" + #define FAKE_build_setting_name_build_static_s "build_static" + #define FAKE_build_setting_name_defines_s "defines" + #define FAKE_build_setting_name_defines_library_s "defines_library" + #define FAKE_build_setting_name_defines_library_shared_s "defines_library_shared" + #define FAKE_build_setting_name_defines_library_static_s "defines_library_static" + #define FAKE_build_setting_name_defines_object_s "defines_object" + #define FAKE_build_setting_name_defines_object_shared_s "defines_object_shared" + #define FAKE_build_setting_name_defines_object_static_s "defines_object_static" + #define FAKE_build_setting_name_defines_program_s "defines_program" + #define FAKE_build_setting_name_defines_program_shared_s "defines_program_shared" + #define FAKE_build_setting_name_defines_program_static_s "defines_program_static" + #define FAKE_build_setting_name_defines_shared_s "defines_shared" + #define FAKE_build_setting_name_defines_static_s "defines_static" + #define FAKE_build_setting_name_environment_s "environment" + #define FAKE_build_setting_name_flags_s "flags" + #define FAKE_build_setting_name_flags_library_s "flags_library" + #define FAKE_build_setting_name_flags_library_shared_s "flags_library_shared" + #define FAKE_build_setting_name_flags_library_static_s "flags_library_static" + #define FAKE_build_setting_name_flags_object_s "flags_object" + #define FAKE_build_setting_name_flags_object_shared_s "flags_object_shared" + #define FAKE_build_setting_name_flags_object_static_s "flags_object_static" + #define FAKE_build_setting_name_flags_program_s "flags_program" + #define FAKE_build_setting_name_flags_program_shared_s "flags_program_shared" + #define FAKE_build_setting_name_flags_program_static_s "flags_program_static" + #define FAKE_build_setting_name_flags_shared_s "flags_shared" + #define FAKE_build_setting_name_flags_static_s "flags_static" + #define FAKE_build_setting_name_has_path_standard_s "has_path_standard" + #define FAKE_build_setting_name_modes_s "modes" + #define FAKE_build_setting_name_modes_default_s "modes_default" + #define FAKE_build_setting_name_path_headers_s "path_headers" + #define FAKE_build_setting_name_path_language_s "path_language" + #define FAKE_build_setting_name_path_library_script_s "path_library_script" + #define FAKE_build_setting_name_path_library_shared_s "path_library_shared" + #define FAKE_build_setting_name_path_library_static_s "path_library_static" + #define FAKE_build_setting_name_path_object_script_s "path_object_script" + #define FAKE_build_setting_name_path_object_shared_s "path_object_shared" + #define FAKE_build_setting_name_path_object_static_s "path_object_static" + #define FAKE_build_setting_name_path_program_script_s "path_program_script" + #define FAKE_build_setting_name_path_program_shared_s "path_program_shared" + #define FAKE_build_setting_name_path_program_static_s "path_program_static" + #define FAKE_build_setting_name_path_sources_s "path_sources" + #define FAKE_build_setting_name_path_sources_object_s "path_sources_object" + #define FAKE_build_setting_name_preserve_path_headers_s "preserve_path_headers" + #define FAKE_build_setting_name_process_post_s "process_post" + #define FAKE_build_setting_name_process_pre_s "process_pre" + #define FAKE_build_setting_name_search_exclusive_s "search_exclusive" + #define FAKE_build_setting_name_search_shared_s "search_shared" + #define FAKE_build_setting_name_search_static_s "search_static" + #define FAKE_build_setting_name_version_file_s "version_file" + #define FAKE_build_setting_name_version_major_s "version_major" + #define FAKE_build_setting_name_version_major_prefix_s "version_major_prefix" + #define FAKE_build_setting_name_version_micro_s "version_micro" + #define FAKE_build_setting_name_version_micro_prefix_s "version_micro_prefix" + #define FAKE_build_setting_name_version_minor_s "version_minor" + #define FAKE_build_setting_name_version_minor_prefix_s "version_minor_prefix" + #define FAKE_build_setting_name_version_nano_s "version_nano" + #define FAKE_build_setting_name_version_nano_prefix_s "version_nano_prefix" + #define FAKE_build_setting_name_version_target_s "version_target" + + #define FAKE_build_setting_default_ar_s_length 2 + #define FAKE_build_setting_default_gcc_s_length 3 + #define FAKE_build_setting_default_version_s_length 1 + #define FAKE_build_setting_default_version_prefix_s_length 1 + #define FAKE_build_setting_default_yes_s_length 3 + + #define FAKE_build_setting_name_build_compiler_s_length 14 + #define FAKE_build_setting_name_build_indexer_s_length 13 + #define FAKE_build_setting_name_build_indexer_arguments_s_length 23 + #define FAKE_build_setting_name_build_language_s_length 14 + #define FAKE_build_setting_name_build_libraries_s_length 15 + #define FAKE_build_setting_name_build_libraries_shared_s_length 22 + #define FAKE_build_setting_name_build_libraries_static_s_length 22 + #define FAKE_build_setting_name_build_name_s_length 10 + #define FAKE_build_setting_name_build_objects_library_s_length 21 + #define FAKE_build_setting_name_build_objects_library_shared_s_length 28 + #define FAKE_build_setting_name_build_objects_library_static_s_length 28 + #define FAKE_build_setting_name_build_objects_program_s_length 21 + #define FAKE_build_setting_name_build_objects_program_shared_s_length 28 + #define FAKE_build_setting_name_build_objects_program_static_s_length 28 + #define FAKE_build_setting_name_build_script_s_length 12 + #define FAKE_build_setting_name_build_shared_s_length 12 + #define FAKE_build_setting_name_build_sources_documentation_s_length 27 + #define FAKE_build_setting_name_build_sources_headers_s_length 21 + #define FAKE_build_setting_name_build_sources_headers_shared_s_length 28 + #define FAKE_build_setting_name_build_sources_headers_static_s_length 28 + #define FAKE_build_setting_name_build_sources_library_s_length 21 + #define FAKE_build_setting_name_build_sources_library_shared_s_length 28 + #define FAKE_build_setting_name_build_sources_library_static_s_length 28 + #define FAKE_build_setting_name_build_sources_object_s_length 20 + #define FAKE_build_setting_name_build_sources_object_shared_s_length 27 + #define FAKE_build_setting_name_build_sources_object_static_s_length 27 + #define FAKE_build_setting_name_build_sources_program_s_length 21 + #define FAKE_build_setting_name_build_sources_program_shared_s_length 28 + #define FAKE_build_setting_name_build_sources_program_static_s_length 28 + #define FAKE_build_setting_name_build_sources_script_s_length 20 + #define FAKE_build_setting_name_build_sources_setting_s_length 21 + #define FAKE_build_setting_name_build_static_s_length 12 + #define FAKE_build_setting_name_environment_s_length 11 + #define FAKE_build_setting_name_defines_s_length 7 + #define FAKE_build_setting_name_defines_library_s_length 15 + #define FAKE_build_setting_name_defines_library_shared_s_length 22 + #define FAKE_build_setting_name_defines_library_static_s_length 22 + #define FAKE_build_setting_name_defines_object_s_length 14 + #define FAKE_build_setting_name_defines_object_shared_s_length 21 + #define FAKE_build_setting_name_defines_object_static_s_length 21 + #define FAKE_build_setting_name_defines_program_s_length 15 + #define FAKE_build_setting_name_defines_program_shared_s_length 22 + #define FAKE_build_setting_name_defines_program_static_s_length 22 + #define FAKE_build_setting_name_defines_shared_s_length 14 + #define FAKE_build_setting_name_defines_static_s_length 14 + #define FAKE_build_setting_name_flags_s_length 5 + #define FAKE_build_setting_name_flags_library_s_length 13 + #define FAKE_build_setting_name_flags_library_shared_s_length 20 + #define FAKE_build_setting_name_flags_library_static_s_length 20 + #define FAKE_build_setting_name_flags_object_s_length 12 + #define FAKE_build_setting_name_flags_object_shared_s_length 19 + #define FAKE_build_setting_name_flags_object_static_s_length 19 + #define FAKE_build_setting_name_flags_program_s_length 13 + #define FAKE_build_setting_name_flags_program_shared_s_length 20 + #define FAKE_build_setting_name_flags_program_static_s_length 20 + #define FAKE_build_setting_name_flags_shared_s_length 12 + #define FAKE_build_setting_name_flags_static_s_length 12 + #define FAKE_build_setting_name_has_path_standard_s_length 17 + #define FAKE_build_setting_name_modes_s_length 5 + #define FAKE_build_setting_name_modes_default_s_length 13 + #define FAKE_build_setting_name_path_headers_s_length 12 + #define FAKE_build_setting_name_path_language_s_length 13 + #define FAKE_build_setting_name_path_library_script_s_length 19 + #define FAKE_build_setting_name_path_library_shared_s_length 19 + #define FAKE_build_setting_name_path_library_static_s_length 19 + #define FAKE_build_setting_name_path_object_script_s_length 18 + #define FAKE_build_setting_name_path_object_shared_s_length 18 + #define FAKE_build_setting_name_path_object_static_s_length 18 + #define FAKE_build_setting_name_path_program_script_s_length 19 + #define FAKE_build_setting_name_path_program_shared_s_length 19 + #define FAKE_build_setting_name_path_program_static_s_length 19 + #define FAKE_build_setting_name_path_sources_s_length 12 + #define FAKE_build_setting_name_path_sources_object_s_length 19 + #define FAKE_build_setting_name_preserve_path_headers_s_length 21 + #define FAKE_build_setting_name_process_post_s_length 12 + #define FAKE_build_setting_name_process_pre_s_length 11 + #define FAKE_build_setting_name_search_exclusive_s_length 16 + #define FAKE_build_setting_name_search_shared_s_length 13 + #define FAKE_build_setting_name_search_static_s_length 13 + #define FAKE_build_setting_name_version_file_s_length 12 + #define FAKE_build_setting_name_version_major_s_length 13 + #define FAKE_build_setting_name_version_major_prefix_s_length 20 + #define FAKE_build_setting_name_version_micro_s_length 13 + #define FAKE_build_setting_name_version_micro_prefix_s_length 20 + #define FAKE_build_setting_name_version_minor_s_length 13 + #define FAKE_build_setting_name_version_minor_prefix_s_length 20 + #define FAKE_build_setting_name_version_nano_s_length 12 + #define FAKE_build_setting_name_version_nano_prefix_s_length 19 + #define FAKE_build_setting_name_version_target_s_length 14 + + extern const f_string_static_t fake_build_setting_default_ar_s; + extern const f_string_static_t fake_build_setting_default_gcc_s; + extern const f_string_static_t fake_build_setting_default_version_s; + extern const f_string_static_t fake_build_setting_default_version_prefix_s; + extern const f_string_static_t fake_build_setting_default_yes_s; + + extern const f_string_static_t fake_build_setting_name_build_compiler_s; + extern const f_string_static_t fake_build_setting_name_build_indexer_s; + extern const f_string_static_t fake_build_setting_name_build_indexer_arguments_s; + extern const f_string_static_t fake_build_setting_name_build_language_s; + extern const f_string_static_t fake_build_setting_name_build_libraries_s; + extern const f_string_static_t fake_build_setting_name_build_libraries_shared_s; + extern const f_string_static_t fake_build_setting_name_build_libraries_static_s; + extern const f_string_static_t fake_build_setting_name_build_name_s; + extern const f_string_static_t fake_build_setting_name_build_objects_library_s; + extern const f_string_static_t fake_build_setting_name_build_objects_library_shared_s; + extern const f_string_static_t fake_build_setting_name_build_objects_library_static_s; + extern const f_string_static_t fake_build_setting_name_build_objects_program_s; + extern const f_string_static_t fake_build_setting_name_build_objects_program_shared_s; + extern const f_string_static_t fake_build_setting_name_build_objects_program_static_s; + extern const f_string_static_t fake_build_setting_name_build_script_s; + extern const f_string_static_t fake_build_setting_name_build_shared_s; + extern const f_string_static_t fake_build_setting_name_build_sources_documentation_s; + extern const f_string_static_t fake_build_setting_name_build_sources_headers_s; + extern const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s; + extern const f_string_static_t fake_build_setting_name_build_sources_headers_static_s; + extern const f_string_static_t fake_build_setting_name_build_sources_library_s; + extern const f_string_static_t fake_build_setting_name_build_sources_library_shared_s; + extern const f_string_static_t fake_build_setting_name_build_sources_library_static_s; + extern const f_string_static_t fake_build_setting_name_build_sources_object_s; + extern const f_string_static_t fake_build_setting_name_build_sources_object_shared_s; + extern const f_string_static_t fake_build_setting_name_build_sources_object_static_s; + extern const f_string_static_t fake_build_setting_name_build_sources_program_s; + extern const f_string_static_t fake_build_setting_name_build_sources_program_shared_s; + extern const f_string_static_t fake_build_setting_name_build_sources_program_static_s; + extern const f_string_static_t fake_build_setting_name_build_sources_script_s; + extern const f_string_static_t fake_build_setting_name_build_sources_setting_s; + extern const f_string_static_t fake_build_setting_name_build_static_s; + extern const f_string_static_t fake_build_setting_name_defines_s; + extern const f_string_static_t fake_build_setting_name_defines_library_s; + extern const f_string_static_t fake_build_setting_name_defines_library_shared_s; + extern const f_string_static_t fake_build_setting_name_defines_library_static_s; + extern const f_string_static_t fake_build_setting_name_defines_object_s; + extern const f_string_static_t fake_build_setting_name_defines_object_shared_s; + extern const f_string_static_t fake_build_setting_name_defines_object_static_s; + extern const f_string_static_t fake_build_setting_name_defines_program_s; + extern const f_string_static_t fake_build_setting_name_defines_program_shared_s; + extern const f_string_static_t fake_build_setting_name_defines_program_static_s; + extern const f_string_static_t fake_build_setting_name_defines_shared_s; + extern const f_string_static_t fake_build_setting_name_defines_static_s; + extern const f_string_static_t fake_build_setting_name_environment_s; + extern const f_string_static_t fake_build_setting_name_flags_s; + extern const f_string_static_t fake_build_setting_name_flags_library_s; + extern const f_string_static_t fake_build_setting_name_flags_library_shared_s; + extern const f_string_static_t fake_build_setting_name_flags_library_static_s; + extern const f_string_static_t fake_build_setting_name_flags_object_s; + extern const f_string_static_t fake_build_setting_name_flags_object_shared_s; + extern const f_string_static_t fake_build_setting_name_flags_object_static_s; + extern const f_string_static_t fake_build_setting_name_flags_program_s; + extern const f_string_static_t fake_build_setting_name_flags_program_shared_s; + extern const f_string_static_t fake_build_setting_name_flags_program_static_s; + extern const f_string_static_t fake_build_setting_name_flags_shared_s; + extern const f_string_static_t fake_build_setting_name_flags_static_s; + extern const f_string_static_t fake_build_setting_name_has_path_standard_s; + extern const f_string_static_t fake_build_setting_name_modes_s; + extern const f_string_static_t fake_build_setting_name_modes_default_s; + extern const f_string_static_t fake_build_setting_name_path_headers_s; + extern const f_string_static_t fake_build_setting_name_path_language_s; + extern const f_string_static_t fake_build_setting_name_path_library_script_s; + extern const f_string_static_t fake_build_setting_name_path_library_shared_s; + extern const f_string_static_t fake_build_setting_name_path_library_static_s; + extern const f_string_static_t fake_build_setting_name_path_object_script_s; + extern const f_string_static_t fake_build_setting_name_path_object_shared_s; + extern const f_string_static_t fake_build_setting_name_path_object_static_s; + extern const f_string_static_t fake_build_setting_name_path_program_script_s; + extern const f_string_static_t fake_build_setting_name_path_program_shared_s; + extern const f_string_static_t fake_build_setting_name_path_program_static_s; + extern const f_string_static_t fake_build_setting_name_path_sources_s; + extern const f_string_static_t fake_build_setting_name_path_sources_object_s; + extern const f_string_static_t fake_build_setting_name_preserve_path_headers_s; + extern const f_string_static_t fake_build_setting_name_process_post_s; + extern const f_string_static_t fake_build_setting_name_process_pre_s; + extern const f_string_static_t fake_build_setting_name_search_exclusive_s; + extern const f_string_static_t fake_build_setting_name_search_shared_s; + extern const f_string_static_t fake_build_setting_name_search_static_s; + extern const f_string_static_t fake_build_setting_name_version_file_s; + extern const f_string_static_t fake_build_setting_name_version_major_s; + extern const f_string_static_t fake_build_setting_name_version_major_prefix_s; + extern const f_string_static_t fake_build_setting_name_version_micro_s; + extern const f_string_static_t fake_build_setting_name_version_micro_prefix_s; + extern const f_string_static_t fake_build_setting_name_version_minor_s; + extern const f_string_static_t fake_build_setting_name_version_minor_prefix_s; + extern const f_string_static_t fake_build_setting_name_version_nano_s; + extern const f_string_static_t fake_build_setting_name_version_nano_prefix_s; + extern const f_string_static_t fake_build_setting_name_version_target_s; +#endif // _di_fake_build_setting_s_ + +#ifndef _di_fake_build_stage_s_ + #define FAKE_build_stage_built_s ".built" + #define FAKE_build_stage_library_script_s "library_script" + #define FAKE_build_stage_library_shared_s "library_shared" + #define FAKE_build_stage_library_static_s "library_static" + #define FAKE_build_stage_object_script_s "object_script" + #define FAKE_build_stage_object_shared_s "object_shared" + #define FAKE_build_stage_object_static_s "object_static" + #define FAKE_build_stage_objects_static_s "objects_static" + #define FAKE_build_stage_process_post_s "process_post" + #define FAKE_build_stage_process_pre_s "process_pre" + #define FAKE_build_stage_program_script_s "program_script" + #define FAKE_build_stage_program_shared_s "program_shared" + #define FAKE_build_stage_program_static_s "program_static" + #define FAKE_build_stage_separate_s "-" + #define FAKE_build_stage_skeleton_s "skeleton" + #define FAKE_build_stage_sources_documentation_s "sources_documentation" + #define FAKE_build_stage_sources_headers_s "sources_headers" + #define FAKE_build_stage_sources_script_s "sources_script" + #define FAKE_build_stage_sources_settings_s "sources_settings" + + #define FAKE_build_stage_built_s_length 6 + #define FAKE_build_stage_library_script_s_length 14 + #define FAKE_build_stage_library_shared_s_length 14 + #define FAKE_build_stage_library_static_s_length 14 + #define FAKE_build_stage_object_script_s_length 13 + #define FAKE_build_stage_object_shared_s_length 13 + #define FAKE_build_stage_object_static_s_length 13 + #define FAKE_build_stage_objects_static_s_length 14 + #define FAKE_build_stage_process_post_s_length 12 + #define FAKE_build_stage_process_pre_s_length 11 + #define FAKE_build_stage_program_script_s_length 14 + #define FAKE_build_stage_program_shared_s_length 14 + #define FAKE_build_stage_program_static_s_length 14 + #define FAKE_build_stage_separate_s_length 1 + #define FAKE_build_stage_skeleton_s_length 8 + #define FAKE_build_stage_sources_documentation_s_length 21 + #define FAKE_build_stage_sources_headers_s_length 15 + #define FAKE_build_stage_sources_script_s_length 14 + #define FAKE_build_stage_sources_settings_s_length 16 + + extern const f_string_static_t fake_build_stage_built_s; + extern const f_string_static_t fake_build_stage_library_script_s; + extern const f_string_static_t fake_build_stage_library_shared_s; + extern const f_string_static_t fake_build_stage_library_static_s; + extern const f_string_static_t fake_build_stage_object_script_s; + extern const f_string_static_t fake_build_stage_object_shared_s; + extern const f_string_static_t fake_build_stage_object_static_s; + extern const f_string_static_t fake_build_stage_objects_static_s; + extern const f_string_static_t fake_build_stage_process_post_s; + extern const f_string_static_t fake_build_stage_process_pre_s; + extern const f_string_static_t fake_build_stage_program_script_s; + extern const f_string_static_t fake_build_stage_program_shared_s; + extern const f_string_static_t fake_build_stage_program_static_s; + extern const f_string_static_t fake_build_stage_separate_s; + extern const f_string_static_t fake_build_stage_skeleton_s; + extern const f_string_static_t fake_build_stage_sources_documentation_s; + extern const f_string_static_t fake_build_stage_sources_headers_s; + extern const f_string_static_t fake_build_stage_sources_script_s; + extern const f_string_static_t fake_build_stage_sources_settings_s; +#endif // _di_fake_build_stage_s_ + +#ifndef _di_fake_build_parameter_s_ + #define FAKE_build_parameter_library_include_s "-I" + #define FAKE_build_parameter_library_link_file_s "-l" + #define FAKE_build_parameter_library_link_path_s "-L" + #define FAKE_build_parameter_library_name_prefix_s "lib" + #define FAKE_build_parameter_library_name_suffix_shared_s ".so" + #define FAKE_build_parameter_library_name_suffix_static_s ".a" + #define FAKE_build_parameter_library_output_s "-o" + #define FAKE_build_parameter_library_shared_s "-shared" + #define FAKE_build_parameter_library_static_s "-static" + #define FAKE_build_parameter_library_shared_prefix_s "-Wl,-soname," + + #define FAKE_build_parameter_library_include_s_length 2 + #define FAKE_build_parameter_library_link_file_s_length 2 + #define FAKE_build_parameter_library_link_path_s_length 2 + #define FAKE_build_parameter_library_name_prefix_s_length 3 + #define FAKE_build_parameter_library_name_suffix_shared_s_length 3 + #define FAKE_build_parameter_library_name_suffix_static_s_length 2 + #define FAKE_build_parameter_library_output_s_length 2 + #define FAKE_build_parameter_library_shared_s_length 7 + #define FAKE_build_parameter_library_static_s_length 7 + #define FAKE_build_parameter_library_shared_prefix_s_length 12 + + extern const f_string_static_t fake_build_parameter_library_include_s; + extern const f_string_static_t fake_build_parameter_library_link_file_s; + extern const f_string_static_t fake_build_parameter_library_link_path_s; + extern const f_string_static_t fake_build_parameter_library_name_prefix_s; + extern const f_string_static_t fake_build_parameter_library_name_suffix_shared_s; + extern const f_string_static_t fake_build_parameter_library_name_suffix_static_s; + extern const f_string_static_t fake_build_parameter_library_output_s; + extern const f_string_static_t fake_build_parameter_library_shared_s; + extern const f_string_static_t fake_build_parameter_library_static_s; + extern const f_string_static_t fake_build_parameter_library_shared_prefix_s; + + #define FAKE_build_parameter_object_compile_s "-c" + #define FAKE_build_parameter_object_name_suffix_s ".o" + #define FAKE_build_parameter_object_output_s "-o" + #define FAKE_build_parameter_object_static_s "-static" + + #define FAKE_build_parameter_object_compile_s_length 2 + #define FAKE_build_parameter_object_name_suffix_s_length 2 + #define FAKE_build_parameter_object_output_s_length 2 + #define FAKE_build_parameter_object_static_s_length 7 + + extern const f_string_static_t fake_build_parameter_object_compile_s; + extern const f_string_static_t fake_build_parameter_object_name_suffix_s; + extern const f_string_static_t fake_build_parameter_object_output_s; + extern const f_string_static_t fake_build_parameter_object_static_s; +#endif // _di_fake_build_parameter_s_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fake_build_string_h diff --git a/level_3/fake/c/main/clean.c b/level_3/fake/c/main/clean.c index 61ee581..5647654 100644 --- a/level_3/fake/c/main/clean.c +++ b/level_3/fake/c/main/clean.c @@ -1,5 +1,4 @@ #include "fake.h" -#include "clean.h" #ifdef __cplusplus extern "C" { @@ -11,8 +10,6 @@ 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); - 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/clean.h b/level_3/fake/c/main/clean.h index cbf493f..5f7ed08 100644 --- a/level_3/fake/c/main/clean.h +++ b/level_3/fake/c/main/clean.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_clean_h -#define _PRIVATE_clean_h +#ifndef _fake_clean_h +#define _fake_clean_h #ifdef __cplusplus extern "C" { @@ -66,4 +66,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_clean_h +#endif // _fake_clean_h diff --git a/level_3/fake/c/main/common.c b/level_3/fake/c/main/common.c index 82b77fd..3d6e007 100644 --- a/level_3/fake/c/main/common.c +++ b/level_3/fake/c/main/common.c @@ -46,6 +46,8 @@ extern "C" { } if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_console_parameter_process)); return; @@ -66,6 +68,8 @@ extern "C" { setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main); if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_process_context)); return; @@ -97,6 +101,8 @@ extern "C" { setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main); if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_process_verbosity)); return; @@ -245,7 +251,7 @@ extern "C" { setting->state.status = F_status_set_error(F_parameter); if (main->error.verbosity > f_console_verbosity_quiet_e) { - fake_print_line_first_locked(setting, main->error); + fake_print_line_first(setting, main->message); fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, names[i]); } @@ -265,6 +271,8 @@ extern "C" { // @todo fix this to print an error about the actual invalid character so that it can be investigated. if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) { fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]); } @@ -286,8 +294,10 @@ extern "C" { setting->state.status = f_path_directory_cleanup(main->parameters.arguments.array[index], variable[i]); if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + if (main->error.verbosity > f_console_verbosity_quiet_e) { - fake_print_line_first_locked(setting, main->error); + fake_print_line_first(setting, main->message); if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_path_directory_cleanup)) == F_false) { fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]); @@ -304,6 +314,8 @@ extern "C" { setting->state.status = f_string_dynamic_resize(0, variable[i]); if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_resize)); return; @@ -333,6 +345,8 @@ extern "C" { setting->state.status = f_string_dynamic_resize(0, variable[i]); if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_resize)); return; @@ -370,7 +384,7 @@ extern "C" { setting->state.status = F_status_set_error(F_parameter); if (main->error.verbosity > f_console_verbosity_quiet_e) { - fake_print_line_first_locked(setting, main->error); + fake_print_line_first(setting, main->message); fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, names[i]); } @@ -383,7 +397,7 @@ extern "C" { if (F_status_is_error(setting->state.status)) { if (main->error.verbosity > f_console_verbosity_quiet_e) { - fake_print_line_first_locked(setting, main->error); + fake_print_line_first(setting, main->message); if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_additional_rip)) == F_false) { fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]); @@ -401,8 +415,9 @@ extern "C" { setting->state.status = f_utf_is_word_dash_plus(main->parameters.arguments.array[i].string + j, width_max, F_false); if (F_status_is_error(setting->state.status)) { - // @todo fix this to print an error about the actual invalid character so that it can be investigated. + fake_print_line_first(setting, main->message); + // @todo fix this to print an error about the actual invalid character so that it can be investigated. if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) { fll_program_print_error_parameter_process(main->error, f_console_symbol_long_normal_s, names[i]); } @@ -434,6 +449,8 @@ extern "C" { setting->state.status = f_uint8s_increase_by(1, &setting->operations); if (F_status_is_error(setting->state.status)) { + fake_print_line_first(setting, main->message); + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_uint8s_increase_by)); return; @@ -461,6 +478,8 @@ extern "C" { state->state->status = f_uint8s_increase(fake_default_allocation_small_d, &data->setting->operations); if (F_status_is_error(state->state->status)) { + fake_print_line_first(setting, main->message); + fake_print_error(data->setting, data->main->error, state->state->status, macro_fake_f(f_uint8s_increase)); return; diff --git a/level_3/fake/c/main/common/define.h b/level_3/fake/c/main/common/define.h index e27f346..b08594e 100644 --- a/level_3/fake/c/main/common/define.h +++ b/level_3/fake/c/main/common/define.h @@ -24,21 +24,19 @@ extern "C" { * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_pipe: A buffer size used for processing piped data. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. */ #ifndef _di_fake_d_ #define fake_allocation_console_d 4 #define fake_allocation_large_d 256 #define fake_allocation_pipe_d 16384 #define fake_allocation_small_d 16 - #define fake_signal_check_d 20000 #endif // _di_fake_d_ /** - * The program defines. + * The program signal defines. * * fake_signal_*_d: - * - check: The normal signal check. + * - check: Number of iterations before performing signal check in non-threaded signal handling. * - check_tiny: The tiny check. * - check_short: The short signal check. */ @@ -51,22 +49,18 @@ extern "C" { /** * Provide common/generic definitions. * - * _di_fake_common_*_d: - * - allocation_large: Large allocation block size. - * - allocation_small: Small allocation block size. - * - max_initial_buffer: Max size to maintain the buffer (to avoid buffer bloat after an overly large allocation) (131072 = 128k). - * - max_operation: Maximum number of operations. - * - max_recursion_depth: Maximum recursion depth. - * - max_stack: Maximum stack call depth. + * _di_fake_max_*_d: + * - initial_buffer: Max size to maintain the buffer (to avoid buffer bloat after an overly large allocation) (131072 = 128k). + * - operation: Maximum number of operations. + * - recursion_depth: Maximum recursion depth. + * - stack: Maximum stack call depth. */ -#ifndef _di_fake_common_d_ - #define fake_common_allocation_large_d 256 - #define fake_common_allocation_small_d 16 - #define fake_common_max_initial_buffer_d 131072 - #define fake_common_max_operation_d 35 - #define fake_common_max_recursion_depth_d 65535 - #define fake_common_max_stack_d 8192 -#endif // _di_fake_common_d_ +#ifndef _di_fake_max_d_ + #define fake_max_initial_buffer_d 131072 + #define fake_max_operation_d 35 + #define fake_max_recursion_depth_d 65535 + #define fake_max_stack_d 8192 +#endif // _di_fake_max_d_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/fake/c/main/common/enumeration.h b/level_3/fake/c/main/common/enumeration.h index fb07ffc..83a59f6 100644 --- a/level_3/fake/c/main/common/enumeration.h +++ b/level_3/fake/c/main/common/enumeration.h @@ -153,59 +153,6 @@ extern "C" { #endif // _di_fake_main_flag_e_ /** - * The build language enumerations. - * - * fake_build_language_*_e: - * - bash: The GNU Bash language. - * - c: The C language. - * - cpp: The C++ language. - * - zsh: The ZSH language (Similar to and somewhat compatible with GNU Bash). - */ -#ifndef _di_fake_build_language_e_ - enum { - fake_build_language_none_e = 0, - fake_build_language_bash_e, - fake_build_language_c_e, - fake_build_language_cpp_e, - fake_build_language_zsh_e, - }; // enum -#endif // _di_fake_build_language_e_ - -/** - * Build settings flag enumeration. - * - * data_build_setting_flag_*: - * - none: No flag set. - * - has_environment: Designate that the "environment" is specified in the "settings" Section of the Fakefile. - */ -#ifndef _di_fake_build_setting_flag_e_ - enum { - data_build_setting_flag_none_e = 0x0, - data_build_setting_flag_has_environment_e = 0x1, - }; // enum -#endif // _di_fake_build_setting_flag_e_ - -/** - * The program version enumerations. - * - * fake_build_version_*_e: - * - none: No version number. - * - major: The major version number. - * - minor: The minor version number. - * - micro: The micro version number (sometimes called the patch version number). - * - nano: The nano version number. - */ -#ifndef _di_fake_build_version_e_ - enum { - fake_build_version_none_e = 0, - fake_build_version_major_e, - fake_build_version_minor_e, - fake_build_version_micro_e, - fake_build_version_nano_e, - }; // enum -#endif // _di_fake_build_version_e_ - -/** * The program operation enumerations. * * fake_operation_*_e: diff --git a/level_3/fake/c/main/common/string.c b/level_3/fake/c/main/common/string.c index bd7c486..6002e0f 100644 --- a/level_3/fake/c/main/common/string.c +++ b/level_3/fake/c/main/common/string.c @@ -59,20 +59,6 @@ extern "C" { const f_string_static_t fake_default_work_s = macro_f_string_static_t_initialize(FAKE_default_work_s, 0, FAKE_default_work_s_length); #endif // _di_fake_default_s_ -#ifndef _di_fake_build_language_s_ - const f_string_static_t fake_build_language_bash_s = macro_f_string_static_t_initialize(FAKE_build_language_bash_s, 0, FAKE_build_language_bash_s_length); - const f_string_static_t fake_build_language_c_s = macro_f_string_static_t_initialize(FAKE_build_language_c_s, 0, FAKE_build_language_c_s_length); - const f_string_static_t fake_build_language_cpp_s = macro_f_string_static_t_initialize(FAKE_build_language_cpp_s, 0, FAKE_build_language_cpp_s_length); - const f_string_static_t fake_build_language_zsh_s = macro_f_string_static_t_initialize(FAKE_build_language_zsh_s, 0, FAKE_build_language_zsh_s_length); -#endif // _di_fake_build_language_s_ - -#ifndef _di_fake_build_version_s_ - const f_string_static_t fake_build_version_major_s = macro_f_string_static_t_initialize(FAKE_build_version_major_s, 0, FAKE_build_version_major_s_length); - const f_string_static_t fake_build_version_minor_s = macro_f_string_static_t_initialize(FAKE_build_version_minor_s, 0, FAKE_build_version_minor_s_length); - const f_string_static_t fake_build_version_micro_s = macro_f_string_static_t_initialize(FAKE_build_version_micro_s, 0, FAKE_build_version_micro_s_length); - const f_string_static_t fake_build_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_version_nano_s, 0, FAKE_build_version_nano_s_length); -#endif // _di_fake_build_version_s_ - #ifndef _di_fake_parameter_s_ const f_string_static_t fake_short_build_s = macro_f_string_static_t_initialize(FAKE_short_build_s, 0, FAKE_short_build_s_length); const f_string_static_t fake_short_data_s = macro_f_string_static_t_initialize(FAKE_short_data_s, 0, FAKE_short_data_s_length); @@ -111,144 +97,6 @@ extern "C" { const f_string_static_t fake_other_operation_skeleton_s = macro_f_string_static_t_initialize(FAKE_other_operation_skeleton_s, 0, FAKE_other_operation_skeleton_s_length); #endif // _di_fake_parameter_s_ -#ifndef _di_fake_build_setting_t_ - const f_string_static_t fake_build_setting_default_ar_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_ar_s, 0, FAKE_build_setting_default_ar_s_length); - const f_string_static_t fake_build_setting_default_gcc_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_gcc_s, 0, FAKE_build_setting_default_gcc_s_length); - const f_string_static_t fake_build_setting_default_version_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_version_s, 0, FAKE_build_setting_default_version_s_length); - const f_string_static_t fake_build_setting_default_version_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_version_prefix_s, 0, FAKE_build_setting_default_version_prefix_s_length); - const f_string_static_t fake_build_setting_default_yes_s = macro_f_string_static_t_initialize(FAKE_build_setting_default_yes_s, 0, FAKE_build_setting_default_yes_s_length); - - const f_string_static_t fake_build_setting_name_build_compiler_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_compiler_s, 0, FAKE_build_setting_name_build_compiler_s_length); - const f_string_static_t fake_build_setting_name_build_indexer_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_indexer_s, 0, FAKE_build_setting_name_build_indexer_s_length); - const f_string_static_t fake_build_setting_name_build_indexer_arguments_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_indexer_arguments_s, 0, FAKE_build_setting_name_build_indexer_arguments_s_length); - const f_string_static_t fake_build_setting_name_build_language_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_language_s, 0, FAKE_build_setting_name_build_language_s_length); - const f_string_static_t fake_build_setting_name_build_libraries_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_s, 0, FAKE_build_setting_name_build_libraries_s_length); - const f_string_static_t fake_build_setting_name_build_libraries_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_shared_s, 0, FAKE_build_setting_name_build_libraries_shared_s_length); - const f_string_static_t fake_build_setting_name_build_libraries_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_libraries_static_s, 0, FAKE_build_setting_name_build_libraries_static_s_length); - const f_string_static_t fake_build_setting_name_build_name_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_name_s, 0, FAKE_build_setting_name_build_name_s_length); - const f_string_static_t fake_build_setting_name_build_objects_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_library_s, 0, FAKE_build_setting_name_build_objects_library_s_length); - const f_string_static_t fake_build_setting_name_build_objects_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_library_shared_s, 0, FAKE_build_setting_name_build_objects_library_shared_s_length); - const f_string_static_t fake_build_setting_name_build_objects_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_library_static_s, 0, FAKE_build_setting_name_build_objects_library_static_s_length); - const f_string_static_t fake_build_setting_name_build_objects_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_program_s, 0, FAKE_build_setting_name_build_objects_program_s_length); - const f_string_static_t fake_build_setting_name_build_objects_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_program_shared_s, 0, FAKE_build_setting_name_build_objects_program_shared_s_length); - const f_string_static_t fake_build_setting_name_build_objects_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_objects_program_static_s, 0, FAKE_build_setting_name_build_objects_program_static_s_length); - const f_string_static_t fake_build_setting_name_build_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_script_s, 0, FAKE_build_setting_name_build_script_s_length); - const f_string_static_t fake_build_setting_name_build_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_shared_s, 0, FAKE_build_setting_name_build_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_documentation_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_documentation_s, 0, FAKE_build_setting_name_build_sources_documentation_s_length); - const f_string_static_t fake_build_setting_name_build_sources_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_s, 0, FAKE_build_setting_name_build_sources_headers_s_length); - const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_shared_s, 0, FAKE_build_setting_name_build_sources_headers_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_headers_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_headers_static_s, 0, FAKE_build_setting_name_build_sources_headers_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_s, 0, FAKE_build_setting_name_build_sources_library_s_length); - const f_string_static_t fake_build_setting_name_build_sources_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_shared_s, 0, FAKE_build_setting_name_build_sources_library_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_library_static_s, 0, FAKE_build_setting_name_build_sources_library_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_object_s, 0, FAKE_build_setting_name_build_sources_object_s_length); - const f_string_static_t fake_build_setting_name_build_sources_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_object_shared_s, 0, FAKE_build_setting_name_build_sources_object_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_object_static_s, 0, FAKE_build_setting_name_build_sources_object_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_s, 0, FAKE_build_setting_name_build_sources_program_s_length); - const f_string_static_t fake_build_setting_name_build_sources_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_shared_s, 0, FAKE_build_setting_name_build_sources_program_shared_s_length); - const f_string_static_t fake_build_setting_name_build_sources_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_program_static_s, 0, FAKE_build_setting_name_build_sources_program_static_s_length); - const f_string_static_t fake_build_setting_name_build_sources_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_script_s, 0, FAKE_build_setting_name_build_sources_script_s_length); - const f_string_static_t fake_build_setting_name_build_sources_setting_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_sources_setting_s, 0, FAKE_build_setting_name_build_sources_setting_s_length); - const f_string_static_t fake_build_setting_name_build_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_build_static_s, 0, FAKE_build_setting_name_build_static_s_length); - const f_string_static_t fake_build_setting_name_defines_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_s, 0, FAKE_build_setting_name_defines_s_length); - const f_string_static_t fake_build_setting_name_defines_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_s, 0, FAKE_build_setting_name_defines_library_s_length); - const f_string_static_t fake_build_setting_name_defines_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_shared_s, 0, FAKE_build_setting_name_defines_library_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_library_static_s, 0, FAKE_build_setting_name_defines_library_static_s_length); - const f_string_static_t fake_build_setting_name_defines_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_object_s, 0, FAKE_build_setting_name_defines_object_s_length); - const f_string_static_t fake_build_setting_name_defines_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_object_shared_s, 0, FAKE_build_setting_name_defines_object_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_object_static_s, 0, FAKE_build_setting_name_defines_object_static_s_length); - const f_string_static_t fake_build_setting_name_defines_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_s, 0, FAKE_build_setting_name_defines_program_s_length); - const f_string_static_t fake_build_setting_name_defines_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_shared_s, 0, FAKE_build_setting_name_defines_program_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_program_static_s, 0, FAKE_build_setting_name_defines_program_static_s_length); - const f_string_static_t fake_build_setting_name_defines_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_shared_s, 0, FAKE_build_setting_name_defines_shared_s_length); - const f_string_static_t fake_build_setting_name_defines_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_defines_static_s, 0, FAKE_build_setting_name_defines_static_s_length); - const f_string_static_t fake_build_setting_name_environment_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_environment_s, 0, FAKE_build_setting_name_environment_s_length); - const f_string_static_t fake_build_setting_name_flags_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_s, 0, FAKE_build_setting_name_flags_s_length); - const f_string_static_t fake_build_setting_name_flags_library_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_s, 0, FAKE_build_setting_name_flags_library_s_length); - const f_string_static_t fake_build_setting_name_flags_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_shared_s, 0, FAKE_build_setting_name_flags_library_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_library_static_s, 0, FAKE_build_setting_name_flags_library_static_s_length); - const f_string_static_t fake_build_setting_name_flags_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_object_s, 0, FAKE_build_setting_name_flags_object_s_length); - const f_string_static_t fake_build_setting_name_flags_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_object_shared_s, 0, FAKE_build_setting_name_flags_object_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_object_static_s, 0, FAKE_build_setting_name_flags_object_static_s_length); - const f_string_static_t fake_build_setting_name_flags_program_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_s, 0, FAKE_build_setting_name_flags_program_s_length); - const f_string_static_t fake_build_setting_name_flags_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_shared_s, 0, FAKE_build_setting_name_flags_program_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_program_static_s, 0, FAKE_build_setting_name_flags_program_static_s_length); - const f_string_static_t fake_build_setting_name_flags_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_shared_s, 0, FAKE_build_setting_name_flags_shared_s_length); - const f_string_static_t fake_build_setting_name_flags_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_flags_static_s, 0, FAKE_build_setting_name_flags_static_s_length); - const f_string_static_t fake_build_setting_name_has_path_standard_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_has_path_standard_s, 0, FAKE_build_setting_name_has_path_standard_s_length); - const f_string_static_t fake_build_setting_name_modes_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_modes_s, 0, FAKE_build_setting_name_modes_s_length); - const f_string_static_t fake_build_setting_name_modes_default_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_modes_default_s, 0, FAKE_build_setting_name_modes_default_s_length); - const f_string_static_t fake_build_setting_name_path_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_headers_s, 0, FAKE_build_setting_name_path_headers_s_length); - const f_string_static_t fake_build_setting_name_path_language_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_language_s, 0, FAKE_build_setting_name_path_language_s_length); - const f_string_static_t fake_build_setting_name_path_library_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_script_s, 0, FAKE_build_setting_name_path_library_script_s_length); - const f_string_static_t fake_build_setting_name_path_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_shared_s, 0, FAKE_build_setting_name_path_library_shared_s_length); - const f_string_static_t fake_build_setting_name_path_library_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_library_static_s, 0, FAKE_build_setting_name_path_library_static_s_length); - const f_string_static_t fake_build_setting_name_path_object_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_object_script_s, 0, FAKE_build_setting_name_path_object_script_s_length); - const f_string_static_t fake_build_setting_name_path_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_object_shared_s, 0, FAKE_build_setting_name_path_object_shared_s_length); - const f_string_static_t fake_build_setting_name_path_object_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_object_static_s, 0, FAKE_build_setting_name_path_object_static_s_length); - const f_string_static_t fake_build_setting_name_path_program_script_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_script_s, 0, FAKE_build_setting_name_path_program_script_s_length); - const f_string_static_t fake_build_setting_name_path_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_shared_s, 0, FAKE_build_setting_name_path_program_shared_s_length); - const f_string_static_t fake_build_setting_name_path_program_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_program_static_s, 0, FAKE_build_setting_name_path_program_static_s_length); - const f_string_static_t fake_build_setting_name_path_sources_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_sources_s, 0, FAKE_build_setting_name_path_sources_s_length); - const f_string_static_t fake_build_setting_name_path_sources_object_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_path_sources_object_s, 0, FAKE_build_setting_name_path_sources_object_s_length); - const f_string_static_t fake_build_setting_name_preserve_path_headers_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_preserve_path_headers_s, 0, FAKE_build_setting_name_preserve_path_headers_s_length); - const f_string_static_t fake_build_setting_name_process_post_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_process_post_s, 0, FAKE_build_setting_name_process_post_s_length); - const f_string_static_t fake_build_setting_name_process_pre_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_process_pre_s, 0, FAKE_build_setting_name_process_pre_s_length); - const f_string_static_t fake_build_setting_name_search_exclusive_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_exclusive_s, 0, FAKE_build_setting_name_search_exclusive_s_length); - const f_string_static_t fake_build_setting_name_search_shared_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_shared_s, 0, FAKE_build_setting_name_search_shared_s_length); - const f_string_static_t fake_build_setting_name_search_static_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_search_static_s, 0, FAKE_build_setting_name_search_static_s_length); - const f_string_static_t fake_build_setting_name_version_file_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_file_s, 0, FAKE_build_setting_name_version_file_s_length); - const f_string_static_t fake_build_setting_name_version_major_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_major_s, 0, FAKE_build_setting_name_version_major_s_length); - const f_string_static_t fake_build_setting_name_version_major_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_major_prefix_s, 0, FAKE_build_setting_name_version_major_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_micro_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_micro_s, 0, FAKE_build_setting_name_version_micro_s_length); - const f_string_static_t fake_build_setting_name_version_micro_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_micro_prefix_s, 0, FAKE_build_setting_name_version_micro_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_minor_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_minor_s, 0, FAKE_build_setting_name_version_minor_s_length); - const f_string_static_t fake_build_setting_name_version_minor_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_minor_prefix_s, 0, FAKE_build_setting_name_version_minor_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_nano_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_nano_s, 0, FAKE_build_setting_name_version_nano_s_length); - const f_string_static_t fake_build_setting_name_version_nano_prefix_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_nano_prefix_s, 0, FAKE_build_setting_name_version_nano_prefix_s_length); - const f_string_static_t fake_build_setting_name_version_target_s = macro_f_string_static_t_initialize(FAKE_build_setting_name_version_target_s, 0, FAKE_build_setting_name_version_target_s_length); -#endif // _di_fake_build_setting_t_ - -#ifndef _di_fake_build_stage_t_ - const f_string_static_t fake_build_stage_built_s = macro_f_string_static_t_initialize(FAKE_build_stage_built_s, 0, FAKE_build_stage_built_s_length); - const f_string_static_t fake_build_stage_library_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_library_script_s, 0, FAKE_build_stage_library_script_s_length); - const f_string_static_t fake_build_stage_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_library_shared_s, 0, FAKE_build_stage_library_shared_s_length); - const f_string_static_t fake_build_stage_library_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_library_static_s, 0, FAKE_build_stage_library_static_s_length); - const f_string_static_t fake_build_stage_object_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_object_script_s, 0, FAKE_build_stage_object_script_s_length); - const f_string_static_t fake_build_stage_object_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_object_shared_s, 0, FAKE_build_stage_object_shared_s_length); - const f_string_static_t fake_build_stage_object_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_object_static_s, 0, FAKE_build_stage_object_static_s_length); - const f_string_static_t fake_build_stage_objects_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_objects_static_s, 0, FAKE_build_stage_objects_static_s_length); - const f_string_static_t fake_build_stage_process_post_s = macro_f_string_static_t_initialize(FAKE_build_stage_process_post_s, 0, FAKE_build_stage_process_post_s_length); - const f_string_static_t fake_build_stage_process_pre_s = macro_f_string_static_t_initialize(FAKE_build_stage_process_pre_s, 0, FAKE_build_stage_process_pre_s_length); - const f_string_static_t fake_build_stage_program_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_program_script_s, 0, FAKE_build_stage_program_script_s_length); - const f_string_static_t fake_build_stage_program_shared_s = macro_f_string_static_t_initialize(FAKE_build_stage_program_shared_s, 0, FAKE_build_stage_program_shared_s_length); - const f_string_static_t fake_build_stage_program_static_s = macro_f_string_static_t_initialize(FAKE_build_stage_program_static_s, 0, FAKE_build_stage_program_static_s_length); - const f_string_static_t fake_build_stage_separate_s = macro_f_string_static_t_initialize(FAKE_build_stage_separate_s, 0, FAKE_build_stage_separate_s_length); - const f_string_static_t fake_build_stage_skeleton_s = macro_f_string_static_t_initialize(FAKE_build_stage_skeleton_s, 0, FAKE_build_stage_skeleton_s_length); - const f_string_static_t fake_build_stage_sources_documentation_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_documentation_s, 0, FAKE_build_stage_sources_documentation_s_length); - const f_string_static_t fake_build_stage_sources_headers_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_headers_s, 0, FAKE_build_stage_sources_headers_s_length); - const f_string_static_t fake_build_stage_sources_script_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_script_s, 0, FAKE_build_stage_sources_script_s_length); - const f_string_static_t fake_build_stage_sources_settings_s = macro_f_string_static_t_initialize(FAKE_build_stage_sources_settings_s, 0, FAKE_build_stage_sources_settings_s_length); -#endif // _di_fake_build_stage_t_ - -#ifndef _di_fake_build_parameter_ - const f_string_static_t fake_build_parameter_library_include_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_include_s, 0, FAKE_build_parameter_library_include_s_length); - const f_string_static_t fake_build_parameter_library_link_file_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_link_file_s, 0, FAKE_build_parameter_library_link_file_s_length); - const f_string_static_t fake_build_parameter_library_link_path_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_link_path_s, 0, FAKE_build_parameter_library_link_path_s_length); - const f_string_static_t fake_build_parameter_library_name_prefix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_prefix_s, 0, FAKE_build_parameter_library_name_prefix_s_length); - const f_string_static_t fake_build_parameter_library_name_suffix_shared_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_suffix_shared_s, 0, FAKE_build_parameter_library_name_suffix_shared_s_length); - const f_string_static_t fake_build_parameter_library_name_suffix_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_name_suffix_static_s, 0, FAKE_build_parameter_library_name_suffix_static_s_length); - const f_string_static_t fake_build_parameter_library_output_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_output_s, 0, FAKE_build_parameter_library_output_s_length); - const f_string_static_t fake_build_parameter_library_shared_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_shared_s, 0, FAKE_build_parameter_library_shared_s_length); - const f_string_static_t fake_build_parameter_library_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_static_s, 0, FAKE_build_parameter_library_static_s_length); - const f_string_static_t fake_build_parameter_library_shared_prefix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_library_shared_prefix_s, 0, FAKE_build_parameter_library_shared_prefix_s_length); - - const f_string_static_t fake_build_parameter_object_compile_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_compile_s, 0, FAKE_build_parameter_object_compile_s_length); - const f_string_static_t fake_build_parameter_object_name_suffix_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_name_suffix_s, 0, FAKE_build_parameter_object_name_suffix_s_length); - const f_string_static_t fake_build_parameter_object_output_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_output_s, 0, FAKE_build_parameter_object_output_s_length); - const f_string_static_t fake_build_parameter_object_static_s = macro_f_string_static_t_initialize(FAKE_build_parameter_object_static_s, 0, FAKE_build_parameter_object_static_s_length); -#endif // _di_fake_build_parameter_ - #ifndef _di_fake_common_ const f_string_static_t fake_common_file_path_access_s = macro_f_string_static_t_initialize(FAKE_common_file_path_access_s, 0, FAKE_common_file_path_access_s_length); const f_string_static_t fake_common_file_directory_copy_s = macro_f_string_static_t_initialize(FAKE_common_file_directory_copy_s, 0, FAKE_common_file_directory_copy_s_length); diff --git a/level_3/fake/c/main/common/string.h b/level_3/fake/c/main/common/string.h index 298b19e..b05d1ca 100644 --- a/level_3/fake/c/main/common/string.h +++ b/level_3/fake/c/main/common/string.h @@ -195,52 +195,6 @@ extern "C" { #endif // _di_fake_default_s_ /** - * The build language strings. - * - * fake_build_language_*_s: - * - bash: The GNU Bash language. - * - c: The C language. - * - cpp: The C++ language. - * - zsh: The ZSH language (Similar to and somewhat compatible with GNU Bash). - */ -#ifndef _di_fake_build_language_s_ - #define FAKE_build_language_bash_s "bash" - #define FAKE_build_language_c_s "c" - #define FAKE_build_language_cpp_s "c++" - #define FAKE_build_language_zsh_s "zsh" - - #define FAKE_build_language_bash_s_length 4 - #define FAKE_build_language_c_s_length 1 - #define FAKE_build_language_cpp_s_length 3 - #define FAKE_build_language_zsh_s_length 3 - - extern const f_string_static_t fake_build_language_bash_s; - extern const f_string_static_t fake_build_language_c_s; - extern const f_string_static_t fake_build_language_cpp_s; - extern const f_string_static_t fake_build_language_zsh_s; -#endif // _di_fake_build_language_s_ - -/** - * The program version strings. - */ -#ifndef _di_fake_build_version_s_ - #define FAKE_build_version_major_s "major" - #define FAKE_build_version_minor_s "minor" - #define FAKE_build_version_micro_s "micro" - #define FAKE_build_version_nano_s "nano" - - #define FAKE_build_version_major_s_length 5 - #define FAKE_build_version_minor_s_length 5 - #define FAKE_build_version_micro_s_length 5 - #define FAKE_build_version_nano_s_length 4 - - extern const f_string_static_t fake_build_version_major_s; - extern const f_string_static_t fake_build_version_minor_s; - extern const f_string_static_t fake_build_version_micro_s; - extern const f_string_static_t fake_build_version_nano_s; -#endif // _di_fake_build_version_s_ - -/** * The main program parameters. */ #ifndef _di_fake_parameter_s_ @@ -354,408 +308,6 @@ extern "C" { extern const f_string_static_t fake_other_operation_skeleton_s; #endif // _di_fake_parameter_s_ -#ifndef _di_fake_build_setting_s_ - #define FAKE_build_setting_default_ar_s "ar" - #define FAKE_build_setting_default_gcc_s "gcc" - #define FAKE_build_setting_default_version_s "0" - #define FAKE_build_setting_default_version_prefix_s "." - #define FAKE_build_setting_default_yes_s "yes" - - #define FAKE_build_setting_name_build_compiler_s "build_compiler" - #define FAKE_build_setting_name_build_indexer_s "build_indexer" - #define FAKE_build_setting_name_build_indexer_arguments_s "build_indexer_arguments" - #define FAKE_build_setting_name_build_language_s "build_language" - #define FAKE_build_setting_name_build_libraries_s "build_libraries" - #define FAKE_build_setting_name_build_libraries_shared_s "build_libraries_shared" - #define FAKE_build_setting_name_build_libraries_static_s "build_libraries_static" - #define FAKE_build_setting_name_build_name_s "build_name" - #define FAKE_build_setting_name_build_objects_library_s "build_objects_library" - #define FAKE_build_setting_name_build_objects_library_shared_s "build_objects_library_shared" - #define FAKE_build_setting_name_build_objects_library_static_s "build_objects_library_static" - #define FAKE_build_setting_name_build_objects_program_s "build_objects_program" - #define FAKE_build_setting_name_build_objects_program_shared_s "build_objects_program_shared" - #define FAKE_build_setting_name_build_objects_program_static_s "build_objects_program_static" - #define FAKE_build_setting_name_build_script_s "build_script" - #define FAKE_build_setting_name_build_shared_s "build_shared" - #define FAKE_build_setting_name_build_sources_documentation_s "build_sources_documentation" - #define FAKE_build_setting_name_build_sources_headers_s "build_sources_headers" - #define FAKE_build_setting_name_build_sources_headers_shared_s "build_sources_headers_shared" - #define FAKE_build_setting_name_build_sources_headers_static_s "build_sources_headers_static" - #define FAKE_build_setting_name_build_sources_library_s "build_sources_library" - #define FAKE_build_setting_name_build_sources_library_shared_s "build_sources_library_shared" - #define FAKE_build_setting_name_build_sources_library_static_s "build_sources_library_static" - #define FAKE_build_setting_name_build_sources_object_s "build_sources_object" - #define FAKE_build_setting_name_build_sources_object_shared_s "build_sources_object_shared" - #define FAKE_build_setting_name_build_sources_object_static_s "build_sources_object_static" - #define FAKE_build_setting_name_build_sources_program_s "build_sources_program" - #define FAKE_build_setting_name_build_sources_program_shared_s "build_sources_program_shared" - #define FAKE_build_setting_name_build_sources_program_static_s "build_sources_program_static" - #define FAKE_build_setting_name_build_sources_script_s "build_sources_script" - #define FAKE_build_setting_name_build_sources_setting_s "build_sources_setting" - #define FAKE_build_setting_name_build_static_s "build_static" - #define FAKE_build_setting_name_defines_s "defines" - #define FAKE_build_setting_name_defines_library_s "defines_library" - #define FAKE_build_setting_name_defines_library_shared_s "defines_library_shared" - #define FAKE_build_setting_name_defines_library_static_s "defines_library_static" - #define FAKE_build_setting_name_defines_object_s "defines_object" - #define FAKE_build_setting_name_defines_object_shared_s "defines_object_shared" - #define FAKE_build_setting_name_defines_object_static_s "defines_object_static" - #define FAKE_build_setting_name_defines_program_s "defines_program" - #define FAKE_build_setting_name_defines_program_shared_s "defines_program_shared" - #define FAKE_build_setting_name_defines_program_static_s "defines_program_static" - #define FAKE_build_setting_name_defines_shared_s "defines_shared" - #define FAKE_build_setting_name_defines_static_s "defines_static" - #define FAKE_build_setting_name_environment_s "environment" - #define FAKE_build_setting_name_flags_s "flags" - #define FAKE_build_setting_name_flags_library_s "flags_library" - #define FAKE_build_setting_name_flags_library_shared_s "flags_library_shared" - #define FAKE_build_setting_name_flags_library_static_s "flags_library_static" - #define FAKE_build_setting_name_flags_object_s "flags_object" - #define FAKE_build_setting_name_flags_object_shared_s "flags_object_shared" - #define FAKE_build_setting_name_flags_object_static_s "flags_object_static" - #define FAKE_build_setting_name_flags_program_s "flags_program" - #define FAKE_build_setting_name_flags_program_shared_s "flags_program_shared" - #define FAKE_build_setting_name_flags_program_static_s "flags_program_static" - #define FAKE_build_setting_name_flags_shared_s "flags_shared" - #define FAKE_build_setting_name_flags_static_s "flags_static" - #define FAKE_build_setting_name_has_path_standard_s "has_path_standard" - #define FAKE_build_setting_name_modes_s "modes" - #define FAKE_build_setting_name_modes_default_s "modes_default" - #define FAKE_build_setting_name_path_headers_s "path_headers" - #define FAKE_build_setting_name_path_language_s "path_language" - #define FAKE_build_setting_name_path_library_script_s "path_library_script" - #define FAKE_build_setting_name_path_library_shared_s "path_library_shared" - #define FAKE_build_setting_name_path_library_static_s "path_library_static" - #define FAKE_build_setting_name_path_object_script_s "path_object_script" - #define FAKE_build_setting_name_path_object_shared_s "path_object_shared" - #define FAKE_build_setting_name_path_object_static_s "path_object_static" - #define FAKE_build_setting_name_path_program_script_s "path_program_script" - #define FAKE_build_setting_name_path_program_shared_s "path_program_shared" - #define FAKE_build_setting_name_path_program_static_s "path_program_static" - #define FAKE_build_setting_name_path_sources_s "path_sources" - #define FAKE_build_setting_name_path_sources_object_s "path_sources_object" - #define FAKE_build_setting_name_preserve_path_headers_s "preserve_path_headers" - #define FAKE_build_setting_name_process_post_s "process_post" - #define FAKE_build_setting_name_process_pre_s "process_pre" - #define FAKE_build_setting_name_search_exclusive_s "search_exclusive" - #define FAKE_build_setting_name_search_shared_s "search_shared" - #define FAKE_build_setting_name_search_static_s "search_static" - #define FAKE_build_setting_name_version_file_s "version_file" - #define FAKE_build_setting_name_version_major_s "version_major" - #define FAKE_build_setting_name_version_major_prefix_s "version_major_prefix" - #define FAKE_build_setting_name_version_micro_s "version_micro" - #define FAKE_build_setting_name_version_micro_prefix_s "version_micro_prefix" - #define FAKE_build_setting_name_version_minor_s "version_minor" - #define FAKE_build_setting_name_version_minor_prefix_s "version_minor_prefix" - #define FAKE_build_setting_name_version_nano_s "version_nano" - #define FAKE_build_setting_name_version_nano_prefix_s "version_nano_prefix" - #define FAKE_build_setting_name_version_target_s "version_target" - - #define FAKE_build_setting_default_ar_s_length 2 - #define FAKE_build_setting_default_gcc_s_length 3 - #define FAKE_build_setting_default_version_s_length 1 - #define FAKE_build_setting_default_version_prefix_s_length 1 - #define FAKE_build_setting_default_yes_s_length 3 - - #define FAKE_build_setting_name_build_compiler_s_length 14 - #define FAKE_build_setting_name_build_indexer_s_length 13 - #define FAKE_build_setting_name_build_indexer_arguments_s_length 23 - #define FAKE_build_setting_name_build_language_s_length 14 - #define FAKE_build_setting_name_build_libraries_s_length 15 - #define FAKE_build_setting_name_build_libraries_shared_s_length 22 - #define FAKE_build_setting_name_build_libraries_static_s_length 22 - #define FAKE_build_setting_name_build_name_s_length 10 - #define FAKE_build_setting_name_build_objects_library_s_length 21 - #define FAKE_build_setting_name_build_objects_library_shared_s_length 28 - #define FAKE_build_setting_name_build_objects_library_static_s_length 28 - #define FAKE_build_setting_name_build_objects_program_s_length 21 - #define FAKE_build_setting_name_build_objects_program_shared_s_length 28 - #define FAKE_build_setting_name_build_objects_program_static_s_length 28 - #define FAKE_build_setting_name_build_script_s_length 12 - #define FAKE_build_setting_name_build_shared_s_length 12 - #define FAKE_build_setting_name_build_sources_documentation_s_length 27 - #define FAKE_build_setting_name_build_sources_headers_s_length 21 - #define FAKE_build_setting_name_build_sources_headers_shared_s_length 28 - #define FAKE_build_setting_name_build_sources_headers_static_s_length 28 - #define FAKE_build_setting_name_build_sources_library_s_length 21 - #define FAKE_build_setting_name_build_sources_library_shared_s_length 28 - #define FAKE_build_setting_name_build_sources_library_static_s_length 28 - #define FAKE_build_setting_name_build_sources_object_s_length 20 - #define FAKE_build_setting_name_build_sources_object_shared_s_length 27 - #define FAKE_build_setting_name_build_sources_object_static_s_length 27 - #define FAKE_build_setting_name_build_sources_program_s_length 21 - #define FAKE_build_setting_name_build_sources_program_shared_s_length 28 - #define FAKE_build_setting_name_build_sources_program_static_s_length 28 - #define FAKE_build_setting_name_build_sources_script_s_length 20 - #define FAKE_build_setting_name_build_sources_setting_s_length 21 - #define FAKE_build_setting_name_build_static_s_length 12 - #define FAKE_build_setting_name_environment_s_length 11 - #define FAKE_build_setting_name_defines_s_length 7 - #define FAKE_build_setting_name_defines_library_s_length 15 - #define FAKE_build_setting_name_defines_library_shared_s_length 22 - #define FAKE_build_setting_name_defines_library_static_s_length 22 - #define FAKE_build_setting_name_defines_object_s_length 14 - #define FAKE_build_setting_name_defines_object_shared_s_length 21 - #define FAKE_build_setting_name_defines_object_static_s_length 21 - #define FAKE_build_setting_name_defines_program_s_length 15 - #define FAKE_build_setting_name_defines_program_shared_s_length 22 - #define FAKE_build_setting_name_defines_program_static_s_length 22 - #define FAKE_build_setting_name_defines_shared_s_length 14 - #define FAKE_build_setting_name_defines_static_s_length 14 - #define FAKE_build_setting_name_flags_s_length 5 - #define FAKE_build_setting_name_flags_library_s_length 13 - #define FAKE_build_setting_name_flags_library_shared_s_length 20 - #define FAKE_build_setting_name_flags_library_static_s_length 20 - #define FAKE_build_setting_name_flags_object_s_length 12 - #define FAKE_build_setting_name_flags_object_shared_s_length 19 - #define FAKE_build_setting_name_flags_object_static_s_length 19 - #define FAKE_build_setting_name_flags_program_s_length 13 - #define FAKE_build_setting_name_flags_program_shared_s_length 20 - #define FAKE_build_setting_name_flags_program_static_s_length 20 - #define FAKE_build_setting_name_flags_shared_s_length 12 - #define FAKE_build_setting_name_flags_static_s_length 12 - #define FAKE_build_setting_name_has_path_standard_s_length 17 - #define FAKE_build_setting_name_modes_s_length 5 - #define FAKE_build_setting_name_modes_default_s_length 13 - #define FAKE_build_setting_name_path_headers_s_length 12 - #define FAKE_build_setting_name_path_language_s_length 13 - #define FAKE_build_setting_name_path_library_script_s_length 19 - #define FAKE_build_setting_name_path_library_shared_s_length 19 - #define FAKE_build_setting_name_path_library_static_s_length 19 - #define FAKE_build_setting_name_path_object_script_s_length 18 - #define FAKE_build_setting_name_path_object_shared_s_length 18 - #define FAKE_build_setting_name_path_object_static_s_length 18 - #define FAKE_build_setting_name_path_program_script_s_length 19 - #define FAKE_build_setting_name_path_program_shared_s_length 19 - #define FAKE_build_setting_name_path_program_static_s_length 19 - #define FAKE_build_setting_name_path_sources_s_length 12 - #define FAKE_build_setting_name_path_sources_object_s_length 19 - #define FAKE_build_setting_name_preserve_path_headers_s_length 21 - #define FAKE_build_setting_name_process_post_s_length 12 - #define FAKE_build_setting_name_process_pre_s_length 11 - #define FAKE_build_setting_name_search_exclusive_s_length 16 - #define FAKE_build_setting_name_search_shared_s_length 13 - #define FAKE_build_setting_name_search_static_s_length 13 - #define FAKE_build_setting_name_version_file_s_length 12 - #define FAKE_build_setting_name_version_major_s_length 13 - #define FAKE_build_setting_name_version_major_prefix_s_length 20 - #define FAKE_build_setting_name_version_micro_s_length 13 - #define FAKE_build_setting_name_version_micro_prefix_s_length 20 - #define FAKE_build_setting_name_version_minor_s_length 13 - #define FAKE_build_setting_name_version_minor_prefix_s_length 20 - #define FAKE_build_setting_name_version_nano_s_length 12 - #define FAKE_build_setting_name_version_nano_prefix_s_length 19 - #define FAKE_build_setting_name_version_target_s_length 14 - - extern const f_string_static_t fake_build_setting_default_ar_s; - extern const f_string_static_t fake_build_setting_default_gcc_s; - extern const f_string_static_t fake_build_setting_default_version_s; - extern const f_string_static_t fake_build_setting_default_version_prefix_s; - extern const f_string_static_t fake_build_setting_default_yes_s; - - extern const f_string_static_t fake_build_setting_name_build_compiler_s; - extern const f_string_static_t fake_build_setting_name_build_indexer_s; - extern const f_string_static_t fake_build_setting_name_build_indexer_arguments_s; - extern const f_string_static_t fake_build_setting_name_build_language_s; - extern const f_string_static_t fake_build_setting_name_build_libraries_s; - extern const f_string_static_t fake_build_setting_name_build_libraries_shared_s; - extern const f_string_static_t fake_build_setting_name_build_libraries_static_s; - extern const f_string_static_t fake_build_setting_name_build_name_s; - extern const f_string_static_t fake_build_setting_name_build_objects_library_s; - extern const f_string_static_t fake_build_setting_name_build_objects_library_shared_s; - extern const f_string_static_t fake_build_setting_name_build_objects_library_static_s; - extern const f_string_static_t fake_build_setting_name_build_objects_program_s; - extern const f_string_static_t fake_build_setting_name_build_objects_program_shared_s; - extern const f_string_static_t fake_build_setting_name_build_objects_program_static_s; - extern const f_string_static_t fake_build_setting_name_build_script_s; - extern const f_string_static_t fake_build_setting_name_build_shared_s; - extern const f_string_static_t fake_build_setting_name_build_sources_documentation_s; - extern const f_string_static_t fake_build_setting_name_build_sources_headers_s; - extern const f_string_static_t fake_build_setting_name_build_sources_headers_shared_s; - extern const f_string_static_t fake_build_setting_name_build_sources_headers_static_s; - extern const f_string_static_t fake_build_setting_name_build_sources_library_s; - extern const f_string_static_t fake_build_setting_name_build_sources_library_shared_s; - extern const f_string_static_t fake_build_setting_name_build_sources_library_static_s; - extern const f_string_static_t fake_build_setting_name_build_sources_object_s; - extern const f_string_static_t fake_build_setting_name_build_sources_object_shared_s; - extern const f_string_static_t fake_build_setting_name_build_sources_object_static_s; - extern const f_string_static_t fake_build_setting_name_build_sources_program_s; - extern const f_string_static_t fake_build_setting_name_build_sources_program_shared_s; - extern const f_string_static_t fake_build_setting_name_build_sources_program_static_s; - extern const f_string_static_t fake_build_setting_name_build_sources_script_s; - extern const f_string_static_t fake_build_setting_name_build_sources_setting_s; - extern const f_string_static_t fake_build_setting_name_build_static_s; - extern const f_string_static_t fake_build_setting_name_defines_s; - extern const f_string_static_t fake_build_setting_name_defines_library_s; - extern const f_string_static_t fake_build_setting_name_defines_library_shared_s; - extern const f_string_static_t fake_build_setting_name_defines_library_static_s; - extern const f_string_static_t fake_build_setting_name_defines_object_s; - extern const f_string_static_t fake_build_setting_name_defines_object_shared_s; - extern const f_string_static_t fake_build_setting_name_defines_object_static_s; - extern const f_string_static_t fake_build_setting_name_defines_program_s; - extern const f_string_static_t fake_build_setting_name_defines_program_shared_s; - extern const f_string_static_t fake_build_setting_name_defines_program_static_s; - extern const f_string_static_t fake_build_setting_name_defines_shared_s; - extern const f_string_static_t fake_build_setting_name_defines_static_s; - extern const f_string_static_t fake_build_setting_name_environment_s; - extern const f_string_static_t fake_build_setting_name_flags_s; - extern const f_string_static_t fake_build_setting_name_flags_library_s; - extern const f_string_static_t fake_build_setting_name_flags_library_shared_s; - extern const f_string_static_t fake_build_setting_name_flags_library_static_s; - extern const f_string_static_t fake_build_setting_name_flags_object_s; - extern const f_string_static_t fake_build_setting_name_flags_object_shared_s; - extern const f_string_static_t fake_build_setting_name_flags_object_static_s; - extern const f_string_static_t fake_build_setting_name_flags_program_s; - extern const f_string_static_t fake_build_setting_name_flags_program_shared_s; - extern const f_string_static_t fake_build_setting_name_flags_program_static_s; - extern const f_string_static_t fake_build_setting_name_flags_shared_s; - extern const f_string_static_t fake_build_setting_name_flags_static_s; - extern const f_string_static_t fake_build_setting_name_has_path_standard_s; - extern const f_string_static_t fake_build_setting_name_modes_s; - extern const f_string_static_t fake_build_setting_name_modes_default_s; - extern const f_string_static_t fake_build_setting_name_path_headers_s; - extern const f_string_static_t fake_build_setting_name_path_language_s; - extern const f_string_static_t fake_build_setting_name_path_library_script_s; - extern const f_string_static_t fake_build_setting_name_path_library_shared_s; - extern const f_string_static_t fake_build_setting_name_path_library_static_s; - extern const f_string_static_t fake_build_setting_name_path_object_script_s; - extern const f_string_static_t fake_build_setting_name_path_object_shared_s; - extern const f_string_static_t fake_build_setting_name_path_object_static_s; - extern const f_string_static_t fake_build_setting_name_path_program_script_s; - extern const f_string_static_t fake_build_setting_name_path_program_shared_s; - extern const f_string_static_t fake_build_setting_name_path_program_static_s; - extern const f_string_static_t fake_build_setting_name_path_sources_s; - extern const f_string_static_t fake_build_setting_name_path_sources_object_s; - extern const f_string_static_t fake_build_setting_name_preserve_path_headers_s; - extern const f_string_static_t fake_build_setting_name_process_post_s; - extern const f_string_static_t fake_build_setting_name_process_pre_s; - extern const f_string_static_t fake_build_setting_name_search_exclusive_s; - extern const f_string_static_t fake_build_setting_name_search_shared_s; - extern const f_string_static_t fake_build_setting_name_search_static_s; - extern const f_string_static_t fake_build_setting_name_version_file_s; - extern const f_string_static_t fake_build_setting_name_version_major_s; - extern const f_string_static_t fake_build_setting_name_version_major_prefix_s; - extern const f_string_static_t fake_build_setting_name_version_micro_s; - extern const f_string_static_t fake_build_setting_name_version_micro_prefix_s; - extern const f_string_static_t fake_build_setting_name_version_minor_s; - extern const f_string_static_t fake_build_setting_name_version_minor_prefix_s; - extern const f_string_static_t fake_build_setting_name_version_nano_s; - extern const f_string_static_t fake_build_setting_name_version_nano_prefix_s; - extern const f_string_static_t fake_build_setting_name_version_target_s; -#endif // _di_fake_build_setting_s_ - -#ifndef _di_fake_build_stage_s_ - #define FAKE_build_stage_built_s ".built" - #define FAKE_build_stage_library_script_s "library_script" - #define FAKE_build_stage_library_shared_s "library_shared" - #define FAKE_build_stage_library_static_s "library_static" - #define FAKE_build_stage_object_script_s "object_script" - #define FAKE_build_stage_object_shared_s "object_shared" - #define FAKE_build_stage_object_static_s "object_static" - #define FAKE_build_stage_objects_static_s "objects_static" - #define FAKE_build_stage_process_post_s "process_post" - #define FAKE_build_stage_process_pre_s "process_pre" - #define FAKE_build_stage_program_script_s "program_script" - #define FAKE_build_stage_program_shared_s "program_shared" - #define FAKE_build_stage_program_static_s "program_static" - #define FAKE_build_stage_separate_s "-" - #define FAKE_build_stage_skeleton_s "skeleton" - #define FAKE_build_stage_sources_documentation_s "sources_documentation" - #define FAKE_build_stage_sources_headers_s "sources_headers" - #define FAKE_build_stage_sources_script_s "sources_script" - #define FAKE_build_stage_sources_settings_s "sources_settings" - - #define FAKE_build_stage_built_s_length 6 - #define FAKE_build_stage_library_script_s_length 14 - #define FAKE_build_stage_library_shared_s_length 14 - #define FAKE_build_stage_library_static_s_length 14 - #define FAKE_build_stage_object_script_s_length 13 - #define FAKE_build_stage_object_shared_s_length 13 - #define FAKE_build_stage_object_static_s_length 13 - #define FAKE_build_stage_objects_static_s_length 14 - #define FAKE_build_stage_process_post_s_length 12 - #define FAKE_build_stage_process_pre_s_length 11 - #define FAKE_build_stage_program_script_s_length 14 - #define FAKE_build_stage_program_shared_s_length 14 - #define FAKE_build_stage_program_static_s_length 14 - #define FAKE_build_stage_separate_s_length 1 - #define FAKE_build_stage_skeleton_s_length 8 - #define FAKE_build_stage_sources_documentation_s_length 21 - #define FAKE_build_stage_sources_headers_s_length 15 - #define FAKE_build_stage_sources_script_s_length 14 - #define FAKE_build_stage_sources_settings_s_length 16 - - extern const f_string_static_t fake_build_stage_built_s; - extern const f_string_static_t fake_build_stage_library_script_s; - extern const f_string_static_t fake_build_stage_library_shared_s; - extern const f_string_static_t fake_build_stage_library_static_s; - extern const f_string_static_t fake_build_stage_object_script_s; - extern const f_string_static_t fake_build_stage_object_shared_s; - extern const f_string_static_t fake_build_stage_object_static_s; - extern const f_string_static_t fake_build_stage_objects_static_s; - extern const f_string_static_t fake_build_stage_process_post_s; - extern const f_string_static_t fake_build_stage_process_pre_s; - extern const f_string_static_t fake_build_stage_program_script_s; - extern const f_string_static_t fake_build_stage_program_shared_s; - extern const f_string_static_t fake_build_stage_program_static_s; - extern const f_string_static_t fake_build_stage_separate_s; - extern const f_string_static_t fake_build_stage_skeleton_s; - extern const f_string_static_t fake_build_stage_sources_documentation_s; - extern const f_string_static_t fake_build_stage_sources_headers_s; - extern const f_string_static_t fake_build_stage_sources_script_s; - extern const f_string_static_t fake_build_stage_sources_settings_s; -#endif // _di_fake_build_stage_s_ - -#ifndef _di_fake_build_parameter_s_ - #define FAKE_build_parameter_library_include_s "-I" - #define FAKE_build_parameter_library_link_file_s "-l" - #define FAKE_build_parameter_library_link_path_s "-L" - #define FAKE_build_parameter_library_name_prefix_s "lib" - #define FAKE_build_parameter_library_name_suffix_shared_s ".so" - #define FAKE_build_parameter_library_name_suffix_static_s ".a" - #define FAKE_build_parameter_library_output_s "-o" - #define FAKE_build_parameter_library_shared_s "-shared" - #define FAKE_build_parameter_library_static_s "-static" - #define FAKE_build_parameter_library_shared_prefix_s "-Wl,-soname," - - #define FAKE_build_parameter_library_include_s_length 2 - #define FAKE_build_parameter_library_link_file_s_length 2 - #define FAKE_build_parameter_library_link_path_s_length 2 - #define FAKE_build_parameter_library_name_prefix_s_length 3 - #define FAKE_build_parameter_library_name_suffix_shared_s_length 3 - #define FAKE_build_parameter_library_name_suffix_static_s_length 2 - #define FAKE_build_parameter_library_output_s_length 2 - #define FAKE_build_parameter_library_shared_s_length 7 - #define FAKE_build_parameter_library_static_s_length 7 - #define FAKE_build_parameter_library_shared_prefix_s_length 12 - - extern const f_string_static_t fake_build_parameter_library_include_s; - extern const f_string_static_t fake_build_parameter_library_link_file_s; - extern const f_string_static_t fake_build_parameter_library_link_path_s; - extern const f_string_static_t fake_build_parameter_library_name_prefix_s; - extern const f_string_static_t fake_build_parameter_library_name_suffix_shared_s; - extern const f_string_static_t fake_build_parameter_library_name_suffix_static_s; - extern const f_string_static_t fake_build_parameter_library_output_s; - extern const f_string_static_t fake_build_parameter_library_shared_s; - extern const f_string_static_t fake_build_parameter_library_static_s; - extern const f_string_static_t fake_build_parameter_library_shared_prefix_s; - - #define FAKE_build_parameter_object_compile_s "-c" - #define FAKE_build_parameter_object_name_suffix_s ".o" - #define FAKE_build_parameter_object_output_s "-o" - #define FAKE_build_parameter_object_static_s "-static" - - #define FAKE_build_parameter_object_compile_s_length 2 - #define FAKE_build_parameter_object_name_suffix_s_length 2 - #define FAKE_build_parameter_object_output_s_length 2 - #define FAKE_build_parameter_object_static_s_length 7 - - extern const f_string_static_t fake_build_parameter_object_compile_s; - extern const f_string_static_t fake_build_parameter_object_name_suffix_s; - extern const f_string_static_t fake_build_parameter_object_output_s; - extern const f_string_static_t fake_build_parameter_object_static_s; -#endif // _di_fake_build_parameter_s_ - #ifndef _di_fake_common_s_ #define FAKE_common_file_directory_copy_s "copy directory" #define FAKE_common_file_path_access_s "access" diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index eebab5c..f70c618 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -1,11 +1,4 @@ #include "fake.h" -#include "fake/path_generate.h" -#include "build.h" -#include "clean.h" -#include "make.h" -#include "make/operate.h" -#include "print.h" -#include "skeleton.h" #ifdef __cplusplus extern "C" { @@ -17,7 +10,7 @@ extern "C" { if (!main || !setting) return; if (F_status_is_error(setting->state.status)) { - fake_print_line_last_locked(setting, main->error); + fake_print_line_last(setting, main->message); return; } @@ -54,7 +47,7 @@ extern "C" { data.main = main; data.setting = setting; - setting->state.status = fake_path_generate(&data); + fake_path_generate(&data); if (F_status_is_error(setting->state.status)) { fake_data_delete(&data); @@ -210,7 +203,7 @@ extern "C" { fake_print_error_failure_operation(setting, main->error, data.operation); } - fake_print_line_last_locked(setting, main->error); + fake_print_line_last(setting, main->message); } else if (setting->state.status != F_child) { if (F_status_is_error_not(setting->state.status)) { @@ -218,7 +211,7 @@ extern "C" { } if (setting->state.status != F_interrupt) { - fake_print_line_last_locked(setting, main->message); + fake_print_line_last(setting, main->message); } } @@ -262,12 +255,14 @@ extern "C" { *status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + *status = F_status_set_error(F_interrupt); - return 0; + return 0; + } } if (*status == F_child) return return_code; @@ -286,8 +281,6 @@ extern "C" { if (data->main->error.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(data->main->error.to); - 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); @@ -305,130 +298,143 @@ extern "C" { #endif // _di_fake_execute_ #ifndef _di_fake_file_buffer_ - f_status_t fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer) { + void fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer) { - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - return F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); + + return; + } } - f_status_t status = f_file_exists(path_file, F_true); + data->setting.state.status = f_file_exists(path_file, F_true); - if (F_status_is_error(status)) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); - return status; + return; } - if (status == F_true) { + if (data->setting.state.status == F_true) { { off_t size_file = 0; - status = f_file_size(path_file, F_true, &size_file); + data->setting.state.status = f_file_size(path_file, F_true, &size_file); - if (F_status_is_error(status)) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, , macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e); - return status; + return; } - if (size_file > fake_common_max_initial_buffer_d) { - size_file = fake_common_max_initial_buffer_d; + if (size_file > fake_max_initial_buffer_d) { + size_file = fake_max_initial_buffer_d; } - status = f_string_dynamic_increase_by(size_file, buffer); + data->setting.state.status = f_string_dynamic_increase_by(size_file, buffer); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24); - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e); - return status; + return; } - status = F_true; + data->setting.state.status = F_true; } f_file_t file = f_file_t_initialize; - status = f_file_stream_open(path_file, f_string_empty_s, &file); + data->setting.state.status = f_file_stream_open(path_file, f_string_empty_s, &file); - if (F_status_is_error(status)) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e); - return status; + return; } - status = f_file_stream_read(file, buffer); + data->setting.state.status = f_file_stream_read(file, buffer); f_file_stream_flush(file); f_file_stream_close(&file); - if (F_status_is_error(status)) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e); + } + else { + data->setting.state.status = F_none; } } else { if (required) { - status = F_status_set_error(F_file_found_not); + data->setting.state.status = F_status_set_error(F_file_found_not); - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); } } - - return status; } #endif // _di_fake_file_buffer_ #ifndef _di_fake_pipe_buffer_ - f_status_t fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer) { + void fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer) { + + if (!data || !buffer) return; - f_status_t status = F_none; f_file_t file = f_file_t_initialize; file.id = F_type_descriptor_input_d; file.stream = F_type_input_d; file.size_read = fake_default_allocation_pipe_d; - status = f_string_dynamic_increase_by(fake_common_max_initial_buffer_d, buffer); + data->setting.state.status = f_string_dynamic_increase_by(fake_max_initial_buffer_d, buffer); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24); - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); - return status; + return; } // Reset the error state before processing. clearerr(F_type_input_d); do { - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - return F_status_set_error(F_interrupt); + f_file_stream_read_block = F_status_set_error(F_interrupt); + + return; + } } - status = f_file_stream_read_block(file, buffer); + data->setting.state.status = f_file_stream_read_block(file, buffer); - } while (F_status_is_fine(status) && status != F_interrupt && status != F_none_eof); + } while (F_status_is_fine(data->setting.state.status) && data->setting.state.status != F_interrupt && data->setting.state.status != F_none_eof); - if (F_status_is_error(status)) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e); + } + else { + data->setting.state.status = F_none; } - - return status; } #endif // _di_fake_pipe_buffer_ #ifndef _di_fake_validate_parameter_paths_ f_status_t fake_validate_parameter_paths(fake_data_t * const data) { - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - return F_status_set_error(F_interrupt); + return F_status_set_error(F_interrupt); + } } const f_string_static_t names[] = { @@ -517,8 +523,6 @@ extern "C" { else if (requireds[i] == F_true) { f_file_stream_lock(data->main->error.to); - 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.h b/level_3/fake/c/main/fake.h index fe70009..41595ec 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -102,10 +102,41 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include #ifdef __cplusplus extern "C" { @@ -175,6 +206,19 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * F_false on file not found and file is not required. + * + * F_file_found_not (with error bit) if file is not found and file is required. + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: f_file_exists() + * Errors (with error bit) from: f_file_size() + * Errors (with error bit) from: f_file_stream_open() + * Errors (with error bit) from: f_file_stream_read() + * Errors (with error bit) from: f_string_dynamic_increase_by() * @param path_file * The path to the file to load. * @param required @@ -183,17 +227,14 @@ extern "C" { * @param buffer * A buffer containing the contents of the file. * - * @return - * F_none on success. - * F_false on file not found and file is not required. - * - * F_file_found_not (with error bit) if file is not found and file is required. - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. - * - * Status codes (with error bit) are returned on any problem. + * @see f_file_exists() + * @see f_file_size() + * @see f_file_stream_open() + * @see f_file_stream_read() + * @see f_string_dynamic_increase_by() */ #ifndef _di_fake_file_buffer_ - extern f_status_t fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer); + extern void fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer); #endif // _di_fake_file_buffer_ /** @@ -201,18 +242,22 @@ extern "C" { * * @param data * The program data. - * @param buffer - * A buffer containing the contents of the file. * - * @return - * F_none on success. + * This alters data.setting.state.status: + * F_none on success. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * F_interrupt (with error bit) on interrupt signal received. * - * Status codes (with error bit) are returned on any problem. + * Errors (with error bit) from: f_file_stream_read_block() + * Errors (with error bit) from: f_string_dynamic_increase_by() + * @param buffer + * A buffer containing the contents of the file. + * + * @see f_file_stream_read_block() + * @see f_string_dynamic_increase_by() */ #ifndef _di_fake_pipe_buffer_ - extern f_status_t fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer); + extern void fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer); #endif // _di_fake_pipe_buffer_ /** diff --git a/level_3/fake/c/main/fake/path_generate.c b/level_3/fake/c/main/fake/path_generate.c index c046f32..04dabcf 100644 --- a/level_3/fake/c/main/fake/path_generate.c +++ b/level_3/fake/c/main/fake/path_generate.c @@ -1,14 +1,15 @@ #include "../fake.h" -#include "path_generate.h" #ifdef __cplusplus extern "C" { #endif #ifndef _di_fake_path_generate_ - f_status_t fake_path_generate(fake_data_t * const data) { + void fake_path_generate(fake_data_t * const data) { - f_status_t status = F_none; + if (!data) return; + + data->setting.state.status = F_none; uint8_t i = 0; { @@ -54,12 +55,12 @@ extern "C" { values[i][j]->used = 0; } // for - status = fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); + fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(fake_path_generate_string_dynamic)); - return status; + return; } } // for } @@ -99,12 +100,12 @@ extern "C" { for (i = 0; i < 13; ++i) { - status = f_string_dynamic_append_nulless(sources[i], values[i]); + data->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - return status; + return; } } // for } @@ -167,12 +168,12 @@ extern "C" { for (i = 0; i < 5; ++i) { - status = fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); + fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic)); - return status; + return; } } // for } @@ -227,12 +228,12 @@ extern "C" { for (i = 0; i < 16; ++i) { - status = f_string_dynamic_append_nulless(sources[i], values[i]); + data->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - return status; + return; } } // for } @@ -249,12 +250,12 @@ extern "C" { values[i]->used = 0; - status = f_string_dynamic_append_nulless(data->setting->work, values[i]); + data->setting.state.status = f_string_dynamic_append_nulless(data->setting->work, values[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - return status; + return; } } // for } @@ -274,12 +275,12 @@ extern "C" { for (i = 0; i < 3; ++i) { - status = f_string_dynamic_append_nulless(sources[i], values[i]); + data->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - return status; + return; } } // for } @@ -314,12 +315,12 @@ extern "C" { for (i = 0; i < 2; ++i) { - status = fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); + data->setting.state.status = fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic)); - return status; + return; } } // for } @@ -345,33 +346,33 @@ extern "C" { for (i = 0; i < 6; ++i) { - status = f_string_dynamic_append_nulless(sources[i], values[i]); + data->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data->setting, data->main->error, data->setting.state.status, macro_fake_f(f_string_dynamic_append_nulless)); - return status; + return; } } // for } } - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_path_generate_ #ifndef _di_fake_path_generate_string_dynamic_ - f_status_t fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t length) { + void fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t length) { + + if (!data) return; - f_status_t status = F_none; + data->setting.state.status = F_none; for (uint8_t i = 0; i < length; ++i) { - status = f_string_dynamic_append_nulless(source, destination[i]); - if (F_status_is_error(status)) return status; + data->setting.state.status = f_string_dynamic_append_nulless(source, destination[i]); + if (F_status_is_error(data->setting.state.status)) break; } // for - - return F_none; } #endif // _di_fake_path_generate_string_dynamic_ diff --git a/level_3/fake/c/main/fake/path_generate.h b/level_3/fake/c/main/fake/path_generate.h index eacffca..cbba01e 100644 --- a/level_3/fake/c/main/fake/path_generate.h +++ b/level_3/fake/c/main/fake/path_generate.h @@ -22,13 +22,18 @@ extern "C" { * @param data * The program data. * - * @return - * F_none on success. + * This alters data.setting.state.status: + * F_none on success. * - * Status codes (with error bit) are returned on any problem. + * Errors (with error bit) from: f_string_dynamic_append_nulless(). + * Errors (with error bit) from: fake_path_generate_string_dynamic(). + * + * @see f_string_dynamic_append_nulless() + * + * @see fake_path_generate_string_dynamic() */ #ifndef _di_fake_path_generate_ - extern f_status_t fake_path_generate(fake_data_t * const data); + extern void fake_path_generate(fake_data_t * const data); #endif // _di_fake_path_generate_ /** @@ -36,8 +41,14 @@ extern "C" { * * The given source is applied to each destination. * - * @param daa + * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: f_string_dynamic_append_nulless(). + * * @param source * The string to copy from. * @param destination @@ -45,13 +56,10 @@ extern "C" { * @param length * The size of the values. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see f_string_dynamic_append_nulless() */ #ifndef _di_fake_path_generate_string_dynamic_ - extern f_status_t fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t size); + extern void fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t size); #endif // _di_fake_path_generate_string_dynamic_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make.c b/level_3/fake/c/main/make.c index 702000a..3e2ebc9 100644 --- a/level_3/fake/c/main/make.c +++ b/level_3/fake/c/main/make.c @@ -1,5 +1,4 @@ #include "fake.h" -#include "make.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/make.h b/level_3/fake/c/main/make.h index 8098223..c72fb96 100644 --- a/level_3/fake/c/main/make.h +++ b/level_3/fake/c/main/make.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_make_h -#define _PRIVATE_make_h +#ifndef _fake_make_h +#define _fake_make_h #ifdef __cplusplus extern "C" { @@ -125,4 +125,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_make_h +#endif // _fake_make_h diff --git a/level_3/fake/c/main/make/load_fakefile.c b/level_3/fake/c/main/make/load_fakefile.c index e60b380..4f7e910 100644 --- a/level_3/fake/c/main/make/load_fakefile.c +++ b/level_3/fake/c/main/make/load_fakefile.c @@ -1,9 +1,4 @@ #include "../fake.h" -#include "../build/load.h" -#include "load_fakefile.h" -#include "operate_validate.h" -#include "print-error.h" -#include "print-warning.h" #ifdef __cplusplus extern "C" { @@ -54,7 +49,7 @@ extern "C" { { f_string_range_t range = macro_f_string_range_t_initialize2(data_make->buffer.used); f_fss_comments_t comments = f_fss_comments_t_initialize; - f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); + f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); *status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments); @@ -87,7 +82,7 @@ extern "C" { bool missing_settings = F_true; f_fss_set_t settings = f_fss_set_t_initialize; - f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); + f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); if (list_objects.used > data_make->fakefile.size) { macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used); diff --git a/level_3/fake/c/main/make/load_parameters.c b/level_3/fake/c/main/make/load_parameters.c index 8c21779..f68bc2c 100644 --- a/level_3/fake/c/main/make/load_parameters.c +++ b/level_3/fake/c/main/make/load_parameters.c @@ -1,5 +1,4 @@ #include "../fake.h" -#include "load_parameters.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/make/operate.c b/level_3/fake/c/main/make/operate.c index 25b78e4..741f7ad 100644 --- a/level_3/fake/c/main/make/operate.c +++ b/level_3/fake/c/main/make/operate.c @@ -1,14 +1,4 @@ #include "../fake.h" -#include "../print.h" -#include "load_parameters.h" -#include "load_fakefile.h" -#include "operate.h" -#include "operate_block.h" -#include "operate_process.h" -#include "operate_validate.h" -#include "print.h" -#include "print-error.h" -#include "print-warning.h" #ifdef __cplusplus extern "C" { @@ -17,10 +7,12 @@ extern "C" { #ifndef _di_fake_make_operate_ f_status_t fake_make_operate(fake_data_t * const data) { - if (fll_program_standard_signal_received(data->main)) { - fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); + if (!((++data->main->signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(data->main)) { + fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - return F_status_set_error(F_interrupt); + return F_status_set_error(F_interrupt); + } } fake_make_print_now_making(data->setting, data->main->message, data->setting->fakefile); @@ -231,7 +223,7 @@ extern "C" { f_iki_data_t *iki_data = &data_make->cache_iki; - f_state_t state = macro_f_state_t_initialize_1(fake_common_allocation_large_d, fake_common_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); + f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); f_string_range_t range = f_string_range_t_initialize; f_string_map_multis_t *parameter = &data_make->setting_make.parameter; @@ -1161,69 +1153,73 @@ extern "C" { #endif // _di_fake_make_operate_expand_context_ #ifndef _di_fake_make_operate_expand_environment_ - f_status_t fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { + void fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { - f_status_t status = F_none; + data->setting.state.status = F_none; data_make->cache_1.used = 0; data_make->cache_2.used = 0; - status = f_string_dynamic_increase_by((range_name.stop - range_name.start) + 2, &data_make->cache_1); + data->setting.state.status = f_string_dynamic_increase_by((range_name.stop - range_name.start) + 2, &data_make->cache_1); - if (F_status_is_error_not(status)) { - status = f_string_dynamic_partial_append_nulless(data_make->buffer, range_name, &data_make->cache_1); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range_name, &data_make->cache_1); } - if (F_status_is_error_not(status)) { - status = f_environment_get(data_make->cache_1, &data_make->cache_2); + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_environment_get(data_make->cache_1, &data_make->cache_2); } - if (F_status_is_error(status)) return status; - if (status == F_exist_not) return F_false; + if (F_status_is_error(data->setting.state.status)) return; - status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + if (data->setting.state.status == F_exist_not) { + data->setting.state.status = F_false; - if (F_status_is_error_not(status)) { - status = f_string_dynamic_increase_by(data_make->cache_2.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + return; } - if (F_status_is_error_not(status)) { - status = f_string_dynamic_append_nulless(data_make->cache_2, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting.state.status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_increase_by(data_make->cache_2.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); } - if (F_status_is_error(status)) return status; + if (F_status_is_error_not(data->setting.state.status)) { + data->setting.state.status = f_string_dynamic_append_nulless(data_make->cache_2, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + } + + if (F_status_is_error(data->setting.state.status)) return; if (!quote) { ++data_make->cache_arguments.used; - status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); - if (F_status_is_error(status)) return status; + data->setting.state.status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + if (F_status_is_error(data->setting.state.status)) return; } - if (data_make->cache_2.used) return F_true; - - return F_data_not; + data->setting.state.status = data_make->cache_2.used ? F_true : F_data_not; } #endif // _di_fake_make_operate_expand_environment_ #ifndef _di_fake_make_operate_section_ - int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t * const section_stack, f_status_t * const status) { + int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t * const section_stack) { - if (F_status_is_error(*status) || *status == F_child) return data_make->data->main->child; + if (!data_make || !section_stack) return 0; + if (F_status_is_error(data->setting.state.status) || data->setting.state.status == F_child) return data_make->data->main->child; if (id_section >= data_make->fakefile.used) { - *status = F_status_set_error(F_parameter); + data->setting.state.status = F_status_set_error(F_parameter); - fake_print_error(data_make->setting, data_make->error, F_parameter, macro_fake_f(fake_make_operate_section)); + fake_print_error(data_make->setting, data_make->error, macro_fake_f(fake_make_operate_section)); return 0; } // Add the operation id to the operation stack. - *status = f_array_lengths_increase(fake_default_allocation_small_d, section_stack); + data->setting.state.status = f_array_lengths_increase(fake_default_allocation_small_d, section_stack); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->error, *status, macro_fake_f(f_array_lengths_increase)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data_make->setting, data_make->error, macro_fake_f(f_array_lengths_increase)); return 0; } @@ -1321,7 +1317,7 @@ extern "C" { f_array_length_t i = 0; f_array_length_t j = 0; - for (i = 0; i < section->objects.used; ++i, *status = F_none) { + for (i = 0; i < section->objects.used; ++i, data->setting.state.status = F_none) { for (j = 0; j < data_make->cache_arguments.size; ++j) { data_make->cache_arguments.array[j].used = 0; @@ -1333,11 +1329,11 @@ extern "C" { state_process.operation_previous = state_process.operation; state_process.operation = 0; - if (!(i % fake_signal_check_short_d)) { + if (!((++data_make->main->signal_check) % fake_signal_check_short_d)) { if (fll_program_standard_signal_received(data_make->main)) { fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); break; } @@ -1345,7 +1341,7 @@ extern "C" { data_make->main->signal_check = 0; } - for (j = 0; j < fake_common_max_operation_d; ++j) { + for (j = 0; j < fake_max_operation_d; ++j) { if (fl_string_dynamic_partial_compare_string(operations_name[j].string, data_make->buffer, operations_name[j].used, section->objects.array[i]) == F_equal_to) { state_process.operation = operations_type[j]; @@ -1357,25 +1353,25 @@ extern "C" { if (!state_process.operation) { fake_print_error_operation_unknown(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[i]); - *status = F_status_set_error(F_valid_not); + data->setting.state.status = F_status_set_error(F_valid_not); } else if (state_process.operation == fake_make_operation_type_operate_e) { - if (section_stack->used == fake_common_max_stack_d) { - fake_print_error_operation_stack_max(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[i], fake_common_max_stack_d); + if (section_stack->used == fake_max_stack_d) { + fake_print_error_operation_stack_max(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[i], fake_max_stack_d); - *status = F_status_set_error(F_recurse); + data->setting.state.status = F_status_set_error(F_recurse); } } - fake_make_operate_expand(data_make, section->name, section->contents.array[i], section->quotess.array[i], status); + fake_make_operate_expand(data_make, section->name, section->contents.array[i], section->quotess.array[i]); fake_make_operate_block_prepare(&state_process); if (state_process.block != fake_state_process_block_done_e && state_process.block != fake_state_process_block_skip_e) { - fake_make_operate_validate(data_make, section->name, &state_process, section_stack, status); + fake_make_operate_validate(data_make, section->name, &state_process, section_stack); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting.state.status)) { if (state_process.block || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_or_e) { state_process.success_block = F_false; @@ -1387,20 +1383,20 @@ extern "C" { } else { if (!state_process.block || state_process.block == fake_state_process_block_operate_e) { - result = fake_make_operate_process(data_make, section->name, &state_process, section_stack, status); - if (*status == F_child) return result; + result = fake_make_operate_process(data_make, section->name, &state_process, section_stack); + if (data->setting.state.status == F_child) return result; } - fake_make_operate_block_postprocess(i == section->objects.used, &state_process, status); + fake_make_operate_block_postprocess(data_make, i == section->objects.used, &state_process); } - if (F_status_set_fine(*status) == F_interrupt) break; + if (F_status_set_fine(data->setting.state.status) == F_interrupt) break; - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting.state.status)) { state_process.success = F_false; // Break acts identical to fail when at the top of the stack. - if (F_status_set_fine(*status) == F_signal_abort && !section_stack->used) { + if (F_status_set_fine(data->setting.state.status) == F_signal_abort && !section_stack->used) { data_make->setting_make.fail = fake_make_operation_fail_exit_e; data_make->error.prefix = fl_print_error_s; data_make->error.suffix = f_string_empty_s; @@ -1414,42 +1410,40 @@ extern "C" { fake_print_error_operation_failed(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[i]); // F_signal_abort is used by the break section operation. - if (F_status_set_fine(*status) == F_signal_abort) break; + if (F_status_set_fine(data->setting.state.status) == F_signal_abort) break; // F_signal_abort is used by the exit section operation. - if (F_status_set_fine(*status) == F_signal_quit) { + if (F_status_set_fine(data->setting.state.status) == F_signal_quit) { if (!section_stack->used) { - *status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } break; } - if (data_make->setting_make.fail == fake_make_operation_fail_exit_e) { - break; - } + if (data_make->setting_make.fail == fake_make_operation_fail_exit_e) break; } - else if (*status == F_signal_abort) { + else if (data->setting.state.status == F_signal_abort) { state_process.success = F_true; // F_signal_abort is used by the break section operation. break; } - else if (*status == F_signal_quit) { + else if (data->setting.state.status == F_signal_quit) { state_process.success = F_true; // F_signal_quit is used by the exit section operation. if (!section_stack->used) { - *status = F_none; + data->setting.state.status = F_none; } break; } - else if (*status == F_failure) { + else if (data->setting.state.status == F_failure) { // When F_failure (without the error bit) is returned, an error occured but the exit mode is not set to exit. // Record the success state and set the status to F_none. - *status = F_none; + data->setting.state.status = F_none; state_process.success = F_false; } else { @@ -1457,19 +1451,19 @@ extern "C" { } } // for - if (F_status_set_error(*status) == F_interrupt) return 0; + if (F_status_set_error(data->setting.state.status) == F_interrupt) return 0; - if (i == section->objects.used && F_status_is_error_not(*status) && (state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_else_e || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_or_e)) { + if (i == section->objects.used && F_status_is_error_not(data->setting.state.status) && (state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_else_e || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_or_e)) { fake_make_print_error_operation_incomplete(data_make->setting, data_make->main->error, state_process.operation); fake_print_error_operation_failed(data_make->setting, data_make->error, data_make->buffer, section->name, section->objects.array[section->objects.used - 1]); - *status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } // Ensure an error is returned during recursion if the last known section operation failed, except for the main operation. - if (state_process.success == F_false && F_status_is_error_not(*status) && section_stack->used > 1) { - *status = F_status_set_error(F_failure); + if (state_process.success == F_false && F_status_is_error_not(data->setting.state.status) && section_stack->used > 1) { + data->setting.state.status = F_status_set_error(F_failure); } --section_stack->used; diff --git a/level_3/fake/c/main/make/operate.h b/level_3/fake/c/main/make/operate.h index a75c8ca..4621277 100644 --- a/level_3/fake/c/main/make/operate.h +++ b/level_3/fake/c/main/make/operate.h @@ -136,25 +136,44 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * F_child on child process exiting. + * F_signal_abort on abort signal received. + * F_signal_quit on quit signal received. + * + * F_failure (with error bit) on failure. + * F_interrupt (with error bit) on interrupt signal received. + * F_parameter (with error bit) on invalid parameter. + * F_recurse (with error bit) is returned if unable to recurse to another operation section (usually max stack depth reached). + * F_valid_not (with error bit) is returned if any part of the section is invalid, such as an invalid operation name. + * + * Errors (with error bit) from: f_array_lengths_increase() + * Errors (with error bit) from: fake_make_operate_block_postprocess() + * Errors (with error bit) from: fake_make_operate_block_prepare() + * Errors (with error bit) from: fake_make_operate_expand() + * Errors (with error bit) from: fake_make_operate_process() + * Errors (with error bit) from: fake_make_operate_validate() * @param id_section * The array location id within the fakefile of the section to operate on. * @param section_stack * The current operation stack. - * @param status - * F_none on success. - * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. - * F_recurse (with error bit) is returned if unable to recurse to another operation section (usually max stack depth reached). - * F_valid_not (with error bit) is returned if any part of the section is invalid, such as an invalid operation name. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. + * + * @see f_array_lengths_increase() + * @see fll_program_print_signal_received() + * @see fake_make_operate_block_postprocess() + * @see fake_make_operate_block_prepare() + * @see fake_make_operate_expand() + * @see fake_make_operate_process() + * @see fake_make_operate_validate() */ #ifndef _di_fake_make_operate_section_ - extern int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t *section_stack, f_status_t * const status); + extern int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t *section_stack); #endif // _di_fake_make_operate_section_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make/operate_block.c b/level_3/fake/c/main/make/operate_block.c index f0034e5..8b6d5c0 100644 --- a/level_3/fake/c/main/make/operate_block.c +++ b/level_3/fake/c/main/make/operate_block.c @@ -7,6 +7,8 @@ extern "C" { #ifndef _di_fake_make_operate_block_prepare_ void fake_make_operate_block_prepare(fake_state_process_t * const state_process) { + if (!state_process) return; + if (state_process->block) { if (state_process->operation == fake_make_operation_type_and_e || state_process->operation == fake_make_operation_type_else_e || state_process->operation == fake_make_operation_type_if_e || state_process->operation == fake_make_operation_type_or_e) { @@ -51,9 +53,11 @@ extern "C" { #endif // _di_fake_make_operate_block_prepare_ #ifndef _di_fake_make_operate_block_postprocess_ - void fake_make_operate_block_postprocess(const bool last, fake_state_process_t * const state_process, f_status_t * const status) { + void fake_make_operate_block_postprocess(fake_make_data_t * const data_make, const bool last, fake_state_process_t * const state_process) { + + if (!data_make || !state_process) return; - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting.state.status)) { state_process->block_result = fake_condition_result_error_e; state_process->success_block = F_false; diff --git a/level_3/fake/c/main/make/operate_block.h b/level_3/fake/c/main/make/operate_block.h index c72404f..9eeb96d 100644 --- a/level_3/fake/c/main/make/operate_block.h +++ b/level_3/fake/c/main/make/operate_block.h @@ -34,16 +34,18 @@ extern "C" { * * This is to be called once an operation is performed or skipped. * + * @param data_make + * All make related setting data, including data from the fakefile and the build settings file. + * + * This does not alter data_make.setting.state.status. * @param last * If TRUE, then this is the last line. * If FALSE, then this is not the last line. * @param state_process * The operation and if-condition states. - * @param status - * The status code. */ #ifndef _di_fake_make_operate_block_postprocess_ - extern void fake_make_operate_block_postprocess(const bool last, fake_state_process_t * const state_process, f_status_t * const status); + extern void fake_make_operate_block_postprocess(fake_make_data_t * const data_make, const bool last, fake_state_process_t * const state_process); #endif // _di_fake_make_operate_block_postprocess_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make/operate_process.c b/level_3/fake/c/main/make/operate_process.c index 4d4c959..c8f7f3f 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -1,122 +1,113 @@ #include "../fake.h" -#include "../build.h" -#include "../clean.h" -#include "../print.h" -#include "../skeleton.h" -#include "operate.h" -#include "operate_process.h" -#include "operate_process_type.h" -#include "print.h" -#include "print-error.h" -#include "print-verbose.h" #ifdef __cplusplus extern "C" { #endif #ifndef _di_fake_make_operate_process_ - int fake_make_operate_process(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack, f_status_t * const status) { + int fake_make_operate_process(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack) { - if (*status == F_child) return data_make->data->main->child; + if (!data_make || !state_process || !section_stack) return 0; + if (data->setting.state.status == F_child) return data_make->data->main->child; if (state_process->operation == fake_make_operation_type_break_e) { - *status = fake_make_operate_process_type_break(data_make); + fake_make_operate_process_type_break(data_make); } else if (state_process->operation == fake_make_operation_type_build_e) { - *status = fake_make_operate_process_type_build(data_make); + fake_make_operate_process_type_build(data_make); } else if (state_process->operation == fake_make_operation_type_clean_e) { - *status = fake_make_operate_process_type_clean(data_make); + fake_make_operate_process_type_clean(data_make); } else if (state_process->operation == fake_make_operation_type_clone_e) { - *status = fake_make_operate_process_type_copy(data_make, F_true); + fake_make_operate_process_type_copy(data_make, F_true); } else if (state_process->operation == fake_make_operation_type_compile_e) { return fake_make_operate_process_type_compile(data_make, status); } else if (state_process->operation == fake_make_operation_type_copy_e) { - *status = fake_make_operate_process_type_copy(data_make, F_false); + fake_make_operate_process_type_copy(data_make, F_false); } else if (state_process->operation == fake_make_operation_type_define_e) { - *status = fake_make_operate_process_type_define(data_make); + fake_make_operate_process_type_define(data_make); } else if (state_process->operation == fake_make_operation_type_delete_e) { - *status = fake_make_operate_process_type_deletes(data_make, F_false); + fake_make_operate_process_type_deletes(data_make, F_false); } else if (state_process->operation == fake_make_operation_type_deletes_e) { - *status = fake_make_operate_process_type_deletes(data_make, F_true); + fake_make_operate_process_type_deletes(data_make, F_true); } else if (state_process->operation == fake_make_operation_type_else_e) { // There is nothing to do. } else if (state_process->operation == fake_make_operation_type_exit_e) { - *status = fake_make_operate_process_type_exit(data_make); + fake_make_operate_process_type_exit(data_make); } else if (state_process->operation == fake_make_operation_type_fail_e) { fake_make_operate_process_type_fail(data_make); } else if (state_process->operation == fake_make_operation_type_group_e) { - *status = fake_make_operate_process_type_groups(data_make, F_false); + fake_make_operate_process_type_groups(data_make, F_false); } else if (state_process->operation == fake_make_operation_type_groups_e) { - *status = fake_make_operate_process_type_groups(data_make, F_true); + fake_make_operate_process_type_groups(data_make, F_true); } else if (state_process->operation == fake_make_operation_type_if_e || state_process->operation == fake_make_operation_type_and_e || state_process->operation == fake_make_operation_type_or_e) { - *status = fake_make_operate_process_type_condition(data_make, state_process); + fake_make_operate_process_type_condition(data_make, state_process); } else if (state_process->operation == fake_make_operation_type_index_e) { return fake_make_operate_process_type_index(data_make, status); } else if (state_process->operation == fake_make_operation_type_link_e) { - *status = fake_make_operate_process_type_link(data_make); + fake_make_operate_process_type_link(data_make); } else if (state_process->operation == fake_make_operation_type_mode_e) { - *status = fake_make_operate_process_type_modes(data_make, F_false); + fake_make_operate_process_type_modes(data_make, F_false); } else if (state_process->operation == fake_make_operation_type_modes_e) { - *status = fake_make_operate_process_type_modes(data_make, F_true); + fake_make_operate_process_type_modes(data_make, F_true); } else if (state_process->operation == fake_make_operation_type_move_e) { - *status = fake_make_operate_process_type_move(data_make); + fake_make_operate_process_type_move(data_make); } else if (state_process->operation == fake_make_operation_type_operate_e) { return fake_make_operate_process_type_operate(data_make, section_stack, status); } else if (state_process->operation == fake_make_operation_type_owner_e) { - *status = fake_make_operate_process_type_owners(data_make, F_false); + fake_make_operate_process_type_owners(data_make, F_false); } else if (state_process->operation == fake_make_operation_type_owners_e) { - *status = fake_make_operate_process_type_owners(data_make, F_true); + fake_make_operate_process_type_owners(data_make, F_true); } else if (state_process->operation == fake_make_operation_type_parameter_e) { - *status = fake_make_operate_process_type_parameter(data_make); + fake_make_operate_process_type_parameter(data_make); } else if (state_process->operation == fake_make_operation_type_pop_e) { - *status = fake_make_operate_process_type_pop(data_make); + fake_make_operate_process_type_pop(data_make); } else if (state_process->operation == fake_make_operation_type_print_e) { - *status = fake_make_operate_process_type_print(data_make); + fake_make_operate_process_type_print(data_make); } else if (state_process->operation == fake_make_operation_type_run_e) { - *status = fake_make_operate_process_run(data_make, F_false); + fake_make_operate_process_run(data_make, F_false); } else if (state_process->operation == fake_make_operation_type_shell_e) { - *status = fake_make_operate_process_run(data_make, F_true); + fake_make_operate_process_run(data_make, F_true); } else if (state_process->operation == fake_make_operation_type_skeleton_e) { - *status = fake_make_operate_process_type_skeleton(data_make); + fake_make_operate_process_type_skeleton(data_make); } else if (state_process->operation == fake_make_operation_type_to_e) { - *status = fake_make_operate_process_type_to(data_make); + fake_make_operate_process_type_to(data_make); } else if (state_process->operation == fake_make_operation_type_top_e) { - *status = fake_make_operate_process_type_top(data_make); + fake_make_operate_process_type_top(data_make); } else if (state_process->operation == fake_make_operation_type_touch_e) { - *status = fake_make_operate_process_type_touch(data_make); + fake_make_operate_process_type_touch(data_make); } else if (state_process->operation == fake_make_operation_type_write_e) { - *status = fake_make_operate_process_type_write(data_make); + fake_make_operate_process_type_write(data_make); } return 0; diff --git a/level_3/fake/c/main/make/operate_process.h b/level_3/fake/c/main/make/operate_process.h index 22ce8d2..26aff10 100644 --- a/level_3/fake/c/main/make/operate_process.h +++ b/level_3/fake/c/main/make/operate_process.h @@ -21,26 +21,89 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: fake_make_operate_process_run() + * Errors (with error bit) from: fake_make_operate_process_type_break() + * Errors (with error bit) from: fake_make_operate_process_type_build() + * Errors (with error bit) from: fake_make_operate_process_type_clean() + * Errors (with error bit) from: fake_make_operate_process_type_copy() + * Errors (with error bit) from: fake_make_operate_process_type_compile() + * Errors (with error bit) from: fake_make_operate_process_type_copy() + * Errors (with error bit) from: fake_make_operate_process_type_define() + * Errors (with error bit) from: fake_make_operate_process_type_deletes() + * Errors (with error bit) from: fake_make_operate_process_type_deletes() + * Errors (with error bit) from: fake_make_operate_process_type_exit() + * Errors (with error bit) from: fake_make_operate_process_type_fail() + * Errors (with error bit) from: fake_make_operate_process_type_groups() + * Errors (with error bit) from: fake_make_operate_process_type_groups() + * Errors (with error bit) from: fake_make_operate_process_type_condition() + * Errors (with error bit) from: fake_make_operate_process_type_index() + * Errors (with error bit) from: fake_make_operate_process_type_link() + * Errors (with error bit) from: fake_make_operate_process_type_modes() + * Errors (with error bit) from: fake_make_operate_process_type_modes() + * Errors (with error bit) from: fake_make_operate_process_type_move() + * Errors (with error bit) from: fake_make_operate_process_type_operate() + * Errors (with error bit) from: fake_make_operate_process_type_owners() + * Errors (with error bit) from: fake_make_operate_process_type_owners() + * Errors (with error bit) from: fake_make_operate_process_type_parameter() + * Errors (with error bit) from: fake_make_operate_process_type_pop() + * Errors (with error bit) from: fake_make_operate_process_type_print() + * Errors (with error bit) from: fake_make_operate_process_type_skeleton() + * Errors (with error bit) from: fake_make_operate_process_type_to() + * Errors (with error bit) from: fake_make_operate_process_type_top() + * Errors (with error bit) from: fake_make_operate_process_type_touch() + * Errors (with error bit) from: fake_make_operate_process_type_write() * @param section_name * The section name. * @param state_process * The operation and if-condition states. * @param section_stack * The current operation stack. - * @param status - * F_none on success. - * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * * This generally is only needed when F_child is returned, where this holds the return status of the child process. + * + * @see fake_make_operate_process_run() + * @see fake_make_operate_process_type_break() + * @see fake_make_operate_process_type_build() + * @see fake_make_operate_process_type_clean() + * @see fake_make_operate_process_type_copy() + * @see fake_make_operate_process_type_compile() + * @see fake_make_operate_process_type_copy() + * @see fake_make_operate_process_type_define() + * @see fake_make_operate_process_type_deletes() + * @see fake_make_operate_process_type_deletes() + * @see fake_make_operate_process_type_exit() + * @see fake_make_operate_process_type_fail() + * @see fake_make_operate_process_type_groups() + * @see fake_make_operate_process_type_groups() + * @see fake_make_operate_process_type_condition() + * @see fake_make_operate_process_type_index() + * @see fake_make_operate_process_type_link() + * @see fake_make_operate_process_type_modes() + * @see fake_make_operate_process_type_modes() + * @see fake_make_operate_process_type_move() + * @see fake_make_operate_process_type_operate() + * @see fake_make_operate_process_type_owners() + * @see fake_make_operate_process_type_owners() + * @see fake_make_operate_process_type_parameter() + * @see fake_make_operate_process_type_pop() + * @see fake_make_operate_process_type_print() + * @see fake_make_operate_process_type_skeleton() + * @see fake_make_operate_process_type_to() + * @see fake_make_operate_process_type_top() + * @see fake_make_operate_process_type_touch() + * @see fake_make_operate_process_type_write() */ #ifndef _di_fake_make_operate_process_ - extern int fake_make_operate_process(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack, f_status_t * const status); + extern int fake_make_operate_process(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack); #endif // _di_fake_make_operate_process_ /** diff --git a/level_3/fake/c/main/make/operate_process_type.c b/level_3/fake/c/main/make/operate_process_type.c index f69f078..6f3bca5 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -1,16 +1,4 @@ #include "../fake.h" -#include "../build.h" -#include "../clean.h" -#include "../make.h" -#include "../print.h" -#include "../skeleton.h" -#include "operate.h" -#include "operate_process.h" -#include "operate_process_type.h" -#include "print.h" -#include "print-error.h" -#include "print-verbose.h" -#include "print-warning.h" #ifdef __cplusplus extern "C" { @@ -38,12 +26,14 @@ extern "C" { #endif // _di_fake_make_operate_process_type_break_ #ifndef _di_fake_make_operate_process_type_build_ - f_status_t fake_make_operate_process_type_build(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_build(fake_make_data_t * const data_make) { - const f_status_t status = fake_build_operate(data_make->data, data_make->cache_arguments.used ? &data_make->cache_arguments : 0, F_false); - if (F_status_set_fine(status) == F_interrupt) return status; + if (!data_make) return; - return fake_make_operate_process_return(data_make, F_status_is_error(status) ? 1 : 0); + fake_build_operate(data_make->data, data_make->cache_arguments.used ? &data_make->cache_arguments : 0, F_false); + if (F_status_set_fine(data->setting.state.status) == F_interrupt) return; + + data->setting.state.status = fake_make_operate_process_return(data_make, F_status_is_error(data->setting.state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_build_ @@ -525,7 +515,7 @@ extern "C" { } if (all) { - status = fll_file_role_change_all(data_make->cache_arguments.array[i], -1, id, dereference, fake_common_max_recursion_depth_d); + status = fll_file_role_change_all(data_make->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); } else { status = f_file_role_change(data_make->cache_arguments.array[i], -1, id, dereference); @@ -1346,7 +1336,7 @@ extern "C" { } if (all) { - status = fll_file_mode_set_all(data_make->cache_arguments.array[i], F_true, mode, fake_common_max_recursion_depth_d); + status = fll_file_mode_set_all(data_make->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); } else { status = f_file_mode_set(data_make->cache_arguments.array[i], mode); @@ -1511,7 +1501,7 @@ extern "C" { } if (all) { - status = fll_file_role_change_all(data_make->cache_arguments.array[i], id, -1, dereference, fake_common_max_recursion_depth_d); + status = fll_file_role_change_all(data_make->cache_arguments.array[i], id, -1, dereference, fake_max_recursion_depth_d); } else { status = f_file_role_change(data_make->cache_arguments.array[i], id, -1, dereference); diff --git a/level_3/fake/c/main/make/operate_validate.c b/level_3/fake/c/main/make/operate_validate.c index 4d64e09..0abbbe5 100644 --- a/level_3/fake/c/main/make/operate_validate.c +++ b/level_3/fake/c/main/make/operate_validate.c @@ -1,8 +1,4 @@ #include "../fake.h" -#include "../print.h" -#include "../make.h" -#include "operate_validate.h" -#include "operate_validate_type.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/make/operate_validate_type.c b/level_3/fake/c/main/make/operate_validate_type.c index 0a4f676..f40047c 100644 --- a/level_3/fake/c/main/make/operate_validate_type.c +++ b/level_3/fake/c/main/make/operate_validate_type.c @@ -1,9 +1,4 @@ #include "../fake.h" -#include "../print.h" -#include "../make.h" -#include "operate_validate.h" -#include "operate_validate_type.h" -#include "print-error.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/fake/c/main/make/print.c b/level_3/fake/c/main/make/print.c index a90ea05..51e92cc 100644 --- a/level_3/fake/c/main/make/print.c +++ b/level_3/fake/c/main/make/print.c @@ -1,5 +1,4 @@ #include "../fake.h" -#include "print.h" #ifdef __cplusplus extern "C" { @@ -8,12 +7,11 @@ extern "C" { #ifndef _di_fake_make_print_now_making_ f_status_t fake_make_print_now_making(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile) { + if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[Now making using '%]", print.to, print.set->important, print.set->important); fl_print_format("%[%Q%]", print.to, print.set->notable, fakefile, print.set->notable); @@ -41,12 +39,11 @@ extern "C" { #ifndef _di_fake_make_print_processing_section_ f_status_t fake_make_print_processing_section(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t buffer, const f_fss_named_t section) { + if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[Processing Section '%]", print.to, print.set->important, print.set->important); fl_print_format("%[%/Q%]", print.to, print.set->notable, buffer, section.name, print.set->notable); fl_print_format("%['.%]%r", print.to, print.set->important, print.set->important, f_string_eol_s); diff --git a/level_3/fake/c/main/make/print.h b/level_3/fake/c/main/make/print.h index c89ad5f..676f54c 100644 --- a/level_3/fake/c/main/make/print.h +++ b/level_3/fake/c/main/make/print.h @@ -32,6 +32,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() */ #ifndef _di_fake_make_print_now_making_ extern f_status_t fake_make_print_now_making(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile); @@ -55,6 +61,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() */ #ifndef _di_fake_make_print_processing_section_ extern f_status_t fake_make_print_processing_section(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t buffer, const f_fss_named_t section); diff --git a/level_3/fake/c/main/make/print-error.c b/level_3/fake/c/main/make/print/error.c similarity index 91% rename from level_3/fake/c/main/make/print-error.c rename to level_3/fake/c/main/make/print/error.c index 679fc33..8e0a087 100644 --- a/level_3/fake/c/main/make/print-error.c +++ b/level_3/fake/c/main/make/print/error.c @@ -1,5 +1,4 @@ -#include "../fake.h" -#include "print-error.h" +#include "../../fake.h" #ifdef __cplusplus extern "C" { @@ -34,8 +33,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe %S%rcontent '%]", print.to, print.context, print.prefix, content, content ? f_string_space_s : f_string_empty_s, print.context); fl_print_format("%[%Q%]", print.to, print.notable, file, print.notable); fl_print_format("%[' must be a valid directory.%]%r", print.to, print.context, print.context, f_string_eol_s); @@ -75,8 +72,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe fakefile '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, fakefile, print.notable); fl_print_format("%[' is missing the required '%]", print.to, print.context, print.context); @@ -107,8 +102,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe file '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, file, print.notable); fl_print_format("%[' must be a %Q file.%]%r", print.to, print.context, print.context, type, f_string_eol_s); @@ -137,8 +130,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%Q%S '%]", print.to, print.context, print.prefix, message, print.context); fl_print_format("%[%r%]", print.to, print.notable, fake_make_operation_if_s, print.notable); fl_print_format("%[', '%]", print.to, print.context, print.context); @@ -193,8 +184,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QIncomplete '%]", print.to, print.context, print.prefix, print.context); if (operation == fake_make_operation_type_and_e) { @@ -225,8 +214,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe section operation '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%/Q%]", print.to, print.notable, buffer, range, print.notable); fl_print_format("%[' is already in the operation stack, recursion is not allowed.%]%r", print.to, print.context, print.context, f_string_eol_s); @@ -240,7 +227,8 @@ extern "C" { #ifndef _di_fake_make_print_error_operation_section_not_found_ f_status_t fake_make_print_error_operation_section_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "No operation section named ", name, " is found"); @@ -251,12 +239,11 @@ extern "C" { #ifndef _di_fake_make_print_error_out_of_range_number_ f_status_t fake_make_print_error_out_of_range_number(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t number, const f_number_unsigned_t minimum, const f_number_unsigned_t maximum) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe number '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, number, print.notable); fl_print_format("%[' may only be between the ranges -%un to %un.%]%r", print.to, print.context, minimum, maximum, print.context, f_string_eol_s); @@ -270,7 +257,8 @@ extern "C" { #ifndef _di_fake_make_print_error_pop_last_path_ f_status_t fake_make_print_error_pop_last_path(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_simple(setting, print, "Must not attempt to pop project root off of path stack"); @@ -281,12 +269,11 @@ extern "C" { #ifndef _di_fake_make_print_error_program_failed_ f_status_t fake_make_print_error_program_failed(fake_setting_t * const setting, const fl_print_t print, const int return_code) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QFailed with return code %]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%i%]", print.to, print.notable, return_code, print.notable); fl_print_format("%[.%]%r", print.to, print.context, print.context, f_string_eol_s); @@ -300,7 +287,8 @@ extern "C" { #ifndef _di_fake_make_print_error_program_not_found_ f_status_t fake_make_print_error_program_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t program) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "Failed to find program ", program, " for executing"); @@ -311,7 +299,8 @@ extern "C" { #ifndef _di_fake_make_print_error_reserved_parameter_name_ f_status_t fake_make_print_error_reserved_parameter_name(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "Cannot assign a value to the parameter name ", name, " because it is a reserved parameter name"); @@ -322,7 +311,8 @@ extern "C" { #ifndef _di_fake_make_print_error_target_file_name_empty_ f_status_t fake_make_print_error_target_file_name_empty(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_simple(setting, print, "Target file name argument must not be an empty string"); @@ -333,7 +323,8 @@ extern "C" { #ifndef _di_fake_make_print_error_unsupported_number_ f_status_t fake_make_print_error_unsupported_number(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t number) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "Invalid or unsupported number provided ", number, 0); @@ -344,12 +335,11 @@ extern "C" { #ifndef _di_fake_make_print_error_unsupported_type_ f_status_t fake_make_print_error_unsupported_type(fake_setting_t * const setting, const fl_print_t print, f_string_static_t type, const f_string_static_t value) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QUnsupported %Q type '%]", print.to, print.context, print.prefix, type, print.context); fl_print_format("%[%Q%]", print.to, print.notable, value, print.notable); fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s); diff --git a/level_3/fake/c/main/make/print-error.h b/level_3/fake/c/main/make/print/error.h similarity index 92% rename from level_3/fake/c/main/make/print-error.h rename to level_3/fake/c/main/make/print/error.h index f80ac6c..9788f64 100644 --- a/level_3/fake/c/main/make/print-error.h +++ b/level_3/fake/c/main/make/print/error.h @@ -34,6 +34,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_argument_invalid_section_ extern f_status_t fake_make_print_error_argument_invalid_section(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name); @@ -55,6 +57,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_compiler_not_specified_ extern f_status_t fake_make_print_error_compiler_not_specified(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t action); @@ -78,6 +82,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_define_invalid_character_ extern f_status_t fake_make_print_error_define_invalid_character(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name); @@ -101,6 +107,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_fakefile_section_missing_ extern f_status_t fake_make_print_error_fakefile_section_missing(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_static_t section); @@ -120,6 +128,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_file_name_empty_ extern f_status_t fake_make_print_error_file_name_empty(fake_setting_t * const setting, const fl_print_t print); @@ -143,6 +153,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_content_not_directory_ extern f_status_t fake_make_print_error_content_not_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_t content, const f_string_static_t file); @@ -162,6 +174,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_define_name_empty_ extern f_status_t fake_make_print_error_define_name_empty(fake_setting_t * const setting, const fl_print_t print); @@ -185,6 +199,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_file_type_ extern f_status_t fake_make_print_error_file_type(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t type, const f_string_static_t file); @@ -206,6 +222,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_indexer_not_specified_ extern f_status_t fake_make_print_error_indexer_not_specified(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t action); @@ -227,6 +245,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_after_condition_ extern f_status_t fake_make_print_error_after_condition(fake_setting_t * const setting, const fl_print_t print, const f_string_t message); @@ -246,6 +266,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_after_condition_may_only_ extern f_status_t fake_make_print_error_after_condition_may_only(fake_setting_t * const setting, const fl_print_t print); @@ -265,6 +287,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_after_condition_must_not_ extern f_status_t fake_make_print_error_after_condition_must_not(fake_setting_t * const setting, const fl_print_t print); @@ -284,6 +308,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_after_condition_no_preceding_ extern f_status_t fake_make_print_error_after_condition_no_preceding(fake_setting_t * const setting, const fl_print_t print); @@ -305,6 +331,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_operation_incomplete_ extern f_status_t fake_make_print_error_operation_incomplete(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation); @@ -326,6 +354,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_operation_recursion_ extern f_status_t fake_make_print_error_operation_recursion(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t range); @@ -347,6 +377,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_operation_section_not_found_ extern f_status_t fake_make_print_error_operation_section_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name); @@ -372,6 +404,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_out_of_range_number_ extern f_status_t fake_make_print_error_out_of_range_number(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t number, const f_number_unsigned_t minimum, const f_number_unsigned_t maximum); @@ -391,6 +425,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_pop_last_path_ extern f_status_t fake_make_print_error_pop_last_path(fake_setting_t * const setting, const fl_print_t print); @@ -412,6 +448,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_program_failed_ extern f_status_t fake_make_print_error_program_failed(fake_setting_t * const setting, const fl_print_t print, const int return_code); @@ -433,6 +471,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_program_not_found_ extern f_status_t fake_make_print_error_program_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t program); @@ -454,6 +494,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_reserved_parameter_name_ extern f_status_t fake_make_print_error_reserved_parameter_name(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name); @@ -473,6 +515,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_target_file_name_empty_ extern f_status_t fake_make_print_error_target_file_name_empty(fake_setting_t * const setting, const fl_print_t print); @@ -494,6 +538,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_unsupported_number_ extern f_status_t fake_make_print_error_unsupported_number(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t number); @@ -517,6 +563,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_error_unsupported_type_ extern f_status_t fake_make_print_error_unsupported_type(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t type, const f_string_static_t value); diff --git a/level_3/fake/c/main/make/print-verbose.c b/level_3/fake/c/main/make/print/verbose.c similarity index 78% rename from level_3/fake/c/main/make/print-verbose.c rename to level_3/fake/c/main/make/print/verbose.c index b758ba2..0cac365 100644 --- a/level_3/fake/c/main/make/print-verbose.c +++ b/level_3/fake/c/main/make/print/verbose.c @@ -1,5 +1,4 @@ -#include "../fake.h" -#include "print-verbose.h" +#include "../../fake.h" #ifdef __cplusplus extern "C" { @@ -8,7 +7,8 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_break_ f_status_t fake_make_print_verbose_operate_break(fake_setting_t * const setting, const fl_print_t print, const f_string_statics_t arguments) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "Breaking as", arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, 0); @@ -19,12 +19,11 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_copy_ f_status_t fake_make_print_verbose_operate_copy(fake_setting_t * const setting, const fl_print_t print, const bool clone, const f_string_static_t source, const f_string_static_t destination) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%s '%[%Q%]' to '", print.to, clone ? "Cloned" : "Copied", print.set->notable, source, print.set->notable); fl_print_format("%[%Q%]'.%r", print.to, print.set->notable, destination, print.set->notable, f_string_eol_s); @@ -37,7 +36,8 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_define_ f_status_t fake_make_print_verbose_operate_define(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t variable) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "Defined environment variable", variable, 0); @@ -48,7 +48,8 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_delete_ f_status_t fake_make_print_verbose_operate_delete(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "Removed", path, 0); @@ -59,7 +60,8 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_exiting_as_ f_status_t fake_make_print_verbose_operate_exiting_as(fake_setting_t * const setting, const fl_print_t print, const f_string_statics_t arguments) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "Exiting as", arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, 0); @@ -70,15 +72,10 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_file_not_found_ f_status_t fake_make_print_verbose_operate_file_not_found(fake_setting_t * const setting, const fl_print_t print, const bool is_directory, const f_string_static_t file) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("The %Q '%[%Q%]' is not found.%]%r", print.to, print.set->notable, is_directory ? f_file_type_name_directory_s : f_file_type_name_file_s, file, print.set->notable, f_string_eol_s); + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; - f_file_stream_unlock(print.to); + fll_print_format("The %Q '%[%Q%]' is not found.%]%r", print.to, print.set->notable, is_directory ? f_file_type_name_directory_s : f_file_type_name_file_s, file, print.set->notable, f_string_eol_s); return F_none; } @@ -87,7 +84,8 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_program_ f_status_t fake_make_print_verbose_operate_program(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t program, const f_string_statics_t arguments) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); @@ -120,12 +118,11 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_set_failure_state_ f_status_t fake_make_print_verbose_operate_set_failure_state(fake_setting_t * const setting, const fl_print_t print, const uint8_t fail) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - f_print_terminated("Set failure state to '", print.to); if (fail == fake_make_operation_fail_exit_e) { @@ -149,12 +146,11 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_set_mode_ f_status_t fake_make_print_verbose_operate_set_mode(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path, const mode_t mode) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fll_print_format("Changed mode of '%[%Q%]' to %[%#@u%].%r", print.to, print.set->notable, path, print.set->notable, print.set->notable, mode, print.set->notable, f_string_eol_s); f_file_stream_unlock(print.to); @@ -166,6 +162,7 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_set_path_ f_status_t fake_make_print_verbose_operate_set_path(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { + if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "Changed project path to", path, 0); @@ -177,12 +174,11 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_set_role_ f_status_t fake_make_print_verbose_operate_set_role(fake_setting_t * const setting, const fl_print_t print, const uint8_t what, f_string_static_t role, f_number_unsigned_t id) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%r %r of '%[%r%]'", print.to, (what & 0x1) ? "Recursively changed" : "Changed", (what & 0x2) ? "owner" : "group", print.set->notable, role, print.set->notable); fl_print_format(" to %[%ul%].%r", print.to, print.set->notable, id, print.set->notable, f_string_eol_s); @@ -195,12 +191,11 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_symbolic_link_ f_status_t fake_make_print_verbose_operate_symbolic_link(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("Created symbolic link from '%[%Q%]", print.to, print.set->notable, source, print.set->notable); fl_print_format("' to %[%Q%].%r", print.to, print.set->notable, destination, print.set->notable, f_string_eol_s); @@ -213,7 +208,8 @@ extern "C" { #ifndef _di_fake_make_print_verbose_operate_touch_ f_status_t fake_make_print_verbose_operate_touch(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "Touched", path, 0); diff --git a/level_3/fake/c/main/make/print-verbose.h b/level_3/fake/c/main/make/print/verbose.h similarity index 93% rename from level_3/fake/c/main/make/print-verbose.h rename to level_3/fake/c/main/make/print/verbose.h index 80d2e02..99f5140 100644 --- a/level_3/fake/c/main/make/print-verbose.h +++ b/level_3/fake/c/main/make/print/verbose.h @@ -33,6 +33,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_break_ extern f_status_t fake_make_print_verbose_operate_break(fake_setting_t * const setting, const fl_print_t print, const f_string_statics_t arguments); @@ -59,6 +61,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_copy_ extern f_status_t fake_make_print_verbose_operate_copy(fake_setting_t * const setting, const fl_print_t print, const bool clone, const f_string_static_t source, const f_string_static_t destination); @@ -80,6 +84,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_define_ extern f_status_t fake_make_print_verbose_operate_define(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t variable); @@ -101,6 +107,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_delete_ extern f_status_t fake_make_print_verbose_operate_delete(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); @@ -123,6 +131,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_exiting_as_ extern f_status_t fake_make_print_verbose_operate_exiting_as(fake_setting_t * const setting, const fl_print_t print, const f_string_statics_t arguments); @@ -147,6 +157,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_file_not_found_ extern f_status_t fake_make_print_verbose_operate_file_not_found(fake_setting_t * const setting, const fl_print_t print, const bool is_directory, const f_string_static_t file); @@ -170,6 +182,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_program_ extern f_status_t fake_make_print_verbose_operate_program(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t program, const f_string_statics_t arguments); @@ -191,6 +205,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_set_failure_state_ extern f_status_t fake_make_print_verbose_operate_set_failure_state(fake_setting_t * const setting, const fl_print_t print, const uint8_t fail); @@ -214,6 +230,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_set_mode_ extern f_status_t fake_make_print_verbose_operate_set_mode(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path, const mode_t mode); @@ -235,6 +253,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_set_path_ extern f_status_t fake_make_print_verbose_operate_set_path(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); @@ -262,6 +282,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_set_role_ extern f_status_t fake_make_print_verbose_operate_set_role(fake_setting_t * const setting, const fl_print_t print, const uint8_t what, f_string_static_t role, f_number_unsigned_t id); @@ -285,6 +307,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_symbolic_link_ extern f_status_t fake_make_print_verbose_operate_symbolic_link(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination); @@ -306,6 +330,8 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_fake_make_print_verbose_operate_touch_ extern f_status_t fake_make_print_verbose_operate_touch(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); diff --git a/level_3/fake/c/main/make/print-warning.c b/level_3/fake/c/main/make/print/warning.c similarity index 82% rename from level_3/fake/c/main/make/print-warning.c rename to level_3/fake/c/main/make/print/warning.c index 50f6697..cb4d548 100644 --- a/level_3/fake/c/main/make/print-warning.c +++ b/level_3/fake/c/main/make/print/warning.c @@ -1,5 +1,4 @@ -#include "../fake.h" -#include "print-warning.h" +#include "../../fake.h" #ifdef __cplusplus extern "C" { @@ -8,12 +7,11 @@ extern "C" { #ifndef _di_fake_make_print_warning_cannot_change_back_ f_status_t fake_make_print_warning_cannot_change_back(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path, const f_status_t status) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QFailed change back to original path '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, path, print.notable); fl_print_format("%[', status code =%] ", print.to, print.context, print.context); @@ -29,7 +27,8 @@ extern "C" { #ifndef _di_fake_make_print_warning_environment_name_already_added_ f_status_t fake_make_print_warning_environment_name_already_added(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "The environment name", name, "is already added, replacing previous value"); @@ -40,7 +39,8 @@ extern "C" { #ifndef _di_fake_make_print_warning_environment_name_invalid_ f_status_t fake_make_print_warning_environment_name_invalid(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "The environment name", name, "is invalid, ignoring"); @@ -51,7 +51,8 @@ extern "C" { #ifndef _di_fake_make_print_warning_fakefile_empty_ f_status_t fake_make_print_warning_fakefile_empty(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "The fakefile", fakefile, "is empty"); @@ -62,7 +63,8 @@ extern "C" { #ifndef _di_fake_make_print_warning_file_not_found_ f_status_t fake_make_print_warning_file_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t file) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_simple_variable(setting, print, "The file", file, "cannot be found"); @@ -73,12 +75,11 @@ extern "C" { #ifndef _di_fake_make_print_warning_setting_content_empty_ f_status_t fake_make_print_warning_setting_content_empty(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_dynamic_t buffer, const f_string_range_t range, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe fakefile '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, fakefile, print.notable); fl_print_format("%[' has empty content for the '%]", print.to, print.context, print.context); @@ -96,12 +97,11 @@ extern "C" { #ifndef _di_fake_make_print_warning_setting_content_invalid_ f_status_t fake_make_print_warning_setting_content_invalid(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_dynamic_t buffer, const f_string_range_t object, const f_string_range_t content, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe fakefile '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, fakefile, print.notable); fl_print_format("%[' has invalid content '%]", print.to, print.context, print.context); @@ -121,7 +121,8 @@ extern "C" { #ifndef _di_fake_make_print_warning_setting_content_multiple_ f_status_t fake_make_print_warning_setting_content_multiple(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_wrapped_variables(setting, print, "The fakefile ", fakefile, " may only have a single content for the object ", name, ", only using the first"); @@ -132,7 +133,8 @@ extern "C" { #ifndef _di_fake_make_print_warning_setting_object_multiple_ f_status_t fake_make_print_warning_setting_object_multiple(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_static_t name) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_wrapped_variables(setting, print, "The object ", name, " in the fakefile ", fakefile, " may only be specified once, only using the first"); diff --git a/level_3/fake/c/main/make/print-warning.h b/level_3/fake/c/main/make/print/warning.h similarity index 87% rename from level_3/fake/c/main/make/print-warning.h rename to level_3/fake/c/main/make/print/warning.h index f14299c..f650bab 100644 --- a/level_3/fake/c/main/make/print-warning.h +++ b/level_3/fake/c/main/make/print/warning.h @@ -34,6 +34,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() */ #ifndef _di_fake_make_print_warning_cannot_change_back_ extern f_status_t fake_make_print_warning_cannot_change_back(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path, const f_status_t status); @@ -55,6 +61,10 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_simple_variable() */ #ifndef _di_fake_make_print_warning_environment_name_already_added_ extern f_status_t fake_make_print_warning_environment_name_already_added(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name); @@ -76,6 +86,10 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_simple_variable() */ #ifndef _di_fake_make_print_warning_environment_name_invalid_ extern f_status_t fake_make_print_warning_environment_name_invalid(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t name); @@ -97,6 +111,10 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_simple_variable() */ #ifndef _di_fake_make_print_warning_fakefile_empty_ extern f_status_t fake_make_print_warning_fakefile_empty(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile); @@ -118,6 +136,10 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_simple_variable() */ #ifndef _di_fake_make_print_warning_file_not_found_ extern f_status_t fake_make_print_warning_file_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t file); @@ -145,6 +167,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() */ #ifndef _di_fake_make_print_warning_setting_content_empty_ extern f_status_t fake_make_print_warning_setting_content_empty(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_dynamic_t buffer, const f_string_range_t range, const f_string_static_t name); @@ -174,6 +202,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() */ #ifndef _di_fake_make_print_warning_setting_content_invalid_ extern f_status_t fake_make_print_warning_setting_content_invalid(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_dynamic_t buffer, const f_string_range_t object, const f_string_range_t content, const f_string_static_t name); @@ -197,6 +231,10 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_wrapped_variables() */ #ifndef _di_fake_make_print_warning_setting_content_multiple_ extern f_status_t fake_make_print_warning_setting_content_multiple(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_static_t name); @@ -220,6 +258,10 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fake_print_context_wrapped_variables() */ #ifndef _di_fake_make_print_warning_setting_object_multiple_ extern f_status_t fake_make_print_warning_setting_object_multiple(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t fakefile, const f_string_static_t name); diff --git a/level_3/fake/c/main/print.c b/level_3/fake/c/main/print.c index 54ebd14..17187e5 100644 --- a/level_3/fake/c/main/print.c +++ b/level_3/fake/c/main/print.c @@ -4,133 +4,11 @@ extern "C" { #endif -#ifndef _di_fake_print_context_simple_ - void fake_print_context_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message) { - - if (!setting) return; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%Q%S.%]%r", print.to, print.context, print.prefix, message, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_simple_ - -#ifndef _di_fake_print_context_simple_variable_ - void fake_print_context_simple_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) { - - if (!setting) return; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, variable, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_simple_variable_ - -#ifndef _di_fake_print_context_wrapped_number_ - void fake_print_context_wrapped_number(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_number_unsigned_t number, const f_string_t after) { - - if (!setting) return; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); - fl_print_format("%[%un%]", print.to, print.notable, number, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_wrapped_number_ - -#ifndef _di_fake_print_context_wrapped_parameter_ - void fake_print_context_wrapped_parameter(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol, const f_string_static_t name, const f_string_t after) { - - if (!setting) return; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); - fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol, name, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_wrapped_parameter_ - -#ifndef _di_fake_print_context_wrapped_parameters_ - void fake_print_context_wrapped_parameters(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol_1, const f_string_static_t name_1, const f_string_t between_1, const f_string_static_t symbol_2, const f_string_static_t name_2, const f_string_t between_2, const f_string_static_t symbol_3, const f_string_static_t name_3, const f_string_t after) { - - if (!setting) return; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); - fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol_1, name_1, print.notable); - fl_print_format("%['%S'%]%r", print.to, print.context, between_1, print.context); - fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol_2, name_2, print.notable); - fl_print_format("%['%S'%]%r", print.to, print.context, between_2, print.context); - fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol_3, name_3, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_wrapped_parameters_ - -#ifndef _di_fake_print_context_wrapped_variable_ - void fake_print_context_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) { - - if (!setting) return; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, variable, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_wrapped_variable_ - -#ifndef _di_fake_print_context_wrapped_variables_ - void fake_print_context_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("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, first, print.notable); - fl_print_format("%['%S'%]", print.to, print.context, between, print.context); - fl_print_format("%[%Q%]", print.to, print.notable, second, print.notable); - fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); - - f_file_stream_unlock(print.to); - } -#endif // _di_fake_print_context_wrapped_variables_ - #ifndef _di_fake_print_generating_skeleton_ f_status_t fake_print_generating_skeleton(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; fake_print_simple(setting, print, "Generating skeleton structure"); @@ -218,160 +96,68 @@ 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) { +#ifndef _di_fake_print_line_first_ + f_status_t fake_print_line_first(fake_setting_t * const setting, const fl_print_t print) { if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - if (setting->flag & fake_main_flag_print_first_e) { - fll_print_dynamic_raw(setting->line_first, print.to); - - setting->flag -= fake_main_flag_print_first_e; + if (F_status_is_error_not(setting->state.status)) { + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not; } - else { - fll_print_dynamic_raw(f_string_eol_s, print.to); - } - - return F_none; - } -#endif // _di_fake_print_line_first_locked_ - -#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) return F_status_set_error(F_output_not); if (setting->flag & fake_main_flag_print_first_e) { fll_print_dynamic_raw(setting->line_first, print.to); setting->flag -= fake_main_flag_print_first_e; } - else { - fll_print_dynamic_raw(f_string_eol_s, print.to); - } - - return F_none; - } -#endif // _di_fake_print_line_first_unlocked_ - -#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) return F_status_set_error(F_output_not); - - fll_print_dynamic_raw(setting->line_last, print.to); return F_none; } -#endif // _di_fake_print_line_last_locked_ +#endif // _di_fake_print_line_first_ -#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) { +#ifndef _di_fake_print_line_last_ + f_status_t fake_print_line_last(fake_setting_t * const setting, const fl_print_t print) { if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - f_print_dynamic_raw(setting->line_last, print.to); - - return F_none; - } -#endif // _di_fake_print_line_last_unlocked_ - -#ifndef _di_fake_print_operation_all_complete_ - f_status_t fake_print_operation_all_complete(fake_setting_t * const setting, const fl_print_t print) { - - if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("All operations complete.%r", print.to, f_string_eol_s, f_string_eol_s); - - f_file_stream_flush(print.to); - f_file_stream_unlock(print.to); - - return F_none; - } -#endif // _di_fake_print_operation_all_complete_ - -#ifndef _di_fake_print_operation_cancelled_ - f_status_t fake_print_operation_cancelled(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation) { - - if (!setting || print.verbosity < f_console_verbosity_normal_e) return F_output_not; - - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[The operation '%]%[", print.to, print.context, print.context, print.notable); - - if (operation == fake_operation_build_e) { - f_print_dynamic(fake_other_operation_build_s, print.to); - } - else if (operation == fake_operation_clean_e) { - f_print_dynamic(fake_other_operation_clean_s, print.to); - } - else if (operation == fake_operation_make_e) { - f_print_dynamic(fake_other_operation_make_s, print.to); + if (F_status_is_error_not(setting->state.status)) { + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + if (setting->flag & fss_write_main_flag_file_to_e) return F_output_not; } - else if (operation == fake_operation_skeleton_e) { - f_print_dynamic(fake_other_operation_skeleton_s, print.to); - } - - fl_print_format("%]%[' is cancelled.%]%r", print.to, print.notable, print.context, print.context, f_string_eol_s); - f_file_stream_flush(print.to); - f_file_stream_unlock(print.to); + fll_print_dynamic_raw(setting->line_last, print.to); return F_none; } -#endif // _di_fake_print_operation_cancelled_ +#endif // _di_fake_print_line_last_ #ifndef _di_fake_print_simple_ void fake_print_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message) { - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); + if (!setting) return; fll_print_format("%S.%r", print.to, message, f_string_eol_s); - - f_file_stream_unlock(print.to); } #endif // _di_fake_print_simple_ #ifndef _di_fake_print_simple_variable_ void fake_print_simple_variable(fake_setting_t * const setting, const fl_print_t print, const f_string_t message, const f_string_static_t variable) { - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); + if (!setting) return; 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_simple_variable_ #ifndef _di_fake_print_wrapped_variable_ 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) { - f_file_stream_lock(print.to); - - fake_print_line_first_unlocked(setting, print); + if (!setting) return; fll_print_format("%S'%[%Q%]'%S.%r", print.to, before, print.set->notable, variable, print.set->notable, after, f_string_eol_s); - - f_file_stream_unlock(print.to); } #endif // _di_fake_print_wrapped_variable_ @@ -382,8 +168,6 @@ extern "C" { 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); diff --git a/level_3/fake/c/main/print.h b/level_3/fake/c/main/print.h index fcaa42c..2ad4f14 100644 --- a/level_3/fake/c/main/print.h +++ b/level_3/fake/c/main/print.h @@ -17,263 +17,6 @@ extern "C" { #endif /** - * Print a simple context message with prefix and a single string message. - * - * 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.state.status. - * @param print - * The output structure to print to. - * @param message - * The string to print. - * - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() - */ -#ifndef _di_fake_print_context_simple_ - extern void fake_print_context_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message); -#endif // _di_fake_print_context_simple_ - -/** - * Print a variable context message with a before string, an after string, and a string variable. - * - * 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.state.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. - * Set to NULL to disable. - * @param variable - * The string representing the variable. - * @param after - * The string being printed after the variable. - * Likely should have a space added at the start of the string. - * Set to NULL to disable. - * - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() - */ -#ifndef _di_fake_print_context_simple_variable_ - extern void fake_print_context_simple_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_context_simple_variable_ - -/** - * Print a variable context message with a before string, an after string, and an unsigned number variable. - * - * 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.state.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. - * Set to NULL to disable. - * @param number - * The number representing the variable. - * @param after - * The string being printed after the variable. - * Likely should have a space added at the start of the string. - * Set to NULL to disable. - * - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() - */ -#ifndef _di_fake_print_context_wrapped_number_ - extern void fake_print_context_wrapped_number(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_number_unsigned_t number, const f_string_t after); -#endif // _di_fake_print_context_wrapped_number_ - -/** - * 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 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.state.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. - * Set to NULL to disable. - * @param symbol - * The string representing the symbol for the parameter. - * Set to f_string_empty_s to disable. - * @param name - * The string representing the parameter name. - * @param after - * The string being printed after the variable. - * Likely should have a space added at the start of the string. - * Set to NULL to disable. - * - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() - */ -#ifndef _di_fake_print_context_wrapped_parameter_ - extern void fake_print_context_wrapped_parameter(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol, const f_string_static_t name, const f_string_t after); -#endif // _di_fake_print_context_wrapped_parameter_ - -/** - * Print a parameter context message with a there parameters, with symbols, and wrapping strings. - * - * 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.state.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. - * Set to NULL to disable. - * @param symbol_1 - * The string representing the symbol for the parameter. - * Set to f_string_empty_s to disable. - * @param name_1 - * The string representing the parameter name. - * @param middle_1 - * The string being printed before the variable. - * Likely should have a space added at the end of the string. - * Set to NULL to disable. - * @param symbol_2 - * The string representing the symbol for the parameter. - * Set to f_string_empty_s to disable. - * @param name_2 - * The string representing the parameter name. - * @param middle_2 - * The string being printed before the variable. - * Likely should have a space added at the end of the string. - * Set to NULL to disable. - * @param symbol_3 - * The string representing the symbol for the parameter. - * Set to f_string_empty_s to disable. - * @param name_3 - * The string representing the parameter name. - * @param after - * The string being printed after the variable. - * Likely should have a space added at the start of the string. - * Set to NULL to disable. - * - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() - */ -#ifndef _di_fake_print_context_wrapped_parameter_ - extern void fake_print_context_wrapped_parameters(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol_1, const f_string_static_t name_1, const f_string_t between_1, const f_string_static_t symbol_2, const f_string_static_t name_2, const f_string_t between_2, const f_string_static_t symbol_3, const f_string_static_t name_3, const f_string_t after); -#endif // _di_fake_print_context_wrapped_parameter_ - -/** - * Print a wrapped context message with a before string, an after string, and a string variable. - * - * 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.state.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. - * Set to NULL to disable. - * @param variable - * The string representing the variable. - * @param after - * The string being printed after the variable. - * Likely should have a space added at the start of the string. - * Set to NULL to disable. - * - * @see f_file_stream_lock() - * @see f_file_stream_unlock() - * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() - */ -#ifndef _di_fake_print_context_wrapped_variable_ - extern void fake_print_context_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_context_wrapped_variable_ - -/** - * 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 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.state.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_context_wrapped_variables_ - extern void fake_print_context_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_context_wrapped_variables_ - -/** * Print a message about generating skeleton. * * @param setting @@ -287,8 +30,6 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_generating_skeleton_ extern f_status_t fake_print_generating_skeleton(fake_setting_t * const setting, const fl_print_t print); @@ -309,34 +50,23 @@ extern "C" { * F_output_not on success, but no printing is performed. * * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_flush() + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see f_print_dynamic_raw() + * @see fl_print_format() + * @see fll_program_print_help_header() + * @see fll_program_print_help_option() + * @see fll_program_print_help_option_other() + * @see fll_program_print_help_option_standard() + * @see fll_program_print_help_usage() */ #ifndef _di_fake_print_help_ extern f_status_t fake_print_help(fake_setting_t * const setting, const fl_print_t print); #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.state.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. @@ -357,36 +87,12 @@ extern "C" { * F_output_not on success, but no printing is performed. * * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_fake_print_line_first_locked_ - extern f_status_t fake_print_line_first_locked(fake_setting_t * const setting, const fl_print_t print); -#endif // _di_fake_print_line_first_locked_ - -/** - * 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. - * - * Once the first line is processed (printed or not), then this will print new lines normally. * - * This function neither locks nor unlocks the input stream. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.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. - * - * F_output_not (with error bit) if setting is NULL. + * @see fll_print_dynamic_raw() */ -#ifndef _di_fake_print_line_first_unlocked_ - extern f_status_t fake_print_line_first_unlocked(fake_setting_t * const setting, const fl_print_t print); -#endif // _di_fake_print_line_first_unlocked_ +#ifndef _di_fake_print_line_first_ + extern f_status_t fake_print_line_first(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_print_line_first_ /** * Print last new line when the main is complete, unless verbosity says otherwise. @@ -407,76 +113,12 @@ extern "C" { * F_output_not on success, but no printing is performed. * * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_fake_print_line_last_locked_ - extern f_status_t fake_print_line_last_locked(fake_setting_t * const setting, const fl_print_t print); -#endif // _di_fake_print_line_last_locked_ - -/** - * Print last new line when the main is complete, unless verbosity says otherwise. - * - * This is generally the very last line printed in the program. - * - * This function neither locks nor unlocks the input stream. - * - * @param setting - * The main program settings. * - * This does not alter setting.state.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. - * - * F_output_not (with error bit) if setting is NULL. + * @see fll_print_dynamic_raw() */ -#ifndef _di_fake_print_line_last_unlocked_ - extern f_status_t fake_print_line_last_unlocked(fake_setting_t * const setting, const fl_print_t print); -#endif // _di_fake_print_line_last_unlocked_ - -/** - * Print message for when all operates successfully complete. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.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. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_fake_print_operation_all_complete_ - extern f_status_t fake_print_operation_all_complete(fake_setting_t * const setting, const fl_print_t print); -#endif // _di_fake_print_operation_all_complete_ - -/** - * Print message for when the operation is cancelled. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.status. - * @param print - * Designates the how and where to print. - * @param operation - * The identifier of the operation that failed. - * - * @return - * F_none on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. - */ -#ifndef _di_fake_print_operation_cancelled_ - extern f_status_t fake_print_operation_cancelled(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation); -#endif // _di_fake_print_operation_cancelled_ +#ifndef _di_fake_print_line_last_ + extern f_status_t fake_print_line_last(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_print_line_last_ /** * Print simple message. @@ -493,6 +135,8 @@ extern "C" { * The output structure to print to. * @param message * The message to print. + * + * @see fll_print_format() */ #ifndef _di_fake_print_simple_ extern void fake_print_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message); @@ -515,6 +159,8 @@ extern "C" { * The message to print. * @param variable * The string representing the variable. + * + * @see fll_print_format() */ #ifndef _di_fake_print_simple_variable_ extern void fake_print_simple_variable(fake_setting_t * const setting, const fl_print_t print, const f_string_t message, const f_string_static_t variable); @@ -543,6 +189,8 @@ extern "C" { * The string being printed after the variable. * Likely should have a space added at the start of the string. * Set to NULL to disable. + * + * @see fll_print_format() */ #ifndef _di_fake_print_wrapped_variable_ 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); @@ -578,8 +226,6 @@ extern "C" { * @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); diff --git a/level_3/fake/c/main/print/context.c b/level_3/fake/c/main/print/context.c new file mode 100644 index 0000000..efb3adf --- /dev/null +++ b/level_3/fake/c/main/print/context.c @@ -0,0 +1,123 @@ +#include "../fake.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_print_context_important_simple_ + void fake_print_context_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_context_important_simple_ + +#ifndef _di_fake_print_context_simple_ + void fake_print_context_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message) { + + if (!setting) return; + + fll_print_format("%[%Q%S.%]%r", print.to, print.context, print.prefix, message, print.context, f_string_eol_s); + } +#endif // _di_fake_print_context_simple_ + +#ifndef _di_fake_print_context_simple_variable_ + void fake_print_context_simple_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) { + + if (!setting) return; + + f_file_stream_lock(print.to); + + fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); + fl_print_format("%[%Q%]", print.to, print.notable, variable, print.notable); + fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_context_simple_variable_ + +#ifndef _di_fake_print_context_wrapped_number_ + void fake_print_context_wrapped_number(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_number_unsigned_t number, const f_string_t after) { + + if (!setting) return; + + f_file_stream_lock(print.to); + + fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); + fl_print_format("%[%un%]", print.to, print.notable, number, print.notable); + fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_context_wrapped_number_ + +#ifndef _di_fake_print_context_wrapped_parameter_ + void fake_print_context_wrapped_parameter(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol, const f_string_static_t name, const f_string_t after) { + + if (!setting) return; + + f_file_stream_lock(print.to); + + fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); + fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol, name, print.notable); + fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_context_wrapped_parameter_ + +#ifndef _di_fake_print_context_wrapped_parameters_ + void fake_print_context_wrapped_parameters(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol_1, const f_string_static_t name_1, const f_string_t between_1, const f_string_static_t symbol_2, const f_string_static_t name_2, const f_string_t between_2, const f_string_static_t symbol_3, const f_string_static_t name_3, const f_string_t after) { + + if (!setting) return; + + f_file_stream_lock(print.to); + + fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); + fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol_1, name_1, print.notable); + fl_print_format("%['%S'%]%r", print.to, print.context, between_1, print.context); + fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol_2, name_2, print.notable); + fl_print_format("%['%S'%]%r", print.to, print.context, between_2, print.context); + fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol_3, name_3, print.notable); + fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_context_wrapped_parameters_ + +#ifndef _di_fake_print_context_wrapped_variable_ + void fake_print_context_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) { + + if (!setting) return; + + f_file_stream_lock(print.to); + + fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); + fl_print_format("%[%Q%]", print.to, print.notable, variable, print.notable); + fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_context_wrapped_variable_ + +#ifndef _di_fake_print_context_wrapped_variables_ + void fake_print_context_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); + + fl_print_format("%[%Q%S'%]", print.to, print.context, print.prefix, before, print.context); + fl_print_format("%[%Q%]", print.to, print.notable, first, print.notable); + fl_print_format("%['%S'%]", print.to, print.context, between, print.context); + fl_print_format("%[%Q%]", print.to, print.notable, second, print.notable); + fl_print_format("%['%S.%]%r", print.to, print.context, after, print.context, f_string_eol_s); + + f_file_stream_unlock(print.to); + } +#endif // _di_fake_print_context_wrapped_variables_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/main/print/context.h b/level_3/fake/c/main/print/context.h new file mode 100644 index 0000000..fa4f424 --- /dev/null +++ b/level_3/fake/c/main/print/context.h @@ -0,0 +1,288 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides print context functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fake_print_context_h +#define _fake_print_context_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * 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.state.status. + * @param print + * The output structure to print to. + * @param message + * The string to print. + * + * @see fake_print_context_simple() + */ +#ifndef _di_fake_print_context_important_simple_ + extern void fake_print_context_important_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message); +#endif // _di_fake_print_context_important_simple_ + +/** + * Print a simple context message with prefix and a single string message. + * + * 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.state.status. + * @param print + * The output structure to print to. + * @param message + * The string to print. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_context_simple_ + extern void fake_print_context_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t message); +#endif // _di_fake_print_context_simple_ + +/** + * Print a variable context message with a before string, an after string, and a string variable. + * + * 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.state.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. + * Set to NULL to disable. + * @param variable + * The string representing the variable. + * @param after + * The string being printed after the variable. + * Likely should have a space added at the start of the string. + * Set to NULL to disable. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_context_simple_variable_ + extern void fake_print_context_simple_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_context_simple_variable_ + +/** + * Print a variable context message with a before string, an after string, and an unsigned number variable. + * + * 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.state.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. + * Set to NULL to disable. + * @param number + * The number representing the variable. + * @param after + * The string being printed after the variable. + * Likely should have a space added at the start of the string. + * Set to NULL to disable. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_context_wrapped_number_ + extern void fake_print_context_wrapped_number(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_number_unsigned_t number, const f_string_t after); +#endif // _di_fake_print_context_wrapped_number_ + +/** + * 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 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.state.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. + * Set to NULL to disable. + * @param symbol + * The string representing the symbol for the parameter. + * Set to f_string_empty_s to disable. + * @param name + * The string representing the parameter name. + * @param after + * The string being printed after the variable. + * Likely should have a space added at the start of the string. + * Set to NULL to disable. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_context_wrapped_parameter_ + extern void fake_print_context_wrapped_parameter(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol, const f_string_static_t name, const f_string_t after); +#endif // _di_fake_print_context_wrapped_parameter_ + +/** + * Print a parameter context message with a there parameters, with symbols, and wrapping strings. + * + * 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.state.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. + * Set to NULL to disable. + * @param symbol_1 + * The string representing the symbol for the parameter. + * Set to f_string_empty_s to disable. + * @param name_1 + * The string representing the parameter name. + * @param middle_1 + * The string being printed before the variable. + * Likely should have a space added at the end of the string. + * Set to NULL to disable. + * @param symbol_2 + * The string representing the symbol for the parameter. + * Set to f_string_empty_s to disable. + * @param name_2 + * The string representing the parameter name. + * @param middle_2 + * The string being printed before the variable. + * Likely should have a space added at the end of the string. + * Set to NULL to disable. + * @param symbol_3 + * The string representing the symbol for the parameter. + * Set to f_string_empty_s to disable. + * @param name_3 + * The string representing the parameter name. + * @param after + * The string being printed after the variable. + * Likely should have a space added at the start of the string. + * Set to NULL to disable. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_context_wrapped_parameter_ + extern void fake_print_context_wrapped_parameters(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t symbol_1, const f_string_static_t name_1, const f_string_t between_1, const f_string_static_t symbol_2, const f_string_static_t name_2, const f_string_t between_2, const f_string_static_t symbol_3, const f_string_static_t name_3, const f_string_t after); +#endif // _di_fake_print_context_wrapped_parameter_ + +/** + * Print a wrapped context message with a before string, an after string, and a string variable. + * + * 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.state.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. + * Set to NULL to disable. + * @param variable + * The string representing the variable. + * @param after + * The string being printed after the variable. + * Likely should have a space added at the start of the string. + * Set to NULL to disable. + * + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_context_wrapped_variable_ + extern void fake_print_context_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_context_wrapped_variable_ + +/** + * 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 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.state.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() + */ +#ifndef _di_fake_print_context_wrapped_variables_ + extern void fake_print_context_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_context_wrapped_variables_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fake_print_context_h diff --git a/level_3/fake/c/main/print-error.c b/level_3/fake/c/main/print/error.c similarity index 75% rename from level_3/fake/c/main/print-error.c rename to level_3/fake/c/main/print/error.c index 5628ce0..721d4bc 100644 --- a/level_3/fake/c/main/print-error.c +++ b/level_3/fake/c/main/print/error.c @@ -1,17 +1,16 @@ -#include "fake.h" +#include "../fake.h" #ifdef __cplusplus extern "C" { #endif #ifndef _di_fake_print_error_ - f_status_t fake_print_error(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function) { + f_status_t fake_print_error(fake_setting_t * const setting, const fl_print_t print, const f_string_t function) { + if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - fake_print_line_first_locked(setting, print); - - fll_error_print(print, F_status_set_fine(status), function, fll_error_file_flag_fallback_e); + fll_error_print(print, F_status_set_fine(data->setting.state.status), function, fll_error_file_flag_fallback_e); return F_none; } @@ -20,6 +19,7 @@ extern "C" { #ifndef _di_fake_print_error_argument_empty_ f_status_t fake_print_error_argument_empty(fake_setting_t * const setting, const fl_print_t print, const f_array_length_t index) { + if (!setting) return F_status_set_error(F_output_not); if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not; fake_print_context_wrapped_number(setting, print, "The ", (f_number_unsigned_t) index, " argument must not be an empty string"); @@ -29,14 +29,14 @@ extern "C" { #endif // _di_fake_print_error_argument_empty_ #ifndef _di_fake_print_error_build_operation_file_ - f_status_t fake_print_error_build_operation_file(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) { + f_status_t fake_print_error_build_operation_file(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) { + + if (!setting) return F_status_set_error(F_output_not); - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_set_fine(setting->state.status) == F_file_found_not) { if (print.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QFailed to find '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, source, print.notable); fl_print_format("%[' ", print.to, print.context); @@ -51,12 +51,10 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_parameter) { + if (F_status_set_fine(setting->state.status) == F_parameter) { if (print.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QInvalid parameter when calling '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, function, print.notable); fl_print_format("%[() ", print.to, print.context); @@ -71,12 +69,10 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_name) { + if (F_status_set_fine(setting->state.status) == F_name) { if (print.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QInvalid name for '%]", print.to, print.context, print.prefix, print.context); if (source.used) { @@ -96,7 +92,7 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_memory_not) { + if (F_status_set_fine(setting->state.status) == F_memory_not) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Unable to allocate memory, ", operation, source, destination, how, 0); } @@ -104,7 +100,7 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_number_overflow) { + if (F_status_set_fine(setting->state.status) == F_number_overflow) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Overflow ", operation, source, destination, how, 0); } @@ -112,7 +108,7 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_directory) { + if (F_status_set_fine(setting->state.status) == F_directory) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Invalid directory ", operation, source, destination, how, 0); } @@ -120,7 +116,7 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_access_denied) { + if (F_status_set_fine(setting->state.status) == F_access_denied) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Access denied ", operation, source, destination, how, 0); } @@ -128,7 +124,7 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_loop) { + if (F_status_set_fine(setting->state.status) == F_loop) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Loop ", operation, source, destination, how, 0); } @@ -136,7 +132,7 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_prohibited) { + if (F_status_set_fine(setting->state.status) == F_prohibited) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Prohibited by system ", operation, source, destination, how, 0); } @@ -144,13 +140,13 @@ extern "C" { return F_false; } - if (F_status_set_fine(status) == F_directory_found_not) { + if (F_status_set_fine(setting->state.status) == F_directory_found_not) { fake_print_error_build_operation_file_full(setting, print, "Failed ", operation, source, destination, how, "due to an invalid directory in the path"); return F_false; } - if (F_status_set_fine(status) == F_failure) { + if (F_status_set_fine(setting->state.status) == F_failure) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_build_operation_file_full(setting, print, "Failed ", operation, source, destination, how, 0); } @@ -158,13 +154,11 @@ extern "C" { return F_false; } - if (fll_error_print(print, F_status_set_fine(status), function, fll_error_file_flag_none_e) == F_known_not && fallback && print.verbosity > f_console_verbosity_quiet_e) { + if (fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_none_e) == F_known_not && fallback && print.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[UNKNOWN %Q(%]", print.to, print.context, print.prefix, print.context); - fl_print_format("%[%ui%]", print.to, print.notable, F_status_set_fine(status), print.notable); + fl_print_format("%[%ui%]", print.to, print.notable, F_status_set_fine(setting->state.status), print.notable); fl_print_format("%[) occurred ", print.to, print.context); fake_print_error_build_operation_file_partial(setting, print, operation, source, destination, how); @@ -181,12 +175,11 @@ extern "C" { #ifndef _di_fake_print_error_build_operation_file_full_ f_status_t fake_print_error_build_operation_file_full(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const f_string_t after) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%Q%S", print.to, print.context, print.prefix, before); if (source.used) { @@ -207,7 +200,8 @@ extern "C" { #ifndef _di_fake_print_error_build_operation_file_partial_ void fake_print_error_build_operation_file_partial(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) { - if (!setting || print.verbosity < f_console_verbosity_error_e || !source.used) return; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e || !source.used) return; fl_print_format("%[while trying to %Q '%]", print.to, print.context, operation, print.context); fl_print_format("%[%Q%]", print.to, print.notable, source, print.notable); @@ -224,7 +218,8 @@ extern "C" { #ifndef _di_fake_print_error_directory_create_parent_missing_ f_status_t fake_print_error_directory_create_parent_missing(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; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The directory ", path, " could not be created, a parent directory is missing or invalid"); @@ -235,12 +230,11 @@ extern "C" { #ifndef _di_fake_print_error_failure_operation_ f_status_t fake_print_error_failure_operation(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe operation '%]%[", print.to, print.context, print.prefix, print.context, print.notable); if (operation == fake_operation_build_e) { @@ -267,7 +261,8 @@ extern "C" { #ifndef _di_fake_print_error_failure_script_ f_status_t fake_print_error_failure_script(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t script) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "Failed to execute script ", script, ""); @@ -276,26 +271,24 @@ extern "C" { #endif // _di_fake_print_error_failure_script_ #ifndef _di_fake_print_error_fallback_ - f_status_t fake_print_error_fallback(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function) { - - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + f_status_t fake_print_error_fallback(fake_setting_t * const setting, const fl_print_t print, const f_string_t function) { - fake_print_line_first_locked(setting, print); + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - if (fll_error_print(print, F_status_set_fine(status), function, fll_error_file_flag_none_e) == F_known_not) return F_false; + if (fll_error_print(print, F_status_set_fine(data->setting.state.status), function, fll_error_file_flag_none_e) == F_known_not) return F_false; return F_true; } #endif // _di_fake_print_error_fallback_ #ifndef _di_fake_print_error_file_ - f_status_t fake_print_error_file(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + f_status_t fake_print_error_file(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - fake_print_line_first_locked(setting, print); + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - fll_error_file_print(print, F_status_set_fine(status), function, fll_error_file_flag_fallback_e, name, operation, type); + fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type); return F_none; } @@ -304,7 +297,8 @@ extern "C" { #ifndef _di_fake_print_error_file_create_parent_missing_ f_status_t fake_print_error_file_create_parent_missing(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; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The file ", path, " could not be created, a parent directory is missing or invalid"); @@ -312,39 +306,24 @@ extern "C" { } #endif // _di_fake_print_error_file_create_parent_missing_ -#ifndef _di_fake_print_error_file_fallback_ - f_status_t fake_print_error_file_fallback(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; - - fake_print_line_first_locked(setting, print); - - if (fll_error_file_print(print, F_status_set_fine(status), function, fll_error_file_flag_none_e, name, operation, type) == F_known_not) return F_false; - - return F_true; - } -#endif // _di_fake_print_error_file_fallback_ - #ifndef _di_fake_print_error_file_simple_ - f_status_t fake_print_error_file_simple(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + f_status_t fake_print_error_file_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - fake_print_line_first_locked(setting, print); + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - fll_error_file_print(print, F_status_set_fine(status), function, fll_error_file_flag_simple_e, name, operation, type); + fll_error_file_print(print, F_status_set_fine(data->setting.state.status), function, fll_error_file_flag_simple_e, name, operation, type); return F_none; } #endif // _di_fake_print_error_file_simple_ #ifndef _di_fake_print_error_fss_ - f_status_t fake_print_error_fss(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) { + f_status_t fake_print_error_fss(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) { - // Treat as if status code us unknown when there is no valid setting pointer. - if (!setting) return F_true; + if (!setting) return F_status_set_error(F_output_not); - if (status == F_file_found_not) { + if (data->setting.state.status == F_file_found_not) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_fss_message(setting, print, 0, "Occurred on invalid UTF-8 character at stop position (at ", range.start, " of the setting file ", path_file, ")"); } @@ -352,13 +331,11 @@ extern "C" { return F_false; } - if (status == F_complete_not_utf || status == F_complete_not_utf_eos || status == F_complete_not_utf_stop) { + if (data->setting.state.status == F_complete_not_utf || data->setting.state.status == F_complete_not_utf_eos || data->setting.state.status == F_complete_not_utf_stop) { if (print.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - - fl_print_format("%[%QOccurred on invalid UTF-8 character at %s (at '%]", print.to, print.context, print.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", print.context); + fl_print_format("%[%QOccurred on invalid UTF-8 character at %s (at '%]", print.to, print.context, print.prefix, data->setting.state.status == F_complete_not_utf_eos ? "end of string" : "stop point of string", print.context); fl_print_format("%[%un%]", print.to, print.notable, range.start, print.notable); fl_print_format("%[ of the setting file '%]", print.to, print.context, print.context); fl_print_format("%[%Q%]", print.to, print.notable, path_file, print.notable); @@ -370,7 +347,7 @@ extern "C" { return F_false; } - if (status == F_complete_not_utf_stop) { + if (data->setting.state.status == F_complete_not_utf_stop) { if (print.verbosity > f_console_verbosity_quiet_e) { fake_print_error_fss_message(setting, print, 0, "Occurred on invalid UTF-8 character at stop point of string (at ", range.start, " of the setting file ", path_file, ")"); } @@ -378,13 +355,13 @@ extern "C" { return F_false; } - if (fll_error_print(print, status, function, fll_error_file_flag_none_e) == F_known_not && fallback) { + if (fll_error_print(print, data->setting.state.status, function, fll_error_file_flag_none_e) == F_known_not && fallback) { if (print.verbosity > f_console_verbosity_quiet_e) { f_string_static_t function_s = f_string_static_t_initialize; function_s.string = function; function_s.used = strlen(function); - fake_print_error_fss_message(setting, print, "UNKNOWN ", 0, (f_number_unsigned_t) status, ") in function ", function_s, "()"); + fake_print_error_fss_message(setting, print, "UNKNOWN ", 0, (f_number_unsigned_t) data->setting.state.status, ") in function ", function_s, "()"); } } @@ -395,12 +372,11 @@ extern "C" { #ifndef _di_fake_print_error_fss_message_ f_status_t fake_print_error_fss_message(fake_setting_t * const setting, const fl_print_t print, const f_string_t prefix, const f_string_t before, const f_number_unsigned_t number, const f_string_t middle, const f_string_static_t variable, const f_string_t after) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%S%Q%S(%]", print.to, print.context, prefix, print.prefix, before, print.context); fl_print_format("%[%un%]", print.to, print.notable, number, print.notable); fl_print_format("%[)%S'%]", print.to, print.context, middle, print.context); @@ -416,7 +392,8 @@ extern "C" { #ifndef _di_fake_print_error_group_not_found_ f_status_t fake_print_error_group_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t group) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The group ", group, " is not found"); @@ -427,7 +404,8 @@ extern "C" { #ifndef _di_fake_print_error_mode_invalid_ f_status_t fake_print_error_mode_invalid(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t mode) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The mode ", mode, " is invalid"); @@ -438,7 +416,8 @@ extern "C" { #ifndef _di_fake_print_error_number_too_large_ f_status_t fake_print_error_number_too_large(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t number) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The number ", number, " is too large"); @@ -449,7 +428,8 @@ extern "C" { #ifndef _di_fake_print_error_operation_failed_ f_status_t fake_print_error_operation_failed(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_array_length_t line = 1; f_state_t state = f_state_t_initialize; @@ -458,8 +438,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe section operation '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%/Q%]", print.to, print.notable, buffer, operation_name, print.notable); fl_print_format("%[' from section '%]", print.to, print.context, print.context); @@ -477,12 +455,11 @@ extern "C" { #ifndef _di_fake_print_error_operation_link_argument_unknown_ f_status_t fake_print_error_operation_link_argument_unknown(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t argument) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe argument '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, argument, print.notable); fl_print_format("%[' is not not valid and may only be one of either '%]", print.to, print.context, print.context); @@ -500,7 +477,8 @@ extern "C" { #ifndef _di_fake_print_error_operation_link_point_exists_ f_status_t fake_print_error_operation_link_point_exists(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t argument) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The point file ", argument, " already exists"); @@ -511,7 +489,8 @@ extern "C" { #ifndef _di_fake_print_error_operation_link_target_exists_not_ f_status_t fake_print_error_operation_link_target_exists_not(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t argument) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The target file ", argument, " does not exist"); @@ -520,15 +499,16 @@ extern "C" { #endif // _di_fake_print_error_operation_link_target_exists_not_ #ifndef _di_fake_print_error_operation_path_outside_ - f_status_t fake_print_error_operation_path_outside(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path) { + f_status_t fake_print_error_operation_path_outside(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; - if (F_status_set_fine(status) == F_false) { + if (F_status_set_fine(data->setting.state.status) == F_false) { fake_print_context_wrapped_variable(setting, print, "The path ", path, " is outside the project root"); } else { - fake_print_error_file(setting, print, status, function, path, fake_common_file_path_determine_real_s, fll_error_file_type_file_e); + fake_print_error_file(setting, print, data->setting.state.status, function, path, fake_common_file_path_determine_real_s, fll_error_file_type_file_e); } return F_none; @@ -536,15 +516,14 @@ extern "C" { #endif // _di_fake_print_error_operation_path_outside_ #ifndef _di_fake_print_error_operation_path_stack_max_ - f_status_t fake_print_error_operation_path_stack_max(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path) { + f_status_t fake_print_error_operation_path_stack_max(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - if (status == F_array_too_large) { + if (data->setting.state.status == F_array_too_large) { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QMaximum stack size reached while processing path '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%]", print.to, print.notable, path, print.notable); fl_print_format("%['", print.to, print.context); @@ -559,7 +538,7 @@ extern "C" { f_file_stream_unlock(print.to); } else { - fake_print_error_file(setting, print, status, function, path, fake_common_file_path_change_to_s, fll_error_file_type_directory_e); + fake_print_error_file(setting, print, function, path, fake_common_file_path_change_to_s, fll_error_file_type_directory_e); } return F_none; @@ -569,7 +548,8 @@ extern "C" { #ifndef _di_fake_print_error_operation_stack_max_ f_status_t fake_print_error_operation_stack_max(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_array_length_t line = 1; f_state_t state = f_state_t_initialize; @@ -578,8 +558,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe section operation '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%/Q%]", print.to, print.notable, buffer, operation_name, print.notable); fl_print_format("%[' from section '%]", print.to, print.context, buffer, print.context); @@ -599,7 +577,8 @@ extern "C" { #ifndef _di_fake_print_error_operation_unknown_ f_status_t fake_print_error_operation_unknown(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; f_array_length_t line = 1; f_state_t state = f_state_t_initialize; @@ -608,8 +587,6 @@ extern "C" { f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe section operation '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%/Q%]", print.to, print.notable, buffer, operation_name, print.notable); fl_print_format("%[' from section '%]", print.to, print.context, buffer, print.context); @@ -627,7 +604,8 @@ extern "C" { #ifndef _di_fake_print_error_parameter_not_empty_ f_status_t fake_print_error_parameter_not_empty(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) { - if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not; fake_print_context_wrapped_parameter(setting, print, "The ", f_console_symbol_long_normal_s, name, " parameter must not be empty and must not contain only white space"); @@ -638,12 +616,11 @@ extern "C" { #ifndef _di_fake_print_error_parameter_not_word_ f_status_t fake_print_error_parameter_not_word(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value) { - if (!setting || print.verbosity == f_console_verbosity_quiet_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity == f_console_verbosity_quiet_e) return F_output_not; f_file_stream_lock(print.to); - fake_print_line_first_unlocked(setting, print); - fl_print_format("%[%QThe '%]", print.to, print.context, print.prefix, print.context); fl_print_format("%[%Q%Q%]", print.to, print.notable, symbol, name, print.notable); fl_print_format("%[' parameter value '%]", print.to, print.context, print.context); @@ -659,7 +636,8 @@ extern "C" { #ifndef _di_fake_print_error_parameter_operation_not_with_ f_status_t fake_print_error_parameter_operation_not_with(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t operation_1, const f_string_static_t operation_2) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variables(setting, print, "The operation ", operation_1, " cannot be specified with the operation ", operation_2, 0); @@ -670,7 +648,8 @@ extern "C" { #ifndef _di_fake_print_error_parameter_too_many_ f_status_t fake_print_error_parameter_too_many(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t parameter) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_parameter(setting, print, "The parameter ", f_console_symbol_long_normal_s, parameter, " is specified too many times"); @@ -681,7 +660,8 @@ extern "C" { #ifndef _di_fake_print_error_requires_more_arguments_ f_status_t fake_print_error_requires_more_arguments(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_simple(setting, print, "Requires more arguments"); @@ -692,7 +672,8 @@ extern "C" { #ifndef _di_fake_print_error_too_many_arguments_ f_status_t fake_print_error_too_many_arguments(fake_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_simple(setting, print, "Has too many arguments"); @@ -703,7 +684,8 @@ extern "C" { #ifndef _di_fake_print_error_user_not_found_ f_status_t fake_print_error_user_not_found(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t user) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The user ", user, " is not found"); diff --git a/level_3/fake/c/main/print-error.h b/level_3/fake/c/main/print/error.h similarity index 89% rename from level_3/fake/c/main/print-error.h rename to level_3/fake/c/main/print/error.h index e12966b..ad31a6a 100644 --- a/level_3/fake/c/main/print-error.h +++ b/level_3/fake/c/main/print/error.h @@ -25,9 +25,6 @@ extern "C" { * This does not alter setting.state.status. * @param print * Designates the how and where to print. - * @param status - * The status to use. - * This is provided, ignoring setting.status, for thread-safety reasons. * @param function * The function name. * @@ -35,14 +32,14 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_ - extern f_status_t fake_print_error(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function); + extern f_status_t fake_print_error(fake_setting_t * const setting, const fl_print_t print, const f_string_t function); #endif // _di_fake_print_error_ /** @@ -61,6 +58,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_number() */ #ifndef _di_fake_print_error_argument_empty_ @@ -76,9 +75,6 @@ extern "C" { * This does not alter setting.state.status. * @param print * Designates the how and where to print. - * @param status - * The status to use. - * This is provided, ignoring setting->state.status, for thread-safety reasons. * @param function * The name of the function where the error happened. * @param operation @@ -96,15 +92,16 @@ extern "C" { * @return * F_true is returned if the status code has no print message. * F_false is returned on successful print of known errors. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_build_operation_file_ - extern f_status_t fake_print_error_build_operation_file(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback); + extern f_status_t fake_print_error_build_operation_file(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback); #endif // _di_fake_print_error_build_operation_file_ /** @@ -134,12 +131,17 @@ extern "C" { * The string being printed after the variable. * Likely should have a space added at the start of the string. * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() * * @see fake_print_error_build_operation_file_partial() - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_build_operation_file_full_ extern f_status_t fake_print_error_build_operation_file_full(fake_setting_t * const setting, const fl_print_t print, const f_string_t before, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const f_string_t after); @@ -190,6 +192,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_file_create_parent_missing_ @@ -212,11 +216,11 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_failure_operation_ extern f_status_t fake_print_error_failure_operation(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation); @@ -238,6 +242,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_failure_script_ @@ -253,23 +259,20 @@ extern "C" { * This does not alter setting.state.status. * @param print * Designates the how and where to print. - * @param status - * The status to use. - * This is provided, ignoring setting.status, for thread-safety reasons. * @param function * The function name. * * @return * F_true is returned if the status code has no print message. * F_false is returned on successful print of known errors. - * F_output_not on success, but no printing is performed. + * F_output_not on success, but no printing is performed.. * - * @see fll_error_file_print() + * F_output_not (with error bit) if setting is NULL. * - * @see fake_print_line_first_locked() + * @see fll_error_file_print() */ #ifndef _di_fake_print_error_fallback_ - extern f_status_t fake_print_error_fallback(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function); + extern f_status_t fake_print_error_fallback(fake_setting_t * const setting, const fl_print_t print, const f_string_t function); #endif // _di_fake_print_error_fallback_ /** @@ -279,9 +282,6 @@ extern "C" { * The main program settings. * * This does not alter setting.state.status. - * @param status - * The status to use. - * This is provided, ignoring setting.status, for thread-safety reasons. * @param print * Designates the how and where to print. * @param name @@ -295,12 +295,12 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * - * @see fll_error_file_print() + * F_output_not (with error bit) if setting is NULL. * - * @see fake_print_line_first_locked() + * @see fll_error_file_print() */ #ifndef _di_fake_print_error_file_ - extern f_status_t fake_print_error_file(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); + extern f_status_t fake_print_error_file(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); #endif // _di_fake_print_error_file_ /** @@ -319,6 +319,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_directory_create_parent_missing_ @@ -326,38 +328,6 @@ extern "C" { #endif // _di_fake_print_error_directory_create_parent_missing_ /** - * Print file related error message regarding a function failing in some way, setting fallback to F_false and returning result.. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.status. - * @param print - * Designates the how and where to print. - * @param status - * The status to use. - * This is provided, ignoring setting.status, for thread-safety reasons. - * @param name - * The name of the file or directory. - * @param operation - * The operation that fails, such as 'create' or 'access'. - * @param type - * A valid file type code from the fll_error_file_type enum. - * - * @return - * F_true is returned if the status code has no print message. - * F_false is returned on successful print of known errors. - * F_output_not on success, but no printing is performed. - * - * @see fll_error_file_print() - * - * @see fake_print_line_first_locked() - */ -#ifndef _di_fake_print_error_file_fallback_ - extern f_status_t fake_print_error_file_fallback(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); -#endif // _di_fake_print_error_file_fallback_ - -/** * Print file related error message regarding a function failing in some way. * * This prints a simple message to avoid "Unable to find file..., because file cannot be found." type of messages. @@ -366,9 +336,6 @@ extern "C" { * The main program settings. * * This does not alter setting.state.status. - * @param status - * The status to use. - * This is provided, ignoring setting.status, for thread-safety reasons. * @param print * Designates the how and where to print. * @param name @@ -382,12 +349,12 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * - * @see fll_error_file_print() + * F_output_not (with error bit) if setting is NULL. * - * @see fake_print_line_first_locked() + * @see fll_error_file_print() */ #ifndef _di_fake_print_error_file_simple_ - extern f_status_t fake_print_error_file_simple(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); + extern f_status_t fake_print_error_file_simple(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); #endif // _di_fake_print_error_file_simple_ /** @@ -413,13 +380,15 @@ extern "C" { * @return * F_true is returned if the status code has no print message. * F_false is returned on successful print of known errors. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() * * @see fake_print_error_fss_message() - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_fss_ extern f_status_t fake_print_error_fss(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback); @@ -437,8 +406,6 @@ extern "C" { * This does not alter setting.state.status. * @param print * Designates the how and where to print. - * @param status - * The error status code to report on. * @param function * The function call that returned the error. * @param path_file @@ -452,11 +419,11 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_fss_message_ extern f_status_t fake_print_error_fss_message(fake_setting_t * const setting, const fl_print_t print, const f_string_t prefix, const f_string_t before, const f_number_unsigned_t number, const f_string_t middle, const f_string_static_t variable, const f_string_t after); @@ -478,6 +445,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_group_not_found_ @@ -500,6 +469,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_mode_invalid_ @@ -522,6 +493,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_number_too_large_ @@ -546,6 +519,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() @@ -568,6 +543,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() @@ -590,6 +567,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() @@ -612,6 +591,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() @@ -629,8 +610,6 @@ extern "C" { * The program data. * @param print * Designates how the section error/warning should be printed. - * @param status - * The status code representing an error. * @param function * The name of the function where the error happened. * @param path @@ -640,13 +619,15 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() * @see fll_error_file_print() */ #ifndef _di_fake_print_error_operation_path_outside_ - extern f_status_t fake_print_error_operation_path_outside(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path); + extern f_status_t fake_print_error_operation_path_outside(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t path); #endif // _fake_print_error_operation_path_outside_ /** @@ -656,8 +637,6 @@ extern "C" { * The program data. * @param error * Designates how the section error/warning should be printed. - * @param status - * The status code representing an error. * @param function * The name of the function where the error happened. * Set to 0 to disable. @@ -668,13 +647,15 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() * @see fll_error_file_print() */ #ifndef _di_fake_print_error_operation_path_stack_max_ - extern f_status_t fake_print_error_operation_path_stack_max(fake_setting_t * const setting, const fl_print_t print, const f_status_t status, const f_string_t function, const f_string_static_t path); + extern f_status_t fake_print_error_operation_path_stack_max(fake_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t path); #endif // _di_fake_print_error_operation_path_stack_max_ /** @@ -697,6 +678,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() @@ -723,6 +706,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() @@ -751,6 +736,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_parameter() */ #ifndef _di_fake_print_error_parameter_not_empty_ @@ -777,11 +764,11 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see f_file_stream_lock() * @see f_file_stream_unlock() * @see fl_print_format() - * - * @see fake_print_line_first_unlocked() */ #ifndef _di_fake_print_error_parameter_not_word_ extern f_status_t fake_print_error_parameter_not_word(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t symbol, const f_string_static_t name, const f_string_static_t value); @@ -805,6 +792,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variables() */ #ifndef _di_fake_print_error_parameter_operation_not_with_ @@ -823,6 +812,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_parameter() */ #ifndef _di_fake_print_error_parameter_too_many_ @@ -839,6 +830,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_simple() */ #ifndef _di_fake_print_error_requires_more_arguments_ @@ -855,6 +848,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_simple() */ #ifndef _di_fake_print_error_too_many_arguments_ @@ -877,6 +872,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_error_user_not_found_ diff --git a/level_3/fake/c/main/print/operation.c b/level_3/fake/c/main/print/operation.c new file mode 100644 index 0000000..6121fa1 --- /dev/null +++ b/level_3/fake/c/main/print/operation.c @@ -0,0 +1,58 @@ +#include "../fake.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fake_print_operation_all_complete_ + f_status_t fake_print_operation_all_complete(fake_setting_t * const setting, const fl_print_t print) { + + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + f_file_stream_lock(print.to); + + fl_print_format("All operations complete.%r", print.to, f_string_eol_s, f_string_eol_s); + + f_file_stream_flush(print.to); + f_file_stream_unlock(print.to); + + return F_none; + } +#endif // _di_fake_print_operation_all_complete_ + +#ifndef _di_fake_print_operation_cancelled_ + f_status_t fake_print_operation_cancelled(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation) { + + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + + f_file_stream_lock(print.to); + + fl_print_format("%[The operation '%]%[", print.to, print.context, print.context, print.notable); + + if (operation == fake_operation_build_e) { + f_print_dynamic(fake_other_operation_build_s, print.to); + } + else if (operation == fake_operation_clean_e) { + f_print_dynamic(fake_other_operation_clean_s, print.to); + } + else if (operation == fake_operation_make_e) { + f_print_dynamic(fake_other_operation_make_s, print.to); + } + else if (operation == fake_operation_skeleton_e) { + f_print_dynamic(fake_other_operation_skeleton_s, print.to); + } + + fl_print_format("%]%[' is cancelled.%]%r", print.to, print.notable, print.context, print.context, f_string_eol_s); + + f_file_stream_flush(print.to); + f_file_stream_unlock(print.to); + + return F_none; + } +#endif // _di_fake_print_operation_cancelled_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fake/c/main/print/operation.h b/level_3/fake/c/main/print/operation.h new file mode 100644 index 0000000..73223ca --- /dev/null +++ b/level_3/fake/c/main/print/operation.h @@ -0,0 +1,76 @@ +/** + * FLL - Level 3 + * + * Project: Featureless Make + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides print operation functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fake_print_operation_h +#define _fake_print_operation_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print message for when all operates successfully complete. + * + * @param setting + * The main program settings. + * + * This does not alter setting.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_flush() + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see fl_print_format() + */ +#ifndef _di_fake_print_operation_all_complete_ + extern f_status_t fake_print_operation_all_complete(fake_setting_t * const setting, const fl_print_t print); +#endif // _di_fake_print_operation_all_complete_ + +/** + * Print message for when the operation is cancelled. + * + * @param setting + * The main program settings. + * + * This does not alter setting.state.status. + * @param print + * Designates the how and where to print. + * @param operation + * The identifier of the operation that failed. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see f_file_stream_flush() + * @see f_file_stream_lock() + * @see f_file_stream_unlock() + * @see f_print_dynamic() + * @see fl_print_format() + */ +#ifndef _di_fake_print_operation_cancelled_ + extern f_status_t fake_print_operation_cancelled(fake_setting_t * const setting, const fl_print_t print, const uint8_t operation); +#endif // _di_fake_print_operation_cancelled_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fake_print_operation_h diff --git a/level_3/fake/c/main/print-verbose.c b/level_3/fake/c/main/print/verbose.c similarity index 71% rename from level_3/fake/c/main/print-verbose.c rename to level_3/fake/c/main/print/verbose.c index ed26852..b5e2706 100644 --- a/level_3/fake/c/main/print-verbose.c +++ b/level_3/fake/c/main/print/verbose.c @@ -1,4 +1,4 @@ -#include "fake.h" +#include "../fake.h" #ifdef __cplusplus extern "C" { @@ -7,7 +7,8 @@ extern "C" { #ifndef _di_fake_print_verbose_clone_ f_status_t fake_print_verbose_clone(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_wrapped_variables(setting, print, "Cloned ", source, " to ", destination, 0); @@ -18,7 +19,8 @@ extern "C" { #ifndef _di_fake_print_verbose_copy_ f_status_t fake_print_verbose_copy(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fll_print_format("Copied '%Q' to '%Q'.%r", output, source, destination, f_string_eol_s); } @@ -27,7 +29,8 @@ extern "C" { #ifndef _di_fake_print_verbose_create_directory_ f_status_t fake_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_simple_variable(setting, print, "Created directory ", path); @@ -38,7 +41,8 @@ extern "C" { #ifndef _di_fake_print_verbose_create_file_ f_status_t fake_print_verbose_create_file(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_simple_variable(setting, print, "Created file ", path); @@ -49,7 +53,8 @@ extern "C" { #ifndef _di_fake_print_verbose_directory_exists_ f_status_t fake_print_verbose_directory_exists(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_wrapped_variable(setting, print, "Directory ", path, " already exists"); @@ -60,7 +65,8 @@ extern "C" { #ifndef _di_fake_print_verbose_file_exists_ f_status_t fake_print_verbose_file_exists(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_wrapped_variable(setting, print, "File ", path, " already exists"); } @@ -69,7 +75,8 @@ extern "C" { #ifndef _di_fake_print_verbose_file_exists_as_link_ f_status_t fake_print_verbose_file_exists_as_link(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_wrapped_variable(setting, print, "File ", path, " already exists (as a symbolic link)"); } @@ -78,7 +85,8 @@ extern "C" { #ifndef _di_fake_print_verbose_file_exists_not_regular_or_link_ f_status_t fake_print_verbose_file_exists_not_regular_or_link(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_wrapped_variable(setting, print, "File ", path, " already exists but is not a regular file (or a symbolic link)"); } @@ -87,7 +95,8 @@ extern "C" { #ifndef _di_fake_print_verbose_file_pre_populated_ f_status_t fake_print_verbose_file_pre_populated(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_simple_variable(setting, print, "Pre-populated file ", path); } @@ -96,7 +105,8 @@ extern "C" { #ifndef _di_fake_print_verbose_move_ f_status_t fake_print_verbose_move(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { - if (!setting || print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fll_print_format("Moved '%Q' to '%Q'.%r", output, source, destination, f_string_eol_s); } diff --git a/level_3/fake/c/main/print-verbose.h b/level_3/fake/c/main/print/verbose.h similarity index 91% rename from level_3/fake/c/main/print-verbose.h rename to level_3/fake/c/main/print/verbose.h index 44d7d66..7334fac 100644 --- a/level_3/fake/c/main/print-verbose.h +++ b/level_3/fake/c/main/print/verbose.h @@ -34,6 +34,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_wrapped_variables() */ #ifndef _di_fake_print_verbose_clone_ @@ -58,7 +60,9 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * - * @see fake_print_wrapped_variables() + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_print_format() */ #ifndef _di_fake_print_verbose_copy_ extern f_status_t fake_print_verbose_copy(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination); @@ -80,6 +84,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_simple_variable() */ #ifndef _di_fake_print_verbose_create_directory_ @@ -102,6 +108,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_simple_variable() */ #ifndef _di_fake_print_verbose_create_file_ @@ -124,6 +132,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_wrapped_variable() */ #ifndef _di_fake_print_verbose_directory_exists_ @@ -146,6 +156,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_wrapped_variable() */ #ifndef _di_fake_print_verbose_file_exists_ @@ -168,6 +180,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_wrapped_variable() */ #ifndef _di_fake_print_verbose_file_exists_as_link_ @@ -190,6 +204,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_wrapped_variable() */ #ifndef _di_fake_print_verbose_file_exists_not_regular_or_link_ @@ -212,6 +228,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_simple_variable() */ #ifndef _di_fake_print_verbose_file_pre_populated_ @@ -236,7 +254,9 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * - * @see fake_print_wrapped_variables() + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_print_format() */ #ifndef _di_fake_print_verbose_move_ extern f_status_t fake_print_verbose_move(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination); diff --git a/level_3/fake/c/main/print-warning.c b/level_3/fake/c/main/print/warning.c similarity index 75% rename from level_3/fake/c/main/print-warning.c rename to level_3/fake/c/main/print/warning.c index 8a2aa48..761f403 100644 --- a/level_3/fake/c/main/print-warning.c +++ b/level_3/fake/c/main/print/warning.c @@ -1,4 +1,4 @@ -#include "fake.h" +#include "../fake.h" #ifdef __cplusplus extern "C" { @@ -7,7 +7,8 @@ extern "C" { #ifndef _di_fake_print_warning_path_exists_not_directory_ f_status_t fake_print_warning_path_exists_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_verbose_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; fake_print_context_wrapped_variable(setting, print, "The path ", path, " exists but is not a directory"); diff --git a/level_3/fake/c/main/print-warning.h b/level_3/fake/c/main/print/warning.h similarity index 95% rename from level_3/fake/c/main/print-warning.h rename to level_3/fake/c/main/print/warning.h index 459b3b8..c55a310 100644 --- a/level_3/fake/c/main/print-warning.h +++ b/level_3/fake/c/main/print/warning.h @@ -32,6 +32,8 @@ extern "C" { * F_none on success. * F_output_not on success, but no printing is performed. * + * F_output_not (with error bit) if setting is NULL. + * * @see fake_print_context_wrapped_variable() */ #ifndef _di_fake_print_warning_path_exists_not_directory_ diff --git a/level_3/fake/c/main/skeleton.c b/level_3/fake/c/main/skeleton.c index b351366..156f876 100644 --- a/level_3/fake/c/main/skeleton.c +++ b/level_3/fake/c/main/skeleton.c @@ -1,5 +1,4 @@ #include "fake.h" -#include "skeleton.h" #ifdef __cplusplus extern "C" { @@ -144,7 +143,8 @@ extern "C" { return F_status_set_warning(F_failure); } - else if (status == F_file_found_not) { + + if (status == F_file_found_not) { status = f_directory_create(path, F_file_mode_all_rwx_d); if (F_status_is_error(status)) { @@ -201,7 +201,8 @@ extern "C" { return F_status_set_warning(F_none); } - else if (F_status_set_fine(status) == F_file_found_not) { + + if (F_status_set_fine(status) == F_file_found_not) { mode_t mode = F_file_mode_all_rw_d; if (executable) { diff --git a/level_3/fake/c/main/skeleton.h b/level_3/fake/c/main/skeleton.h index 685121d..4a303ae 100644 --- a/level_3/fake/c/main/skeleton.h +++ b/level_3/fake/c/main/skeleton.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_skeleton_h -#define _PRIVATE_skeleton_h +#ifndef _fake_skeleton_h +#define _fake_skeleton_h #ifdef __cplusplus extern "C" { @@ -112,4 +112,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_skeleton_h +#endif // _fake_skeleton_h diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index 1262f85..7a1eacd 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -27,19 +27,19 @@ build_libraries-individual -lf_account -lf_capability -lf_color -lf_console -lf_ 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/print-verbose.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/print-error.c main/build/print-verbose.c main/build/print-warning.c main/build/program.c main/build/skeleton.c +build_sources_library main/build.c main/clean.c main/common.c main/fake.c main/make.c main/print.c main/print/context.c main/print/error.c main/print/operation.c main/print/warning.c main/print/verbose.c main/skeleton.c +build_sources_library main/build/enumeration.c main/build/library.c main/build/load.c main/build/object.c main/build/objects.c main/build/print.c main/build/print/compile.c main/build/print/error.c main/build/print/verbose.c main/build/print/warning.c main/build/program.c main/build/skeleton.c main/build/string.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 -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/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_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/print-verbose.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/print-error.h main/build/print-verbose.h main/build/print-warning.h main/build/program.h main/build/skeleton.h +build_sources_headers main/build.h main/clean.h main/common.h main/fake.h main/make.h main/print.h main/print/context.h main/print/error.h main/print/operation.h main/print/warning.h main/print/verbose.h main/skeleton.h +build_sources_headers main/build/enumeration.h main/build/library.h main/build/load.h main/build/object.h main/build/objects.h main/build/print.h main/build/print/compile.h main/build/print/error.h main/build/print/verbose.h main/build/print/warning.h main/build/program.h main/build/skeleton.h main/build/string.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 -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 main/make/print-warning.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_documentation man diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index dfe2b3e..183d023 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -36,6 +36,7 @@ extern "C" { setting->state.step_small = iki_read_allocation_small_d; if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_console_parameter_process)); return; @@ -55,6 +56,7 @@ extern "C" { setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(fll_program_parameter_process_context)); return; @@ -86,6 +88,7 @@ extern "C" { setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(fll_program_parameter_process_verbosity)); return; @@ -114,7 +117,7 @@ extern "C" { if (!(main->parameters.remaining.used || (main->pipe & fll_program_data_pipe_input_e))) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_missing_file(main->error); return; @@ -124,7 +127,7 @@ extern "C" { if (main->parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_at_s, iki_read_long_whole_s); return; @@ -139,7 +142,7 @@ extern "C" { if (F_status_is_error(setting->state.status)) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s, main->parameters.arguments.array[index]); return; @@ -150,7 +153,7 @@ extern "C" { else if (main->parameters.array[iki_read_parameter_at_e].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_at_s); return; @@ -166,7 +169,7 @@ extern "C" { if (F_status_is_error(setting->state.status)) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_integer_not(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s, main->parameters.arguments.array[index]); return; @@ -177,7 +180,7 @@ extern "C" { else if (main->parameters.array[iki_read_parameter_line_e].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_line_s); return; @@ -189,6 +192,7 @@ extern "C" { setting->state.status = f_string_dynamics_increase_by(main->parameters.array[iki_read_parameter_name_e].values.used, &setting->names); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_increase_by)); return; @@ -220,6 +224,7 @@ extern "C" { } // for if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_append)); return; @@ -230,7 +235,7 @@ extern "C" { else if (main->parameters.array[iki_read_parameter_name_e].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_missing_value(main->error, f_console_symbol_long_normal_s, iki_read_long_name_s); return; @@ -240,7 +245,7 @@ extern "C" { if ((main->parameters.array[iki_read_parameter_replace_e].result & f_console_result_found_e) || main->parameters.array[iki_read_parameter_replace_e].values.used % 2 != 0) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_replace_s, iki_read_string_two_s); return; @@ -251,6 +256,7 @@ extern "C" { setting->state.status = f_string_maps_increase_by(main->parameters.array[iki_read_parameter_replace_e].values.used / 2, &setting->replace); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_maps_increase_by)); return; @@ -285,6 +291,7 @@ extern "C" { } if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize)); return; @@ -324,7 +331,7 @@ extern "C" { if ((main->parameters.array[iki_read_parameter_wrap_e].result & f_console_result_found_e) || main->parameters.array[iki_read_parameter_wrap_e].values.used % 3 != 0) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, iki_read_long_wrap_s, iki_read_string_three_s); return; @@ -335,6 +342,7 @@ extern "C" { setting->state.status = f_string_triples_increase_by(main->parameters.array[iki_read_parameter_wrap_e].values.used / 3, &setting->wrap); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_triples_increase_by)); return; @@ -373,6 +381,7 @@ extern "C" { } if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize)); return; @@ -420,7 +429,7 @@ extern "C" { if (main->parameters.array[ids[i]].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_literal_s, names[i]); return; @@ -445,7 +454,7 @@ extern "C" { if (main->parameters.array[ids[i]].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_object_s, names[i]); return; @@ -458,7 +467,7 @@ extern "C" { if (main->parameters.array[iki_read_parameter_total_e].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_content_s, iki_read_long_total_s); return; @@ -470,7 +479,7 @@ extern "C" { if (main->parameters.array[iki_read_parameter_whole_e].result & f_console_result_found_e) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_cannot_use_with(main->error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, iki_read_long_total_s, iki_read_long_wrap_s); return; @@ -494,6 +503,7 @@ extern "C" { setting->state.status = f_string_dynamics_resize(main->parameters.remaining.used, &setting->files); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamics_resize)); return; @@ -508,6 +518,7 @@ extern "C" { setting->state.status = f_string_dynamic_resize(0, &setting->files.array[setting->files.used]); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize)); return; @@ -523,7 +534,7 @@ extern "C" { setting->state.status = f_file_exists(setting->files.array[setting->files.used], F_true); if (F_status_is_error(setting->state.status)) { - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_error_file_print(main->error, F_status_set_fine(setting->state.status), "f_file_exists", fll_error_file_flag_fallback_e, setting->files.array[setting->files.used], f_file_operation_verify_s, fll_error_file_type_file_e); return; @@ -541,7 +552,7 @@ extern "C" { if ((parameter.result & f_console_result_found_e) || parameter.values.used % 3 != 0) { setting->state.status = F_status_set_error(F_parameter); - iki_read_print_line_first_locked(setting, main->error); + iki_read_print_line_first(setting, main->error); fll_program_print_error_parameter_missing_value_requires_amount(main->error, f_console_symbol_long_normal_s, name, iki_read_string_three_s); return F_false; @@ -552,6 +563,7 @@ extern "C" { setting->state.status = f_string_triples_increase_by(parameter.values.used / 3, triple); if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_triples_increase_by)); return F_false; @@ -592,6 +604,7 @@ extern "C" { } if (F_status_is_error(setting->state.status)) { + iki_read_print_line_first(setting, main->message); iki_read_print_error(setting, main->error, macro_iki_read_f(f_string_dynamic_resize)); return F_false; diff --git a/level_3/iki_read/c/main/common-print.c b/level_3/iki_read/c/main/common/print.c similarity index 96% rename from level_3/iki_read/c/main/common-print.c rename to level_3/iki_read/c/main/common/print.c index b94b513..b11515c 100644 --- a/level_3/iki_read/c/main/common-print.c +++ b/level_3/iki_read/c/main/common/print.c @@ -1,4 +1,4 @@ -#include "iki_read.h" +#include "../iki_read.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_read/c/main/common-print.h b/level_3/iki_read/c/main/common/print.h similarity index 100% rename from level_3/iki_read/c/main/common-print.h rename to level_3/iki_read/c/main/common/print.h diff --git a/level_3/iki_read/c/main/common-string.c b/level_3/iki_read/c/main/common/string.c similarity index 99% rename from level_3/iki_read/c/main/common-string.c rename to level_3/iki_read/c/main/common/string.c index 787add9..af8c7df 100644 --- a/level_3/iki_read/c/main/common-string.c +++ b/level_3/iki_read/c/main/common/string.c @@ -1,4 +1,4 @@ -#include "iki_read.h" +#include "../iki_read.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_read/c/main/common-string.h b/level_3/iki_read/c/main/common/string.h similarity index 100% rename from level_3/iki_read/c/main/common-string.h rename to level_3/iki_read/c/main/common/string.h diff --git a/level_3/iki_read/c/main/private-common.c b/level_3/iki_read/c/main/common/type.c similarity index 62% rename from level_3/iki_read/c/main/private-common.c rename to level_3/iki_read/c/main/common/type.c index ea6bcd8..de0e2a3 100644 --- a/level_3/iki_read/c/main/private-common.c +++ b/level_3/iki_read/c/main/common/type.c @@ -1,5 +1,4 @@ -#include "iki_read.h" -#include "private-common.h" +#include "../iki_read.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_read/c/main/common-type.h b/level_3/iki_read/c/main/common/type.h similarity index 82% rename from level_3/iki_read/c/main/common-type.h rename to level_3/iki_read/c/main/common/type.h index 4f6e7e7..4d36376 100644 --- a/level_3/iki_read/c/main/common-type.h +++ b/level_3/iki_read/c/main/common/type.h @@ -23,12 +23,18 @@ extern "C" { * - allocation_console: An allocation step used for small buffers specifically for console parameter. * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. + * - block_max: The max block read size before checking for interrupt. + * - block_read_small: The block read size for small files. + * - block_read_large: The block read size for large files. * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. */ #ifndef _di_iki_read_d_ #define iki_read_allocation_console_d 4 #define iki_read_allocation_large_d 256 #define iki_read_allocation_small_d 16 + #define iki_read_block_max 16777216 + #define iki_read_block_read_small 8192 + #define iki_read_block_read_large 65536 #define iki_read_signal_check_d 20000 #endif // _di_iki_read_d_ @@ -36,42 +42,44 @@ extern "C" { * Flags passed to the main function or program. * * iki_read_main_flag_*_e: - * - none: No flags set. - * - at: Selecting at a specific index. - * - content: Print Contents. - * - copyright: Print copyright. - * - help: Print help. - * - literal: Print as literal data (printing entire variable). - * - line: Selecting at a specific line. - * - name: Selecting using a specific Vocabulary name. - * - object: Print Objects. - * - replace: Using re-assignments. - * - replace: Using replacements. - * - substitute: Using substitutions. - * - total: Enable printing of "total" count. - * - version: Print version. - * - whole: Print all data. - * - wrap: Using wrapping. + * - none: No flags set. + * - at: Selecting at a specific index. + * - content: Print Contents. + * - copyright: Print copyright. + * - help: Print help. + * - literal: Print as literal data (printing entire variable). + * - line: Selecting at a specific line. + * - name: Selecting using a specific Vocabulary name. + * - object: Print Objects. + * - print_first: When set, the first character printing logic is to be processed (this is usually automatic). + * - replace: Using re-assignments. + * - replace: Using replacements. + * - substitute: Using substitutions. + * - total: Enable printing of "total" count. + * - version: Print version. + * - whole: Print all data. + * - wrap: Using wrapping. */ #ifndef _di_iki_read_main_flag_e_ enum { - iki_read_main_flag_none_e = 0x0, - iki_read_main_flag_at_e = 0x1, - iki_read_main_flag_content_e = 0x2, - iki_read_main_flag_copyright_e = 0x4, - iki_read_main_flag_help_e = 0x8, - iki_read_main_flag_literal_e = 0x10, - iki_read_main_flag_line_e = 0x20, - iki_read_main_flag_name_e = 0x40, - iki_read_main_flag_object_e = 0x80, - iki_read_main_flag_reassign_e = 0x100, - iki_read_main_flag_replace_e = 0x200, - iki_read_main_flag_substitute_e = 0x400, - iki_read_main_flag_total_e = 0x800, - iki_read_main_flag_version_e = 0x1000, - iki_read_main_flag_whole_e = 0x2000, - iki_read_main_flag_wrap_e = 0x4000, - }; + iki_read_main_flag_none_e = 0x0, + iki_read_main_flag_at_e = 0x1, + iki_read_main_flag_content_e = 0x2, + iki_read_main_flag_copyright_e = 0x4, + iki_read_main_flag_help_e = 0x8, + iki_read_main_flag_literal_e = 0x10, + iki_read_main_flag_line_e = 0x20, + iki_read_main_flag_name_e = 0x40, + iki_read_main_flag_object_e = 0x80, + iki_read_main_flag_print_first_e = 0x100, + iki_read_main_flag_reassign_e = 0x200, + iki_read_main_flag_replace_e = 0x400, + iki_read_main_flag_substitute_e = 0x800, + iki_read_main_flag_total_e = 0x1000, + iki_read_main_flag_version_e = 0x2000, + iki_read_main_flag_whole_e = 0x4000, + iki_read_main_flag_wrap_e = 0x8000, + }; // enum #endif // _di_iki_read_main_flag_e_ /** @@ -199,7 +207,7 @@ extern "C" { #define iki_read_setting_t_initialize \ { \ - iki_read_main_flag_none_e, \ + iki_read_main_flag_print_first_e, \ macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_none, 0, 0, 0, 0, 0, 0), \ 0, \ 0, \ diff --git a/level_3/iki_read/c/main/identify.c b/level_3/iki_read/c/main/identify.c new file mode 100644 index 0000000..e882339 --- /dev/null +++ b/level_3/iki_read/c/main/identify.c @@ -0,0 +1,85 @@ +#include "iki_read.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_iki_read_identify_alteration_ + void iki_read_identify_alteration(iki_read_setting_t * const setting) { + + if (!(setting->replace.used || setting->wrap.used)) return; + + f_array_length_t i = 0; + + if (setting->flag & (iki_read_main_flag_content_e | iki_read_main_flag_literal_e)) { + f_array_length_t j = 0; + + for (i = 0; i < setting->data.vocabulary.used; ++i) { + + if (setting->replace.used) { + setting->map_replaces[i] = setting->replace.used; + + j = setting->replace.used - 1; + + do { + if (fl_string_dynamic_partial_compare_string(setting->replace.array[j].name.string, setting->buffer, setting->replace.array[j].name.used, setting->data.vocabulary.array[i]) == F_equal_to) { + setting->map_replaces[i] = j; + + break; + } + + } while (j--); + } + + if (setting->wrap.used) { + setting->map_wraps[i] = setting->wrap.used; + + j = setting->wrap.used - 1; + + do { + if (fl_string_dynamic_partial_compare_string(setting->wrap.array[j].a.string, setting->buffer, setting->wrap.array[j].a.used, setting->data.vocabulary.array[i]) == F_equal_to) { + setting->map_wraps[i] = j; + + break; + } + + } while (j--); + } + } // for + } + else { + for (i = 0; i < setting->data.vocabulary.used; ++i) { + + if (setting->replace.used) { + setting->map_replaces[i] = setting->replace.used; + } + + if (setting->wrap.used) { + setting->map_wraps[i] = setting->wrap.used; + } + } // for + } + } +#endif // _di_iki_read_identify_alteration_ + +#ifndef _di_iki_read_identify_substitution_ + f_array_length_t iki_read_identify_substitution(iki_read_setting_t * const setting, const f_string_range_t name, const f_string_range_t value, f_string_triples_t *triple) { + + f_array_length_t i = triple->used - 1; + + do { + if (fl_string_dynamic_partial_compare_string(triple->array[i].a.string, setting->buffer, triple->array[i].a.used, name) == F_equal_to) { + if (fl_string_dynamic_partial_compare_string(triple->array[i].b.string, setting->buffer, triple->array[i].b.used, value) == F_equal_to) { + return i; + } + } + + } while (i--); + + return triple->used; + } +#endif // _di_iki_read_identify_substitution_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_read/c/main/identify.h b/level_3/iki_read/c/main/identify.h new file mode 100644 index 0000000..e8b4b54 --- /dev/null +++ b/level_3/iki_read/c/main/identify.h @@ -0,0 +1,67 @@ +/** + * FLL - Level 3 + * + * Project: IKI + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the identify functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_read_identify_h +#define _iki_read_identify_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Process the arguments, associating replacements and wraps with a given vocabulary. + * + * This does not handle substitutions because substitutions must match both name and value (Object and Content). + * This function does not know the value (Content). + * + * @param setting + * The main program settings. + * @param replaces + * A map to the last matching replacment or a value of setting->data.vocabulary.used if there is no matching replacement. + * Must be an array of length setting->data.vocabulary.used. + * @param wraps + * A map to the last matching wrap or a value of setting->data.vocabulary.used if there is no matching wrap. + * Must be an array of length setting->data.vocabulary.used. + * + * @return + * The matching setting->data.vocabulary index or if no match then setting->data.vocabulary.used. + */ +#ifndef _di_iki_read_identify_alteration_ + extern void iki_read_identify_alteration(iki_read_setting_t * const setting); +#endif // _di_iki_read_identify_alteration_ + +/** + * Process the arguments, associating the last matching reassignment or substitution with a given vocabulary name and value (Object and Content). + * + * This function expects appropriate sanity checks are performed on the reassignments or substitutions array before calling. + * + * @param setting + * The main program settings. + * @param name + * A range within setting->buffer representing the name (Object) to match. + * @param value + * A range within setting->buffer representing the value (Content) to match. + * @param triple + * The setting, such as setting->substitute, to update. + * + * @return + * The matched substitution. + * The value of the triple.used is returned on no match. + */ +#ifndef _di_iki_read_identify_substitution_ + extern f_array_length_t iki_read_identify_substitution(iki_read_setting_t * const setting, const f_string_range_t name, const f_string_range_t value, f_string_triples_t *triple); +#endif // _di_iki_read_identify_substitution_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_read_identify_h diff --git a/level_3/iki_read/c/main/iki_read.c b/level_3/iki_read/c/main/iki_read.c index 78d92e7..635e1f5 100644 --- a/level_3/iki_read/c/main/iki_read.c +++ b/level_3/iki_read/c/main/iki_read.c @@ -1,6 +1,4 @@ #include "iki_read.h" -#include "private-common.h" -#include "private-read.h" #ifdef __cplusplus extern "C" { @@ -12,7 +10,7 @@ extern "C" { if (!main || !setting) return; if (F_status_is_error(setting->state.status)) { - iki_read_print_line_last_locked(setting, main->error); + iki_read_print_line_last(setting, main->message); return; } @@ -37,6 +35,8 @@ extern "C" { return; } + iki_read_print_line_first(setting, main->message); + if (main->pipe & fll_program_data_pipe_input_e) { f_file_t file = f_file_t_initialize; @@ -169,7 +169,7 @@ extern "C" { } if (F_status_is_error(setting->state.status)) { - iki_read_print_line_last_locked(setting, F_status_set_fine(setting->state.status) == F_interrupt ? main->message : main->error); + iki_read_print_line_last(setting, main->message); } } #endif // _di_iki_read_main_ diff --git a/level_3/iki_read/c/main/iki_read.h b/level_3/iki_read/c/main/iki_read.h index 3848d5f..79c7601 100644 --- a/level_3/iki_read/c/main/iki_read.h +++ b/level_3/iki_read/c/main/iki_read.h @@ -51,11 +51,15 @@ #include // IKI Read includes. -#include -#include -#include +#include +#include +#include #include +#include #include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_read/c/main/print.c b/level_3/iki_read/c/main/print.c index e062eca..61739d6 100644 --- a/level_3/iki_read/c/main/print.c +++ b/level_3/iki_read/c/main/print.c @@ -1,37 +1,14 @@ #include "iki_read.h" -#include "private-common.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_iki_read_print_error_ - f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function) { - - if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - - iki_read_print_line_first_locked(setting, print); - fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e); - - return F_none; - } -#endif // _di_iki_read_print_error_ - -#ifndef _di_iki_read_print_error_file_ - f_status_t iki_read_print_error_file(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { - - if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - - iki_read_print_line_first_locked(setting, print); - fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type); - - return F_none; - } -#endif // _di_iki_read_print_error_file_ - #ifndef _di_iki_read_print_help_ f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print) { + if (!setting) return F_status_set_error(F_output_not); + f_file_stream_lock(print.to); f_print_dynamic_raw(setting->line_first, print.to); @@ -124,40 +101,31 @@ extern "C" { } #endif // _di_iki_read_print_help_ -#ifndef _di_iki_read_print_line_first_locked_ - f_status_t iki_read_print_line_first_locked(iki_read_setting_t * const setting, const fl_print_t print) { +#ifndef _di_iki_read_print_line_first_ + f_status_t iki_read_print_line_first(iki_read_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; if (F_status_is_error_not(setting->state.status)) { if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; } - f_print_dynamic_raw(setting->line_first, print.to); + if (setting->flag & iki_read_main_flag_print_first_e) { + fll_print_dynamic_raw(setting->line_first, print.to); - return F_none; - } -#endif // _di_iki_read_print_line_first_locked_ - -#ifndef _di_iki_read_print_line_first_unlocked_ - f_status_t iki_read_print_line_first_unlocked(iki_read_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->state.status)) { - if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; + setting->flag -= iki_read_main_flag_print_first_e; } - fll_print_dynamic_raw(setting->line_first, print.to); - return F_none; } -#endif // _di_iki_read_print_line_first_unlocked_ +#endif // _di_iki_read_print_line_first_ -#ifndef _di_iki_read_print_line_last_locked_ - f_status_t iki_read_print_line_last_locked(iki_read_setting_t * const setting, const fl_print_t print) { +#ifndef _di_iki_read_print_line_last_ + f_status_t iki_read_print_line_last(iki_read_setting_t * const setting, const fl_print_t print) { - if (!setting || print.verbosity < f_console_verbosity_error_e) return F_output_not; + if (!setting) return F_status_set_error(F_output_not); + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; if (F_status_is_error_not(setting->state.status)) { if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; @@ -167,22 +135,7 @@ extern "C" { return F_none; } -#endif // _di_iki_read_print_line_last_locked_ - -#ifndef _di_iki_read_print_line_last_unlocked_ - f_status_t iki_read_print_line_last_unlocked(iki_read_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->state.status)) { - if (print.verbosity < f_console_verbosity_normal_e) return F_output_not; - } - - f_print_dynamic_raw(setting->line_last, print.to); - - return F_none; - } -#endif // _di_iki_read_print_line_last_unlocked_ +#endif // _di_iki_read_print_line_last_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/iki_read/c/main/print.h b/level_3/iki_read/c/main/print.h index b651fd9..aaa969e 100644 --- a/level_3/iki_read/c/main/print.h +++ b/level_3/iki_read/c/main/print.h @@ -4,6 +4,10 @@ * Project: UTF8 * API Version: 0.7 * Licenses: lgpl-2.1-or-later + * + * Provides the print functionality. + * + * This is auto-included and should not need to be explicitly included. */ #ifndef _iki_read_print_h #define _iki_read_print_h @@ -13,55 +17,6 @@ extern "C" { #endif /** - * Print generic error message regarding a function failing in some way. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.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 fll_error_print() - */ -#ifndef _di_iki_read_print_error_ - extern f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function); -#endif // _di_iki_read_print_error_ - -/** - * Print file related error or warning messages. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.status. - * @param print - * Designates how printing is to be performed. - * @param function - * The name of the function where the error happened. - * Set to 0 to disable. - * @param name - * The name of the file or directory. - * @param operation - * The operation that fails, such as 'create' or 'access'. - * @param type - * A valid file type code from the fll_error_file_type enum. - * - * @return - * F_none on success. - * F_output_not on success, but no printing is performed. - * - * @see fll_error_file_print() - */ -#ifndef _di_iki_read_print_error_file_ - extern f_status_t iki_read_print_error_file(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); -#endif // _di_iki_read_print_error_file_ - -/** * Print help. * * @param setting @@ -73,6 +28,9 @@ extern "C" { * * @return * F_none on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. */ #ifndef _di_iki_read_print_help_ extern f_status_t iki_read_print_help(iki_read_setting_t * const setting, const fl_print_t print); @@ -95,32 +53,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. - */ -#ifndef _di_iki_read_print_line_first_locked_ - extern f_status_t iki_read_print_line_first_locked(iki_read_setting_t * const setting, const fl_print_t print); -#endif // _di_iki_read_print_line_first_locked_ - -/** - * 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. - * - * This function neither locks nor unlocks the input stream. - * - * @param setting - * The main program settings. * - * This does not alter setting.state.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. + * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_iki_read_print_line_first_unlocked_ - extern f_status_t iki_read_print_line_first_unlocked(iki_read_setting_t * const setting, const fl_print_t print); -#endif // _di_iki_read_print_line_first_unlocked_ +#ifndef _di_iki_read_print_line_first_ + extern f_status_t iki_read_print_line_first(iki_read_setting_t * const setting, const fl_print_t print); +#endif // _di_iki_read_print_line_first_ /** * Print last new line when the main is complete, unless verbosity says otherwise. @@ -139,32 +77,12 @@ extern "C" { * @return * F_none on success. * F_output_not on success, but no printing is performed. - */ -#ifndef _di_iki_read_print_line_last_locked_ - extern f_status_t iki_read_print_line_last_locked(iki_read_setting_t * const setting, const fl_print_t print); -#endif // _di_iki_read_print_line_last_locked_ - -/** - * Print last new line when the main is complete, unless verbosity says otherwise. - * - * This is generally the very last line printed in the program. - * - * This function neither locks nor unlocks the input stream. - * - * @param setting - * The main program settings. - * - * This does not alter setting.state.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. + * F_output_not (with error bit) if setting is NULL. */ -#ifndef _di_iki_read_print_line_last_unlocked_ - extern f_status_t iki_read_print_line_last_unlocked(iki_read_setting_t * const setting, const fl_print_t print); -#endif // _di_iki_read_print_line_last_unlocked_ +#ifndef _di_iki_read_print_line_last_ + extern f_status_t iki_read_print_line_last(iki_read_setting_t * const setting, const fl_print_t print); +#endif // _di_iki_read_print_line_last_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/iki_read/c/main/private-print.c b/level_3/iki_read/c/main/print/data.c similarity index 72% rename from level_3/iki_read/c/main/private-print.c rename to level_3/iki_read/c/main/print/data.c index 5fd8187..106f3a5 100644 --- a/level_3/iki_read/c/main/private-print.c +++ b/level_3/iki_read/c/main/print/data.c @@ -1,14 +1,17 @@ -#include "iki_read.h" -#include "private-common.h" -#include "private-print.h" -#include "private-read.h" +#include "../iki_read.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_iki_read_print_ - void iki_read_print(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) { +#ifndef _di_iki_read_print_data_ + void iki_read_print_data(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) { + + if (!setting) return; + + if (!main) { + setting->state.status = F_status_set_error(F_parameter); + } f_array_length_t at = setting->reassign.used; @@ -44,22 +47,22 @@ extern "C" { if (at < setting->substitute.used) { if (setting->flag & iki_read_main_flag_content_e) { - iki_read_print_wrap_prepend(main, setting, index); + iki_read_print_data_wrap_prepend(main, setting, index); f_print_dynamic(setting->substitute.array[at].c, main->output.to); - iki_read_print_wrap_append(main, setting, index); + iki_read_print_data_wrap_append(main, setting, index); } else { f_string_range_t range = macro_f_string_range_t_initialize(setting->data.variable.array[index].start, setting->data.content.array[index].start - 1); f_print_dynamic_partial(setting->buffer, range, main->output.to); - iki_read_print_wrap_prepend(main, setting, index); + iki_read_print_data_wrap_prepend(main, setting, index); f_print_dynamic(setting->substitute.array[at].c, main->output.to); - iki_read_print_wrap_append(main, setting, index); + iki_read_print_data_wrap_append(main, setting, index); range.start = setting->data.content.array[index].stop + 1; range.stop = setting->data.variable.array[index].stop; @@ -69,11 +72,11 @@ extern "C" { } else if (setting->replace.used && setting->map_replaces[index] < setting->replace.used) { if (setting->flag & iki_read_main_flag_content_e) { - iki_read_print_wrap_prepend(main, setting, index); + iki_read_print_data_wrap_prepend(main, setting, index); f_print_dynamic(setting->replace.array[setting->map_replaces[index]].value, main->output.to); - iki_read_print_wrap_append(main, setting, index); + iki_read_print_data_wrap_append(main, setting, index); } else if (setting->flag & iki_read_main_flag_object_e) { f_print_dynamic(setting->replace.array[setting->map_replaces[index]].name, main->output.to); @@ -83,11 +86,11 @@ extern "C" { f_print_dynamic_partial(setting->buffer, range, main->output.to); - iki_read_print_wrap_prepend(main, setting, index); + iki_read_print_data_wrap_prepend(main, setting, index); f_print_dynamic(setting->replace.array[setting->map_replaces[index]].value, main->output.to); - iki_read_print_wrap_append(main, setting, index); + iki_read_print_data_wrap_append(main, setting, index); range.start = setting->data.content.array[index].stop + 1; range.stop = setting->data.variable.array[index].stop; @@ -96,11 +99,11 @@ extern "C" { } } else if (setting->flag & iki_read_main_flag_content_e) { - iki_read_print_wrap_prepend(main, setting, index); + iki_read_print_data_wrap_prepend(main, setting, index); f_print_dynamic_partial(setting->buffer, setting->data.content.array[index], main->output.to); - iki_read_print_wrap_append(main, setting, index); + iki_read_print_data_wrap_append(main, setting, index); } else if (setting->flag & iki_read_main_flag_object_e) { f_print_dynamic_partial(setting->buffer, setting->data.vocabulary.array[index], main->output.to); @@ -110,11 +113,11 @@ extern "C" { f_print_dynamic_partial(setting->buffer, range, main->output.to); - iki_read_print_wrap_prepend(main, setting, index); + iki_read_print_data_wrap_prepend(main, setting, index); f_print_dynamic_partial(setting->buffer, setting->data.content.array[index], main->output.to); - iki_read_print_wrap_append(main, setting, index); + iki_read_print_data_wrap_append(main, setting, index); range.start = setting->data.content.array[index].stop + 1; range.stop = setting->data.variable.array[index].stop; @@ -122,10 +125,16 @@ extern "C" { f_print_dynamic_partial(setting->buffer, range, main->output.to); } } -#endif // _di_iki_read_print_ +#endif // _di_iki_read_print_data_ -#ifndef _di_iki_read_print_wrap_append_ - void iki_read_print_wrap_append(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) { +#ifndef _di_iki_read_print_data_wrap_append_ + void iki_read_print_data_wrap_append(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) { + + if (!setting) return; + + if (!main) { + setting->state.status = F_status_set_error(F_parameter); + } if (index < setting->data.vocabulary.used && setting->map_wraps[index] < setting->wrap.used) { if (!setting->wrap.array[setting->map_wraps[index]].c.used) return; @@ -136,10 +145,16 @@ extern "C" { f_print_dynamic(setting->wrap.array[setting->map_wraps[index]].c, main->output.to); } -#endif // _di_iki_read_print_wrap_append_ +#endif // _di_iki_read_print_data_wrap_append_ + +#ifndef _di_iki_read_print_data_wrap_prepend_ + void iki_read_print_data_wrap_prepend(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) { -#ifndef _di_iki_read_print_wrap_prepend_ - void iki_read_print_wrap_prepend(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) { + if (!setting) return; + + if (!main) { + setting->state.status = F_status_set_error(F_parameter); + } if (index < setting->data.vocabulary.used && setting->map_wraps[index] < setting->wrap.used) { if (!setting->wrap.array[setting->map_wraps[index]].b.used) return; @@ -150,7 +165,7 @@ extern "C" { f_print_dynamic(setting->wrap.array[setting->map_wraps[index]].b, main->output.to); } -#endif // _di_iki_read_print_wrap_prepend_ +#endif // _di_iki_read_print_data_wrap_prepend_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/iki_read/c/main/print/data.h b/level_3/iki_read/c/main/print/data.h new file mode 100644 index 0000000..1e17ed4 --- /dev/null +++ b/level_3/iki_read/c/main/print/data.h @@ -0,0 +1,94 @@ +/** + * FLL - Level 3 + * + * Project: IKI + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print data functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_read_print_data_h +#define _iki_read_print_data_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print the given range at the given index. + * + * This expects the caller to have the output locked appropriately. + * + * This detects and prints any applicable substitution matching the vocabulary at the given index. + * If there is no substitution, then this prints the given range at the given index. + * + * @param main + * The main program data. + * @param setting + * The main program settings. + * + * The setting.map_wraps is expected to be defined as a valid pointer to an array. + * The setting.map_replaces is expected to be defined as a valid pointer to an array. + * + * This does not alter setting.state.status. + * @param index + * The index used to identify the desired range in variable, content, and ranges. + * + * @see f_print_dynamic() + * @see f_print_dynamic_partial() + * + * @see iki_read_identify_substitution() + * @see iki_read_print_data_wrap_prepend() + * @see iki_read_print_data_wrap_append() + */ +#ifndef _di_iki_read_print_data_ + extern void iki_read_print_data(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d; +#endif // _di_iki_read_print_data_ + +/** + * Print the append part of the wrap at the given index, if valid. + * + * This expects the caller to have the output locked appropriately. + * + * @param main + * The main program data. + * @param setting + * The main program settings. + * + * This does not alter setting.state.status. + * @param index + * The index within the setting->map_wraps array to print. + * + * @see f_print_dynamic() + */ +#ifndef _di_iki_read_print_data_wrap_append_ + extern void iki_read_print_data_wrap_append(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d; +#endif // _di_iki_read_print_data_wrap_append_ + +/** + * Print the prepend part of the wrap at the given index, if valid. + * + * This expects the caller to have the output locked appropriately. + * + * @param main + * The main program data. + * @param setting + * The main program settings. + * + * This does not alter setting.state.status. + * @param index + * The index within the setting->map_wraps array to print. + * + * @see f_print_dynamic() + */ +#ifndef _di_iki_read_print_data_wrap_prepend_ + extern void iki_read_print_data_wrap_prepend(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d; +#endif // _di_iki_read_print_data_wrap_prepend_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_read_print_data_h diff --git a/level_3/iki_read/c/main/print/error.c b/level_3/iki_read/c/main/print/error.c new file mode 100644 index 0000000..1a03906 --- /dev/null +++ b/level_3/iki_read/c/main/print/error.c @@ -0,0 +1,31 @@ +#include "../iki_read.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_iki_read_print_error_ + f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function) { + + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; + + fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e); + + return F_none; + } +#endif // _di_iki_read_print_error_ + +#ifndef _di_iki_read_print_error_file_ + f_status_t iki_read_print_error_file(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type) { + + if (print.verbosity < f_console_verbosity_error_e) return F_output_not; + + fll_error_file_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e, name, operation, type); + + return F_none; + } +#endif // _di_iki_read_print_error_file_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_read/c/main/print/error.h b/level_3/iki_read/c/main/print/error.h new file mode 100644 index 0000000..f825f58 --- /dev/null +++ b/level_3/iki_read/c/main/print/error.h @@ -0,0 +1,76 @@ +/** + * FLL - Level 3 + * + * Project: UTF8 + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides the print error functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_read_print_error_h +#define _iki_read_print_error_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Print generic error message regarding a function failing in some way. + * + * @param setting + * The main program settings. + * + * This does not alter setting.state.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. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_print() + */ +#ifndef _di_iki_read_print_error_ + extern f_status_t iki_read_print_error(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function); +#endif // _di_iki_read_print_error_ + +/** + * Print file related error or warning messages. + * + * @param setting + * The main program settings. + * + * This does not alter setting.state.status. + * @param print + * Designates how printing is to be performed. + * @param function + * The name of the function where the error happened. + * Set to 0 to disable. + * @param name + * The name of the file or directory. + * @param operation + * The operation that fails, such as 'create' or 'access'. + * @param type + * A valid file type code from the fll_error_file_type enum. + * + * @return + * F_none on success. + * F_output_not on success, but no printing is performed. + * + * F_output_not (with error bit) if setting is NULL. + * + * @see fll_error_file_print() + */ +#ifndef _di_iki_read_print_error_file_ + extern f_status_t iki_read_print_error_file(iki_read_setting_t * const setting, const fl_print_t print, const f_string_t function, const f_string_static_t name, const f_string_static_t operation, const uint8_t type); +#endif // _di_iki_read_print_error_file_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_read_print_error_h diff --git a/level_3/iki_read/c/main/private-common.h b/level_3/iki_read/c/main/private-common.h deleted file mode 100644 index 51fb11a..0000000 --- a/level_3/iki_read/c/main/private-common.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: IKI Read - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - */ -#ifndef _PRIVATE_common_h -#define _PRIVATE_common_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Provide common/generic definitions. - * - * iki_read_common_allocation_*: - * - large: An allocation step used for buffers that are anticipated to have large buffers. - * - small: An allocation step used for buffers that are anticipated to have small buffers. - * - * iki_read_block_*: - * - max: The max block read size before checking for interrupt. - * - read_small: The block read size for small files. - * - read_large: The block read size for large files. - */ -#ifndef _di_iki_read_common_ - #define iki_read_common_allocation_large_d 256 - #define iki_read_common_allocation_small_d 16 - - #define iki_read_block_max 16777216 - #define iki_read_block_read_small 8192 - #define iki_read_block_read_large 65536 -#endif // _di_iki_read_common_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _PRIVATE_common_h diff --git a/level_3/iki_read/c/main/private-print.h b/level_3/iki_read/c/main/private-print.h deleted file mode 100644 index 8369be3..0000000 --- a/level_3/iki_read/c/main/private-print.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * FLL - Level 3 - * - * Project: IKI - * API Version: 0.7 - * Licenses: lgpl-2.1-or-later - */ -#ifndef _PRIVATE_print_h -#define _PRIVATE_print_h - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Print the given range at the given index. - * - * This detects and prints any applicable substitution matching the vocabulary at the given index. - * If there is no substitution, then this prints the given range at the given index. - * - * @param main - * The main program data. - * @param setting - * The main program settings. - * - * The setting.map_wraps is expected to be defined as a valid pointer to an array. - * The setting.map_replaces is expected to be defined as a valid pointer to an array. - * - * This does not alter setting.state.status. - * @param index - * The index used to identify the desired range in variable, content, and ranges. - */ -#ifndef _di_iki_read_print_ - extern void iki_read_print(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d; -#endif // _di_iki_read_print_ - -/** - * Print the append part of the wrap at the given index, if valid. - * - * @param main - * The main program data. - * @param setting - * The main program settings. - * - * This does not alter setting.state.status. - * @param index - * The index within the setting->map_wraps array to print. - */ -#ifndef _di_iki_read_print_wrap_append_ - extern void iki_read_print_wrap_append(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d; -#endif // _di_iki_read_print_wrap_append_ - -/** - * Print the prepend part of the wrap at the given index, if valid. - * - * @param main - * The main program data. - * @param setting - * The main program settings. - * - * This does not alter setting.state.status. - * @param index - * The index within the setting->map_wraps array to print. - */ -#ifndef _di_iki_read_print_wrap_prepend_ - extern void iki_read_print_wrap_prepend(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_array_length_t index) F_attribute_visibility_internal_d; -#endif // _di_iki_read_print_wrap_prepend_ - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _PRIVATE_print_h diff --git a/level_3/iki_read/c/main/private-read.c b/level_3/iki_read/c/main/process.c similarity index 80% rename from level_3/iki_read/c/main/private-read.c rename to level_3/iki_read/c/main/process.c index 59e38d1..27f8c55 100644 --- a/level_3/iki_read/c/main/private-read.c +++ b/level_3/iki_read/c/main/process.c @@ -1,88 +1,9 @@ #include "iki_read.h" -#include "private-common.h" -#include "private-print.h" -#include "private-read.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_iki_read_identify_alteration_ - void iki_read_identify_alteration(iki_read_setting_t * const setting) { - - if (!(setting->replace.used || setting->wrap.used)) return; - - f_array_length_t i = 0; - - if (setting->flag & (iki_read_main_flag_content_e | iki_read_main_flag_literal_e)) { - f_array_length_t j = 0; - - for (i = 0; i < setting->data.vocabulary.used; ++i) { - - if (setting->replace.used) { - setting->map_replaces[i] = setting->replace.used; - - j = setting->replace.used - 1; - - do { - if (fl_string_dynamic_partial_compare_string(setting->replace.array[j].name.string, setting->buffer, setting->replace.array[j].name.used, setting->data.vocabulary.array[i]) == F_equal_to) { - setting->map_replaces[i] = j; - - break; - } - - } while (j--); - } - - if (setting->wrap.used) { - setting->map_wraps[i] = setting->wrap.used; - - j = setting->wrap.used - 1; - - do { - if (fl_string_dynamic_partial_compare_string(setting->wrap.array[j].a.string, setting->buffer, setting->wrap.array[j].a.used, setting->data.vocabulary.array[i]) == F_equal_to) { - setting->map_wraps[i] = j; - - break; - } - - } while (j--); - } - } // for - } - else { - for (i = 0; i < setting->data.vocabulary.used; ++i) { - - if (setting->replace.used) { - setting->map_replaces[i] = setting->replace.used; - } - - if (setting->wrap.used) { - setting->map_wraps[i] = setting->wrap.used; - } - } // for - } - } -#endif // _di_iki_read_identify_alteration_ - -#ifndef _di_iki_read_identify_substitution_ - f_array_length_t iki_read_identify_substitution(iki_read_setting_t * const setting, const f_string_range_t name, const f_string_range_t value, f_string_triples_t *triple) { - - f_array_length_t i = triple->used - 1; - - do { - if (fl_string_dynamic_partial_compare_string(triple->array[i].a.string, setting->buffer, triple->array[i].a.used, name) == F_equal_to) { - if (fl_string_dynamic_partial_compare_string(triple->array[i].b.string, setting->buffer, triple->array[i].b.used, value) == F_equal_to) { - return i; - } - } - - } while (i--); - - return triple->used; - } -#endif // _di_iki_read_identify_substitution_ - #ifndef _di_iki_read_process_line_ void iki_read_process_line(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *range) { @@ -210,7 +131,7 @@ extern "C" { if (matches++ > setting->at) break; } - iki_read_print(main, setting, i); + iki_read_print_data(main, setting, i); f_print_dynamic_raw(f_string_eol_s, main->output.to); } @@ -232,7 +153,7 @@ extern "C" { if (setting->at < setting->data.variable.used) { f_file_stream_lock(main->output.to); - iki_read_print(main, setting, setting->at); + iki_read_print_data(main, setting, setting->at); f_print_dynamic_raw(f_string_eol_s, main->output.to); @@ -249,7 +170,7 @@ extern "C" { for (i = 0; i < setting->data.variable.used; ++i) { - iki_read_print(main, setting, i); + iki_read_print_data(main, setting, i); f_print_dynamic_raw(f_string_eol_s, main->output.to); } // for @@ -334,11 +255,11 @@ extern "C" { } // for if (k < setting->names.used) { - iki_read_print(main, setting, j); + iki_read_print_data(main, setting, j); } } else { - iki_read_print(main, setting, j); + iki_read_print_data(main, setting, j); } i = setting->data.variable.array[j].stop + 1; diff --git a/level_3/iki_read/c/main/private-read.h b/level_3/iki_read/c/main/process.h similarity index 60% rename from level_3/iki_read/c/main/private-read.h rename to level_3/iki_read/c/main/process.h index 724fd37..94c40a4 100644 --- a/level_3/iki_read/c/main/private-read.h +++ b/level_3/iki_read/c/main/process.h @@ -4,59 +4,19 @@ * Project: IKI * API Version: 0.7 * Licenses: lgpl-2.1-or-later + * + * Provides the process functionality. + * + * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_read_h -#define _PRIVATE_read_h +#ifndef _iki_read_process_h +#define _iki_read_process_h #ifdef __cplusplus extern "C" { #endif /** - * Process the arguments, associating replacements and wraps with a given vocabulary. - * - * This does not handle substitutions because substitutions must match both name and value (Object and Content). - * This function does not know the value (Content). - * - * @param setting - * The main program settings. - * @param replaces - * A map to the last matching replacment or a value of setting->data.vocabulary.used if there is no matching replacement. - * Must be an array of length setting->data.vocabulary.used. - * @param wraps - * A map to the last matching wrap or a value of setting->data.vocabulary.used if there is no matching wrap. - * Must be an array of length setting->data.vocabulary.used. - * - * @return - * The matching setting->data.vocabulary index or if no match then setting->data.vocabulary.used. - */ -#ifndef _di_iki_read_identify_alteration_ - extern void iki_read_identify_alteration(iki_read_setting_t * const setting) F_attribute_visibility_internal_d; -#endif // _di_iki_read_identify_alteration_ - -/** - * Process the arguments, associating the last matching reassignment or substitution with a given vocabulary name and value (Object and Content). - * - * This function expects appropriate sanity checks are performed on the reassignments or substitutions array before calling. - * - * @param setting - * The main program settings. - * @param name - * A range within setting->buffer representing the name (Object) to match. - * @param value - * A range within setting->buffer representing the value (Content) to match. - * @param triple - * The setting, such as setting->substitute, to update. - * - * @return - * The matched substitution. - * The value of the triple.used is returned on no match. - */ -#ifndef _di_iki_read_identify_substitution_ - extern f_array_length_t iki_read_identify_substitution(iki_read_setting_t * const setting, const f_string_range_t name, const f_string_range_t value, f_string_triples_t *triple) F_attribute_visibility_internal_d; -#endif // _di_iki_read_identify_substitution_ - -/** * Determine the range based on the --line parameter. * * If the --line parameter is not specified in the console arguments, then range is untouched. @@ -75,7 +35,7 @@ extern "C" { * The range value to represent the --line values. */ #ifndef _di_iki_read_process_line_ - extern void iki_read_process_line(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *range) F_attribute_visibility_internal_d; + extern void iki_read_process_line(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *range); #endif // _di_iki_read_process_line_ /** @@ -103,7 +63,7 @@ extern "C" { * @see iki_read_process_buffer_ranges_whole() */ #ifndef _di_iki_read_process_buffer_ - extern void iki_read_process_buffer(fll_program_data_t * const main, iki_read_setting_t * const setting) F_attribute_visibility_internal_d; + extern void iki_read_process_buffer(fll_program_data_t * const main, iki_read_setting_t * const setting); #endif // _di_iki_read_process_buffer_ /** @@ -123,7 +83,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_ranges_ - extern void iki_read_process_buffer_ranges(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *buffer_range) F_attribute_visibility_internal_d; + extern void iki_read_process_buffer_ranges(fll_program_data_t * const main, iki_read_setting_t * const setting, f_string_range_t *buffer_range); #endif // _di_iki_read_process_buffer_ranges_ /** @@ -145,7 +105,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_ranges_whole_ - extern void iki_read_process_buffer_ranges_whole(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_string_range_t buffer_range) F_attribute_visibility_internal_d; + extern void iki_read_process_buffer_ranges_whole(fll_program_data_t * const main, iki_read_setting_t * const setting, const f_string_range_t buffer_range); #endif // _di_iki_read_process_buffer_ranges_whole_ /** @@ -162,11 +122,11 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_iki_read_process_buffer_total_ - extern void iki_read_process_buffer_total(fll_program_data_t * const main, iki_read_setting_t * const setting) F_attribute_visibility_internal_d; + extern void iki_read_process_buffer_total(fll_program_data_t * const main, iki_read_setting_t * const setting); #endif // _di_iki_read_process_buffer_total_ #ifdef __cplusplus } // extern "C" #endif -#endif // _PRIVATE_read_h +#endif // _iki_read_process_h diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index 9f0ee9d..44ed04d 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -22,11 +22,11 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/iki_read.c main/common.c main/common-print.c main/common-string.c main/common-type.c main/print.c main/private-common.c main/private-print.c main/private-read.c +build_sources_library main/iki_read.c main/common.c main/identify.c main/common/print.c main/common/string.c main/common/type.c main/print.c main/print/data.c main/print/error.c main/process.c build_sources_program main/main.c -build_sources_headers main/iki_read.h main/common.h main/common-print.h main/common-string.h main/common-type.h main/print.h +build_sources_headers main/iki_read.h main/common.h main/identify.h main/common/print.h main/common/string.h main/common/type.h main/print.h main/print/data.h main/print/error.h main/process.h build_sources_documentation man diff --git a/level_3/iki_write/c/main/print-error.c b/level_3/iki_write/c/main/print/error.c similarity index 99% rename from level_3/iki_write/c/main/print-error.c rename to level_3/iki_write/c/main/print/error.c index 9df61bf..015a011 100644 --- a/level_3/iki_write/c/main/print-error.c +++ b/level_3/iki_write/c/main/print/error.c @@ -1,4 +1,4 @@ -#include "iki_write.h" +#include "../iki_write.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_write/c/main/print-error.h b/level_3/iki_write/c/main/print/error.h similarity index 100% rename from level_3/iki_write/c/main/print-error.h rename to level_3/iki_write/c/main/print/error.h diff --git a/level_3/iki_write/c/main/process.h b/level_3/iki_write/c/main/process.h index 0c04d4b..9b01726 100644 --- a/level_3/iki_write/c/main/process.h +++ b/level_3/iki_write/c/main/process.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_write_process_h -#define _PRIVATE_write_process_h +#ifndef _iki_write_write_process_h +#define _iki_write_write_process_h #ifdef __cplusplus extern "C" { @@ -47,4 +47,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_write_process_h +#endif // _iki_write_write_process_h diff --git a/level_3/iki_write/data/build/settings b/level_3/iki_write/data/build/settings index 785ea5d..da00094 100644 --- a/level_3/iki_write/data/build/settings +++ b/level_3/iki_write/data/build/settings @@ -21,11 +21,11 @@ build_libraries-individual -lfll_error -lfll_iki -lfll_print -lfll_program -lfl_ build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/iki_write.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/print.c main/print-error.c main/process.c +build_sources_library main/iki_write.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/print.c main/print/error.c main/process.c build_sources_program main/main.c -build_sources_headers main/iki_write.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/print.h main/print-error.h main/process.h +build_sources_headers main/iki_write.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/print.h main/print/error.h main/process.h build_sources_documentation man diff --git a/level_3/status_code/c/main/convert.h b/level_3/status_code/c/main/convert.h index 51a1428..f4bfc09 100644 --- a/level_3/status_code/c/main/convert.h +++ b/level_3/status_code/c/main/convert.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_status_code_convert_h -#define _PRIVATE_status_code_convert_h +#ifndef _status_code_convert_h +#define _status_code_convert_h #ifdef __cplusplus extern "C" { @@ -48,4 +48,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_status_code_convert_h +#endif // _status_code_convert_h diff --git a/level_3/status_code/c/main/print-data.c b/level_3/status_code/c/main/print/data.c similarity index 97% rename from level_3/status_code/c/main/print-data.c rename to level_3/status_code/c/main/print/data.c index 1e95f30..b2e3319 100644 --- a/level_3/status_code/c/main/print-data.c +++ b/level_3/status_code/c/main/print/data.c @@ -1,4 +1,4 @@ -#include "status_code.h" +#include "../status_code.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/status_code/c/main/print-data.h b/level_3/status_code/c/main/print/data.h similarity index 100% rename from level_3/status_code/c/main/print-data.h rename to level_3/status_code/c/main/print/data.h diff --git a/level_3/status_code/c/main/print-error.c b/level_3/status_code/c/main/print/error.c similarity index 99% rename from level_3/status_code/c/main/print-error.c rename to level_3/status_code/c/main/print/error.c index 8421d78..f097de9 100644 --- a/level_3/status_code/c/main/print-error.c +++ b/level_3/status_code/c/main/print/error.c @@ -1,4 +1,4 @@ -#include "status_code.h" +#include "../status_code.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/status_code/c/main/print-error.h b/level_3/status_code/c/main/print/error.h similarity index 100% rename from level_3/status_code/c/main/print-error.h rename to level_3/status_code/c/main/print/error.h diff --git a/level_3/status_code/c/main/process.h b/level_3/status_code/c/main/process.h index 170895f..7193026 100644 --- a/level_3/status_code/c/main/process.h +++ b/level_3/status_code/c/main/process.h @@ -9,8 +9,8 @@ * * This is auto-included and should not need to be explicitly included. */ -#ifndef _PRIVATE_status_code_process_h -#define _PRIVATE_status_code_process_h +#ifndef status_code_process_h +#define status_code_process_h #ifdef __cplusplus extern "C" { @@ -98,4 +98,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_status_code_process_h +#endif // status_code_process_h diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index a661c6c..1ba1b05 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -25,10 +25,10 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfll_status_st build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/status_code.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print.c main/print-data.c main/print-error.c main/process.c +build_sources_library main/status_code.c main/common.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print.c main/print/data.c main/print/error.c main/process.c build_sources_library fss/status_code.c fss/common.c -build_sources_headers main/status_code.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print.h main/print-data.h main/print-error.h main/process.h +build_sources_headers main/status_code.h main/common.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print.h main/print/data.h main/print/error.h main/process.h build_sources_headers fss/status_code.h fss/common.h build_sources_documentation man diff --git a/level_3/utf8/c/main/print-data.c b/level_3/utf8/c/main/print/data.c similarity index 99% rename from level_3/utf8/c/main/print-data.c rename to level_3/utf8/c/main/print/data.c index ab7e2ce..289658b 100644 --- a/level_3/utf8/c/main/print-data.c +++ b/level_3/utf8/c/main/print/data.c @@ -1,4 +1,4 @@ -#include "utf8.h" +#include "../utf8.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/utf8/c/main/print-data.h b/level_3/utf8/c/main/print/data.h similarity index 100% rename from level_3/utf8/c/main/print-data.h rename to level_3/utf8/c/main/print/data.h diff --git a/level_3/utf8/c/main/print-error.c b/level_3/utf8/c/main/print/error.c similarity index 99% rename from level_3/utf8/c/main/print-error.c rename to level_3/utf8/c/main/print/error.c index bf1a341..a76938c 100644 --- a/level_3/utf8/c/main/print-error.c +++ b/level_3/utf8/c/main/print/error.c @@ -1,4 +1,4 @@ -#include "utf8.h" +#include "../utf8.h" #ifdef __cplusplus extern "C" { diff --git a/level_3/utf8/c/main/print-error.h b/level_3/utf8/c/main/print/error.h similarity index 100% rename from level_3/utf8/c/main/print-error.h rename to level_3/utf8/c/main/print/error.h diff --git a/level_3/utf8/data/build/settings b/level_3/utf8/data/build/settings index 4c9dd60..303084c 100644 --- a/level_3/utf8/data/build/settings +++ b/level_3/utf8/data/build/settings @@ -22,11 +22,11 @@ build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/common.c main/common/print.c main/common/string.c main/common/type.c main/bytesequence.c main/codepoint.c main/print.c main/print-error.c main/print-data.c main/process.c main/utf8.c +build_sources_library main/common.c main/common/print.c main/common/string.c main/common/type.c main/bytesequence.c main/codepoint.c main/print.c main/print/error.c main/print/data.c main/process.c main/utf8.c build_sources_program main/main.c -build_sources_headers main/common.h main/common/print.h main/common/string.h main/common/type.h main/bytesequence.h main/codepoint.h main/print.h main/print-error.h main/print-data.h main/process.h main/utf8.h +build_sources_headers main/common.h main/common/print.h main/common/string.h main/common/type.h main/bytesequence.h main/codepoint.h main/print.h main/print/error.h main/print/data.h main/process.h main/utf8.h build_sources_documentation man