From 0e7498fead01cc1d3314f0057a9f60a42a75236c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 12 Mar 2023 22:12:28 -0500 Subject: [PATCH] Progress: Continue program related work, focusing on Featureless Make. This gets Featureless Make compiling again. The program also appears to work. I need to now start reviewing the code, fixing non-compile time catching mistakes, resolving any todd or fixme cases, and optimization. There may also be some directory and file structure manipulation. --- level_3/fake/c/main/build.c | 22 +- level_3/fake/c/main/build/library.c | 16 +- level_3/fake/c/main/build/load.c | 80 +++---- level_3/fake/c/main/build/object.c | 18 +- level_3/fake/c/main/build/objects.c | 61 +++--- level_3/fake/c/main/build/objects.h | 11 +- level_3/fake/c/main/build/program.c | 19 +- level_3/fake/c/main/build/skeleton.c | 4 +- level_3/fake/c/main/clean.c | 4 +- level_3/fake/c/main/common.c | 72 ++++--- level_3/fake/c/main/fake.c | 26 +-- level_3/fake/c/main/fake.h | 1 + level_3/fake/c/main/fake/path_generate.c | 6 +- level_3/fake/c/main/main.c | 2 +- level_3/fake/c/main/make.c | 77 ++++--- level_3/fake/c/main/make.h | 14 +- level_3/fake/c/main/make/load_fakefile.c | 180 ++++++++-------- level_3/fake/c/main/make/load_fakefile.h | 8 +- level_3/fake/c/main/make/load_parameters.c | 165 +++++++------- level_3/fake/c/main/make/load_parameters.h | 11 +- level_3/fake/c/main/make/operate.c | 262 +++++++++++------------ level_3/fake/c/main/make/operate_block.c | 4 +- level_3/fake/c/main/make/operate_process.c | 104 +++++---- level_3/fake/c/main/make/operate_process_type.c | 106 ++++----- level_3/fake/c/main/make/operate_validate.c | 2 +- level_3/fake/c/main/make/operate_validate_type.c | 52 +++-- level_3/fake/c/main/make/print/warning.c | 4 +- level_3/fake/c/main/make/print/warning.h | 4 +- level_3/fake/c/main/print.c | 4 +- level_3/fake/c/main/print/error.c | 6 +- level_3/fake/c/main/print/error.h | 4 +- level_3/fake/c/main/print/verbose.c | 12 +- level_3/fake/c/main/print/verbose.h | 8 +- level_3/fake/c/main/skeleton.c | 143 +++++++------ level_3/fake/c/main/skeleton.h | 32 +-- 35 files changed, 778 insertions(+), 766 deletions(-) diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index 42697b3..e97589f 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -7,7 +7,7 @@ extern "C" { #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) { - if (!data || !data_build || !arguments) return; + if (!data || !data->main || !data->setting || !data_build || !arguments) return; if (F_status_is_error(data->setting->state.status)) return; { @@ -158,7 +158,7 @@ extern "C" { #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) { - if (!data) return; + if (!data || !data->main || !data->setting) 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 (!((++data->main->signal_check) % fake_signal_check_d)) { @@ -555,7 +555,7 @@ extern "C" { #ifndef _di_fake_build_get_file_name_without_extension_ 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; + if (!data || !data->main || !data->setting) return; name->used = 0; data->setting->state.status = F_none; @@ -586,7 +586,7 @@ extern "C" { #ifndef _di_fake_build_objects_add_ 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; + if (!data || !data->main || !data->setting || !data_build || !path || !generic || !specific || !arguments) return; f_array_length_t i = 0; f_array_length_t j = 0; @@ -625,7 +625,7 @@ extern "C" { #ifndef _di_fake_build_operate_ void fake_build_operate(fake_data_t * const data, const f_string_statics_t * const build_arguments, const bool process_pipe) { - if (!data) return; + if (!data || !data->main || !data->setting) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { if (fll_program_standard_signal_received(data->main)) { @@ -810,7 +810,7 @@ extern "C" { #ifndef _di_fake_build_path_source_length_ void fake_build_path_source_length(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) { - if (!data || !data_build || !setting_path_source || !source) return; + if (!data || !data->main || !data->setting || !data_build || !setting_path_source || !source) return; source->used = 0; @@ -835,9 +835,9 @@ extern "C" { #endif // _di_fake_build_path_source_length_ #ifndef _di_fake_build_path_source_string_ - void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source) { + void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) { - if (!data || !data_build || !setting_path_source) return; + if (!data || !data->main || !data->setting || !data_build || !setting_path_source || !source) return; source->used = 0; @@ -869,7 +869,7 @@ extern "C" { #ifndef _di_fake_build_sources_add_ void fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) { - if (!data || !data_build || !generic || !specific || !arguments) return; + if (!data || !data->main || !data->setting || !data_build || !generic || !specific || !arguments) return; f_array_length_t i = 0; f_array_length_t j = 0; @@ -910,7 +910,7 @@ extern "C" { #ifndef _di_fake_build_sources_object_add_ void fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) { - if (!data || !data_build || !generic || !specific || !arguments) return; + if (!data || !data->main || !data->setting || !data_build || !generic || !specific || !arguments) return; if (!generic->used && !specific->used) { data->setting->state.status = F_none; @@ -955,7 +955,7 @@ extern "C" { #ifndef _di_fake_build_touch_ void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file) { - if (!data) return; + if (!data || !data->main || !data->setting) return; if (F_status_is_error(data->setting->state.status)) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { diff --git a/level_3/fake/c/main/build/library.c b/level_3/fake/c/main/build/library.c index 750381d..3280009 100644 --- a/level_3/fake/c/main/build/library.c +++ b/level_3/fake/c/main/build/library.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_build_library_script_ int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (!data) return 0; + if (!data || !data->main || !data->setting) return 0; 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; @@ -20,7 +20,7 @@ extern "C" { #ifndef _di_fake_build_library_shared_ int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (!data || !data_build) return 0; + if (!data || !data->main || !data->setting || !data_build) return 0; 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 (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0; @@ -29,9 +29,9 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - data->setting->state.status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments); + fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments); - if (F_status_is_error(*data->setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); f_string_dynamics_resize(0, &arguments); @@ -39,7 +39,7 @@ extern "C" { return 0; } - data->setting->state.status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments); + fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add)); @@ -436,7 +436,7 @@ extern "C" { #ifndef _di_fake_build_library_static_ int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (!data || !data_build) return 0; + if (!data || !data->main || !data->setting || !data_build) return 0; 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 (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0; @@ -497,7 +497,7 @@ extern "C" { source_path.used = 0; - data->setting->state.status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); + fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_get_file_name_without_extension)); @@ -565,7 +565,7 @@ extern "C" { int result = data->main->child; if (F_status_is_error_not(data->setting->state.status)) { - result = fake_execute(data, data_build->environment, data_build->setting.build_indexer, arguments, status); + result = fake_execute(data, data_build->environment, data_build->setting.build_indexer, arguments); } f_string_dynamic_resize(0, &file_name); diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index ea6aa68..6311d99 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -7,7 +7,7 @@ extern "C" { #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) { - if (!data || !data_build || !environment) return; + if (!data || !data->main || !data->setting || !data_build || !environment) return; if (F_status_is_error(data->setting->state.status)) return; // Reset the environment. @@ -72,7 +72,7 @@ extern "C" { #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) { - if (!data || !setting) return; + if (!data || !data->main || !data->setting || !setting) return; if (F_status_is_error(data->setting->state.status)) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { @@ -153,13 +153,13 @@ extern "C" { // @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); + fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &data->setting->state); 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 { - data->setting->state.status = f_fss_apply_delimit(state, delimits, &buffer); + f_fss_apply_delimit(delimits, &buffer, &data->setting->state); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_fss_apply_delimit)); @@ -213,15 +213,16 @@ extern "C" { #endif // _di_fake_build_load_setting_ #ifndef _di_fake_build_load_setting_process_ - 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) { + 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) { - if (F_status_is_error(*status) && buffer.used) return; + if (!data || !data->main || !data->setting || !setting) return; + if (F_status_is_error(data->setting->state.status) && buffer.used) 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); - *status = F_status_set_error(F_interrupt); + data->setting->state.status = F_status_set_error(F_interrupt); return; } @@ -548,9 +549,9 @@ extern "C" { f_string_t function = macro_fake_f(fll_fss_snatch_apart); - *status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, fake_build_setting_total_d, settings_value, settings_matches, 0); + data->setting->state.status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, fake_build_setting_total_d, settings_value, settings_matches, 0); - if (*status == F_none) { + if (data->setting->state.status == F_none) { const int total_build_libraries = setting->build_libraries.used; // Custom modes are always used if provided, otherwise if any mode is specified, the entire defaults is replaced. @@ -587,7 +588,7 @@ extern "C" { fake_build_print_error_mode_invalid(data->setting, data->main->warning, modes->array[i], path_file); error_printed = F_true; - *status = F_status_set_error(F_parameter); + data->setting->state.status = F_status_set_error(F_parameter); break; } @@ -596,40 +597,40 @@ extern "C" { settings_mode_names[j].used = 0; - *status = f_string_dynamic_increase_by(settings_value[j]->used + f_string_ascii_minus_s.used + modes->array[i].used, &settings_mode_names[j]); + data->setting->state.status = f_string_dynamic_increase_by(settings_value[j]->used + f_string_ascii_minus_s.used + modes->array[i].used, &settings_mode_names[j]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { function = macro_fake_f(f_string_dynamic_increase_by); break; } - *status = f_string_dynamic_append_nulless(settings_name[j], &settings_mode_names[j]); + data->setting->state.status = f_string_dynamic_append_nulless(settings_name[j], &settings_mode_names[j]); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(f_string_ascii_minus_s, &settings_mode_names[j]); + if (F_status_is_error_not(data->setting->state.status)) { + data->setting->state.status = f_string_dynamic_append_nulless(f_string_ascii_minus_s, &settings_mode_names[j]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(modes->array[i], &settings_mode_names[j]); + if (F_status_is_error_not(data->setting->state.status)) { + data->setting->state.status = f_string_dynamic_append_nulless(modes->array[i], &settings_mode_names[j]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { function = macro_fake_f(f_string_dynamic_append); break; } } // for - if (*status == F_none) { - *status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, fake_build_setting_total_d, settings_value, 0, 0); + if (data->setting->state.status == F_none) { + data->setting->state.status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, fake_build_setting_total_d, settings_value, 0, 0); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { function = macro_fake_f(fll_fss_snatch_apart); } } - if (F_status_is_error(*status)) break; + if (F_status_is_error(data->setting->state.status)) break; } // for for (j = 0; j < fake_build_setting_total_d; ++j) { @@ -666,8 +667,8 @@ extern "C" { } } - if (F_status_is_error(*status)) { - if (*status == F_status_set_error(F_string_too_large)) { + if (F_status_is_error(data->setting->state.status)) { + if (data->setting->state.status == F_status_set_error(F_string_too_large)) { fake_build_print_error_setting_too_long(data->setting, data->main->warning, path_file); } else if (!error_printed) { @@ -1108,9 +1109,9 @@ extern "C" { if (!settings_single_matches[i] && settings_single_destination[i]) { settings_single_destination[i]->used = 0; - *status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]); + data->setting->state.status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append)); break; @@ -1173,26 +1174,26 @@ extern "C" { settings_single_destination[i]->used = 0; if (settings_single_type[i] == 2) { - *status = f_path_directory_cleanup(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); + data->setting->state.status = f_path_directory_cleanup(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_path_directory_cleanup)); break; } } else { - *status = f_string_dynamic_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, settings_single_destination[i]); + data->setting->state.status = f_string_dynamic_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, settings_single_destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; } - *status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); + data->setting->state.status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); - if (F_status_is_error(*status)) { + 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; @@ -1201,7 +1202,7 @@ extern "C" { } } // for - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { if (checks && !setting->version_file) { setting->version_file = fake_build_version_micro_e; @@ -1260,14 +1261,15 @@ extern "C" { #endif // _di_fake_build_load_setting_process_ #ifndef _di_fake_build_load_setting_override_ - void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting, f_status_t * const status) { + void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting) { - if (F_status_is_error(*status)) return; + if (!data || !data->main || !data->setting || !setting) return; + if (F_status_is_error(data->setting->state.status)) return; if (data->main->parameters.array[fake_parameter_sources_e].result & f_console_result_value_e && setting->path_sources.used) { - *status = f_string_dynamic_append_assure(f_path_separator_s, &setting->path_sources); + data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &setting->path_sources); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure)); return; @@ -1324,7 +1326,7 @@ extern "C" { if (setting->build_shared == F_false && setting->build_static == F_false) { fake_build_print_warning_setting_both_cannot_when_language(data->setting, data->main->warning, fake_build_setting_name_build_shared_s, fake_build_setting_name_build_static_s, setting->build_language == fake_build_language_c_e ? fake_build_language_c_s : fake_build_language_cpp_s); - *status = F_status_set_error(F_failure); + data->setting->state.status = F_status_set_error(F_failure); } } } @@ -1333,7 +1335,7 @@ extern "C" { #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) { - if (!data || !stage) return; + if (!data || !data->main || !data->setting || !stage) return; if (F_status_is_error(data->setting->state.status)) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { diff --git a/level_3/fake/c/main/build/object.c b/level_3/fake/c/main/build/object.c index aca9afe..795b2b5 100644 --- a/level_3/fake/c/main/build/object.c +++ b/level_3/fake/c/main/build/object.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_build_object_script_ int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (!data || !data_build) return 0; + if (!data || !data->main || !data->setting || !data_build) return 0; 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; fake_build_touch(data, file_stage); @@ -19,7 +19,7 @@ extern "C" { #ifndef _di_fake_build_object_shared_ int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (!data || !data_build) return 0; + if (!data || !data->main || !data->setting || !data_build) return 0; 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 (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0; @@ -27,7 +27,7 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - data->setting->state.status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments); + fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_object_add)); @@ -64,7 +64,7 @@ extern "C" { } // for } - fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e, &arguments, status); + fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_arguments_standard_add)); @@ -74,7 +74,7 @@ extern "C" { return 0; } - int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status); + int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments); macro_f_string_dynamics_t_delete_simple(arguments); @@ -89,7 +89,7 @@ extern "C" { #ifndef _di_fake_build_object_static_ int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (!data || !data_build) return 0; + if (!data || !data->main || !data->setting || !data_build) return 0; 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 (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0; @@ -97,7 +97,7 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - data->setting->state.status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments); + fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_object_add)); @@ -134,7 +134,7 @@ extern "C" { } // for } - fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e, &arguments, status); + fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_arguments_standard_add)); @@ -144,7 +144,7 @@ extern "C" { return 0; } - int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status); + int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments); macro_f_string_dynamics_t_delete_simple(arguments); diff --git a/level_3/fake/c/main/build/objects.c b/level_3/fake/c/main/build/objects.c index f2afde0..6941951 100644 --- a/level_3/fake/c/main/build/objects.c +++ b/level_3/fake/c/main/build/objects.c @@ -5,18 +5,19 @@ extern "C" { #endif #ifndef _di_fake_build_objects_static_ - int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_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 data->main->child; + if (!data || !data->main || !data->setting) return 0; + 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 (!data_build->setting.build_sources_library.used) return 0; fake_build_print_compile_object_static_library(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static, &arguments); + fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static, &arguments); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); f_string_dynamics_resize(0, &arguments); @@ -59,58 +60,58 @@ extern "C" { source.used += sources[i]->array[j].used; source.string[source.used] = 0; - *status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); + fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_get_file_name_without_extension)); break; } - *status = f_file_name_directory(sources[i]->array[j], &destination_path); + data->setting->state.status = f_file_name_directory(sources[i]->array[j], &destination_path); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory)); break; } if (destination_path.used) { - *status = f_string_dynamic_prepend(data->path_build_objects, &destination_path); + data->setting->state.status = f_string_dynamic_prepend(data->path_build_objects, &destination_path); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_prepend)); break; } - *status = f_string_dynamic_append_assure(f_path_separator_s, &destination_path); + data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &destination_path); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure)); break; } - *status = f_directory_exists(destination_path); + data->setting->state.status = f_directory_exists(destination_path); - if (*status == F_false) { + if (data->setting->state.status == F_false) { fake_build_print_error_exist_not_directory(data->setting, data->main->message, destination_path); - *status = F_status_set_error(F_failure); + data->setting->state.status = F_status_set_error(F_failure); break; } - if (*status == F_file_found_not) { - *status = f_directory_create(destination_path, mode.directory); + if (data->setting->state.status == F_file_found_not) { + data->setting->state.status = f_directory_create(destination_path, mode.directory); - if (F_status_is_error(*status)) { - if (F_status_set_fine(*status) == F_file_found_not) { + if (F_status_is_error(data->setting->state.status)) { + if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { fake_build_print_error_cannot_create_due_to_parent(data->setting, data->main->message, destination_path); } else { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_directory_create), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_create), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e); } break; @@ -119,8 +120,8 @@ extern "C" { fake_build_print_verbose_create_directory(data->setting, data->main->message, destination_path); } - if (F_status_is_error(*status)) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_directory_exists), destination_path, 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, macro_fake_f(f_directory_exists), destination_path, f_file_operation_create_s, fll_error_file_type_directory_e); break; } @@ -158,33 +159,33 @@ extern "C" { if (!values[k].used) continue; - *status = fll_execute_arguments_add(values[k], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(values[k], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for - fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e, &arguments, status); + fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e, &arguments); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); break; } - result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status); + result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments); macro_f_string_dynamics_t_delete_simple(arguments); - if (F_status_is_error(*status) || *status == F_child) break; + if (F_status_is_error(data->setting->state.status) || data->setting->state.status == F_child) break; } // for - if (F_status_is_error(*status) || *status == F_child) break; + if (F_status_is_error(data->setting->state.status) || data->setting->state.status == F_child) break; } // for f_string_dynamic_resize(0, &file_name); f_string_dynamic_resize(0, &destination_path); f_string_dynamics_resize(0, &arguments); - if (F_status_is_error_not(*status) && *status != F_child) { + if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status != F_child) { fake_build_touch(data, file_stage); } diff --git a/level_3/fake/c/main/build/objects.h b/level_3/fake/c/main/build/objects.h index 83baced..649280c 100644 --- a/level_3/fake/c/main/build/objects.h +++ b/level_3/fake/c/main/build/objects.h @@ -24,23 +24,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.settings.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @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. */ #ifndef _di_fake_build_objects_static_ - extern int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_objects_static_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/build/program.c b/level_3/fake/c/main/build/program.c index 3f513ff..d7d98c9 100644 --- a/level_3/fake/c/main/build/program.c +++ b/level_3/fake/c/main/build/program.c @@ -7,6 +7,7 @@ extern "C" { #ifndef _di_fake_build_program_script_ int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { + if (!data || !data->main || !data->setting || !data_build) return 0; 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; fake_build_touch(data, file_stage); @@ -18,6 +19,7 @@ extern "C" { #ifndef _di_fake_build_program_shared_ int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { + if (!data || !data->main || !data->setting || !data_build) return 0; 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 (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0; @@ -25,7 +27,7 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - data->setting->state.status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments); + fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); @@ -35,7 +37,7 @@ extern "C" { return 0; } - data->setting->state.status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments); + fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add)); @@ -85,7 +87,7 @@ extern "C" { data->setting->state.status = fll_execute_arguments_add(link_project_library, &arguments); } - fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_program_e, &arguments, status); + fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_program_e, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); @@ -95,7 +97,7 @@ extern "C" { return 0; } - int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status); + int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments); macro_f_string_dynamics_t_delete_simple(arguments); @@ -110,6 +112,7 @@ extern "C" { #ifndef _di_fake_build_program_static_ int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { + if (!data || !data->main || !data->setting || !data_build) return 0; 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 (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0; @@ -117,7 +120,7 @@ extern "C" { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - data->setting->state.status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments); + fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); @@ -127,7 +130,7 @@ extern "C" { return 0; } - data->setting->state.status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments); + fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add)); @@ -187,7 +190,7 @@ extern "C" { } // for } - fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_program_e, &arguments, status); + fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_program_e, &arguments); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); @@ -197,7 +200,7 @@ extern "C" { return 0; } - int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status); + int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments); macro_f_string_dynamics_t_delete_simple(arguments); diff --git a/level_3/fake/c/main/build/skeleton.c b/level_3/fake/c/main/build/skeleton.c index feab20c..7531876 100644 --- a/level_3/fake/c/main/build/skeleton.c +++ b/level_3/fake/c/main/build/skeleton.c @@ -7,7 +7,7 @@ extern "C" { #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) { - if (!data || !data_build) return; + if (!data || !data->main || !data->setting || !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; @@ -64,7 +64,7 @@ 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 (!((++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); diff --git a/level_3/fake/c/main/clean.c b/level_3/fake/c/main/clean.c index 1b899f8..48eccb9 100644 --- a/level_3/fake/c/main/clean.c +++ b/level_3/fake/c/main/clean.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_clean_operate_ void fake_clean_operate(fake_data_t * const data) { - if (!data) return; + if (!data || !data->main || !data->setting) return; 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); @@ -48,7 +48,7 @@ extern "C" { #if !defined(_di_fake_clean_operate_) int fake_clean_remove_recursively_verbosely(const char * const path, const struct stat *file_stat, int type, struct FTW *entity) { - if (!entity->level || !path) return 0; + if (!path || !entity || !entity->level) return 0; const int result = remove(path); diff --git a/level_3/fake/c/main/common.c b/level_3/fake/c/main/common.c index 3372efb..342d684 100644 --- a/level_3/fake/c/main/common.c +++ b/level_3/fake/c/main/common.c @@ -45,15 +45,15 @@ extern "C" { setting->state.step_small = 4; - f_console_parameter_process(arguments, &main->parameters, &setting->state.status, (void *) &data); + f_console_parameter_process(arguments, &main->parameters, &setting->state, (void *) &data); setting->state.step_small = step_original; } - if (F_status_is_error(main->setting->state.status)) { + 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)); + fake_print_error(setting, main->error, macro_fake_f(f_console_parameter_process)); return; } @@ -72,10 +72,10 @@ extern "C" { setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main); - if (F_status_is_error(main->setting->state.status)) { + 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)); + fake_print_error(setting, main->error, macro_fake_f(fll_program_parameter_process_context)); return; } @@ -105,10 +105,10 @@ extern "C" { setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main); - if (F_status_is_error(main->setting->state.status)) { + 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)); + fake_print_error(setting, main->error, macro_fake_f(fll_program_parameter_process_verbosity)); return; } @@ -275,10 +275,10 @@ 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(main->setting->state.status)) { + 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) { + if (fake_print_error_fallback(setting, main->error, 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]); } @@ -298,15 +298,15 @@ extern "C" { if (cleanups[i]) { setting->state.status = f_path_directory_cleanup(main->parameters.arguments.array[index], variable[i]); - if (F_status_is_error(main->setting->state.status)) { + 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(setting, main->message); - if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_path_directory_cleanup)) == F_false) { + /*if (fake_print_error_fallback(setting, main->error, 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]); - } + }*/ } return; @@ -318,10 +318,10 @@ extern "C" { if (variable[i]->size) { setting->state.status = f_string_dynamic_resize(0, variable[i]); - if (F_status_is_error(main->setting->state.status)) { + 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)); + fake_print_error(setting, main->error, macro_fake_f(f_string_dynamic_resize)); return; } @@ -349,10 +349,10 @@ extern "C" { if (variable[i]->size) { setting->state.status = f_string_dynamic_resize(0, variable[i]); - if (F_status_is_error(main->setting->state.status)) { + 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)); + fake_print_error(setting, main->error, macro_fake_f(f_string_dynamic_resize)); return; } @@ -400,13 +400,13 @@ extern "C" { if (main->parameters.array[parameters[i]].result & f_console_result_value_e) { setting->state.status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[parameters[i]].values, variable[i]); - if (F_status_is_error(main->setting->state.status)) { + if (F_status_is_error(setting->state.status)) { if (main->error.verbosity > f_console_verbosity_quiet_e) { 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) { + /*if (fake_print_error_fallback(setting, main->error, 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]); - } + }*/ } return; @@ -419,13 +419,13 @@ 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(main->setting->state.status)) { + if (F_status_is_error(setting->state.status)) { 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) { + /*if (fake_print_error_fallback(setting, main->error, 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]); - } + }*/ return; } @@ -453,10 +453,10 @@ extern "C" { setting->state.status = f_uint8s_increase_by(1, &setting->operations); - if (F_status_is_error(main->setting->state.status)) { + 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)); + fake_print_error(setting, main->error, macro_fake_f(f_uint8s_increase_by)); return; } @@ -467,12 +467,12 @@ extern "C" { #endif // _di_fake_setting_load_ #ifndef _di_fake_setting_load_parameter_callback_ - void fake_setting_load_parameter_callback(const f_console_arguments_t arguments, void * const void_parameters, f_console_parameter_state_t * const state, void * const void_data) { + void fake_setting_load_parameter_callback(const f_console_arguments_t arguments, void * const void_parameters, f_console_parameter_state_t * const state_parameter, void * const void_data) { - if (!state) return; + if (!state_parameter || !state_parameter->state) return; - if (!void_parameters || !void_data || (state->type != f_console_parameter_state_type_simple_e && state->type != f_console_parameter_state_type_miss_e)) { - state->state->status = F_process; + if (!void_parameters || !void_data || (state_parameter->type != f_console_parameter_state_type_simple_e && state_parameter->type != f_console_parameter_state_type_miss_e)) { + state_parameter->state->status = F_process; return; } @@ -480,17 +480,19 @@ extern "C" { f_console_parameters_t * const parameters = (f_console_parameters_t * const) void_parameters; fake_data_t * const data = (fake_data_t * const) void_data; - state->state->status = f_uint8s_increase(fake_allocation_small_d, &data->setting->operations); + if (!data->setting) return; - if (F_status_is_error(state->state->status)) { - fake_print_line_first(setting, main->message); + state_parameter->state->status = f_uint8s_increase(state_parameter->state->step_small, &data->setting->operations); + + if (F_status_is_error(state_parameter->state->status)) { + fake_print_line_first(data->setting, data->main->message); - fake_print_error(data->setting, data->main->error, state->state->status, macro_fake_f(f_uint8s_increase)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_uint8s_increase)); return; } - switch (state->at) { + switch (state_parameter->at) { case fake_parameter_operation_build_e: data->setting->operations.array[data->setting->operations.used++] = fake_operation_build_e; data->setting->flag |= fake_main_flag_operation_build_e; @@ -516,12 +518,12 @@ extern "C" { break; default: - state->state->status = F_process; + state_parameter->state->status = F_process; return; } - state->state->status = F_none; + state_parameter->state->status = F_none; } #endif // _di_fake_setting_load_parameter_callback_ diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index 7c64c22..b865f29 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -9,7 +9,7 @@ extern "C" { if (!main || !setting) return; - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(setting->state.status)) { fake_print_line_last(setting, main->message); return; @@ -49,7 +49,7 @@ extern "C" { fake_path_generate(&data); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(setting->state.status)) { fake_data_delete(&data); return; @@ -66,8 +66,8 @@ extern "C" { setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &setting->fakefile); } - if (F_status_is_error(data->setting->state.status)) { - fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(setting->state.status)) { + fake_print_error(setting, main->error, macro_fake_f(f_string_dynamic_append)); } } @@ -103,7 +103,7 @@ extern "C" { setting->state.status = F_status_set_error(F_file_not); } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(setting->state.status)) { fake_print_error_file( setting, main->error, @@ -190,12 +190,12 @@ extern "C" { main->signal_check = 0; } - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(setting->state.status)) break; } // for } } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(setting->state.status)) { if (F_status_set_fine(setting->state.status) == F_interrupt) { fake_print_operation_cancelled(setting, main->message, data.operation); } @@ -224,7 +224,7 @@ extern "C" { #ifndef _di_fake_execute_ int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments) { - if (!data) return; + if (!data || !data->main || !data->setting) return 1; if (F_status_is_error(data->setting->state.status)) return 1; if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { @@ -328,7 +328,7 @@ extern "C" { data->setting->state.status = f_file_size(path_file, F_true, &size_file); 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); + 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; } @@ -385,7 +385,7 @@ extern "C" { #ifndef _di_fake_pipe_buffer_ void fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer) { - if (!data || !buffer) return; + if (!data || !data->main || !data->setting || !buffer) return; f_file_t file = f_file_t_initialize; @@ -410,7 +410,7 @@ extern "C" { if (fll_program_standard_signal_received(data->main)) { fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - f_file_stream_read_block = F_status_set_error(F_interrupt); + data->setting->state.status = F_status_set_error(F_interrupt); return; } @@ -432,7 +432,7 @@ extern "C" { #ifndef _di_fake_validate_parameter_paths_ void fake_validate_parameter_paths(fake_data_t * const data) { - if (!data) return; + if (!data || !data->main || !data->setting) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { if (fll_program_standard_signal_received(data->main)) { @@ -440,7 +440,7 @@ extern "C" { data->setting->state.status = F_status_set_error(F_interrupt); - return + return; } } diff --git a/level_3/fake/c/main/fake.h b/level_3/fake/c/main/fake.h index 8bc15a7..ac8d406 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -120,6 +120,7 @@ #include #include #include +#include #include #include #include diff --git a/level_3/fake/c/main/fake/path_generate.c b/level_3/fake/c/main/fake/path_generate.c index 04bfd48..28b41e5 100644 --- a/level_3/fake/c/main/fake/path_generate.c +++ b/level_3/fake/c/main/fake/path_generate.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_path_generate_ void fake_path_generate(fake_data_t * const data) { - if (!data) return; + if (!data || !data->main || !data->setting) return; data->setting->state.status = F_none; uint8_t i = 0; @@ -315,7 +315,7 @@ extern "C" { for (i = 0; i < 2; ++i) { - data->setting->state.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(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic)); @@ -364,7 +364,7 @@ extern "C" { #ifndef _di_fake_path_generate_string_dynamic_ 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; + if (!data || !data->main || !data->setting) return; data->setting->state.status = F_none; diff --git a/level_3/fake/c/main/main.c b/level_3/fake/c/main/main.c index 24478e9..55b6dc7 100644 --- a/level_3/fake/c/main/main.c +++ b/level_3/fake/c/main/main.c @@ -39,7 +39,7 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_down(&data); - if (setting.status == F_child) { + if (setting.state.status == F_child) { exit(data.child); } diff --git a/level_3/fake/c/main/make.c b/level_3/fake/c/main/make.c index eaf2291..5a3f028 100644 --- a/level_3/fake/c/main/make.c +++ b/level_3/fake/c/main/make.c @@ -7,15 +7,15 @@ extern "C" { #ifndef _di_fake_make_assure_inside_project_ void fake_make_assure_inside_project(fake_make_data_t * const data_make, const f_string_static_t path) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->cache_path.used = 0; - data.setting.state.status = fll_path_canonical(path, &data_make->cache_path); - if (F_status_is_error(data.setting.state.status)) return; + data_make->setting->state.status = fll_path_canonical(path, &data_make->cache_path); + if (F_status_is_error(data_make->setting->state.status)) return; if (data_make->cache_path.used < data_make->path.stack.array[0].used) { - data.setting.state.status = F_status_set_error(F_false); + data_make->setting->state.status = F_status_set_error(F_false); return; } @@ -23,33 +23,33 @@ extern "C" { const f_string_range_t range = macro_f_string_range_t_initialize2(data_make->path.stack.array[0].used); if (range.start <= range.stop) { - data.setting.state.status = fl_string_dynamic_partial_compare(data_make->path.stack.array[0], data_make->cache_path, range, range); - if (F_status_is_error(data.setting.state.status)) return; + data_make->setting->state.status = fl_string_dynamic_partial_compare(data_make->path.stack.array[0], data_make->cache_path, range, range); + if (F_status_is_error(data_make->setting->state.status)) return; - if (data.setting.state.status) { + if (data_make->setting->state.status) { if (data_make->cache_path.used == data_make->path.stack.array[0].used || data_make->cache_path.string[data_make->path.stack.array[0].used] == f_path_separator_s.string[0]) { - data.setting.state.status = F_true; + data_make->setting->state.status = F_true; return; } } } - data.setting.state.status = F_status_set_error(F_false); + data_make->setting->state.status = F_status_set_error(F_false); } #endif // _di_fake_make_assure_inside_project_ #ifndef _di_fake_make_get_id_ - void fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer, void *id) { + f_number_unsigned_t fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer) { - if (!data || !id) return; + if (!data_make || !data_make->main || !data_make->setting) return 0; if (!buffer.used) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); data_make->setting->state.status = F_status_set_error(F_parameter); - return; + return 0; } f_number_unsigned_t number = 0; @@ -57,20 +57,27 @@ extern "C" { data_make->setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); if (F_status_is_error(data_make->setting->state.status)) { + + // When the buffer is not a number, then check to see if this is a group or owner name. if (F_status_set_fine(data_make->setting->state.status) == F_number) { + if (is_owner) { + uid_t uid = 0; - data_make->setting->state.status = is_owner - ? f_account_id_by_name(buffer, (uid_t *) id) - : f_account_group_id_by_name(buffer, (gid_t *) id); + data_make->setting->state.status = f_account_id_by_name(buffer, &uid); + } + else { + gid_t gid = 0; + + data_make->setting->state.status = f_account_group_id_by_name(buffer, &gid); + } if (F_status_is_error(data_make->setting->state.status)) { fake_print_error( data_make->setting, data_make->main->error, - macro_fake_f(is_owner - ? f_account_id_by_name - : f_account_group_id_by_name - ) + is_owner + ? macro_fake_f(f_account_id_by_name) + : macro_fake_f(f_account_group_id_by_name) ); } else { @@ -88,35 +95,35 @@ extern "C" { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect)); } - return; + return 0; } if (number > F_type_size_32_unsigned_d) { fake_print_error_number_too_large(data_make->setting, data_make->main->error, buffer); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); - return; + return 0; } - *id = is_owner ? (uid_t) number : (gid_t) number; + return number; } #endif // _di_fake_make_get_id_ #ifndef _di_fake_make_get_id_mode_ void fake_make_get_id_mode(fake_make_data_t * const data_make, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) { - if (!data_make || !mode || !replace) return; + if (!data_make || !data_make->main || !data_make->setting || !mode || !replace) return; if (!buffer.used) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); - data.setting.state.status = F_status_set_error(F_parameter); + data_make->setting->state.status = F_status_set_error(F_parameter); return; } - data_make->setting->state.status = f_file_mode_from_string(buffer, data->main->umask, mode, replace); + data_make->setting->state.status = f_file_mode_from_string(buffer, data_make->main->umask, mode, replace); if (F_status_is_error(data_make->setting->state.status)) { if (F_status_set_fine(data_make->setting->state.status) == F_syntax) { @@ -127,7 +134,7 @@ extern "C" { } } else { - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_get_id_mode_ @@ -135,18 +142,18 @@ extern "C" { #ifndef _di_fake_make_path_relative_ void fake_make_path_relative(fake_make_data_t * const data_make, const f_string_static_t path) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->cache_path.used = 0; if (!path.used || path.used == data_make->path.stack.array[0].used) { - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; return; } if (path.used < data_make->path.stack.array[0].used) { - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -156,13 +163,13 @@ extern "C" { range.start = data_make->path.stack.array[0].used + 1; range.stop = range.start + (path.used - range.start) - 1; - data.setting.state.status = f_string_dynamic_partial_append(path, range, &data_make->cache_path); - if (F_status_is_error(data.setting.state.status)) return; + data_make->setting->state.status = f_string_dynamic_partial_append(path, range, &data_make->cache_path); + if (F_status_is_error(data_make->setting->state.status)) return; - data.setting.state.status = f_string_dynamic_terminate(&data_make->cache_path); - if (F_status_is_error(data.setting.state.status)) return; + data_make->setting->state.status = f_string_dynamic_terminate(&data_make->cache_path); + if (F_status_is_error(data_make->setting->state.status)) return; - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_path_relative_ diff --git a/level_3/fake/c/main/make.h b/level_3/fake/c/main/make.h index 5489cf4..6b9c3e3 100644 --- a/level_3/fake/c/main/make.h +++ b/level_3/fake/c/main/make.h @@ -52,18 +52,22 @@ extern "C" { * F_parameter (with error bit) on invalid parameter. * * Errors (with error bit) from: fl_conversion_dynamic_to_unsigned_detect() - * @param + * @param is_owner + * If TRUE, then buffer represents a UID. + * If FALSE, then buffer represents a GID. * @param buffer * The string containing the name or number. - * @param id + * + * @return * The detected owner id or group id. - * When is_owner is TRUE, then this must be of type (uid_t *). - * When is_owner is TRUE, then this must be of type (gid_t *). + * When is_owner is TRUE, then this should be cast to type (uid_t *). + * When is_owner is TRUE, then this should be cast to type (gid_t *). + * This is set to 0 on any error, check data_make.setting.state.status for error. * * @see fl_conversion_dynamic_to_unsigned_detect() */ #ifndef _di_fake_make_get_id_ - extern void fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer, void *id); + extern f_number_unsigned_t fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer); #endif // _di_fake_make_get_id_ /** diff --git a/level_3/fake/c/main/make/load_fakefile.c b/level_3/fake/c/main/make/load_fakefile.c index 5509309..674e093 100644 --- a/level_3/fake/c/main/make/load_fakefile.c +++ b/level_3/fake/c/main/make/load_fakefile.c @@ -7,13 +7,13 @@ extern "C" { #ifndef _di_fake_make_load_fakefile_ void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe) { - if (!data_make) return; - if (F_status_is_error(data->setting->state.status)) return; + if (!data_make || !data_make->data || !data_make->main || !data_make->setting) return; + if (F_status_is_error(data_make->setting->state.status)) return; 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); + fll_program_print_signal_received(data_make->main->warning, data_make->setting->line_first, data_make->main->signal_received); - data->setting->state.status = F_status_set_error(F_interrupt); + data_make->setting->state.status = F_status_set_error(F_interrupt); return; } @@ -23,19 +23,19 @@ extern "C" { if (process_pipe) { fake_pipe_buffer(data_make->data, &data_make->buffer); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { data_make->buffer.used = 0; } else { - data->setting->state.status = f_string_dynamic_append_assure(f_string_eol_s, &data_make->buffer); + data_make->setting->state.status = f_string_dynamic_append_assure(f_string_eol_s, &data_make->buffer); } } - if (F_status_is_error_not(data->setting->state.status)) { + if (F_status_is_error_not(data_make->setting->state.status)) { fake_file_buffer(data_make->data, data_make->data->file_data_build_fakefile, process_pipe ? F_false : F_true, &data_make->buffer); } - if (F_status_is_error(data->setting->state.status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; if (!data_make->buffer.used) { fake_make_print_warning_fakefile_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile); @@ -51,15 +51,15 @@ 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; - fll_fss_basic_list_read(data_make->buffer, data->setting->state, &range, &list_objects, &list_contents, &delimits, 0, &comments); + fll_fss_basic_list_read(data_make->buffer, &range, &list_objects, &list_contents, &delimits, 0, &comments, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_basic_list_read), data_make->data->file_data_build_fakefile, range, F_true); } else { - data->setting->state.status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + f_fss_apply_delimit(delimits, &data_make->buffer, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit)); } @@ -68,7 +68,7 @@ extern "C" { macro_f_fss_comments_t_delete_simple(comments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { macro_f_fss_objects_t_delete_simple(list_objects); macro_f_fss_contents_t_delete_simple(list_contents); macro_f_fss_delimits_t_delete_simple(delimits); @@ -84,10 +84,10 @@ extern "C" { f_fss_set_t settings = f_fss_set_t_initialize; if (list_objects.used > data_make->fakefile.size) { - macro_f_fss_nameds_t_resize((data->setting->state.status), data_make->fakefile, list_objects.used); + macro_f_fss_nameds_t_resize((data_make->setting->state.status), data_make->fakefile, list_objects.used); } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(macro_f_fss_nameds_t_resize)); macro_f_fss_set_t_delete_simple(settings); @@ -105,9 +105,9 @@ extern "C" { if (!(i % 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); + fll_program_print_signal_received(data_make->main->warning, data_make->setting->line_first, data_make->main->signal_received); - data->setting->state.status = F_status_set_error(F_interrupt); + data_make->setting->state.status = F_status_set_error(F_interrupt); break; } @@ -125,17 +125,17 @@ extern "C" { delimits.used = 0; content_range = list_contents.array[i].array[0]; - data->setting->state.status = fll_fss_extended_read(data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0, &data->setting->state); + fll_fss_extended_read(data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true); break; } - data->setting->state.status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + f_fss_apply_delimit(delimits, &data_make->buffer, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit)); break; @@ -166,17 +166,17 @@ extern "C" { if (list_contents.array[i].used) { content_range = list_contents.array[i].array[0]; - fll_fss_extended_read(data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0, &data->setting->state); + fll_fss_extended_read(data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true); break; } - data->setting->state.status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + f_fss_apply_delimit(delimits, &data_make->buffer, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit)); break; @@ -191,7 +191,7 @@ extern "C" { macro_f_fss_contents_t_delete_simple(list_contents); macro_f_fss_delimits_t_delete_simple(delimits); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { macro_f_fss_set_t_delete_simple(settings); return; @@ -200,7 +200,7 @@ extern "C" { if (missing_main) { fake_make_print_error_fakefile_section_missing(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_item_main_s); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); macro_f_fss_set_t_delete_simple(settings); @@ -211,21 +211,21 @@ extern "C" { { f_string_t function_name = macro_fake_f(macro_f_string_map_multis_t_resize); - data->setting->state.status = f_string_map_multis_resize(data->setting->state.step_small, &data_make->setting_make.parameter); + data_make->setting->state.status = f_string_map_multis_resize(data_make->setting->state.step_small, &data_make->setting_make.parameter); - if (F_status_is_error_not(data->setting->state.status)) { + if (F_status_is_error_not(data_make->setting->state.status)) { data_make->setting_make.parameter.used = 1; function_name = macro_fake_f(f_string_dynamic_append); - data->setting->state.status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].name); + data_make->setting->state.status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].name); } - if (F_status_is_error_not(data->setting->state.status)) { + if (F_status_is_error_not(data_make->setting->state.status)) { function_name = macro_fake_f(f_string_dynamics_resize); - data->setting->state.status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value); + data_make->setting->state.status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value); } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, function_name); macro_f_fss_set_t_delete_simple(settings); @@ -251,8 +251,8 @@ extern "C" { fake_make_load_fakefile_setting_compiler(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_compiler); } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_environment_s.string, data_make->buffer, fake_make_setting_environment_s.used, settings.objects.array[i]) == F_equal_to) { - data->setting->state.status = fake_make_load_fakefile_setting_environment(data_make, &settings.contents.array[i]); - if (F_status_is_error(data->setting->state.status)) break; + fake_make_load_fakefile_setting_environment(data_make, &settings.contents.array[i]); + if (F_status_is_error(data_make->setting->state.status)) break; } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_fail_s.string, data_make->buffer, fake_make_setting_fail_s.used, settings.objects.array[i]) == F_equal_to) { fake_make_load_fakefile_setting_fail(data_make, &settings.objects.array[i], &settings.contents.array[i]); @@ -261,27 +261,27 @@ extern "C" { fake_make_load_fakefile_setting_indexer(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_indexer); } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_parameter_s.string, data_make->buffer, fake_make_setting_parameter_s.used, settings.objects.array[i]) == F_equal_to) { - data->setting->state.status = fake_make_load_fakefile_setting_parameter(data_make, &settings.objects.array[i], &settings.contents.array[i]); - if (F_status_is_error(data->setting->state.status)) break; + fake_make_load_fakefile_setting_parameter(data_make, &settings.objects.array[i], &settings.contents.array[i]); + if (F_status_is_error(data_make->setting->state.status)) break; } } // for - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { macro_f_fss_set_t_delete_simple(settings); return; } } - if (F_status_is_error_not(data->setting->state.status) && data_make->setting_make.load_build) { + if (F_status_is_error_not(data_make->setting->state.status) && data_make->setting_make.load_build) { fake_build_load_setting(data_make->data, 0, F_false, &data_make->setting_build); - if (F_status_is_error(data->setting->state.status) && data->setting->state.status != F_status_set_error(F_interrupt)) { + if (F_status_is_error(data_make->setting->state.status) && data_make->setting->state.status != F_status_set_error(F_interrupt)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_build_load_setting)); } } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { macro_f_fss_set_t_delete_simple(settings); return; @@ -291,17 +291,17 @@ extern "C" { if (range_compiler) { data_make->setting_build.build_compiler.used = 0; - data->setting->state.status = f_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler); + data_make->setting->state.status = f_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler); } - if (F_status_is_error_not(data->setting->state.status) && range_indexer) { + if (F_status_is_error_not(data_make->setting->state.status) && range_indexer) { data_make->setting_build.build_indexer.used = 0; - data->setting->state.status = f_string_dynamic_partial_append(data_make->buffer, *range_indexer, &data_make->setting_build.build_indexer); + data_make->setting->state.status = f_string_dynamic_partial_append(data_make->buffer, *range_indexer, &data_make->setting_build.build_indexer); } - if (F_status_is_error(data->setting->state.status)) { - if (F_status_set_fine(data->setting->state.status) != F_interrupt) { + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->setting->state.status) != F_interrupt) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append)); } @@ -310,19 +310,19 @@ extern "C" { return; } - data->setting->state.status = fake_make_load_fakefile_setting_define_and_parameter(data_make->data, data_make, &settings); + fake_make_load_fakefile_setting_define_and_parameter(data_make, &settings); macro_f_fss_set_t_delete_simple(settings); } - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_ #ifndef _di_fake_make_load_fakefile_setting_build_ void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) { - if (!data_make || !object || !content) return; + if (!data_make || !data_make->data || !data_make->main || !data_make->setting || !object || !content) return; if (content->used) { if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_yes_s.string, data_make->buffer, fake_common_setting_bool_yes_s.used, content->array[0]) == F_equal_to) { @@ -348,7 +348,7 @@ extern "C" { #ifndef _di_fake_make_load_fakefile_setting_compiler_ void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_compiler) { - if (!data_make || !object || !content || !range_compiler) return; + if (!data_make || !data_make->data || !data_make->main || !data_make->setting || !object || !content || !range_compiler) return; if (content->used) { *range_compiler = &content->array[content->used - 1]; @@ -364,16 +364,16 @@ extern "C" { #endif // _di_fake_make_load_fakefile_setting_compiler_ #ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_ - void fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings) { + void fake_make_load_fakefile_setting_define_and_parameter(fake_make_data_t * const data_make, f_fss_set_t * const settings) { - if (!data || !data_make || !settings) return; + if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !settings) return; ; f_string_map_multis_t define = f_string_map_multis_t_initialize; // Load the fakefile "settings" as if they are build "settings". - fake_build_load_setting_process(data, F_false, data->file_data_build_fakefile, 0, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build); + fake_build_load_setting_process(data_make->data, F_false, data_make->data->file_data_build_fakefile, 0, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build); - if (F_status_is_error_not(data->setting->state.status) && settings->objects.used) { + if (F_status_is_error_not(data_make->setting->state.status) && settings->objects.used) { const f_string_static_t settings_name[] = { fake_make_setting_define_s, fake_make_setting_parameter_s, @@ -384,10 +384,10 @@ extern "C" { &data_make->setting_make.parameter, }; - data->setting->state.status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0); + data_make->setting->state.status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0); - if (F_status_is_error(data->setting->state.status)) { - fake_print_error(data->setting, data->main->error, macro_fake_f(fll_fss_snatch_map_apart)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_snatch_map_apart)); f_string_map_multis_resize(0, &define); @@ -405,26 +405,26 @@ extern "C" { fake_make_operate_validate_define_name(define.array[i].name); - if (data->setting->state.status) { + if (data_make->setting->state.status) { combined.used = 0; for (j = 0; j < define.array[i].value.used; ++j) { - data->setting->state.status = f_string_dynamic_mash(f_string_space_s, define.array[i].value.array[j], &combined); + data_make->setting->state.status = f_string_dynamic_mash(f_string_space_s, define.array[i].value.array[j], &combined); - if (F_status_is_error(data->setting->state.status)) { - fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_mash)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_mash)); break; } } // for - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(data_make->setting->state.status)) break; - data->setting->state.status = f_environment_set(define.array[i].name, combined, F_true); + data_make->setting->state.status = f_environment_set(define.array[i].name, combined, F_true); - if (F_status_is_error(data->setting->state.status)) { - fake_print_error(data->setting, data->main->error, macro_fake_f(f_environment_set)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_set)); break; } @@ -432,7 +432,7 @@ extern "C" { else { fake_make_print_error_define_invalid_character(data_make->setting, data_make->main->error, define.array[i].name); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); break; } @@ -443,15 +443,17 @@ extern "C" { f_string_map_multis_resize(0, &define); - if (F_status_is_error(data->setting->state.status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_setting_define_and_parameter_ #ifndef _di_fake_make_load_fakefile_setting_environment_ void fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_fss_content_t * const content) { + if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !content) return; + f_string_dynamic_t name_define = f_string_dynamic_t_initialize; f_array_length_t i = 0; @@ -461,9 +463,9 @@ extern "C" { for (; i < content->used; ++i) { - data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &name_define); + data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &name_define); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; @@ -476,9 +478,9 @@ extern "C" { } // for if (j == data_make->setting_build.environment.used) { - data->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, &data_make->setting_build.environment); + data_make->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, &data_make->setting_build.environment); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; @@ -486,17 +488,17 @@ extern "C" { data_make->setting_build.environment.array[j].used = 0; - data->setting->state.status = f_string_dynamic_increase_by(name_define.used + 1, &data_make->setting_build.environment.array[j]); + data_make->setting->state.status = f_string_dynamic_increase_by(name_define.used + 1, &data_make->setting_build.environment.array[j]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; } - data->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); + data_make->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; @@ -509,9 +511,9 @@ extern "C" { data_make->setting_build.environment.array[j].used = 0; - data->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); + data_make->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; @@ -527,15 +529,17 @@ extern "C" { f_string_dynamic_resize(0, &name_define); - if (F_status_is_error(data->setting->state.status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_setting_environment_ #ifndef _di_fake_make_load_fakefile_setting_fail_ void fake_make_load_fakefile_setting_fail(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) { + if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !object || !content) return; + if (content->used) { if (fl_string_dynamic_partial_compare_string(fake_make_operation_argument_exit_s.string, data_make->buffer, fake_make_operation_argument_exit_s.used, content->array[content->used - 1]) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_exit_e; @@ -563,6 +567,8 @@ extern "C" { #ifndef _di_fake_make_load_fakefile_setting_indexer_ void fake_make_load_fakefile_setting_indexer(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_indexer) { + if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !object || !content || !range_indexer) return; + if (content->used) { *range_indexer = &content->array[content->used - 1]; @@ -579,6 +585,8 @@ extern "C" { #ifndef _di_fake_make_load_fakefile_setting_parameter_ void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) { + if (!data_make || !data_make->data || !data_make->data || !data_make->main || !data_make->setting || !object || !content) return; + if (content->used) { if (fl_string_dynamic_partial_compare_string(fake_make_setting_return_s.string, data_make->buffer, fake_make_setting_return_s.used, content->array[0]) == F_equal_to) { if (content->used > 1) { @@ -588,24 +596,24 @@ extern "C" { for (f_array_length_t i = 1; i < content->used; ++i) { - data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &data_make->setting_make.parameter.array[0].value.array[0]); + data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &data_make->setting_make.parameter.array[0].value.array[0]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; } - data->setting->state.status = f_string_dynamic_append_assure(f_string_space_s, &data_make->setting_make.parameter.array[0].value.array[0]); + data_make->setting->state.status = f_string_dynamic_append_assure(f_string_space_s, &data_make->setting_make.parameter.array[0].value.array[0]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure)); break; } } // for - if (F_status_is_error(data->setting->state.status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; } } } @@ -613,7 +621,7 @@ extern "C" { fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_return_s); } - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_setting_parameter_ diff --git a/level_3/fake/c/main/make/load_fakefile.h b/level_3/fake/c/main/make/load_fakefile.h index db4088b..a8011ec 100644 --- a/level_3/fake/c/main/make/load_fakefile.h +++ b/level_3/fake/c/main/make/load_fakefile.h @@ -77,8 +77,8 @@ extern "C" { /** * Load the fakefile setting "parameter". * - * @param data - * The program data. + * @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. @@ -86,8 +86,6 @@ extern "C" { * Errors (with error bit) from: f_environment_set(). * Errors (with error bit) from: f_string_dynamic_mash_nulless(). * Errors (with error bit) from: fll_fss_snatch_map_apart(). - * @param data_make - * All make related setting data, including data from the fakefile and the build settings file. * @param settings * The settings data. * @@ -96,7 +94,7 @@ extern "C" { * @see fll_fss_snatch_map_apart() */ #ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_ - extern void fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings); + extern void fake_make_load_fakefile_setting_define_and_parameter(fake_make_data_t * const data_make, f_fss_set_t * const settings); #endif // _di_fake_make_load_fakefile_setting_define_and_parameter_ /** diff --git a/level_3/fake/c/main/make/load_parameters.c b/level_3/fake/c/main/make/load_parameters.c index 48789a2..a5ab088 100644 --- a/level_3/fake/c/main/make/load_parameters.c +++ b/level_3/fake/c/main/make/load_parameters.c @@ -5,18 +5,19 @@ extern "C" { #endif #ifndef _di_fake_make_load_parameters_ - void fake_make_load_parameters(fake_make_data_t * const data_make, f_status_t * const status) { + void fake_make_load_parameters(fake_make_data_t * const data_make) { - if (F_status_is_error(*status)) return; + if (!data_make || !data_make->main || !data_make->setting) return; + if (F_status_is_error(data_make->setting->state.status)) return; if (data_make->main->context.mode != f_color_mode_none_e) { - *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.color); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.color); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; @@ -24,46 +25,46 @@ extern "C" { if (data_make->main->context.mode == f_color_mode_not_e) { if (data_make->main->parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } else if (data_make->main->parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_no_color_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_no_color_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } } else if (data_make->main->context.mode == f_color_mode_dark_e) { if (data_make->main->parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } else if (data_make->main->parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_dark_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_dark_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } } else { if (data_make->main->parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } else if (data_make->main->parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_light_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_light_s, &data_make->parameter.color.array[data_make->parameter.color.used]); } } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(data_make->parameter.color.array[data_make->parameter.color.used], &data_make->parameter_option.color.array[data_make->parameter_option.color.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(data_make->parameter.color.array[data_make->parameter.color.used], &data_make->parameter_option.color.array[data_make->parameter_option.color.used]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); return; @@ -74,13 +75,13 @@ extern "C" { } if (data_make->main->error.verbosity != f_console_verbosity_normal_e) { - *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.verbosity); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.verbosity); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; @@ -88,58 +89,58 @@ extern "C" { if (data_make->main->error.verbosity == f_console_verbosity_quiet_e) { if (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data_make->main->parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_quiet_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_quiet_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } else if (data_make->main->error.verbosity == f_console_verbosity_error_e) { if (data_make->main->parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data_make->main->parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_error_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_error_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } else if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { if (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data_make->main->parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_verbose_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_verbose_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } else { if (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } else if (data_make->main->parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + data_make->setting->state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(f_console_standard_short_debug_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(f_console_standard_short_debug_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); } } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append(data_make->parameter.verbosity.array[data_make->parameter.verbosity.used], &data_make->parameter_option.verbosity.array[data_make->parameter_option.verbosity.used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append(data_make->parameter.verbosity.array[data_make->parameter.verbosity.used], &data_make->parameter_option.verbosity.array[data_make->parameter_option.verbosity.used]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); return; @@ -189,43 +190,43 @@ extern "C" { for (j = 0; j < source[i].used; ++j) { if (destination[i]->used + 2 > destination[i]->size) { - *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; } } - *status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); + data_make->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); return; } if (console[i]->flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append_nulless(f_console_symbol_short_normal_s, &destination[i]->array[destination[i]->used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(f_console_symbol_short_normal_s, &destination[i]->array[destination[i]->used]); } else if (console[i]->flag & f_console_flag_inverse_e) { - *status = f_string_dynamic_append_nulless(f_console_symbol_short_inverse_s, &destination[i]->array[destination[i]->used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(f_console_symbol_short_inverse_s, &destination[i]->array[destination[i]->used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_nulless(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -234,21 +235,21 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; } - *status = f_string_dynamic_append_nulless(source[i].array[j], &destination[i]->array[destination[i]->used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(source[i].array[j], &destination[i]->array[destination[i]->used]); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(source[i].array[j], &destination_value[i]->array[destination_value[i]->used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_nulless(source[i].array[j], &destination_value[i]->array[destination_value[i]->used]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -338,43 +339,43 @@ extern "C" { if (!(console[i]->result & f_console_result_found_e)) continue; if (destination[i]->used + 2 > destination[i]->size) { - *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; } } - *status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); + data_make->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); return; } if (console[i]->flag & f_console_flag_normal_e) { - *status = f_string_dynamic_append_nulless(f_console_symbol_short_normal_s, &destination[i]->array[destination[i]->used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(f_console_symbol_short_normal_s, &destination[i]->array[destination[i]->used]); } else if (console[i]->flag & f_console_flag_inverse_e) { - *status = f_string_dynamic_append_nulless(f_console_symbol_short_inverse_s, &destination[i]->array[destination[i]->used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(f_console_symbol_short_inverse_s, &destination[i]->array[destination[i]->used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); } - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_nulless(destination[i]->array[destination[i]->used], &destination_option[i]->array[destination_option[i]->used]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -383,21 +384,21 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; } - *status = f_string_dynamic_append_nulless(source[i], &destination[i]->array[destination[i]->used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(source[i], &destination[i]->array[destination[i]->used]); - if (F_status_is_error_not(*status)) { - *status = f_string_dynamic_append_nulless(source[i], &destination_value[i]->array[destination_value[i]->used]); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_nulless(source[i], &destination_value[i]->array[destination_value[i]->used]); } - if (F_status_is_error(*status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; diff --git a/level_3/fake/c/main/make/load_parameters.h b/level_3/fake/c/main/make/load_parameters.h index b50902e..d9d1b76 100644 --- a/level_3/fake/c/main/make/load_parameters.h +++ b/level_3/fake/c/main/make/load_parameters.h @@ -21,17 +21,16 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param status - * The return status. * - * F_none on success. + * This alters data_make.settings.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 receiving a terminate process signal, such as an interrupt signal. * - * Status codes (with error bit) are returned on any problem. + * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_load_parameters_ - extern void fake_make_load_parameters(fake_make_data_t * const data_make, f_status_t * const status); + extern void fake_make_load_parameters(fake_make_data_t * const data_make); #endif // _di_fake_make_load_parameters_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make/operate.c b/level_3/fake/c/main/make/operate.c index 843e8a3..cac46e9 100644 --- a/level_3/fake/c/main/make/operate.c +++ b/level_3/fake/c/main/make/operate.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_make_operate_ void fake_make_operate(fake_data_t * const data) { - if (!data) return; + if (!data || !data->main || !data->setting) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { if (fll_program_standard_signal_received(data->main)) { @@ -28,7 +28,7 @@ extern "C" { data_make.main = data->main; data_make.setting = data->setting; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make.path.stack); + data->setting->state.status = f_string_dynamics_increase(data->setting->state.step_small, &data_make.path.stack); if (F_status_is_error(data->setting->state.status)) { fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_string_dynamics_increase)); @@ -153,7 +153,7 @@ extern "C" { if (fl_string_dynamic_partial_compare(data->main->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) { { - int result = fake_make_operate_section(&data_make, j, §ion_stack,); + int result = fake_make_operate_section(&data_make, j, §ion_stack); if (data->setting->state.status == F_child) { data->main->child = result; @@ -219,14 +219,14 @@ extern "C" { #ifndef _di_fake_make_operate_expand_ void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes) { - if (!data_make) return; - if (F_status_is_error(data->setting->state.status)) return; + if (!data_make || !data_make->main || !data_make->setting) return; + if (F_status_is_error(data_make->setting->state.status)) return; if (!content.used) return; // Pre-allocate the known arguments size. - data->setting->state.status = f_string_dynamics_increase_by(content.used, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase_by(content.used, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status) || data->setting->state.status == F_string_too_large) { + if (F_status_is_error(data_make->setting->state.status) || data_make->setting->state.status == F_string_too_large) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; @@ -341,13 +341,13 @@ extern "C" { &data_make->parameter_value.work, }; - data->setting->state.flag = 0; - data->setting->state.handle = 0; - data->setting->state.data = 0; + data_make->setting->state.flag = 0; + data_make->setting->state.handle = 0; + data_make->setting->state.data = 0; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); return; @@ -367,9 +367,9 @@ extern "C" { if (quotes.array[i]) { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; @@ -383,10 +383,10 @@ extern "C" { range = content.array[i]; - data->setting->state.status = fl_iki_read(&data_make->buffer, &range, iki_data, state); + fl_iki_read(&data_make->buffer, &range, iki_data, &data_make->setting->state); - if (F_status_is_error(data->setting->state.status)) { - if (F_status_set_fine(data->setting->state.status) != F_interrupt) { + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->setting->state.status) != F_interrupt) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_iki_read)); } @@ -405,9 +405,9 @@ extern "C" { range.start = content.array[i].start; range.stop = iki_data->variable.array[0].start - 1; - data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; @@ -420,30 +420,30 @@ extern "C" { is = 0; - data->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_define.string, data_make->buffer, vocabulary_define.used, iki_data->vocabulary.array[j]); + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_define.string, data_make->buffer, vocabulary_define.used, iki_data->vocabulary.array[j]); - if (data->setting->state.status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { is = 2; iki_type |= 0x2; } - else if (data->setting->state.status == F_equal_to_not) { - data->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_parameter.string, data_make->buffer, vocabulary_parameter.used, iki_data->vocabulary.array[j]); + else if (data_make->setting->state.status == F_equal_to_not) { + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_parameter.string, data_make->buffer, vocabulary_parameter.used, iki_data->vocabulary.array[j]); - if (data->setting->state.status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { is = 1; iki_type |= 0x1; } - else if (data->setting->state.status == F_equal_to_not) { - data->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_context.string, data_make->buffer, vocabulary_context.used, iki_data->vocabulary.array[j]); + else if (data_make->setting->state.status == F_equal_to_not) { + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_context.string, data_make->buffer, vocabulary_context.used, iki_data->vocabulary.array[j]); - if (data->setting->state.status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { is = 3; iki_type |= 0x4; } } } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_string_dynamic_partial_compare)); break; @@ -456,18 +456,18 @@ extern "C" { if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_return_s.string, data_make->buffer, fake_make_parameter_variable_return_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->setting_make.parameter.array[0].value.array[0].used) { - data->setting->state.status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } } else { - data->setting->state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); break; @@ -479,26 +479,26 @@ extern "C" { else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_top_s.string, data_make->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - data->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; } - data->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); break; } // For safe path handling, always append the trailing slash. - data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure)); break; @@ -510,26 +510,26 @@ extern "C" { else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_current_s.string, data_make->buffer, fake_make_parameter_variable_current_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - data->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; } - data->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); break; } // For safe path handling, always append the trailing slash. - data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure)); break; @@ -561,9 +561,9 @@ extern "C" { } // for } // for - data->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; @@ -574,18 +574,18 @@ extern "C" { if (!reserved_value[k]->array[l].used) continue; if (separate) { - data->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); break; } } - data->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; @@ -606,9 +606,9 @@ extern "C" { if (separate) { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; @@ -617,9 +617,9 @@ extern "C" { data_make->cache_arguments.array[data_make->cache_arguments.used].used = 0; } - data->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; @@ -632,10 +632,10 @@ extern "C" { break; } // for - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(data_make->setting->state.status)) break; } - if (unmatched && F_status_is_error_not(data->setting->state.status)) { + if (unmatched && F_status_is_error_not(data_make->setting->state.status)) { for (k = 0; k < parameter->used; ++k) { // Check against IKI variable list. @@ -659,9 +659,9 @@ extern "C" { } // for } // for - data->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; @@ -674,9 +674,9 @@ extern "C" { if (separate) { if (quotes.array[i]) { - data->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); break; @@ -687,9 +687,9 @@ extern "C" { else { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; @@ -699,9 +699,9 @@ extern "C" { } } - data->setting->state.status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; @@ -710,25 +710,25 @@ extern "C" { separate = F_true; } // for - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(data_make->setting->state.status)) break; } break; } // for } - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(data_make->setting->state.status)) break; if (unmatched) { fake_make_operate_expand_build(data_make, quotes.array[i], iki_data->content.array[j]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_build)); break; } - if (data->setting->state.status == F_true) { + if (data_make->setting->state.status == F_true) { iki_type |= 0x8; } } @@ -736,20 +736,20 @@ extern "C" { else if (is == 2) { fake_make_operate_expand_environment(data_make, quotes.array[i], iki_data->content.array[j]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_environment)); break; } - if (data->setting->state.status == F_true) { + if (data_make->setting->state.status == F_true) { iki_type |= 0x8; } } else if (is == 3) { fake_make_operate_expand_context(data_make, quotes.array[i], iki_data->content.array[j]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_context)); break; @@ -764,9 +764,9 @@ extern "C" { range.start = iki_data->variable.array[j].stop + 1; range.stop = iki_data->variable.array[j + 1].start - 1; - data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; @@ -775,16 +775,16 @@ extern "C" { } } // for - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(data_make->setting->state.status)) break; // Copy everything after the last IKI variable to the end of the content. if (iki_data->variable.used && content.array[i].stop > iki_data->variable.array[iki_data->variable.used - 1].stop) { range.start = iki_data->variable.array[iki_data->variable.used - 1].stop + 1; range.stop = content.array[i].stop; - data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; @@ -794,9 +794,9 @@ extern "C" { if (!(content.array[i].start == iki_data->variable.array[0].start && content.array[i].stop == iki_data->variable.array[0].stop && !quotes.array[i]) || (iki_type & 0xb) && !quotes.array[i] || i && content.used > 1 && i + 1 == content.used) { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; @@ -806,9 +806,9 @@ extern "C" { } } else { - data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; @@ -816,9 +816,9 @@ extern "C" { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; @@ -1118,7 +1118,7 @@ extern "C" { data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); } - if (F_status_is_error(data->setting->state.status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; if (data_make->cache_1.used) { data_make->setting->state.status = F_true; @@ -1133,7 +1133,7 @@ extern "C" { #ifndef _di_fake_make_operate_expand_context_ void fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; const f_string_static_t *context = 0; @@ -1171,50 +1171,50 @@ extern "C" { } // for if (context) { - data->setting->state.status = f_string_dynamic_append_nulless(*context, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(data->setting->state.status)) return; + data_make->setting->state.status = f_string_dynamic_append_nulless(*context, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + if (F_status_is_error(data_make->setting->state.status)) return; } - data->setting->state.status = F_true; + data_make->setting->state.status = F_true; } #endif // _di_fake_make_operate_expand_context_ #ifndef _di_fake_make_operate_expand_environment_ void fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; data_make->cache_1.used = 0; data_make->cache_2.used = 0; - data->setting->state.status = f_string_dynamic_increase_by((range_name.stop - range_name.start) + 2, &data_make->cache_1); + data_make->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(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(data_make->setting->state.status)) { + data_make->setting->state.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_environment_get(data_make->cache_1, &data_make->cache_2); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_environment_get(data_make->cache_1, &data_make->cache_2); } if (F_status_is_error(data_make->setting->state.status)) return; - if (data->setting->state.status == F_exist_not) { - data->setting->state.status = F_false; + if (data_make->setting->state.status == F_exist_not) { + data_make->setting->state.status = F_false; return; } - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &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_not(data_make->setting->state.status)) { + data_make->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_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_not(data_make->setting->state.status)) { + data_make->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_make->setting->state.status)) return; @@ -1222,22 +1222,22 @@ extern "C" { if (!quote) { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); if (F_status_is_error(data_make->setting->state.status)) return; } - data->setting->state.status = data_make->cache_2.used ? F_true : F_data_not; + data_make->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) { - 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 (!data_make || !data_make->main || !data_make->setting || !section_stack) return 0; + if (F_status_is_error(data_make->setting->state.status) || data_make->setting->state.status == F_child) return data_make->main->child; if (id_section >= data_make->fakefile.used) { - data->setting->state.status = F_status_set_error(F_parameter); + data_make->setting->state.status = F_status_set_error(F_parameter); fake_print_error(data_make->setting, data_make->error, macro_fake_f(fake_make_operate_section)); @@ -1245,9 +1245,9 @@ extern "C" { } // Add the operation id to the operation stack. - data->setting->state.status = f_array_lengths_increase(data_make->setting->state.step_small, section_stack); + data_make->setting->state.status = f_array_lengths_increase(data_make->setting->state.step_small, section_stack); - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->error, macro_fake_f(f_array_lengths_increase)); return 0; @@ -1346,7 +1346,7 @@ extern "C" { f_array_length_t i = 0; f_array_length_t j = 0; - for (i = 0; i < section->objects.used; ++i, data->setting->state.status = F_none) { + for (i = 0; i < section->objects.used; ++i, data_make->setting->state.status = F_none) { for (j = 0; j < data_make->cache_arguments.size; ++j) { data_make->cache_arguments.array[j].used = 0; @@ -1360,9 +1360,9 @@ extern "C" { 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); + fll_program_print_signal_received(data_make->main->warning, data_make->setting->line_first, data_make->main->signal_received); - data->setting->state.status = F_status_set_error(F_interrupt); + data_make->setting->state.status = F_status_set_error(F_interrupt); break; } @@ -1382,13 +1382,13 @@ 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]); - data->setting->state.status = F_status_set_error(F_valid_not); + data_make->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_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); - data->setting->state.status = F_status_set_error(F_recurse); + data_make->setting->state.status = F_status_set_error(F_recurse); } } @@ -1400,7 +1400,7 @@ extern "C" { fake_make_operate_validate(data_make, section->name, &state_process, section_stack); } - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->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; @@ -1413,19 +1413,19 @@ 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); - if (data->setting->state.status == F_child) return result; + if (data_make->setting->state.status == F_child) return result; } fake_make_operate_block_postprocess(data_make, i == section->objects.used, &state_process); } - if (F_status_set_fine(data->setting->state.status) == F_interrupt) break; + if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) break; - if (F_status_is_error(data->setting->state.status)) { + if (F_status_is_error(data_make->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(data->setting->state.status) == F_signal_abort && !section_stack->used) { + if (F_status_set_fine(data_make->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; @@ -1439,12 +1439,12 @@ 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(data->setting->state.status) == F_signal_abort) break; + if (F_status_set_fine(data_make->setting->state.status) == F_signal_abort) break; // F_signal_abort is used by the exit section operation. - if (F_status_set_fine(data->setting->state.status) == F_signal_quit) { + if (F_status_set_fine(data_make->setting->state.status) == F_signal_quit) { if (!section_stack->used) { - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } break; @@ -1452,27 +1452,27 @@ extern "C" { if (data_make->setting_make.fail == fake_make_operation_fail_exit_e) break; } - else if (data->setting->state.status == F_signal_abort) { + else if (data_make->setting->state.status == F_signal_abort) { state_process.success = F_true; // F_signal_abort is used by the break section operation. break; } - else if (data->setting->state.status == F_signal_quit) { + else if (data_make->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) { - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } break; } - else if (data->setting->state.status == F_failure) { + else if (data_make->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. - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; state_process.success = F_false; } else { @@ -1480,19 +1480,19 @@ extern "C" { } } // for - if (F_status_set_error(data->setting->state.status) == F_interrupt) return 0; + if (F_status_set_error(data_make->setting->state.status) == F_interrupt) return 0; - 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)) { + if (i == section->objects.used && F_status_is_error_not(data_make->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]); - data->setting->state.status = F_status_set_error(F_failure); + data_make->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(data->setting->state.status) && section_stack->used > 1) { - data->setting->state.status = F_status_set_error(F_failure); + if (state_process.success == F_false && F_status_is_error_not(data_make->setting->state.status) && section_stack->used > 1) { + data_make->setting->state.status = F_status_set_error(F_failure); } --section_stack->used; diff --git a/level_3/fake/c/main/make/operate_block.c b/level_3/fake/c/main/make/operate_block.c index 8b6d5c0..50e9d55 100644 --- a/level_3/fake/c/main/make/operate_block.c +++ b/level_3/fake/c/main/make/operate_block.c @@ -55,9 +55,9 @@ extern "C" { #ifndef _di_fake_make_operate_block_postprocess_ 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 (!data_make || !data_make->main || !data_make->setting || !state_process) return; - if (F_status_is_error(data_make->setting.state.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_process.c b/level_3/fake/c/main/make/operate_process.c index 809f6ea..73e533b 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -7,8 +7,8 @@ extern "C" { #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) { - if (!data_make || !state_process || !section_stack) return 0; - if (data->setting->state.status == F_child) return data_make->data->main->child; + if (!data_make || !data_make->main || !data_make->setting || !state_process || !section_stack) return 0; + if (data_make->setting->state.status == F_child) return data_make->data->main->child; if (state_process->operation == fake_make_operation_type_break_e) { fake_make_operate_process_type_break(data_make); @@ -23,7 +23,7 @@ extern "C" { 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); + return fake_make_operate_process_type_compile(data_make); } else if (state_process->operation == fake_make_operation_type_copy_e) { fake_make_operate_process_type_copy(data_make, F_false); @@ -56,7 +56,7 @@ extern "C" { 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); + return fake_make_operate_process_type_index(data_make); } else if (state_process->operation == fake_make_operation_type_link_e) { fake_make_operate_process_type_link(data_make); @@ -71,7 +71,7 @@ extern "C" { 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); + return fake_make_operate_process_type_operate(data_make, section_stack); } else if (state_process->operation == fake_make_operation_type_owner_e) { fake_make_operate_process_type_owners(data_make, F_false); @@ -117,16 +117,16 @@ extern "C" { #ifndef _di_fake_make_operate_process_buffer_escape_ void fake_make_operate_process_buffer_escape(fake_make_data_t * const data_make, const f_string_static_t source, f_string_dynamic_t * const destination) { - if (!data_make || !destination) return; + if (!data_make || !data_make->main || !data_make->setting || !destination) return; if (!source.used) { - data_make->setting->status = F_data_not; + data_make->setting->state.status = F_data_not; return; } - data_make->setting->status = f_string_dynamic_increase_by(source.used, destination); - if (F_status_is_error(data_make->setting->status)) return; + data_make->setting->state.status = f_string_dynamic_increase_by(source.used, destination); + if (F_status_is_error(data_make->setting->state.status)) return; for (f_array_length_t i = 0; i < source.used; ++i) { @@ -138,8 +138,8 @@ extern "C" { // A slash by itself at the end of the string is invalid. if (++i >= source.used) break; - data_make->setting->status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); - if (F_status_is_error(data_make->setting->status)) return; + data_make->setting->state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + if (F_status_is_error(data_make->setting->state.status)) return; if (source.string[i] == f_string_ascii_slash_backward_s.string[0]) { destination->string[destination->used++] = f_string_ascii_slash_backward_s.string[0]; @@ -209,18 +209,18 @@ extern "C" { if (buffer.used > 2) { uint32_t codepoint = 0; - data_make->setting->status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint); + data_make->setting->state.status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint); - if (F_status_is_error(data_make->setting->status)) { - if (!(data_make->setting->status == F_failure || data_make->setting->status == F_utf_not || data_make->setting->status == F_complete_not_utf || data_make->setting->status == F_utf_fragment || data_make->setting->status == F_valid_not)) { + if (F_status_is_error(data_make->setting->state.status)) { + if (!(data_make->setting->state.status == F_failure || data_make->setting->state.status == F_utf_not || data_make->setting->state.status == F_complete_not_utf || data_make->setting->state.status == F_utf_fragment || data_make->setting->state.status == F_valid_not)) { break; } } else { // Reserve 4-bytes (the max size of a Unicode UTF-8 sequence). - data_make->setting->status = f_string_dynamic_increase_by(4, destination); - if (F_status_is_error(data_make->setting->status)) return; + data_make->setting->state.status = f_string_dynamic_increase_by(4, destination); + if (F_status_is_error(data_make->setting->state.status)) return; if (!codepoint) { destination->string[destination->used++] = f_string_null_s.string[0]; @@ -229,10 +229,10 @@ extern "C" { { f_string_t address = destination->string + destination->used; - data_make->setting->status = f_utf_unicode_from(codepoint, 4, &address); + data_make->setting->state.status = f_utf_unicode_from(codepoint, 4, &address); } - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { destination->string[destination->used] = 0; } else { @@ -262,26 +262,26 @@ extern "C" { } } else { - data_make->setting->status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); - if (F_status_is_error(data_make->setting->status)) return; + data_make->setting->state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + if (F_status_is_error(data_make->setting->state.status)) return; destination->string[destination->used++] = source.string[i]; } } // for - if (F_status_is_error(data_make->setting->status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_buffer_escape_ #ifndef _di_fake_make_operate_process_execute_ void fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (!program.used && !arguments.used) { - data_make->setting->status = F_data_not; + data_make->setting->state.status = F_data_not; return; } @@ -289,7 +289,7 @@ extern "C" { 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); - data_make->setting->status = F_status_set_error(F_interrupt); + data_make->setting->state.status = F_status_set_error(F_interrupt); return; } @@ -304,18 +304,18 @@ extern "C" { data_make->environment.used = 0; if (data_make->setting_build.flag & data_build_setting_flag_has_environment_e) { - data_make->setting->status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment); + data_make->setting->state.status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_environment_load_names)); return; } } else { - data_make->setting->status = f_environment_get_all(&data_make->environment); + data_make->setting->state.status = f_environment_get_all(&data_make->environment); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_get_all)); return; @@ -333,23 +333,23 @@ extern "C" { int return_code = 0; - data_make->setting->status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); + data_make->setting->state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); 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); - data_make->setting->status = F_status_set_error(F_interrupt); + data_make->setting->state.status = F_status_set_error(F_interrupt); return; } - if (F_status_is_error(data_make->setting->status)) { - if (F_status_set_fine(data_make->setting->status) == F_interrupt) return; + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return; - if (F_status_set_fine(data_make->setting->status) == F_file_found_not) { + if (F_status_set_fine(data_make->setting->state.status) == F_file_found_not) { fake_make_print_error_program_not_found(data_make->setting, data_make->main->error, program); } - else if (F_status_set_fine(data_make->setting->status) != F_failure) { + else if (F_status_set_fine(data_make->setting->state.status) != F_failure) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fll_execute_program)); } } @@ -363,56 +363,54 @@ extern "C" { #ifndef _di_fake_make_operate_process_return_ void fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; + + const f_status_t status_original = data_make->setting->state.status; data_make->setting_make.parameter.array[0].value.array[0].used = 0; if (return_code) { f_string_dynamic_t number = f_string_dynamic_t_initialize; - result = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number); + data_make->setting->state.status = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_conversion_number_signed_to_string)); f_string_dynamic_resize(0, &number); - data_make->setting.state.status = result; - return; } - result = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); + data_make->setting->state.status = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); f_string_dynamic_resize(0, &number); - if (F_status_is_error(result)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); - data_make->setting.state.status = result; - return; } fake_make_print_error_program_failed(data_make->setting, data_make->main->error, return_code); - data_make->setting.state.status = data_make->setting_make.fail == fake_make_operation_fail_type_exit_e ? F_status_set_error(F_failure) : F_failure; + data_make->setting->state.status = (data_make->setting_make.fail == fake_make_operation_fail_exit_e) ? F_status_set_error(F_failure) : F_failure; return; } - if (F_status_is_error(data_make->setting.state.status)) { - data_make->setting.state.status = f_string_dynamic_append(f_string_ascii_1_s, &data_make->setting_make.parameter.array[0].value.array[0]); + if (F_status_is_error(status_original)) { + data_make->setting->state.status = f_string_dynamic_append(f_string_ascii_1_s, &data_make->setting_make.parameter.array[0].value.array[0]); } else { - data_make->setting.state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->setting_make.parameter.array[0].value.array[0]); + data_make->setting->state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->setting_make.parameter.array[0].value.array[0]); } - if (F_status_is_error(result)) { - fll_error_print(data_make->error, F_status_set_fine(result), "f_string_dynamic_append", F_true); + if (F_status_is_error(data_make->setting->state.status)) { + fll_error_print(data_make->error, F_status_set_fine(data_make->setting->state.status), macro_fake_f(f_string_dynamic_append), F_true); } else { - data_make->setting.state.status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_operate_process_return_ @@ -420,10 +418,10 @@ extern "C" { #ifndef _di_fake_make_operate_process_run_ void fake_make_operate_process_run(fake_make_data_t * const data_make, const bool as_shell) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (!data_make->cache_arguments.used) { - data_make->setting->status = F_data_not; + data_make->setting->state.status = F_data_not; return; } 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 17ce9b0..49d8aa3 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_break_ void fake_make_operate_process_type_break(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->setting->state.status = F_none; @@ -30,31 +30,31 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_build_ void fake_make_operate_process_type_build(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; fake_build_operate(data_make->data, data_make->cache_arguments.used ? &data_make->cache_arguments : 0, F_false); if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return; - data_make->setting->state.status = fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); + fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_build_ #ifndef _di_fake_make_operate_process_type_clean_ void fake_make_operate_process_type_clean(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; - data_make->setting->state.status = fake_clean_operate(data_make->data); + fake_clean_operate(data_make->data); if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return; - data_make->setting->state.status = fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); + fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_clean_ #ifndef _di_fake_make_operate_process_type_compile_ int fake_make_operate_process_type_compile(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make) return 0; const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_compiler, data_make->cache_arguments); @@ -62,7 +62,7 @@ extern "C" { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute)); } else if (data_make->setting->state.status == F_child) { - return; + return result; } fake_make_operate_process_return(data_make, result); @@ -74,7 +74,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_condition_ void fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->setting->state.status = F_none; @@ -195,7 +195,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_copy_ void fake_make_operate_process_type_copy(fake_make_data_t * const data_make, const bool clone) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; const f_array_length_t total = data_make->cache_arguments.used - 1; f_string_static_t destination = f_string_static_t_initialize; @@ -208,7 +208,7 @@ extern "C" { } else { recurse.verbose = fake_print_verbose_copy; - macro_f_mode_t_set_default_umask(recurse.state.mode, data_make->main->umask); + macro_f_mode_t_set_default_umask(recurse.mode, data_make->main->umask); } bool existing = F_true; @@ -290,9 +290,11 @@ extern "C" { recurse.flag -= recurse.flag & f_directory_recurse_flag_clone_e; } - fl_directory_copy(data_make->cache_arguments.array[i], destination, mode, &recurse); + fl_directory_copy(data_make->cache_arguments.array[i], destination, &recurse); + + if (F_status_is_error(recurse.state.status)) { + data_make->setting->state.status = recurse.state.status; - if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fl_directory_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); data_make->setting->state.status = F_status_set_error(F_failure); @@ -303,17 +305,15 @@ extern "C" { data_make->setting->state.status = f_file_clone(data_make->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); } else { - data_make->setting->state.status = f_file_copy(data_make->cache_arguments.array[i], destination, mode, recurse.size_block, recurse.flag); + data_make->setting->state.status = f_file_copy(data_make->cache_arguments.array[i], destination, recurse.mode, recurse.size_block, recurse.flag); } if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e); - f_directory_recurse_delete(&recurse); - data_make->setting->state.status = F_status_set_error(F_failure); - return; + break; } fake_make_print_verbose_operate_copy(data_make->setting, data_make->main->message, clone, data_make->cache_arguments.array[i], destination); @@ -321,24 +321,24 @@ extern "C" { else if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e); - f_directory_recurse_delete(&recurse); - data_make->setting->state.status = F_status_set_error(F_failure); - return; + break; } } // for f_directory_recurse_delete(&recurse); - data_make->setting->state.status = F_none; + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = F_none; + } } #endif // _di_fake_make_operate_process_type_copy_ #ifndef _di_fake_make_operate_process_type_define_ void fake_make_operate_process_type_define(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { data_make->setting->state.status = f_environment_set(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1], F_true); @@ -361,7 +361,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_deletes_ void fake_make_operate_process_type_deletes(fake_make_data_t * const data_make, const bool all) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; const int recursion_max = all ? F_directory_max_descriptors_d : 0; struct stat file_stat; @@ -440,7 +440,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_exit_ void fake_make_operate_process_type_exit(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->setting->state.status = F_none; @@ -473,7 +473,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_fail_ void fake_make_operate_process_type_fail(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, data_make->cache_arguments.array[0]) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_exit_e; @@ -508,7 +508,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_groups_ void fake_make_operate_process_type_groups(fake_make_data_t * const data_make, const bool all) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; gid_t id = 0; bool dereference = F_true; @@ -521,7 +521,7 @@ extern "C" { dereference = F_false; } - fake_make_get_id(data_make, F_false, data_make->cache_arguments.array[i++], (void *) &id); + id = (gid_t) fake_make_get_id(data_make, F_false, data_make->cache_arguments.array[i++]); if (F_status_is_error(data_make->setting->state.status)) { data_make->setting->state.status = F_status_set_error(F_failure); @@ -562,7 +562,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_define_ void fake_make_operate_process_type_if_define(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; state_process->condition_result = fake_condition_result_true_e; @@ -593,7 +593,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_exist_ void fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; @@ -657,7 +657,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_is_ void fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; // block = 0x1 (0000 0001) link = 0x10 (0001 0000) // character = 0x2 (0000 0010) regular = 0x20 (0010 0000) @@ -783,7 +783,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_ void fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; f_string_range_t range = f_string_range_t_initialize; f_number_unsigned_t number_left = 0; @@ -929,7 +929,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_group_ void fake_make_operate_process_type_if_group(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; uid_t id = 0; f_array_length_t i = if_not ? 2 : 1; @@ -942,7 +942,7 @@ extern "C" { dereference = F_false; } - fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++], (void *) &id); + id = (uid_t) fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++]); if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_e; @@ -993,7 +993,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_mode_ void fake_make_operate_process_type_if_mode(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; f_file_mode_t mode_rule = 0; mode_t mode_match = 0; @@ -1090,7 +1090,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_owner_ void fake_make_operate_process_type_if_owner(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; uid_t id = 0; f_array_length_t i = if_not ? 2 : 1; @@ -1103,7 +1103,7 @@ extern "C" { dereference = F_false; } - fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++], (void *) &id); + id = (uid_t) fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++]); if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_e; @@ -1154,7 +1154,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_if_parameter_ void fake_make_operate_process_type_if_parameter(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; const f_string_static_t reserved_name[] = { fake_make_parameter_variable_build_s, @@ -1288,7 +1288,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_index_ int fake_make_operate_process_type_index(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make) return 0; const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_indexer, data_make->cache_arguments); @@ -1307,7 +1307,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_link_ void fake_make_operate_process_type_link(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; // 0x1 = force, 0x2 = strict. uint8_t flag = 0; @@ -1374,7 +1374,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_modes_ void fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->setting->state.status = F_none; @@ -1441,7 +1441,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_move_ void fake_make_operate_process_type_move(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; const f_array_length_t total = data_make->cache_arguments.used -1; @@ -1516,7 +1516,9 @@ extern "C" { fll_file_move(data_make->cache_arguments.array[i], destination, &recurse); - if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_is_error(recurse.state.status)) { + data_make->setting->state.status = recurse.state.status; + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fll_file_move), data_make->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e); data_make->setting->state.status = F_status_set_error(F_failure); @@ -1562,7 +1564,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_owners_ void fake_make_operate_process_type_owners(fake_make_data_t * const data_make, const bool all) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; uid_t id = 0; bool dereference = F_true; @@ -1573,7 +1575,7 @@ extern "C" { dereference = F_false; } - fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++], (void *) &id); + id = (uid_t) fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++]); if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); @@ -1618,7 +1620,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_parameter_ void fake_make_operate_process_type_parameter(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; bool found = F_false; f_array_length_t i = 0; @@ -1714,7 +1716,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_pop_ void fake_make_operate_process_type_pop(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; f_string_dynamic_t *argument = &data_make->path.stack.array[data_make->path.stack.used - 1]; @@ -1756,7 +1758,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_print_ void fake_make_operate_process_type_print(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; data_make->cache_1.used = 0; @@ -1822,7 +1824,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_skeleton_ void fake_make_operate_process_type_skeleton(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; fake_skeleton_operate(data_make->data); if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return; @@ -1834,7 +1836,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_to_ void fake_make_operate_process_type_to(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]); @@ -1911,7 +1913,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_top_ void fake_make_operate_process_type_top(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; { data_make->setting->state.status = f_path_change_at(data_make->path.top.id); @@ -1941,7 +1943,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_touch_ void fake_make_operate_process_type_touch(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; f_mode_t mode = f_mode_t_initialize; @@ -1992,7 +1994,7 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_write_ void fake_make_operate_process_type_write(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; f_file_t file = f_file_t_initialize; diff --git a/level_3/fake/c/main/make/operate_validate.c b/level_3/fake/c/main/make/operate_validate.c index 0c8c442..b79fb21 100644 --- a/level_3/fake/c/main/make/operate_validate.c +++ b/level_3/fake/c/main/make/operate_validate.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_ void fake_make_operate_validate(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 (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (F_status_is_error(data_make->setting->state.status)) return; if (!section_stack) { 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 9fb82b9..fd82613 100644 --- a/level_3/fake/c/main/make/operate_validate_type.c +++ b/level_3/fake/c/main/make/operate_validate_type.c @@ -7,7 +7,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_break_ void fake_make_operate_validate_type_break(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -36,7 +36,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_build_ void fake_make_operate_validate_type_build(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { if (data_make->cache_arguments.array[0].used) { @@ -84,7 +84,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_clean_top_skeleton_ void fake_make_operate_validate_type_clean_top_skeleton(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -100,7 +100,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_clone_ void fake_make_operate_validate_type_clone(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { f_status_t status = F_none; @@ -172,7 +172,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_compile_ void fake_make_operate_validate_type_compile(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (!data_make->cache_arguments.used) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); @@ -193,7 +193,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_condition_ void fake_make_operate_validate_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; if (state_process->operation == fake_make_operation_type_if_e) { if (state_process->operation_previous == fake_make_operation_type_if_e) { @@ -474,9 +474,7 @@ extern "C" { i = ++k; } else if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_not_group_e) { - gid_t id = 0; - - fake_make_get_id(data_make, F_false, data_make->cache_arguments.array[k++], (void *) &id); + fake_make_get_id(data_make, F_false, data_make->cache_arguments.array[k++]); if (F_status_is_error(data_make->setting->state.status)) { data_make->setting->state.status = F_status_set_error(F_failure); @@ -537,9 +535,7 @@ extern "C" { } } else if (state_process->condition == fake_make_operation_if_type_if_owner_e || state_process->condition == fake_make_operation_if_type_if_not_owner_e) { - uid_t id = 0; - - fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[k++], (void *) &id); + fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[k++]); if (F_status_is_error(data_make->setting->state.status)) { data_make->setting->state.status = F_status_set_error(F_failure); @@ -657,7 +653,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_copy_ void fake_make_operate_validate_type_copy(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { f_status_t status = F_none; @@ -729,7 +725,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_define_ void fake_make_operate_validate_type_define(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { fake_make_operate_validate_define_name(data_make->cache_arguments.array[0]); @@ -758,7 +754,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_delete_ void fake_make_operate_validate_type_delete(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { f_status_t status = F_none; @@ -787,7 +783,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_else_ void fake_make_operate_validate_type_else(fake_make_data_t * const data_make, fake_state_process_t * const state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; if (state_process->operation_previous == fake_make_operation_type_else_e) { fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error); @@ -828,7 +824,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_exit_ void fake_make_operate_validate_type_exit(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -857,7 +853,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_fail_ void fake_make_operate_validate_type_fail(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, data_make->cache_arguments.array[0]) == F_equal_to_not) { @@ -885,7 +881,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_index_ void fake_make_operate_validate_type_index(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (!data_make->cache_arguments.used) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); @@ -906,7 +902,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_link_ void fake_make_operate_validate_type_link(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 4) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -1069,7 +1065,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_move_ void fake_make_operate_validate_type_move(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { { @@ -1154,7 +1150,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_operate_ void fake_make_operate_validate_type_operate(fake_make_data_t * const data_make, f_array_lengths_t * const section_stack) { - if (!data_make || !section_stack) return; + if (!data_make || !data_make->main || !data_make->setting || !section_stack) return; if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -1206,7 +1202,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_parameter_ void fake_make_operate_validate_type_parameter(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { const f_string_static_t reserved_name[] = { @@ -1269,7 +1265,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_permission_ void fake_make_operate_validate_type_permission(fake_make_data_t * const data_make, fake_state_process_t * const state_process) { - if (!data_make || !state_process) return; + if (!data_make || !data_make->main || !data_make->setting || !state_process) return; if (data_make->cache_arguments.used) { f_array_length_t i = 1; @@ -1316,7 +1312,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_pop_ void fake_make_operate_validate_type_pop(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -1340,7 +1336,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_run_ void fake_make_operate_validate_type_run(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (!data_make->cache_arguments.used) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); @@ -1356,7 +1352,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_to_ void fake_make_operate_validate_type_to(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); @@ -1414,7 +1410,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_type_touch_ void fake_make_operate_validate_type_touch(fake_make_data_t * const data_make) { - if (!data_make) return; + if (!data_make || !data_make->main || !data_make->setting) return; if (data_make->cache_arguments.used > 1) { if (fl_string_dynamic_compare(fake_make_operation_argument_file_s, data_make->cache_arguments.array[0]) == F_equal_to_not) { diff --git a/level_3/fake/c/main/make/print/warning.c b/level_3/fake/c/main/make/print/warning.c index cb4d548..a2b3e5a 100644 --- a/level_3/fake/c/main/make/print/warning.c +++ b/level_3/fake/c/main/make/print/warning.c @@ -5,7 +5,7 @@ extern "C" { #endif #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) { + 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) { if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; @@ -15,7 +15,7 @@ extern "C" { 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); - fl_print_format("%[%ui%]", print.to, print.notable, F_status_set_fine(status), print.notable); + fl_print_format("%[%ui%]", print.to, print.notable, setting->state.status, print.notable); fl_print_format("%['.%]%r", print.to, print.context, print.context, f_string_eol_s); f_file_stream_unlock(print.to); diff --git a/level_3/fake/c/main/make/print/warning.h b/level_3/fake/c/main/make/print/warning.h index f650bab..d52e08f 100644 --- a/level_3/fake/c/main/make/print/warning.h +++ b/level_3/fake/c/main/make/print/warning.h @@ -28,8 +28,6 @@ extern "C" { * The output structure to print to. * @param path * The path that cannot be changed back to. - * @param status - * The status code representing the cause of the failure. * * @return * F_none on success. @@ -42,7 +40,7 @@ extern "C" { * @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); + 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); #endif // _di_fake_make_print_warning_cannot_change_back_ /** diff --git a/level_3/fake/c/main/print.c b/level_3/fake/c/main/print.c index 17187e5..bef2aaa 100644 --- a/level_3/fake/c/main/print.c +++ b/level_3/fake/c/main/print.c @@ -104,7 +104,7 @@ extern "C" { 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; + if (setting->flag & fake_main_flag_file_to_e) return F_output_not; } if (setting->flag & fake_main_flag_print_first_e) { @@ -125,7 +125,7 @@ extern "C" { 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; + if (setting->flag & fake_main_flag_file_to_e) return F_output_not; } fll_print_dynamic_raw(setting->line_last, print.to); diff --git a/level_3/fake/c/main/print/error.c b/level_3/fake/c/main/print/error.c index f4f9928..a9e7c60 100644 --- a/level_3/fake/c/main/print/error.c +++ b/level_3/fake/c/main/print/error.c @@ -10,7 +10,7 @@ extern "C" { if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_error_e) return F_output_not; - fll_error_print(print, F_status_set_fine(data->setting->state.status), function, fll_error_file_flag_fallback_e); + fll_error_print(print, F_status_set_fine(setting->state.status), function, fll_error_file_flag_fallback_e); return F_none; } @@ -200,7 +200,7 @@ 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) return F_status_set_error(F_output_not); + if (!setting) return; 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); @@ -504,7 +504,7 @@ extern "C" { 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(data->setting->state.status) == F_false) { + if (F_status_set_fine(setting->state.status) == F_false) { fake_print_context_wrapped_variable(setting, print, "The path ", path, " is outside the project root"); } else { diff --git a/level_3/fake/c/main/print/error.h b/level_3/fake/c/main/print/error.h index ad31a6a..86fb48c 100644 --- a/level_3/fake/c/main/print/error.h +++ b/level_3/fake/c/main/print/error.h @@ -366,8 +366,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 @@ -391,7 +389,7 @@ extern "C" { * @see fake_print_error_fss_message() */ #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); + extern 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); #endif // _di_fake_print_error_fss_ /** diff --git a/level_3/fake/c/main/print/verbose.c b/level_3/fake/c/main/print/verbose.c index 8f3f830..434107a 100644 --- a/level_3/fake/c/main/print/verbose.c +++ b/level_3/fake/c/main/print/verbose.c @@ -17,7 +17,7 @@ extern "C" { return; } - fake_data_t * const data = (fake_data_t * const) recurse->state.custom; + fake_data_t * const data = (fake_data_t *) recurse->state.custom; if (data->main->message.verbosity < f_console_verbosity_verbose_e) { recurse->state.status = F_output_not; @@ -42,7 +42,7 @@ extern "C" { return; } - fake_data_t * const data = (fake_data_t * const) recurse->state.custom; + fake_data_t * const data = (fake_data_t *) recurse->state.custom; if (data->main->message.verbosity < f_console_verbosity_verbose_e) { recurse->state.status = F_output_not; @@ -57,12 +57,10 @@ extern "C" { #ifndef _di_fake_print_verbose_create_directory_ void fake_print_verbose_create_directory(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; + if (!setting) return; + if (print.verbosity < f_console_verbosity_verbose_e) return; fake_print_simple_variable(setting, print, "Created directory ", path); - - return F_none; } #endif // _di_fake_print_verbose_create_directory_ @@ -143,7 +141,7 @@ extern "C" { return; } - fake_data_t * const data = (fake_data_t * const) recurse->state.custom; + fake_data_t * const data = (fake_data_t *) recurse->state.custom; if (data->main->message.verbosity < f_console_verbosity_verbose_e) { recurse->state.status = F_output_not; diff --git a/level_3/fake/c/main/print/verbose.h b/level_3/fake/c/main/print/verbose.h index 0d73336..45d1877 100644 --- a/level_3/fake/c/main/print/verbose.h +++ b/level_3/fake/c/main/print/verbose.h @@ -74,16 +74,10 @@ extern "C" { * @param path * The name of the file. * - * @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_simple_variable() */ #ifndef _di_fake_print_verbose_create_directory_ - extern f_status_t fake_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); + extern void fake_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path); #endif // _di_fake_print_verbose_create_directory_ /** diff --git a/level_3/fake/c/main/skeleton.c b/level_3/fake/c/main/skeleton.c index 1938a5c..ebff9f3 100644 --- a/level_3/fake/c/main/skeleton.c +++ b/level_3/fake/c/main/skeleton.c @@ -5,9 +5,9 @@ extern "C" { #endif #ifndef _di_fake_skeleton_operate_ - f_status_t fake_skeleton_operate(fake_data_t * const data) { + void fake_skeleton_operate(fake_data_t * const data) { - f_status_t status = F_none; + if (!data || !data->main || !data->setting) return; if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { fake_print_generating_skeleton(data->setting, data->main->message); @@ -77,12 +77,12 @@ extern "C" { for (uint8_t i = 0; i < 24; ++i) { - status = fake_skeleton_operate_directory_create(data, path[i]); + fake_skeleton_operate_directory_create(data, path[i]); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_skeleton_operate_directory_create)); - return status; + return; } } // for @@ -91,135 +91,136 @@ extern "C" { } } - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_data_build_defines, F_false, fake_make_skeleton_content_defines_s); - } + fake_skeleton_operate_file_create(data, data->file_data_build_defines, F_false, fake_make_skeleton_content_defines_s); + if (F_status_is_error(data->setting->state.status)) return; - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_data_build_dependencies, F_false, fake_make_skeleton_content_dependencies_s); - } + fake_skeleton_operate_file_create(data, data->file_data_build_dependencies, F_false, fake_make_skeleton_content_dependencies_s); + if (F_status_is_error(data->setting->state.status)) return; - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_data_build_process_post, F_true, fake_make_skeleton_content_process_post_s); - } + fake_skeleton_operate_file_create(data, data->file_data_build_process_post, F_true, fake_make_skeleton_content_process_post_s); + if (F_status_is_error(data->setting->state.status)) return; - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_data_build_process_pre, F_true, fake_make_skeleton_content_process_pre_s); - } + fake_skeleton_operate_file_create(data, data->file_data_build_process_pre, F_true, fake_make_skeleton_content_process_pre_s); + if (F_status_is_error(data->setting->state.status)) return; - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_data_build_settings, F_false, fake_make_skeleton_content_settings_s); - } - - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_documents_readme, F_false, f_string_empty_s); - } + fake_skeleton_operate_file_create(data, data->file_data_build_settings, F_false, fake_make_skeleton_content_settings_s); + if (F_status_is_error(data->setting->state.status)) return; - if (F_status_is_error_not(status)) { - status = fake_skeleton_operate_file_create(data, data->file_data_build_fakefile, F_false, fake_make_skeleton_content_fakefile_s); - } + fake_skeleton_operate_file_create(data, data->file_documents_readme, F_false, f_string_empty_s); + if (F_status_is_error(data->setting->state.status)) return; - if (F_status_is_error(status)) return status; + fake_skeleton_operate_file_create(data, data->file_data_build_fakefile, F_false, fake_make_skeleton_content_fakefile_s); + if (F_status_is_error(data->setting->state.status)) return; - return F_none; + data->setting->state.status = F_none; } #endif // _di_fake_skeleton_operate_ #ifndef _di_fake_skeleton_operate_directory_create_ - f_status_t fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path) { + void fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path) { - if (!path.used) return F_none; + if (!data || !data->main || !data->setting) return; + if (!path.used) return; - f_status_t status = f_directory_exists(path); + data->setting->state.status = f_directory_exists(path); - if (status == F_true) { + if (data->setting->state.status == F_true) { fake_print_verbose_directory_exists(data->setting, data->main->message, path); - return F_none; + data->setting->state.status = F_none; + + return; } - if (status == F_false) { + if (data->setting->state.status == F_false) { fake_print_warning_path_exists_not_directory(data->setting, data->main->warning, path); - return F_status_set_warning(F_failure); + data->setting->state.status = F_status_set_warning(F_failure); + + return; } - if (status == F_file_found_not) { - status = f_directory_create(path, F_file_mode_all_rwx_d); + if (data->setting->state.status == F_file_found_not) { + data->setting->state.status = f_directory_create(path, F_file_mode_all_rwx_d); - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_is_error(data->setting->state.status)) { + if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { fake_print_error_directory_create_parent_missing(data->setting, data->main->error, path); } else { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_create), path, f_file_operation_create_s, fll_error_file_type_directory_e); } - return status; + return; } fake_print_verbose_create_directory(data->setting, data->main->message, path); } - else if (F_status_is_error(status)) { + else if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_exists), path, f_file_operation_create_s, fll_error_file_type_directory_e); - return status; + return; } - return F_none; + data->setting->state.status = F_none; } #endif // _di_fake_skeleton_operate_directory_create_ #ifndef _di_fake_skeleton_operate_file_create_ - f_status_t fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content) { - - f_status_t status = F_none; + void fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content) { - if (!path.used) return F_none; + if (!data || !data->main || !data->setting) return; + if (!path.used) return; - status = f_file_is(path, F_file_type_regular_d, F_false); + data->setting->state.status = f_file_is(path, F_file_type_regular_d, F_false); - if (status == F_true) { + if (data->setting->state.status == F_true) { fake_print_verbose_file_exists(data->setting, data->main->message, path); - return F_none; + data->setting->state.status = F_none; + + return; } // symbolic links might also be fine. - if (status == F_false) { - status = f_file_is(path, F_file_type_link_d, F_false); + if (data->setting->state.status == F_false) { + data->setting->state.status = f_file_is(path, F_file_type_link_d, F_false); - if (status == F_true) { + if (data->setting->state.status == F_true) { fake_print_verbose_file_exists_as_link(data->setting, data->main->message, path); - return F_none; + data->setting->state.status = F_none; + + return; } } - if (status == F_false) { + if (data->setting->state.status == F_false) { fake_print_verbose_file_exists_not_regular_or_link(data->setting, data->main->message, path); - return F_status_set_warning(F_none); + data->setting->state.status = F_status_set_warning(F_none); + + return; } - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { mode_t mode = F_file_mode_all_rw_d; if (executable) { mode = F_file_mode_all_rwx_d; } - status = f_file_create(path, mode, F_true); + data->setting->state.status = f_file_create(path, mode, F_true); - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_is_error(data->setting->state.status)) { + if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { fake_print_error_file_create_parent_missing(data->setting, data->main->error, path); } else { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_create), path, f_file_operation_create_s, fll_error_file_type_file_e); } - return status; + return; } fake_print_verbose_create_file(data->setting, data->main->message, path); @@ -230,23 +231,23 @@ extern "C" { file.flag = F_file_flag_append_wo_d; file.size_write = content.used; - status = f_file_open(path, 0, &file); + data->setting->state.status = f_file_open(path, 0, &file); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_open), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); - return status; + return; } - status = f_file_write(file, content, 0); + data->setting->state.status = f_file_write(file, content, 0); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_write), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); f_file_stream_flush(file); f_file_stream_close(&file); - return status; + return; } fake_print_verbose_file_pre_populated(data->setting, data->main->message, path); @@ -255,13 +256,13 @@ extern "C" { f_file_stream_close(&file); } } - else if (F_status_is_error(status)) { + else if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_is), path, f_file_operation_create_s, fll_error_file_type_file_e); - return status; + return; } - return F_none; + data->setting->state.status = F_none; } #endif // _di_fake_skeleton_operate_file_create_ diff --git a/level_3/fake/c/main/skeleton.h b/level_3/fake/c/main/skeleton.h index 16b4356..46af9f1 100644 --- a/level_3/fake/c/main/skeleton.h +++ b/level_3/fake/c/main/skeleton.h @@ -22,12 +22,12 @@ extern "C" { * @param data * The program data. * - * @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 receiving a terminate process signal, such as an interrupt signal. * - * Status codes (with error bit) are returned on any problem. + * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_ extern void fake_skeleton_operate(fake_data_t * const data); @@ -38,14 +38,14 @@ extern "C" { * * @param data * The program data. - * @param path - * The file path for the directory to create. * - * @return - * F_none on success. + * This alters data.setting.state.status: + * F_none on success. * - * Status codes (with warning bit) are returned on certain problems that can be ignored. - * Status codes (with error bit) are returned on any problem. + * Status codes (with warning bit) are returned on certain problems that can be ignored. + * Status codes (with error bit) are returned on any problem. + * @param path + * The file path for the directory to create. */ #ifndef _di_fake_skeleton_operate_directory_create_ extern void fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path); @@ -56,6 +56,12 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with warning bit) are returned on certain problems that can be ignored. + * Status codes (with error bit) are returned on any problem. * @param path * The file path for the directory to create. * @param executable @@ -63,12 +69,6 @@ extern "C" { * Set to FALSE to not make the file executable. * @param content * When creating a new file, write the content specified by this string to that file. - * - * @return - * F_none on success. - * - * Status codes (with warning bit) are returned on certain problems that can be ignored. - * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_file_create_ extern void fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content); -- 1.8.3.1