From 18b50d4d526ed37c912a6feb0a5a91034a9841e0 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 2 Apr 2023 15:34:44 -0500 Subject: [PATCH] Progress: Continue program related work, focusing on Featureless Make. The Featureless Make is not handling the return status correctly on error. This is due to a regression from switching to having status on state. There are a couple of separate reasons: 1) One function is not doing the pre-check for error and then overrides the status. 2) Other functions that handle the error printing are calling f_fss_count_lines() which overrides the state. The first situation is easily solved with a condition check. The second case requires saving the status and then restoring it for error handling functions calling f_fss_count_lines(). Change the code were reasonably possible to use const on the return code. Don't bother with return_code != 0, as removing the != 0 should be effectively the same check. Make sure path separator is only added if it is not already present. The migration of status into main.setting.state.status incorrectly changed fake_make_operate_validate_define_name(). This function does not set the status on main.setting.state.status. Make sure a single white space is after simple variable print messages (before the quoted variable). Remove the extra arguments being created (just as is done in 0.6.x with commit e8998b2e7976cee50c8e0db55ed19e2137d7aa12). Reduce the number of pointer accesses (such data->main->... into main->...) by using a variable. This costs some memory but should reduce having to navigate two pointers constantly. Doing it this way also avoids having to add a parameter to each function. --- level_3/fake/c/main/build.c | 452 ++++----- level_3/fake/c/main/build.h | 1 + level_3/fake/c/main/build/library.c | 178 ++-- level_3/fake/c/main/build/load.c | 244 ++--- level_3/fake/c/main/build/object.c | 78 +- level_3/fake/c/main/build/objects.c | 116 +-- level_3/fake/c/main/build/program.c | 84 +- level_3/fake/c/main/build/skeleton.c | 60 +- level_3/fake/c/main/clean.c | 24 +- level_3/fake/c/main/fake.c | 180 ++-- level_3/fake/c/main/fake/path_generate.c | 70 +- level_3/fake/c/main/make.c | 94 +- level_3/fake/c/main/make/load_fakefile.c | 4 +- level_3/fake/c/main/make/load_parameters.c | 254 ++--- level_3/fake/c/main/make/operate.c | 594 ++++++------ 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 | 1068 ++++++++++++---------- level_3/fake/c/main/make/operate_validate.c | 2 +- level_3/fake/c/main/make/operate_validate.h | 2 +- level_3/fake/c/main/make/operate_validate_type.c | 790 ++++++++-------- level_3/fake/c/main/make/print/verbose.c | 12 +- level_3/fake/c/main/print/error.c | 9 + level_3/fake/c/main/skeleton.c | 136 +-- 24 files changed, 2385 insertions(+), 2175 deletions(-) diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index c8a8262..8d767ac 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -10,6 +10,8 @@ extern "C" { if (!data || !data->main || !data_build) return; if (F_status_is_error(data->main->setting.state.status)) return; + fake_main_t * const main = data->main; + { f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s.used + data->path_build_libraries_shared.used; @@ -42,12 +44,12 @@ extern "C" { if (!values[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } // for } - if (data->main->setting.work.used) { + if (main->setting.work.used) { f_string_static_t buffer = f_string_static_t_initialize; { @@ -60,8 +62,8 @@ extern "C" { memcpy(buffer_string, fake_build_parameter_library_include_s.string, sizeof(f_char_t) * fake_build_parameter_library_include_s.used); memcpy(buffer_string + fake_build_parameter_library_include_s.used, data->path_work_includes.string, sizeof(f_char_t) * data->path_work_includes.used); - data->main->setting.state.status = fll_execute_arguments_add(buffer, &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(buffer, &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } if (data_build->setting.search_shared && (is_shared || !data_build->setting.search_exclusive)) { @@ -74,8 +76,8 @@ extern "C" { memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used); memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, data->path_work_libraries_shared.string, sizeof(f_char_t) * data->path_work_libraries_shared.used); - data->main->setting.state.status = fll_execute_arguments_add(buffer, &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(buffer, &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } if (data_build->setting.search_static && (!is_shared || !data_build->setting.search_exclusive)) { @@ -88,8 +90,8 @@ extern "C" { memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used); memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, data->path_work_libraries_static.string, sizeof(f_char_t) * data->path_work_libraries_static.used); - data->main->setting.state.status = fll_execute_arguments_add(buffer, &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(buffer, &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } } @@ -134,7 +136,7 @@ extern "C" { : (is_shared) ? &data_build->setting.defines_program_shared : &data_build->setting.defines_program_static, - &data->main->setting.defines, + &main->setting.defines, }; f_array_length_t i = 0; @@ -145,13 +147,13 @@ extern "C" { if (!strings[s]->array[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(strings[s]->array[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(strings[s]->array[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } // for } // for } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_build_arguments_standard_add_ @@ -162,11 +164,13 @@ extern "C" { if (data->main->setting.state.status == F_child) return; if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; + + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -178,14 +182,14 @@ extern "C" { f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize; f_string_static_t buffer = f_string_static_t_initialize; - if (data->main->program.message.verbosity != f_console_verbosity_quiet_e && data->main->program.message.verbosity != f_console_verbosity_error_e) { - fll_print_format("%r%[Copying %Q.%]%r", data->main->program.message.to, f_string_eol_s, data->main->program.context.set.important, label, data->main->program.context.set.important, f_string_eol_s); + if (main->program.message.verbosity != f_console_verbosity_quiet_e && main->program.message.verbosity != f_console_verbosity_error_e) { + fll_print_format("%r%[Copying %Q.%]%r", main->program.message.to, f_string_eol_s, main->program.context.set.important, label, main->program.context.set.important, f_string_eol_s); } - data->main->setting.state.status = f_string_dynamic_resize(source.used, &path_source); + main->setting.state.status = f_string_dynamic_resize(source.used, &path_source); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_resize)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize)); f_string_dynamic_resize(0, &path_source); @@ -203,90 +207,90 @@ extern "C" { for (f_array_length_t i = 0; i < files.used; ++i) { - if (!((++data->main->program.signal_check) % fake_signal_check_short_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + if (!((++main->program.signal_check) % fake_signal_check_short_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); break; } - data->main->program.signal_check = 0; + main->program.signal_check = 0; } if (!files.array[i].used) continue; path_source.used = source.used; - data->main->setting.state.status = f_string_dynamic_append_nulless(files.array[i], &path_source); + main->setting.state.status = f_string_dynamic_append_nulless(files.array[i], &path_source); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } - data->main->setting.state.status = f_directory_is(path_source); + main->setting.state.status = f_directory_is(path_source); - if (data->main->setting.state.status == F_true) { + if (main->setting.state.status == F_true) { destination_directory.used = 0; - data->main->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_directory); + main->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_directory); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } - data->main->setting.state.status = f_file_name_base(path_source, &destination_directory); + main->setting.state.status = f_file_name_base(path_source, &destination_directory); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_base)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_base)); break; } fl_directory_copy(path_source, destination_directory, &recurse); - if (F_status_is_error(data->main->setting.state.status)) { - if (data->main->program.error.verbosity >= f_console_verbosity_verbose_e) { + if (F_status_is_error(main->setting.state.status)) { + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { /* // @fixme for (f_array_length_t j = 0; j < failures.used; ++j) { - fake_print_error_build_operation_file(&data->main->program.error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); + fake_print_error_build_operation_file(&main->program.error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } // for */ - if (F_status_set_fine(data->main->setting.state.status) != F_failure) { - fake_print_error(&data->main->program.error, macro_fake_f(fl_directory_copy)); + if (F_status_set_fine(main->setting.state.status) != F_failure) { + fake_print_error(&main->program.error, macro_fake_f(fl_directory_copy)); } } - else if (data->main->program.error.verbosity > f_console_verbosity_quiet_e) { - fake_print_error_build_operation_file(&data->main->program.error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); + else if (main->program.error.verbosity > f_console_verbosity_quiet_e) { + fake_print_error_build_operation_file(&main->program.error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } break; } } - else if (data->main->setting.state.status == F_false) { + else if (main->setting.state.status == F_false) { destination_file.used = 0; destination_directory.used = 0; - data->main->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_file); + main->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } if (perserve_offset && perserve_offset < path_source.used) { - data->main->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_directory); + main->setting.state.status = f_string_dynamic_append_nulless(destination, &destination_directory); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -294,57 +298,57 @@ extern "C" { buffer.string = path_source.string + perserve_offset; buffer.used = path_source.used - perserve_offset; - data->main->setting.state.status = f_file_name_directory(buffer, &destination_directory); + main->setting.state.status = f_file_name_directory(buffer, &destination_directory); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_directory)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory)); break; } - data->main->setting.state.status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d); + main->setting.state.status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e); break; } - data->main->setting.state.status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file); + main->setting.state.status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_append)); break; } } else { - data->main->setting.state.status = f_file_name_base(path_source, &destination_file); + main->setting.state.status = f_file_name_base(path_source, &destination_file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_base)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_base)); break; } } - data->main->setting.state.status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, f_file_stat_flag_reference_e); + main->setting.state.status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, f_file_stat_flag_reference_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_build_operation_file(&data->main->program.error, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_build_operation_file(&main->program.error, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); break; } - fake_build_print_verbose_copied_file(&data->main->program.message, path_source, destination_file); + fake_build_print_verbose_copied_file(&main->program.message, path_source, destination_file); } - else if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e); + else if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e); break; } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } // for f_directory_recurse_copy_delete(&recurse); @@ -365,69 +369,71 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!process_script.used) return 0; - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_main_t * const main = data->main; + + fake_string_dynamics_reset(&main->cache_arguments); - data->main->setting.state.status = fll_execute_arguments_add(fake_other_operation_build_s, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add(fake_other_operation_build_s, &main->cache_arguments); // Ensure console color mode is passed to the scripts so that they can also react to color mode. - if (F_status_is_error_not(data->main->setting.state.status) && data->main->program.context.mode != f_color_mode_none_e) { - fake_string_dynamic_reset(&data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status) && main->program.context.mode != f_color_mode_none_e) { + fake_string_dynamic_reset(&main->cache_argument); - data->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - if (data->main->program.context.mode == f_color_mode_dark_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_dark_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + if (main->program.context.mode == f_color_mode_dark_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_dark_s, &main->cache_argument); } - else if (data->main->program.context.mode == f_color_mode_light_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_light_s, &data->main->cache_argument); + else if (main->program.context.mode == f_color_mode_light_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_light_s, &main->cache_argument); } - else if (data->main->program.context.mode == f_color_mode_not_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_no_color_s, &data->main->cache_argument); + else if (main->program.context.mode == f_color_mode_not_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_no_color_s, &main->cache_argument); } } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); return 0; } - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_argument, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add(main->cache_argument, &main->cache_arguments); } // Ensure verbosity level is passed to the scripts so that they can also react to requested verbosity. - if (F_status_is_error_not(data->main->setting.state.status) && data->main->program.error.verbosity != f_console_verbosity_normal_e) { - fake_string_dynamic_reset(&data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status) && main->program.error.verbosity != f_console_verbosity_normal_e) { + fake_string_dynamic_reset(&main->cache_argument); - data->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - if (data->main->program.context.mode == f_console_verbosity_quiet_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_quiet_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + if (main->program.context.mode == f_console_verbosity_quiet_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_quiet_s, &main->cache_argument); } - else if (data->main->program.context.mode == f_console_verbosity_error_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_error_s, &data->main->cache_argument); + else if (main->program.context.mode == f_console_verbosity_error_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_error_s, &main->cache_argument); } - else if (data->main->program.context.mode == f_console_verbosity_verbose_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_verbose_s, &data->main->cache_argument); + else if (main->program.context.mode == f_console_verbosity_verbose_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_verbose_s, &main->cache_argument); } - else if (data->main->program.context.mode == f_console_verbosity_debug_e) { - data->main->setting.state.status = f_string_dynamic_append(f_console_standard_short_debug_s, &data->main->cache_argument); + else if (main->program.context.mode == f_console_verbosity_debug_e) { + main->setting.state.status = f_string_dynamic_append(f_console_standard_short_debug_s, &main->cache_argument); } } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); return 0; } - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_argument, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add(main->cache_argument, &main->cache_arguments); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add)); return 0; } @@ -435,15 +441,15 @@ extern "C" { { f_string_dynamic_t defines = f_string_dynamic_t_initialize; - if (data->main->setting.defines.used) { - for (f_array_length_t i = 0; i < data->main->setting.defines.used; ++i) { + if (main->setting.defines.used) { + for (f_array_length_t i = 0; i < main->setting.defines.used; ++i) { - data->main->setting.state.status = f_string_dynamic_mash(f_string_space_s, data->main->setting.defines.array[i], &defines); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = f_string_dynamic_mash(f_string_space_s, main->setting.defines.array[i], &defines); + if (F_status_is_error(main->setting.state.status)) break; } // for - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_mash)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_mash)); f_string_dynamic_resize(0, &defines); @@ -476,40 +482,40 @@ extern "C" { }; const f_string_static_t values[] = { - data->main->setting.build, - data->main->setting.data, + main->setting.build, + main->setting.data, defines, - data->main->setting.documents, - data->main->setting.licenses, - data->main->setting.process, - data->main->setting.settings, + main->setting.documents, + main->setting.licenses, + main->setting.process, + main->setting.settings, data_build->setting.path_sources, - data->main->setting.work, + main->setting.work, }; - data->main->setting.state.status = fll_execute_arguments_add_parameter_set(prefixs, names, values, 9, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add_parameter_set(prefixs, names, values, 9, &main->cache_arguments); f_string_dynamic_resize(0, &defines); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add_parameter_set)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add_parameter_set)); return 0; } } - fake_string_dynamic_reset(&data->main->cache_argument); + fake_string_dynamic_reset(&main->cache_argument); if (process_script.string[0] != f_path_separator_s.string[0]) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_data_build, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_data_build, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(process_script, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(process_script, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } @@ -523,20 +529,20 @@ extern "C" { fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(FL_execute_parameter_option_path_d, 0, &data_build->environment, &signals, 0); - data->main->setting.state.status = fll_execute_program(data->main->cache_argument, data->main->cache_arguments, ¶meter, 0, (void *) &return_code); + main->setting.state.status = fll_execute_program(main->cache_argument, main->cache_arguments, ¶meter, 0, (void *) &return_code); - if (!((++data->main->program.signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + if (!((++main->program.signal_check) % fake_signal_check_d) && fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); } - else if (data->main->setting.state.status != F_child) { - if (F_status_is_error(data->main->setting.state.status)) { - if (F_status_set_fine(data->main->setting.state.status) == F_failure) { - fake_print_error_failure_script(&data->main->program.error, data->main->cache_argument); + else if (main->setting.state.status != F_child) { + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_failure) { + fake_print_error_failure_script(&main->program.error, main->cache_argument); } else { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_program)); + fake_print_error(&main->program.error, macro_fake_f(fll_execute_program)); } } else { @@ -552,16 +558,19 @@ extern "C" { 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 || !data->main) return; + if (F_status_is_error(data->main->setting.state.status)) return; + + fake_main_t * const main = data->main; name->used = 0; - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; if (!path.used) return; - data->main->setting.state.status = f_file_name_base(path, name); + main->setting.state.status = f_file_name_base(path, name); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_base)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_base)); return; } @@ -575,7 +584,7 @@ extern "C" { } } // for - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_build_get_file_name_without_extension_ @@ -584,6 +593,8 @@ extern "C" { if (!data || !data->main || !data_build || !path || !generic || !specific) return; + fake_main_t * const main = data->main; + f_array_length_t i = 0; f_array_length_t j = 0; @@ -609,12 +620,12 @@ extern "C" { memcpy(source_string, path->string, sizeof(f_char_t) * path->used); memcpy(source_string + path->used, sources[i]->array[j].string, sizeof(f_char_t) * sources[i]->array[j].used); - data->main->setting.state.status = fll_execute_arguments_add(source, &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(source, &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } // for } // for - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_build_objects_add_ @@ -623,29 +634,31 @@ extern "C" { if (!data || !data->main) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; + + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; f_mode_t mode = f_mode_t_initialize; fake_build_data_t data_build = fake_build_data_t_initialize; fake_build_stage_t stage = fake_build_stage_t_initialize; - macro_f_mode_t_set_default_umask(mode, data->main->program.umask); + macro_f_mode_t_set_default_umask(mode, main->program.umask); fake_build_load_setting(data, build_arguments, process_pipe, &data_build.setting); - if (F_status_is_fine(data->main->setting.state.status)) { - fake_print_message_building(&data->main->program.message, build_arguments, &data_build.setting); + if (F_status_is_fine(main->setting.state.status)) { + fake_print_message_building(&main->program.message, build_arguments, &data_build.setting); } fake_build_load_stage(data, build_arguments && build_arguments->array[0].used ? build_arguments->array[0] : f_string_empty_s, &stage); @@ -654,7 +667,7 @@ extern "C" { fake_build_skeleton(data, &data_build, mode.directory, stage.file_skeleton); - data->main->program.child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre); + main->program.child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre); fake_build_copy(data, mode, fake_build_documentation_files_s, data->path_data_documentation, data->path_build_documentation, data_build.setting.build_sources_documentation, stage.file_sources_documentation, 0); @@ -668,77 +681,77 @@ extern "C" { fake_build_program_script(data, &data_build, mode, stage.file_program_script); if (data_build.setting.build_script) { - fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &data->main->cache_argument); + fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_path_part_script_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_path_part_script_s, &main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); } } - fake_build_copy(data, mode, fake_build_scripts_s, data->main->cache_argument, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0); + fake_build_copy(data, mode, fake_build_scripts_s, main->cache_argument, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0); } } else { if (data_build.setting.build_sources_headers.used) { - fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &data->main->cache_argument); + fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - fake_string_dynamic_reset(&data->main->cache_1); + if (F_status_is_error_not(main->setting.state.status)) { + fake_string_dynamic_reset(&main->cache_1); - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_includes, &data->main->cache_1); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_includes, &main->cache_1); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build.setting.path_headers, &data->main->cache_1); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build.setting.path_headers, &main->cache_1); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); } } } - fake_build_copy(data, mode, fake_build_header_files_s, data->main->cache_argument, data->main->cache_1, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.preserve_path_headers ? data->main->cache_argument.used : 0); + fake_build_copy(data, mode, fake_build_header_files_s, main->cache_argument, main->cache_1, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.preserve_path_headers ? main->cache_argument.used : 0); if (data_build.setting.build_shared) { - fake_build_copy(data, mode, fake_build_header_files_shared_s, data->main->cache_argument, data->main->cache_1, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.preserve_path_headers ? data->main->cache_argument.used : 0); + fake_build_copy(data, mode, fake_build_header_files_shared_s, main->cache_argument, main->cache_1, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.preserve_path_headers ? main->cache_argument.used : 0); } if (data_build.setting.build_static) { - fake_build_copy(data, mode, fake_build_header_files_static_s, data->main->cache_argument, data->main->cache_1, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.preserve_path_headers ? data->main->cache_argument.used : 0); + fake_build_copy(data, mode, fake_build_header_files_static_s, main->cache_argument, main->cache_1, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.preserve_path_headers ? main->cache_argument.used : 0); } } if (data_build.setting.build_shared) { - data->main->program.child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared); + main->program.child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared); - data->main->program.child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared); + main->program.child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared); - data->main->program.child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared); + main->program.child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared); } if (data_build.setting.build_static) { - data->main->program.child = fake_build_object_static(data, &data_build, mode, stage.file_object_static); + main->program.child = fake_build_object_static(data, &data_build, mode, stage.file_object_static); - data->main->program.child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static); + main->program.child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static); - data->main->program.child = fake_build_library_static(data, &data_build, mode, stage.file_library_static); + main->program.child = fake_build_library_static(data, &data_build, mode, stage.file_library_static); - data->main->program.child = fake_build_program_static(data, &data_build, mode, stage.file_program_static); + main->program.child = fake_build_program_static(data, &data_build, mode, stage.file_program_static); } if (data_build.setting.build_script) { - fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &data->main->cache_argument); + fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_path_part_script_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_path_part_script_s, &main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); } else { - fake_build_copy(data, mode, fake_build_scripts_s, data->main->cache_argument, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0); + fake_build_copy(data, mode, fake_build_scripts_s, main->cache_argument, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0); } } } @@ -755,29 +768,32 @@ extern "C" { 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_dynamic_t * const source) { if (!data || !data->main || !data_build || !setting_path_source || !source) return; + if (F_status_is_error(data->main->setting.state.status)) return; + + fake_main_t * const main = data->main; fake_string_dynamic_reset(source); - data->main->setting.state.status = f_string_dynamic_append_nulless(*setting_path_source, source); + main->setting.state.status = f_string_dynamic_append_nulless(*setting_path_source, source); - if (F_status_is_error_not(data->main->setting.state.status) && data_build->setting.has_path_standard) { + if (F_status_is_error_not(main->setting.state.status) && data_build->setting.has_path_standard) { if (data_build->setting.build_language == fake_build_language_c_e) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_c_s, source); + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_c_s, source); } else if (data_build->setting.build_language == fake_build_language_cpp_e) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_cpp_s, source); + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_cpp_s, source); } else if (data_build->setting.build_language == fake_build_language_bash_e) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_bash_s, source); + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_language_bash_s, source); } } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(f_path_separator_s, source); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, source); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); } } #endif // _di_fake_build_path_source_string_ @@ -787,6 +803,8 @@ extern "C" { if (!data || !data->main || !data_build || !generic || !specific) return; + fake_main_t * const main = data->main; + f_array_length_t i = 0; f_array_length_t j = 0; @@ -801,23 +819,23 @@ extern "C" { if (!sources[i]->array[j].used) continue; - fake_build_path_source_string(data, data_build, &data_build->setting.path_sources, &data->main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) return; + fake_build_path_source_string(data, data_build, &data_build->setting.path_sources, &main->cache_argument); + if (F_status_is_error(main->setting.state.status)) return; - data->main->setting.state.status = f_string_dynamic_append_nulless(sources[i]->array[j], &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(sources[i]->array[j], &main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_argument, &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(main->cache_argument, &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; } // for } // for - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_build_sources_add_ @@ -832,21 +850,23 @@ extern "C" { return; } - fake_build_path_source_string(data, data_build, &data_build->setting.path_sources_object, &data->main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) return; + fake_main_t * const main = data->main; - data->main->setting.state.status = f_string_dynamic_append_nulless(specific->used ? *specific : *generic, &data->main->cache_argument); + fake_build_path_source_string(data, data_build, &data_build->setting.path_sources_object, &main->cache_argument); + if (F_status_is_error(main->setting.state.status)) return; - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + main->setting.state.status = f_string_dynamic_append_nulless(specific->used ? *specific : *generic, &main->cache_argument); + + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_argument, &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) return; + main->setting.state.status = fll_execute_arguments_add(main->cache_argument, &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) return; - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_build_sources_object_add_ @@ -856,11 +876,13 @@ extern "C" { if (!data || !data->main) return; if (F_status_is_error(data->main->setting.state.status)) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; - data->main->setting.state.status = F_status_set_error(F_interrupt); + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -868,15 +890,15 @@ extern "C" { f_mode_t mode = f_mode_t_initialize; - macro_f_mode_t_set_default_umask(mode, data->main->program.umask); + macro_f_mode_t_set_default_umask(mode, main->program.umask); - data->main->setting.state.status = f_file_touch(file, mode.regular, F_false); + main->setting.state.status = f_file_touch(file, mode.regular, F_false); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e); } else { - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_build_touch_ diff --git a/level_3/fake/c/main/build.h b/level_3/fake/c/main/build.h index 3de34c3..b579f88 100644 --- a/level_3/fake/c/main/build.h +++ b/level_3/fake/c/main/build.h @@ -270,6 +270,7 @@ extern "C" { * The source string to append the build path source to. * This gets reset by fake_string_dynamics_reset(). * + * @see f_string_dynamic_append_assure() * @see f_string_dynamic_append_nulless() * * @see fake_string_dynamics_reset() diff --git a/level_3/fake/c/main/build/library.c b/level_3/fake/c/main/build/library.c index 137b630..bb26111 100644 --- a/level_3/fake/c/main/build/library.c +++ b/level_3/fake/c/main/build/library.c @@ -25,22 +25,24 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0; - fake_build_print_compile_library_shared(&data->main->program.message); + fake_main_t * const main = data->main; - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_build_print_compile_library_shared(&main->program.message); + + fake_string_dynamics_reset(&main->cache_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); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_objects_add)); return 0; } fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_sources_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_add)); return 0; } @@ -286,14 +288,14 @@ extern "C" { if (!values[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_library_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add)); return 0; } @@ -302,8 +304,8 @@ extern "C" { { const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); - if (F_status_is_error(data->main->setting.state.status)) return 0; - if (data->main->setting.state.status == F_child) return result; + if (F_status_is_error(main->setting.state.status)) return 0; + if (main->setting.state.status == F_child) return result; } if (parameter_file_name_major.used) { @@ -317,19 +319,19 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name.string, sizeof(f_char_t) * parameter_file_name.used); - data->main->setting.state.status = f_file_link(parameter_file_name_major, parameter_file_path); + main->setting.state.status = f_file_link(parameter_file_name_major, parameter_file_path); - if (F_status_is_error_not(data->main->setting.state.status)) { - fake_build_print_verbose_linked_file(&data->main->program.message, parameter_file_path, parameter_file_name_major); + if (F_status_is_error_not(main->setting.state.status)) { + fake_build_print_verbose_linked_file(&main->program.message, parameter_file_path, parameter_file_name_major); } else { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_set_fine(main->setting.state.status) == F_file_found) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -348,13 +350,13 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_major.string, sizeof(f_char_t) * parameter_file_name_major.used); - data->main->setting.state.status = f_file_link(parameter_file_name_minor, parameter_file_path); + main->setting.state.status = f_file_link(parameter_file_name_minor, parameter_file_path); - if (F_status_is_error_not(data->main->setting.state.status)) { - fake_build_print_verbose_linked_file(&data->main->program.message, parameter_file_path, parameter_file_name_minor); + if (F_status_is_error_not(main->setting.state.status)) { + fake_build_print_verbose_linked_file(&main->program.message, parameter_file_path, parameter_file_name_minor); } else { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), F_status_set_fine(data->main->setting.state.status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), F_status_set_fine(main->setting.state.status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -371,19 +373,19 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_minor.string, sizeof(f_char_t) * parameter_file_name_minor.used); - data->main->setting.state.status = f_file_link(parameter_file_name_micro, parameter_file_path); + main->setting.state.status = f_file_link(parameter_file_name_micro, parameter_file_path); - if (F_status_is_error_not(data->main->setting.state.status)) { - fake_build_print_verbose_linked_file(&data->main->program.message, parameter_file_path, parameter_file_name_micro); + if (F_status_is_error_not(main->setting.state.status)) { + fake_build_print_verbose_linked_file(&main->program.message, parameter_file_path, parameter_file_name_micro); } else { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_set_fine(main->setting.state.status) == F_file_found) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -399,19 +401,19 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_micro.string, sizeof(f_char_t) * parameter_file_name_micro.used); - data->main->setting.state.status = f_file_link(parameter_file_name_nano, parameter_file_path); + main->setting.state.status = f_file_link(parameter_file_name_nano, parameter_file_path); - if (F_status_is_error_not(data->main->setting.state.status)) { - fake_build_print_verbose_linked_file(&data->main->program.message, parameter_file_path, parameter_file_name_nano); + if (F_status_is_error_not(main->setting.state.status)) { + fake_build_print_verbose_linked_file(&main->program.message, parameter_file_path, parameter_file_name_nano); } else { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_set_fine(main->setting.state.status) == F_file_found) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_link), parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -433,11 +435,13 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0; - fake_build_print_compile_library_static(&data->main->program.message); + fake_main_t * const main = data->main; + + fake_build_print_compile_library_static(&main->program.message); - fake_string_dynamic_reset(&data->main->cache_1); - fake_string_dynamic_reset(&data->main->cache_2); - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_string_dynamic_reset(&main->cache_1); + fake_string_dynamic_reset(&main->cache_2); + fake_string_dynamics_reset(&main->cache_arguments); f_array_length_t i = 0; @@ -445,34 +449,34 @@ extern "C" { if (!data_build->setting.build_indexer_arguments.array[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(data_build->setting.build_indexer_arguments.array[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(data_build->setting.build_indexer_arguments.array[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_libraries_static, &data->main->cache_2); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_libraries_static, &main->cache_2); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_name_prefix_s, &data->main->cache_2); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_name_prefix_s, &main->cache_2); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &data->main->cache_2); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &main->cache_2); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_name_suffix_static_s, &data->main->cache_2); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_name_suffix_static_s, &main->cache_2); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); } else { - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_2, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add(main->cache_2, &main->cache_arguments); } } - if (F_status_is_error_not(data->main->setting.state.status)) { + if (F_status_is_error_not(main->setting.state.status)) { f_array_length_t j = 0; const f_string_dynamics_t *sources[2] = { @@ -484,75 +488,75 @@ extern "C" { for (j = 0; j < sources[i]->used; ++j) { - fake_string_dynamic_reset(&data->main->cache_2); + fake_string_dynamic_reset(&main->cache_2); - fake_build_get_file_name_without_extension(data, sources[i]->array[j], &data->main->cache_1); + fake_build_get_file_name_without_extension(data, sources[i]->array[j], &main->cache_1); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_get_file_name_without_extension)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_get_file_name_without_extension)); break; } - data->main->setting.state.status = f_file_name_directory(sources[i]->array[j], &data->main->cache_2); + main->setting.state.status = f_file_name_directory(sources[i]->array[j], &main->cache_2); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_directory)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory)); break; } - fake_string_dynamic_reset(&data->main->cache_argument); + fake_string_dynamic_reset(&main->cache_argument); - if (data->main->cache_2.used) { - data->main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects, &data->main->cache_2); + if (main->cache_2.used) { + main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects, &main->cache_2); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_prepend)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_prepend)); break; } - data->main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &data->main->cache_2); + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_2); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_assure)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure)); break; } - data->main->setting.state.status = f_string_dynamic_append_nulless(data->main->cache_2, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->main->cache_1, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_1, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument); } } else { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->main->cache_1, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_1, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument); } } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_argument, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add(main->cache_argument, &main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add)); break; } @@ -560,13 +564,11 @@ extern "C" { } // for } - int result = data->main->program.child; - - if (F_status_is_error_not(data->main->setting.state.status)) { - result = fake_execute(data, data_build->environment, data_build->setting.build_indexer); - } + const int result = F_status_is_error(main->setting.state.status) + ? main->program.child + : fake_execute(data, data_build->environment, data_build->setting.build_indexer); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status != F_child) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) { fake_build_touch(data, file_stage); } diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index 4f7fcb2..19e9eef 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -10,6 +10,8 @@ extern "C" { if (!data || !data->main || !data_build || !environment) return; if (F_status_is_error(data->main->setting.state.status)) return; + fake_main_t * const main = data->main; + // Reset the environment. for (f_array_length_t i = 0; i < environment->used; ++i) { @@ -28,10 +30,10 @@ extern "C" { for (uint8_t i = 0; i < 2; ++i) { - data->main->setting.state.status = fl_environment_load_name(variables[i], environment); + main->setting.state.status = fl_environment_load_name(variables[i], environment); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fl_environment_load_name)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fl_environment_load_name)); return; } @@ -40,21 +42,21 @@ extern "C" { if (environment->used + data_build->setting.environment.used > environment->size) { if (environment->used + data_build->setting.environment.used > f_environment_max_length_d) { - fake_build_print_error_setting_value_too_long(&data->main->program.error, fake_build_setting_name_environment_s, data->file_data_build_settings); + fake_build_print_error_setting_value_too_long(&main->program.error, fake_build_setting_name_environment_s, data->file_data_build_settings); - data->main->setting.state.status = F_status_set_error(F_array_too_large); + main->setting.state.status = F_status_set_error(F_array_too_large); return; } } - data->main->setting.state.status = fl_environment_load_names(data_build->setting.environment, environment); + main->setting.state.status = fl_environment_load_names(data_build->setting.environment, environment); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fl_environment_load_names)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fl_environment_load_names)); } else { - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_build_load_environment_ @@ -65,11 +67,13 @@ extern "C" { if (!data || !data->main || !setting) return; if (F_status_is_error(data->main->setting.state.status)) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; + + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -92,7 +96,7 @@ extern "C" { if (build_arguments && build_arguments->used) { path_file.used = data->path_data_build.used + build_arguments->array[0].used; } - else if (!process_pipe || (data->main->setting.flag & fake_main_flag_operation_e)) { + else if (!process_pipe || (main->setting.flag & fake_main_flag_operation_e)) { path_file.used = data->file_data_build_settings.used; } else { @@ -107,7 +111,7 @@ extern "C" { memcpy(path_file_string, data->path_data_build.string, sizeof(f_char_t) * data->path_data_build.used); memcpy(path_file_string + data->path_data_build.used, build_arguments->array[0].string, sizeof(f_char_t) * build_arguments->array[0].used); } - else if (!process_pipe || (data->main->setting.flag & fake_main_flag_operation_e)) { + else if (!process_pipe || (main->setting.flag & fake_main_flag_operation_e)) { memcpy(path_file_string, data->file_data_build_settings.string, sizeof(f_char_t) * data->file_data_build_settings.used); } else { @@ -122,37 +126,37 @@ extern "C" { if (process_pipe) { fake_pipe_buffer(data, &buffer); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { buffer.used = 0; } else { - data->main->setting.state.status = f_string_dynamic_append_assure(f_string_eol_s, &buffer); + main->setting.state.status = f_string_dynamic_append_assure(f_string_eol_s, &buffer); } } - if (F_status_is_error_not(data->main->setting.state.status)) { - if (build_arguments && build_arguments->used || !process_pipe || (data->main->setting.flag & fake_main_flag_operation_e)) { + if (F_status_is_error_not(main->setting.state.status)) { + if (build_arguments && build_arguments->used || !process_pipe || (main->setting.flag & fake_main_flag_operation_e)) { fake_file_buffer(data, path_file, process_pipe ? F_false : F_true, &buffer); } } - if (F_status_is_error_not(data->main->setting.state.status)) { + if (F_status_is_error_not(main->setting.state.status)) { f_string_range_t range = macro_f_string_range_t_initialize2(buffer.used); f_fss_delimits_t delimits = f_fss_delimits_t_initialize; - // @todo make sure data->main->setting.state.custom = (void *) data->main->program; - //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->program, 0); + // @todo make sure main->setting.state.custom = (void *) main->program; + //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 *) main->program, 0); - fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &data->main->setting.state); + fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &main->setting.state); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_fss(&data->main->program.error, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_fss(&main->program.error, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true); } else { - f_fss_apply_delimit(delimits, &buffer, &data->main->setting.state); + f_fss_apply_delimit(delimits, &buffer, &main->setting.state); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_fss_apply_delimit)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_fss_apply_delimit)); } else { fake_build_load_setting_process(data, F_true, path_file, modes_custom.used ? &modes_custom : 0, buffer, objects, contents, setting); @@ -169,7 +173,7 @@ extern "C" { } // Error when required settings are not specified. - if (F_status_is_error_not(data->main->setting.state.status)) { + if (F_status_is_error_not(main->setting.state.status)) { bool failed = F_false; f_string_static_t * const settings[] = { @@ -183,19 +187,19 @@ extern "C" { for (uint8_t i = 0; i < 1; ++i) { if (!settings[i]->used) { - fake_build_print_error_missing_required_setting(&data->main->program.warning, names[i], path_file); + fake_build_print_error_missing_required_setting(&main->program.warning, names[i], path_file); failed = F_true; } } // for if (failed) { - data->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } fake_build_load_setting_override(data, setting); @@ -208,11 +212,13 @@ extern "C" { if (!data || !data->main || !setting) return; if (F_status_is_error(data->main->setting.state.status) && buffer.used) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; + + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -539,16 +545,16 @@ extern "C" { f_string_t function = macro_fake_f(fll_fss_snatch_apart); - data->main->setting.state.status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, fake_build_setting_total_d, settings_value, settings_matches, 0); + main->setting.state.status = fll_fss_snatch_apart(buffer, objects, contents, settings_name, fake_build_setting_total_d, settings_value, settings_matches, 0); - if (data->main->setting.state.status == F_none) { + if (main->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. const f_string_statics_t * const modes = modes_custom && modes_custom->used ? modes_custom - : data->main->setting.modes.used - ? &data->main->setting.modes + : main->setting.modes.used + ? &main->setting.modes : &setting->modes_default; f_string_dynamic_t settings_mode_names[fake_build_setting_total_d]; @@ -575,10 +581,10 @@ extern "C" { } // for if (found == F_false) { - fake_build_print_error_mode_invalid(&data->main->program.warning, modes->array[i], path_file); + fake_build_print_error_mode_invalid(&main->program.warning, modes->array[i], path_file); error_printed = F_true; - data->main->setting.state.status = F_status_set_error(F_parameter); + main->setting.state.status = F_status_set_error(F_parameter); break; } @@ -587,40 +593,40 @@ extern "C" { settings_mode_names[j].used = 0; - data->main->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]); + main->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(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { function = macro_fake_f(f_string_dynamic_increase_by); break; } - data->main->setting.state.status = f_string_dynamic_append_nulless(settings_name[j], &settings_mode_names[j]); + main->setting.state.status = f_string_dynamic_append_nulless(settings_name[j], &settings_mode_names[j]); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(f_string_ascii_minus_s, &settings_mode_names[j]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(f_string_ascii_minus_s, &settings_mode_names[j]); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(modes->array[i], &settings_mode_names[j]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(modes->array[i], &settings_mode_names[j]); } - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { function = macro_fake_f(f_string_dynamic_append); break; } } // for - if (data->main->setting.state.status == F_none) { - data->main->setting.state.status = fll_fss_snatch_apart(buffer, objects, contents, settings_mode_names, fake_build_setting_total_d, settings_value, 0, 0); + if (main->setting.state.status == F_none) { + main->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(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { function = macro_fake_f(fll_fss_snatch_apart); } } - if (F_status_is_error(data->main->setting.state.status)) break; + if (F_status_is_error(main->setting.state.status)) break; } // for for (j = 0; j < fake_build_setting_total_d; ++j) { @@ -657,12 +663,12 @@ extern "C" { } } - if (F_status_is_error(data->main->setting.state.status)) { - if (data->main->setting.state.status == F_status_set_error(F_string_too_large)) { - fake_build_print_error_setting_too_long(&data->main->program.warning, path_file); + if (F_status_is_error(main->setting.state.status)) { + if (main->setting.state.status == F_status_set_error(F_string_too_large)) { + fake_build_print_error_setting_too_long(&main->program.warning, path_file); } else if (!error_printed) { - fake_print_error(&data->main->program.error, function); + fake_print_error(&main->program.error, function); } } else { @@ -894,7 +900,7 @@ extern "C" { fake_path_part_script_s, // path_program_script fake_path_part_shared_s, // path_program_shared fake_path_part_static_s, // path_program_static - data->main->setting.sources, // path_sources + main->setting.sources, // path_sources f_string_empty_s, // path_sources_object f_string_empty_s, // preserve_path_headers f_string_empty_s, // process_post @@ -1099,10 +1105,10 @@ extern "C" { if (!settings_single_matches[i] && settings_single_destination[i]) { settings_single_destination[i]->used = 0; - data->main->setting.state.status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]); + main->setting.state.status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); break; } @@ -1120,7 +1126,7 @@ extern "C" { else { *settings_single_bool[i] = F_true; - fake_build_print_warning_setting_boolean_may_only_be(&data->main->program.warning, settings_single_name[i], path_file, settings_single_version_default_name[i]); + fake_build_print_warning_setting_boolean_may_only_be(&main->program.warning, settings_single_name[i], path_file, settings_single_version_default_name[i]); } } else if (settings_single_type[i] == 4) { @@ -1136,7 +1142,7 @@ extern "C" { else { *settings_single_language[i] = fake_build_language_c_e; - fake_build_print_warning_setting_language_may_only_be(&data->main->program.warning, settings_single_name[i], path_file, fake_build_language_c_s); + fake_build_print_warning_setting_language_may_only_be(&main->program.warning, settings_single_name[i], path_file, fake_build_language_c_s); } } else if (settings_single_type[i] == 5) { @@ -1155,7 +1161,7 @@ extern "C" { else { *settings_single_version[i] = settings_single_version_default[i]; - fake_build_print_warning_setting_version_may_only_be(&data->main->program.warning, settings_single_name[i], path_file, settings_single_version_default_name[i]); + fake_build_print_warning_setting_version_may_only_be(&main->program.warning, settings_single_name[i], path_file, settings_single_version_default_name[i]); } } else if (settings_single_destination[i]) { @@ -1164,27 +1170,27 @@ extern "C" { settings_single_destination[i]->used = 0; if (settings_single_type[i] == 2) { - data->main->setting.state.status = f_path_directory_cleanup(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); + main->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(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_path_directory_cleanup)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_path_directory_cleanup)); break; } } else { - data->main->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]); + main->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(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); break; } - data->main->setting.state.status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); + main->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(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -1192,17 +1198,17 @@ extern "C" { } } // for - if (F_status_is_error_not(data->main->setting.state.status)) { + if (F_status_is_error_not(main->setting.state.status)) { if (checks && !setting->version_file) { setting->version_file = fake_build_version_micro_e; - fake_build_print_warning_setting_required_default_to(&data->main->program.warning, fake_build_setting_name_version_file_s, path_file, fake_build_version_micro_s); + fake_build_print_warning_setting_required_default_to(&main->program.warning, fake_build_setting_name_version_file_s, path_file, fake_build_version_micro_s); } if (checks && !setting->version_target) { setting->version_target = fake_build_version_major_e; - fake_build_print_warning_setting_required_default_to(&data->main->program.warning, fake_build_setting_name_version_target_s, path_file, fake_build_version_major_s); + fake_build_print_warning_setting_required_default_to(&main->program.warning, fake_build_setting_name_version_target_s, path_file, fake_build_version_major_s); } } } @@ -1256,19 +1262,21 @@ extern "C" { if (!data || !data->main || !setting) return; if (F_status_is_error(data->main->setting.state.status)) return; - if (data->main->program.parameters.array[fake_parameter_sources_e].result & f_console_result_value_e && setting->path_sources.used) { - data->main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &setting->path_sources); + fake_main_t * const main = data->main; - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_assure)); + if (main->program.parameters.array[fake_parameter_sources_e].result & f_console_result_value_e && setting->path_sources.used) { + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &setting->path_sources); + + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure)); return; } } - if (data->main->program.parameters.array[fake_parameter_shared_disable_e].result & f_console_result_found_e) { - if (data->main->program.parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) { - if (data->main->program.parameters.array[fake_parameter_shared_enable_e].location > data->main->program.parameters.array[fake_parameter_shared_disable_e].location) { + if (main->program.parameters.array[fake_parameter_shared_disable_e].result & f_console_result_found_e) { + if (main->program.parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) { + if (main->program.parameters.array[fake_parameter_shared_enable_e].location > main->program.parameters.array[fake_parameter_shared_disable_e].location) { setting->build_shared = F_true; setting->search_shared = F_true; } @@ -1277,21 +1285,21 @@ extern "C" { setting->search_shared = F_false; } - fake_build_print_warning_parameters_contradict(&data->main->program.warning, f_console_symbol_long_normal_s, fake_long_shared_disabled_s, f_console_symbol_long_normal_s, fake_long_shared_enabled_s, f_console_symbol_long_normal_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s); + fake_build_print_warning_parameters_contradict(&main->program.warning, f_console_symbol_long_normal_s, fake_long_shared_disabled_s, f_console_symbol_long_normal_s, fake_long_shared_enabled_s, f_console_symbol_long_normal_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s); } else { setting->build_shared = F_false; setting->search_shared = F_false; } } - else if (data->main->program.parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) { + else if (main->program.parameters.array[fake_parameter_shared_enable_e].result & f_console_result_found_e) { setting->build_shared = F_true; setting->search_shared = F_true; } - if (data->main->program.parameters.array[fake_parameter_static_disable_e].result & f_console_result_found_e) { - if (data->main->program.parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) { - if (data->main->program.parameters.array[fake_parameter_static_enable_e].location > data->main->program.parameters.array[fake_parameter_static_disable_e].location) { + if (main->program.parameters.array[fake_parameter_static_disable_e].result & f_console_result_found_e) { + if (main->program.parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) { + if (main->program.parameters.array[fake_parameter_static_enable_e].location > main->program.parameters.array[fake_parameter_static_disable_e].location) { setting->build_static = F_true; setting->search_static = F_true; } @@ -1300,23 +1308,23 @@ extern "C" { setting->search_static = F_false; } - fake_build_print_warning_parameters_contradict(&data->main->program.warning, f_console_symbol_long_normal_s, fake_long_static_disabled_s, f_console_symbol_long_normal_s, fake_long_static_enabled_s, f_console_symbol_long_normal_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s); + fake_build_print_warning_parameters_contradict(&main->program.warning, f_console_symbol_long_normal_s, fake_long_static_disabled_s, f_console_symbol_long_normal_s, fake_long_static_enabled_s, f_console_symbol_long_normal_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s); } else { setting->build_static = F_false; setting->search_static = F_false; } } - else if (data->main->program.parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) { + else if (main->program.parameters.array[fake_parameter_static_enable_e].result & f_console_result_found_e) { setting->build_static = F_true; setting->search_static = F_true; } if (setting->build_language == fake_build_language_c_e || setting->build_language == fake_build_language_cpp_e) { if (setting->build_shared == F_false && setting->build_static == F_false) { - fake_build_print_warning_setting_both_cannot_when_language(&data->main->program.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); + fake_build_print_warning_setting_both_cannot_when_language(&main->program.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); - data->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } } @@ -1328,11 +1336,13 @@ extern "C" { if (!data || !data->main || !stage) return; if (F_status_is_error(data->main->setting.state.status)) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; + + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -1378,53 +1388,53 @@ extern "C" { &stage->file_sources_settings, }; - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; f_string_dynamic_t settings_file_base = f_string_dynamic_t_initialize; if (settings_file.used) { - data->main->setting.state.status = f_file_name_base(settings_file, &settings_file_base); + main->setting.state.status = f_file_name_base(settings_file, &settings_file_base); } else { - data->main->setting.state.status = f_file_name_base(data->file_data_build_settings, &settings_file_base); + main->setting.state.status = f_file_name_base(data->file_data_build_settings, &settings_file_base); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_base)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_base)); return; } for (uint8_t i = 0; i < fake_build_stage_total_d; ++i) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_stage, values[i]); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_stage, values[i]); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.process.used) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->main->setting.process, values[i]); + if (F_status_is_error_not(main->setting.state.status) && main->setting.process.used) { + main->setting.state.status = f_string_dynamic_append_nulless(main->setting.process, values[i]); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(names[i], values[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(names[i], values[i]); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(settings_file_base, values[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(settings_file_base, values[i]); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_built_s, values[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_stage_built_s, values[i]); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } diff --git a/level_3/fake/c/main/build/object.c b/level_3/fake/c/main/build/object.c index 073a98b..75bf30a 100644 --- a/level_3/fake/c/main/build/object.c +++ b/level_3/fake/c/main/build/object.c @@ -25,32 +25,34 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0; - fake_build_print_compile_object_shared(&data->main->program.message); + fake_main_t * const main = data->main; - fake_string_dynamic_reset(&data->main->cache_argument); - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_build_print_compile_object_shared(&main->program.message); + + fake_string_dynamic_reset(&main->cache_argument); + fake_string_dynamics_reset(&main->cache_arguments); fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_sources_object_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_object_add)); return 0; } { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_shared, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_shared, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } @@ -58,29 +60,29 @@ extern "C" { const f_string_static_t values[] = { fake_build_parameter_object_compile_s, fake_build_parameter_object_output_s, - data->main->cache_argument, + main->cache_argument, }; for (uint8_t i = 0; i < 3; ++i) { if (!values[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for } fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_arguments_standard_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_arguments_standard_add)); return 0; } - int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); + const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status != F_child) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) { fake_build_touch(data, file_stage); } @@ -96,32 +98,34 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0; - fake_build_print_compile_object_static(&data->main->program.message); + fake_main_t * const main = data->main; + + fake_build_print_compile_object_static(&main->program.message); - fake_string_dynamic_reset(&data->main->cache_argument); - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_string_dynamic_reset(&main->cache_argument); + fake_string_dynamics_reset(&main->cache_arguments); fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_sources_object_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_object_add)); return 0; } { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_static, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects_static, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } @@ -129,29 +133,29 @@ extern "C" { const f_string_static_t values[] = { fake_build_parameter_object_compile_s, fake_build_parameter_object_output_s, - data->main->cache_argument, + main->cache_argument, }; for (uint8_t i = 0; i < 3; ++i) { if (!values[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for } fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_arguments_standard_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_arguments_standard_add)); return 0; } const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status != F_child) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) { fake_build_touch(data, file_stage); } diff --git a/level_3/fake/c/main/build/objects.c b/level_3/fake/c/main/build/objects.c index 877be40..d1cf612 100644 --- a/level_3/fake/c/main/build/objects.c +++ b/level_3/fake/c/main/build/objects.c @@ -12,19 +12,21 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_library.used) return 0; - fake_build_print_compile_object_static_library(&data->main->program.message); + fake_main_t * const main = data->main; - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_build_print_compile_object_static_library(&main->program.message); + + fake_string_dynamics_reset(&main->cache_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); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_objects_add)); return 0; } - int result = data->main->program.child; + int result = main->program.child; const f_string_dynamics_t *sources[2] = { &data_build->setting.build_sources_library, @@ -41,142 +43,142 @@ extern "C" { if (!sources[i]->array[j].used) continue; - fake_string_dynamic_reset(&data->main->cache_1); - fake_string_dynamic_reset(&data->main->cache_2); - fake_string_dynamic_reset(&data->main->cache_argument); + fake_string_dynamic_reset(&main->cache_1); + fake_string_dynamic_reset(&main->cache_2); + fake_string_dynamic_reset(&main->cache_argument); - fake_build_path_source_string(data, data_build, &data_build->setting.path_sources, &data->main->cache_1); - if (F_status_is_error(data->main->setting.state.status)) break; + fake_build_path_source_string(data, data_build, &data_build->setting.path_sources, &main->cache_1); + if (F_status_is_error(main->setting.state.status)) break; - data->main->setting.state.status = f_string_dynamic_append_nulless(sources[i]->array[j], &data->main->cache_1); + main->setting.state.status = f_string_dynamic_append_nulless(sources[i]->array[j], &main->cache_1); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } - fake_build_get_file_name_without_extension(data, sources[i]->array[j], &data->main->cache_2); + fake_build_get_file_name_without_extension(data, sources[i]->array[j], &main->cache_2); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_get_file_name_without_extension)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_get_file_name_without_extension)); break; } - data->main->setting.state.status = f_file_name_directory(sources[i]->array[j], &data->main->cache_argument); + main->setting.state.status = f_file_name_directory(sources[i]->array[j], &main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_file_name_directory)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_name_directory)); break; } - if (data->main->cache_argument.used) { - data->main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects, &data->main->cache_argument); + if (main->cache_argument.used) { + main->setting.state.status = f_string_dynamic_prepend(data->path_build_objects, &main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_prepend)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_prepend)); break; } - data->main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_argument); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_assure)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure)); break; } - data->main->setting.state.status = f_directory_exists(data->main->cache_argument); + main->setting.state.status = f_directory_exists(main->cache_argument); - if (data->main->setting.state.status == F_false) { - fake_build_print_error_exist_not_directory(&data->main->program.message, data->main->cache_argument); + if (main->setting.state.status == F_false) { + fake_build_print_error_exist_not_directory(&main->program.message, main->cache_argument); - data->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); break; } - if (data->main->setting.state.status == F_file_found_not) { - data->main->setting.state.status = f_directory_create(data->main->cache_argument, mode.directory); + if (main->setting.state.status == F_file_found_not) { + main->setting.state.status = f_directory_create(main->cache_argument, mode.directory); - if (F_status_is_error(data->main->setting.state.status)) { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found_not) { - fake_build_print_error_cannot_create_due_to_parent(&data->main->program.message, data->main->cache_argument); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_build_print_error_cannot_create_due_to_parent(&main->program.message, main->cache_argument); } else { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_create), data->main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e); } break; } - fake_build_print_verbose_create_directory(&data->main->program.message, data->main->cache_argument); + fake_build_print_verbose_create_directory(&main->program.message, main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_exists), data->main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_exists), main->cache_argument, f_file_operation_create_s, fll_error_file_type_directory_e); break; } } - if (data->main->cache_argument.used) { - data->main->setting.state.status = F_none; + if (main->cache_argument.used) { + main->setting.state.status = F_none; } else { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_objects, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->main->cache_2, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_argument); } - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_object_name_suffix_s, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } const f_string_static_t values[] = { - data->main->cache_1, + main->cache_1, fake_build_parameter_object_compile_s, fake_build_parameter_object_static_s, fake_build_parameter_object_output_s, - data->main->cache_argument, + main->cache_argument, }; for (k = 0; k < 5; ++k) { if (!values[k].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[k], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(values[k], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add)); break; } result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); - if (F_status_is_error(data->main->setting.state.status) || data->main->setting.state.status == F_child) break; + if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) break; } // for - if (F_status_is_error(data->main->setting.state.status) || data->main->setting.state.status == F_child) break; + if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_child) break; } // for - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status != F_child) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) { fake_build_touch(data, file_stage); } diff --git a/level_3/fake/c/main/build/program.c b/level_3/fake/c/main/build/program.c index 3c3c08a..4745987 100644 --- a/level_3/fake/c/main/build/program.c +++ b/level_3/fake/c/main/build/program.c @@ -25,85 +25,87 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0; - fake_build_print_compile_program_shared(&data->main->program.message); + fake_main_t * const main = data->main; - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_build_print_compile_program_shared(&main->program.message); + + fake_string_dynamics_reset(&main->cache_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); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_objects_add)); return 0; } fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_sources_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_add)); return 0; } - if (F_status_is_error_not(data->main->setting.state.status)) { - fake_string_dynamic_reset(&data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + fake_string_dynamic_reset(&main->cache_argument); - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_programs_shared, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_programs_shared, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } const f_string_static_t values[] = { fake_build_parameter_library_output_s, - data->main->cache_argument, + main->cache_argument, }; for (uint8_t i = 0; i < 2; ++i) { if (!values[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for } // If project-specific library sources exist, then the -lbuild_name needs to be added to the arguments. - if (F_status_is_error_not(data->main->setting.state.status) && data_build->setting.build_sources_library.used) { - fake_string_dynamic_reset(&data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status) && data_build->setting.build_sources_library.used) { + fake_string_dynamic_reset(&main->cache_argument); - data->main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_link_file_s, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(fake_build_parameter_library_link_file_s, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.build_name, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return 0; } - data->main->setting.state.status = fll_execute_arguments_add(data->main->cache_argument, &data->main->cache_arguments); + main->setting.state.status = fll_execute_arguments_add(main->cache_argument, &main->cache_arguments); } fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_program_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add)); return 0; } const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status != F_child) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) { fake_build_touch(data, file_stage); } @@ -119,27 +121,29 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || f_file_exists(file_stage, F_true) == F_true) return 0; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0; - fake_build_print_compile_program_static(&data->main->program.message); + fake_main_t * const main = data->main; + + fake_build_print_compile_program_static(&main->program.message); - fake_string_dynamics_reset(&data->main->cache_arguments); + fake_string_dynamics_reset(&main->cache_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); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_objects_add)); return 0; } fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_build_sources_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_build_sources_add)); return 0; } - if (F_status_is_error_not(data->main->setting.state.status)) { + if (F_status_is_error_not(main->setting.state.status)) { f_string_static_t source_library = f_string_static_t_initialize; source_library.used = data->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used; @@ -184,22 +188,22 @@ extern "C" { if (!values[i].used) continue; - data->main->setting.state.status = fll_execute_arguments_add(values[i], &data->main->cache_arguments); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = fll_execute_arguments_add(values[i], &main->cache_arguments); + if (F_status_is_error(main->setting.state.status)) break; } // for } fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_program_e); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_arguments_add)); return 0; } - int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); + const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status != F_child) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status != F_child) { fake_build_touch(data, file_stage); } diff --git a/level_3/fake/c/main/build/skeleton.c b/level_3/fake/c/main/build/skeleton.c index 6cfd3a2..5853343 100644 --- a/level_3/fake/c/main/build/skeleton.c +++ b/level_3/fake/c/main/build/skeleton.c @@ -11,17 +11,19 @@ extern "C" { if (F_status_is_error(data->main->setting.state.status) || data->main->setting.state.status == F_child) return; if (f_file_exists(file_stage, F_true) == F_true) return; - fake_string_dynamic_reset(&data->main->cache_argument); + fake_main_t * const main = data->main; + + fake_string_dynamic_reset(&main->cache_argument); if (data_build->setting.path_headers.used) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_includes, &data->main->cache_argument); + main->setting.state.status = f_string_dynamic_append_nulless(data->path_build_includes, &main->cache_argument); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.path_headers, &data->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(data_build->setting.path_headers, &main->cache_argument); } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -46,10 +48,10 @@ extern "C" { data->path_build_programs_static, data->path_build_settings, data->path_build_stage, - data->main->cache_argument, + main->cache_argument, }; - fake_build_print_message_skeleton_build_base(&data->main->program.message); + fake_build_print_message_skeleton_build_base(&main->program.message); bool created = F_false; f_array_length_t j = 0; @@ -64,11 +66,11 @@ extern "C" { if (f_path_separator_s.used && directorys[i].string[j] != f_path_separator_s.string[0]) continue; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -76,58 +78,58 @@ extern "C" { directorys[i].string[j] = 0; - data->main->setting.state.status = f_directory_exists(directorys[i]); + main->setting.state.status = f_directory_exists(directorys[i]); - if (F_status_is_error(data->main->setting.state.status) || data->main->setting.state.status == F_false) { + if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_false) { directorys[i].string[j] = f_path_separator_s.string[0]; break; } - if (data->main->setting.state.status == F_file_found_not) { - data->main->setting.state.status = f_directory_create(directorys[i], mode); + if (main->setting.state.status == F_file_found_not) { + main->setting.state.status = f_directory_create(directorys[i], mode); created = F_true; } directorys[i].string[j] = f_path_separator_s.string[0]; - if (F_status_is_error(data->main->setting.state.status)) break; + if (F_status_is_error(main->setting.state.status)) break; } // for - if (F_status_is_fine(data->main->setting.state.status) && directorys[i].used && f_path_separator_s.used && directorys[i].string[directorys[i].used - 1] != f_path_separator_s.string[0]) { - data->main->setting.state.status = f_directory_exists(directorys[i]); + if (F_status_is_fine(main->setting.state.status) && directorys[i].used && f_path_separator_s.used && directorys[i].string[directorys[i].used - 1] != f_path_separator_s.string[0]) { + main->setting.state.status = f_directory_exists(directorys[i]); - if (F_status_is_error_not(data->main->setting.state.status)) { - if (data->main->setting.state.status == F_false) { - data->main->setting.state.status = f_directory_create(directorys[i], mode); + if (F_status_is_error_not(main->setting.state.status)) { + if (main->setting.state.status == F_false) { + main->setting.state.status = f_directory_create(directorys[i], mode); created = F_true; } } } - if (F_status_is_error(data->main->setting.state.status)) { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found) { - data->main->setting.state.status = F_none; + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_file_found) { + main->setting.state.status = F_none; continue; } - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_create), directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e); return; } if (created) { - fake_build_print_verbose_create_directory(&data->main->program.message, directorys[i]); + fake_build_print_verbose_create_directory(&main->program.message, directorys[i]); } } // for fake_build_touch(data, file_stage); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = F_none; + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = F_none; } } #endif // _di_fake_build_skeleton_ diff --git a/level_3/fake/c/main/clean.c b/level_3/fake/c/main/clean.c index 815b97c..c8eb7f0 100644 --- a/level_3/fake/c/main/clean.c +++ b/level_3/fake/c/main/clean.c @@ -9,28 +9,30 @@ extern "C" { if (!data || !data->main) return; - fake_print_message_delete_all_files(&data->main->program.message); + fake_main_t * const main = data->main; - data->main->setting.state.status = F_none; + fake_print_message_delete_all_files(&main->program.message); - if (data->main->program.error.verbosity >= f_console_verbosity_verbose_e) { - data->main->setting.state.status = f_directory_remove_custom(data->main->setting.build, F_directory_max_descriptors_d, F_true, fake_clean_remove_recursively_verbosely); + main->setting.state.status = F_none; + + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { + main->setting.state.status = f_directory_remove_custom(main->setting.build, F_directory_max_descriptors_d, F_true, fake_clean_remove_recursively_verbosely); } else { - data->main->setting.state.status = f_directory_remove(data->main->setting.build, F_directory_max_descriptors_d, F_true); + main->setting.state.status = f_directory_remove(main->setting.build, F_directory_max_descriptors_d, F_true); } - if (F_status_set_fine(data->main->setting.state.status) == F_file_found_not || F_status_set_fine(data->main->setting.state.status) == F_directory) { - fake_print_warning_build_directory_not_directory(&data->main->program.warning, data->main->setting.build); + if (F_status_set_fine(main->setting.state.status) == F_file_found_not || F_status_set_fine(main->setting.state.status) == F_directory) { + fake_print_warning_build_directory_not_directory(&main->program.warning, main->setting.build); - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_remove), data->main->setting.build, f_file_operation_delete_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_remove), main->setting.build, f_file_operation_delete_s, fll_error_file_type_directory_e); } else { - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_clean_operate_ diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index 6a970c4..26a30a4 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -253,22 +253,24 @@ extern "C" { if (!data || !data->main) return 1; if (F_status_is_error(data->main->setting.state.status)) return 1; - if (data->main->program.error.verbosity >= f_console_verbosity_verbose_e) { - f_file_stream_lock(data->main->program.message.to); + fake_main_t * const main = data->main; - f_print_dynamic(program, data->main->program.message.to); + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { + f_file_stream_lock(main->program.message.to); - for (f_array_length_t i = 0; i < data->main->cache_arguments.used; ++i) { + f_print_dynamic(program, main->program.message.to); - if (!data->main->cache_arguments.array[i].used) continue; + for (f_array_length_t i = 0; i < main->cache_arguments.used; ++i) { - fl_print_format(" %Q", data->main->program.message.to, data->main->cache_arguments.array[i]); + if (!main->cache_arguments.array[i].used) continue; + + fl_print_format(" %Q", main->program.message.to, main->cache_arguments.array[i]); } // for - f_print_dynamic_raw(f_string_eol_s, data->main->program.message.to); + f_print_dynamic_raw(f_string_eol_s, main->program.message.to); - f_file_stream_flush(data->main->program.message.to); - f_file_stream_unlock(data->main->program.message.to); + f_file_stream_flush(main->program.message.to); + f_file_stream_unlock(main->program.message.to); } int return_code = 0; @@ -282,35 +284,35 @@ extern "C" { fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(0, 0, &environment, &signals, 0); - data->main->setting.state.status = fll_execute_program(program, data->main->cache_arguments, ¶meter, 0, (void *) &return_code); + main->setting.state.status = fll_execute_program(program, main->cache_arguments, ¶meter, 0, (void *) &return_code); - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return 0; } } - if (data->main->setting.state.status == F_child) return return_code; + if (main->setting.state.status == F_child) return return_code; } else { - data->main->setting.state.status = F_status_set_error(F_file_found_not); + main->setting.state.status = F_status_set_error(F_file_found_not); } - if (return_code != 0) { - data->main->setting.state.status = F_status_set_error(F_failure); + if (return_code) { + main->setting.state.status = F_status_set_error(F_failure); } - else if (F_status_is_error(data->main->setting.state.status)) { + else if (F_status_is_error(main->setting.state.status)) { return_code = 1; - if (F_status_set_fine(data->main->setting.state.status) == F_file_found_not) { - fake_print_error_execute_program_not_found(&data->main->program.error, program); + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_print_error_execute_program_not_found(&main->program.error, program); } else { - fake_print_error(&data->main->program.error, macro_fake_f(fll_execute_program)); + fake_print_error(&main->program.error, macro_fake_f(fll_execute_program)); } } @@ -321,32 +323,36 @@ extern "C" { #ifndef _di_fake_file_buffer_ void fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer) { - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + if (!data || !data->main || !buffer) return; + + fake_main_t * const main = data->main; + + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } } - data->main->setting.state.status = f_file_exists(path_file, F_true); + main->setting.state.status = f_file_exists(path_file, F_true); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); return; } - if (data->main->setting.state.status == F_true) { + if (main->setting.state.status == F_true) { { off_t size_file = 0; - data->main->setting.state.status = f_file_size(path_file, F_true, &size_file); + main->setting.state.status = f_file_size(path_file, F_true, &size_file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e); return; } @@ -355,46 +361,46 @@ extern "C" { size_file = fake_max_initial_buffer_d; } - data->main->setting.state.status = f_string_dynamic_increase_by(size_file, buffer); + main->setting.state.status = f_string_dynamic_increase_by(size_file, buffer); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24); - fake_print_error_file(&data->main->program.error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e); return; } - data->main->setting.state.status = F_true; + main->setting.state.status = F_true; } f_file_t file = f_file_t_initialize; - data->main->setting.state.status = f_file_stream_open(path_file, f_string_empty_s, &file); + main->setting.state.status = f_file_stream_open(path_file, f_string_empty_s, &file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e); return; } - data->main->setting.state.status = f_file_stream_read(file, buffer); + main->setting.state.status = f_file_stream_read(file, buffer); f_file_stream_flush(file); f_file_stream_close(&file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e); } else { - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } else { if (required) { - data->main->setting.state.status = F_status_set_error(F_file_found_not); + main->setting.state.status = F_status_set_error(F_file_found_not); - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); } } } @@ -405,17 +411,19 @@ extern "C" { if (!data || !data->main || !buffer) return; + fake_main_t * const main = data->main; + f_file_t file = f_file_t_initialize; file.id = F_type_descriptor_input_d; file.stream = F_type_input_d; file.size_read = fake_allocation_pipe_d; - data->main->setting.state.status = f_string_dynamic_increase_by(fake_max_initial_buffer_d, buffer); + main->setting.state.status = f_string_dynamic_increase_by(fake_max_initial_buffer_d, buffer); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24); - fake_print_error_file(&data->main->program.error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); return; } @@ -424,25 +432,25 @@ extern "C" { clearerr(F_type_input_d); do { - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } } - data->main->setting.state.status = f_file_stream_read_block(file, buffer); + main->setting.state.status = f_file_stream_read_block(file, buffer); - } while (F_status_is_fine(data->main->setting.state.status) && data->main->setting.state.status != F_interrupt && data->main->setting.state.status != F_none_eof); + } while (F_status_is_fine(main->setting.state.status) && main->setting.state.status != F_interrupt && main->setting.state.status != F_none_eof); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e); } else { - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_pipe_buffer_ @@ -452,11 +460,13 @@ extern "C" { if (!data || !data->main) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; - data->main->setting.state.status = F_status_set_error(F_interrupt); + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -472,17 +482,17 @@ extern "C" { }; const f_string_dynamic_t values[] = { - data->main->setting.build, - data->main->setting.data, - data->main->setting.documents, - data->main->setting.licenses, - data->main->setting.sources, - data->main->setting.work, + main->setting.build, + main->setting.data, + main->setting.documents, + main->setting.licenses, + main->setting.sources, + main->setting.work, }; uint8_t requireds[] = { F_false, // fake_long_build_s - (data->main->program.pipe & fll_program_data_pipe_input_e) ? F_false : F_true, // fake_long_data_s + (main->program.pipe & fll_program_data_pipe_input_e) ? F_false : F_true, // fake_long_data_s F_false, // fake_long_documents_s F_false, // fake_long_licenses_s F_false, // fake_long_sources_s @@ -491,12 +501,12 @@ extern "C" { struct stat directory_stat; - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; // Check only expected operations (fake_operation_clean_e and fake_operation_skeleton_e should not call this function). if (data->operation == fake_operation_make_e) { - if (data->main->program.parameters.array[fake_parameter_fakefile_e].result == f_console_result_none_e) { - if (data->main->setting.build.used && f_file_exists(data->main->setting.build, F_false) != F_true) { + if (main->program.parameters.array[fake_parameter_fakefile_e].result == f_console_result_none_e) { + if (main->setting.build.used && f_file_exists(main->setting.build, F_false) != F_true) { if (f_file_exists(fake_default_fakefile_s, F_false) == F_true) { requireds[1] = F_false; // fake_long_data_s } @@ -506,7 +516,7 @@ extern "C" { // If a custom --data or a custom --fakefile parameter is passed and uses an absolute or relative to current path, then do not check. if (data->operation == fake_operation_make_e || data->operation == fake_operation_build_e) { - f_console_parameter_t * const parameter = &data->main->program.parameters.array[ + f_console_parameter_t * const parameter = &main->program.parameters.array[ data->operation == fake_operation_make_e ? fake_parameter_fakefile_e : fake_parameter_settings_e @@ -515,13 +525,13 @@ extern "C" { if (parameter->result & f_console_result_value_e) { const f_array_length_t index = parameter->values.array[parameter->values.used - 1]; - if (f_path_is_absolute(data->main->program.parameters.arguments.array[index]) == F_true || f_path_is_relative_current(data->main->program.parameters.arguments.array[index]) == F_true) { + if (f_path_is_absolute(main->program.parameters.arguments.array[index]) == F_true || f_path_is_relative_current(main->program.parameters.arguments.array[index]) == F_true) { requireds[1] = F_none; // fake_long_data_s } else { - data->main->setting.state.status = f_file_exists(data->main->program.parameters.arguments.array[index], F_true); + main->setting.state.status = f_file_exists(main->program.parameters.arguments.array[index], F_true); - if (F_status_is_error_not(data->main->setting.state.status) && data->main->setting.state.status == F_true) { + if (F_status_is_error_not(main->setting.state.status) && main->setting.state.status == F_true) { requireds[1] = F_none; // fake_long_data_s } } @@ -533,30 +543,30 @@ extern "C" { if (requireds[i] != F_none && values[i].used) { memset(&directory_stat, 0, sizeof(struct stat)); - data->main->setting.state.status = f_file_stat(values[i], F_true, &directory_stat); + main->setting.state.status = f_file_stat(values[i], F_true, &directory_stat); - if (data->main->setting.state.status == F_status_set_error(F_file_found_not)) { - data->main->setting.state.status = F_status_set_error(F_directory_found_not); + if (main->setting.state.status == F_status_set_error(F_file_found_not)) { + main->setting.state.status = F_status_set_error(F_directory_found_not); } - if (F_status_is_error(data->main->setting.state.status)) { - if (F_status_set_fine(data->main->setting.state.status) != F_directory_found_not || requireds[i]) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_stat), values[i], f_file_operation_access_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) != F_directory_found_not || requireds[i]) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stat), values[i], f_file_operation_access_s, fll_error_file_type_directory_e); return; } } } else if (requireds[i] == F_true) { - fake_print_error_parameter_directory_not_found_path(&data->main->program.error, f_console_symbol_long_normal_s, names[i], values[i]); + fake_print_error_parameter_directory_not_found_path(&main->program.error, f_console_symbol_long_normal_s, names[i], values[i]); - data->main->setting.state.status = F_status_set_error(F_directory_found_not); + main->setting.state.status = F_status_set_error(F_directory_found_not); return; } } // for - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_validate_parameter_paths_ diff --git a/level_3/fake/c/main/fake/path_generate.c b/level_3/fake/c/main/fake/path_generate.c index a378752..34c870d 100644 --- a/level_3/fake/c/main/fake/path_generate.c +++ b/level_3/fake/c/main/fake/path_generate.c @@ -9,15 +9,17 @@ extern "C" { if (!data || !data->main) return; - data->main->setting.state.status = F_none; + fake_main_t * const main = data->main; + + main->setting.state.status = F_none; uint8_t i = 0; { uint8_t j = 0; const f_string_dynamic_t sources[] = { - data->main->setting.build, - data->main->setting.data, + main->setting.build, + main->setting.data, }; const uint8_t parameters_size[] = { @@ -57,8 +59,8 @@ extern "C" { fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_path_generate_string_dynamic)); return; } @@ -100,10 +102,10 @@ extern "C" { for (i = 0; i < 13; ++i) { - data->main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); + main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -170,8 +172,8 @@ extern "C" { fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_path_generate_string_dynamic)); return; } @@ -179,11 +181,11 @@ extern "C" { } // When custom fakefile or settings are used and they are paths to a file, remove the default path. - if (f_path_is(data->main->setting.fakefile) == F_true || f_file_exists(data->main->setting.fakefile, F_true) == F_true) { + if (f_path_is(main->setting.fakefile) == F_true || f_file_exists(main->setting.fakefile, F_true) == F_true) { data->file_data_build_fakefile.used = 0; } - if (f_path_is(data->main->setting.settings) == F_true || f_file_exists(data->main->setting.settings, F_true) == F_true) { + if (f_path_is(main->setting.settings) == F_true || f_file_exists(main->setting.settings, F_true) == F_true) { data->file_data_build_settings.used = 0; } @@ -202,8 +204,8 @@ extern "C" { fake_file_dependencies_s, fake_file_process_post_s, fake_file_process_pre_s, - data->main->setting.fakefile, - data->main->setting.settings, + main->setting.fakefile, + main->setting.settings, fake_file_readme_s, }; @@ -228,17 +230,17 @@ extern "C" { for (i = 0; i < 16; ++i) { - data->main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); + main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } } // for } - if (data->main->setting.work.used) { + if (main->setting.work.used) { { f_string_dynamic_t * const values[] = { &data->path_work_includes, @@ -250,10 +252,10 @@ extern "C" { values[i]->used = 0; - data->main->setting.state.status = f_string_dynamic_append_nulless(data->main->setting.work, values[i]); + main->setting.state.status = f_string_dynamic_append_nulless(main->setting.work, values[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -275,10 +277,10 @@ extern "C" { for (i = 0; i < 3; ++i) { - data->main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); + main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -317,8 +319,8 @@ extern "C" { fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_path_generate_string_dynamic)); return; } @@ -346,10 +348,10 @@ extern "C" { for (i = 0; i < 6; ++i) { - data->main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); + main->setting.state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -357,7 +359,7 @@ extern "C" { } } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_path_generate_ @@ -366,12 +368,14 @@ extern "C" { if (!data || !data->main || !destination) return; - data->main->setting.state.status = F_none; + fake_main_t * const main = data->main; + + main->setting.state.status = F_none; for (uint8_t i = 0; i < length; ++i) { - data->main->setting.state.status = f_string_dynamic_append_nulless(source, destination[i]); - if (F_status_is_error(data->main->setting.state.status)) break; + main->setting.state.status = f_string_dynamic_append_nulless(source, destination[i]); + if (F_status_is_error(main->setting.state.status)) break; } // for } #endif // _di_fake_path_generate_string_dynamic_ diff --git a/level_3/fake/c/main/make.c b/level_3/fake/c/main/make.c index 4c15316..45bad80 100644 --- a/level_3/fake/c/main/make.c +++ b/level_3/fake/c/main/make.c @@ -9,13 +9,15 @@ extern "C" { if (!data_make || !data_make->main) return; - fake_string_dynamic_reset(&data_make->main->cache_argument); + fake_main_t * const main = data_make->main; - data_make->main->setting.state.status = fl_path_canonical(path, &data_make->main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) return; + fake_string_dynamic_reset(&main->cache_argument); - if (data_make->main->cache_argument.used < data_make->path.stack.array[0].used) { - data_make->main->setting.state.status = F_status_set_error(F_false); + main->setting.state.status = fl_path_canonical(path, &main->cache_argument); + if (F_status_is_error(main->setting.state.status)) return; + + if (main->cache_argument.used < data_make->path.stack.array[0].used) { + main->setting.state.status = F_status_set_error(F_false); return; } @@ -23,19 +25,19 @@ 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_make->main->setting.state.status = f_compare_dynamic_partial(data_make->path.stack.array[0], data_make->main->cache_argument, range, range); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_compare_dynamic_partial(data_make->path.stack.array[0], main->cache_argument, range, range); + if (F_status_is_error(main->setting.state.status)) return; - if (data_make->main->setting.state.status) { - if (data_make->main->cache_argument.used == data_make->path.stack.array[0].used || data_make->main->cache_argument.string[data_make->path.stack.array[0].used] == f_path_separator_s.string[0]) { - data_make->main->setting.state.status = F_true; + if (main->setting.state.status) { + if (main->cache_argument.used == data_make->path.stack.array[0].used || main->cache_argument.string[data_make->path.stack.array[0].used] == f_path_separator_s.string[0]) { + main->setting.state.status = F_true; return; } } } - data_make->main->setting.state.status = F_status_set_error(F_false); + main->setting.state.status = F_status_set_error(F_false); } #endif // _di_fake_make_assure_inside_project_ @@ -44,58 +46,60 @@ extern "C" { if (!data_make || !data_make->main) return 0; + fake_main_t * const main = data_make->main; + if (!buffer.used) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id)); + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id)); - data_make->main->setting.state.status = F_status_set_error(F_parameter); + main->setting.state.status = F_status_set_error(F_parameter); return 0; } f_number_unsigned_t number = 0; - data_make->main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); + main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->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->main->setting.state.status) == F_number) { + if (F_status_set_fine(main->setting.state.status) == F_number) { if (is_owner) { uid_t uid = 0; - data_make->main->setting.state.status = f_account_id_by_name(buffer, &uid); + main->setting.state.status = f_account_id_by_name(buffer, &uid); } else { gid_t gid = 0; - data_make->main->setting.state.status = f_account_group_id_by_name(buffer, &gid); + main->setting.state.status = f_account_group_id_by_name(buffer, &gid); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, is_owner ? macro_fake_f(f_account_id_by_name) : macro_fake_f(f_account_group_id_by_name)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, is_owner ? macro_fake_f(f_account_id_by_name) : macro_fake_f(f_account_group_id_by_name)); } else { - if (data_make->main->setting.state.status == F_exist_not) { - fake_print_error_group_not_found(&data_make->main->program.error, buffer); + if (main->setting.state.status == F_exist_not) { + fake_print_error_group_not_found(&main->program.error, buffer); - data_make->main->setting.state.status = F_status_set_error(F_exist_not); + main->setting.state.status = F_status_set_error(F_exist_not); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } } else { - fake_print_error(&data_make->main->program.error, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect)); + fake_print_error(&main->program.error, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect)); } return 0; } if (number > F_type_size_32_unsigned_d) { - fake_print_error_number_too_large(&data_make->main->program.error, buffer); + fake_print_error_number_too_large(&main->program.error, buffer); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return 0; } @@ -109,26 +113,28 @@ extern "C" { if (!data_make || !data_make->main || !mode || !replace) return; + fake_main_t * const main = data_make->main; + if (!buffer.used) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id_mode)); + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id_mode)); - data_make->main->setting.state.status = F_status_set_error(F_parameter); + main->setting.state.status = F_status_set_error(F_parameter); return; } - data_make->main->setting.state.status = f_file_mode_from_string(buffer, data_make->main->program.umask, mode, replace); + main->setting.state.status = f_file_mode_from_string(buffer, main->program.umask, mode, replace); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_set_fine(data_make->main->setting.state.status) == F_syntax) { - fake_print_error_mode_invalid(&data_make->main->program.error, buffer); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_syntax) { + fake_print_error_mode_invalid(&main->program.error, buffer); } else { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id_mode)); + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id_mode)); } } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_get_id_mode_ @@ -138,16 +144,18 @@ extern "C" { if (!data_make || !data_make->main) return; - fake_string_dynamic_reset(&data_make->main->cache_argument); + fake_main_t * const main = data_make->main; + + fake_string_dynamic_reset(&main->cache_argument); if (!path.used || path.used == data_make->path.stack.array[0].used) { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } if (path.used < data_make->path.stack.array[0].used) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -157,13 +165,13 @@ extern "C" { range.start = data_make->path.stack.array[0].used + 1; range.stop = range.start + (path.used - range.start) - 1; - data_make->main->setting.state.status = f_string_dynamic_partial_append(path, range, &data_make->main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_string_dynamic_partial_append(path, range, &main->cache_argument); + if (F_status_is_error(main->setting.state.status)) return; - data_make->main->setting.state.status = f_string_dynamic_terminate(&data_make->main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_string_dynamic_terminate(&main->cache_argument); + if (F_status_is_error(main->setting.state.status)) return; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_path_relative_ diff --git a/level_3/fake/c/main/make/load_fakefile.c b/level_3/fake/c/main/make/load_fakefile.c index 6be953d..c8c8f6f 100644 --- a/level_3/fake/c/main/make/load_fakefile.c +++ b/level_3/fake/c/main/make/load_fakefile.c @@ -398,9 +398,7 @@ extern "C" { for (; i < define.used; ++i) { - fake_make_operate_validate_define_name(define.array[i].name); - - if (data_make->main->setting.state.status) { + if (fake_make_operate_validate_define_name(define.array[i].name) == F_true) { combined.used = 0; for (j = 0; j < define.array[i].value.used; ++j) { diff --git a/level_3/fake/c/main/make/load_parameters.c b/level_3/fake/c/main/make/load_parameters.c index a3abec1..e4777c7 100644 --- a/level_3/fake/c/main/make/load_parameters.c +++ b/level_3/fake/c/main/make/load_parameters.c @@ -10,62 +10,64 @@ extern "C" { if (!data_make || !data_make->main) return; if (F_status_is_error(data_make->main->setting.state.status)) return; - if (data_make->main->program.context.mode != f_color_mode_none_e) { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color); + fake_main_t * const main = data_make->main; - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.color); + if (main->program.context.mode != f_color_mode_none_e) { + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color); + + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.color); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } - if (data_make->main->program.context.mode == f_color_mode_not_e) { - if (data_make->main->program.parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + if (main->program.context.mode == f_color_mode_not_e) { + if (main->program.parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + else if (main->program.parameters.array[fake_parameter_no_color_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.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(main->setting.state.status)) { + main->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->program.context.mode == f_color_mode_dark_e) { - if (data_make->main->program.parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) { - data_make->main->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 (main->program.context.mode == f_color_mode_dark_e) { + if (main->program.parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + else if (main->program.parameters.array[fake_parameter_dark_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.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(main->setting.state.status)) { + main->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->program.parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + if (main->program.parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.color.array[data_make->parameter.color.used]); + else if (main->program.parameters.array[fake_parameter_light_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->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(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - data_make->main->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_not(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); return; } @@ -74,74 +76,74 @@ extern "C" { ++data_make->parameter_option.color.used; } - if (data_make->main->program.error.verbosity != f_console_verbosity_normal_e) { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity); + if (main->program.error.verbosity != f_console_verbosity_normal_e) { + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.verbosity); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.verbosity); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } - if (data_make->main->program.error.verbosity == f_console_verbosity_quiet_e) { - if (data_make->main->program.parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + if (main->program.error.verbosity == f_console_verbosity_quiet_e) { + if (main->program.parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + else if (main->program.parameters.array[fake_parameter_verbosity_quiet_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.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(main->setting.state.status)) { + main->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->program.error.verbosity == f_console_verbosity_error_e) { - if (data_make->main->program.parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) { - data_make->main->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 (main->program.error.verbosity == f_console_verbosity_error_e) { + if (main->program.parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + else if (main->program.parameters.array[fake_parameter_verbosity_error_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.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(main->setting.state.status)) { + main->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->program.error.verbosity >= f_console_verbosity_verbose_e) { - if (data_make->main->program.parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) { - data_make->main->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 (main->program.error.verbosity >= f_console_verbosity_verbose_e) { + if (main->program.parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + else if (main->program.parameters.array[fake_parameter_verbosity_verbose_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.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(main->setting.state.status)) { + main->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->program.parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_normal_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + if (main->program.parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) { + main->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->program.parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append(f_console_symbol_short_inverse_s, &data_make->parameter.verbosity.array[data_make->parameter.verbosity.used]); + else if (main->program.parameters.array[fake_parameter_verbosity_debug_e].flag & f_console_flag_normal_e) { + main->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(data_make->main->setting.state.status)) { - data_make->main->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(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - data_make->main->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_not(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); return; } @@ -157,8 +159,8 @@ extern "C" { }; const f_console_parameter_t *console[] = { - &data_make->main->program.parameters.array[fake_parameter_define_e], - &data_make->main->program.parameters.array[fake_parameter_mode_e], + &main->program.parameters.array[fake_parameter_define_e], + &main->program.parameters.array[fake_parameter_mode_e], }; const f_string_dynamics_t source[] = { @@ -190,44 +192,44 @@ extern "C" { for (j = 0; j < source[i].used; ++j) { if (destination[i]->used + 2 > destination[i]->size) { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } } - data_make->main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); + main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); return; } if (console[i]->flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(f_console_symbol_short_normal_s, &destination[i]->array[destination[i]->used]); + main->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) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(f_console_symbol_short_inverse_s, &destination[i]->array[destination[i]->used]); + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->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_not(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -235,22 +237,22 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(source[i].array[j], &destination[i]->array[destination[i]->used]); + main->setting.state.status = f_string_dynamic_append_nulless(source[i].array[j], &destination[i]->array[destination[i]->used]); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->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_not(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -275,15 +277,15 @@ extern "C" { }; const f_console_parameter_t *console[] = { - &data_make->main->program.parameters.array[fake_parameter_build_e], - &data_make->main->program.parameters.array[fake_parameter_data_e], - &data_make->main->program.parameters.array[fake_parameter_documents_e], - &data_make->main->program.parameters.array[fake_parameter_fakefile_e], - &data_make->main->program.parameters.array[fake_parameter_licenses_e], - &data_make->main->program.parameters.array[fake_parameter_process_e], - &data_make->main->program.parameters.array[fake_parameter_settings_e], - &data_make->main->program.parameters.array[fake_parameter_sources_e], - &data_make->main->program.parameters.array[fake_parameter_work_e], + &main->program.parameters.array[fake_parameter_build_e], + &main->program.parameters.array[fake_parameter_data_e], + &main->program.parameters.array[fake_parameter_documents_e], + &main->program.parameters.array[fake_parameter_fakefile_e], + &main->program.parameters.array[fake_parameter_licenses_e], + &main->program.parameters.array[fake_parameter_process_e], + &main->program.parameters.array[fake_parameter_settings_e], + &main->program.parameters.array[fake_parameter_sources_e], + &main->program.parameters.array[fake_parameter_work_e], }; const f_string_dynamic_t source[] = { @@ -339,44 +341,44 @@ extern "C" { if (!(console[i]->result & f_console_result_found_e)) continue; if (destination[i]->used + 2 > destination[i]->size) { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } } - data_make->main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); + main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); return; } if (console[i]->flag & f_console_flag_normal_e) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(f_console_symbol_short_normal_s, &destination[i]->array[destination[i]->used]); + main->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) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(f_console_symbol_short_inverse_s, &destination[i]->array[destination[i]->used]); + main->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(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(parameter[i], &destination[i]->array[destination[i]->used]); } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->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_not(main->setting.state.status)) { + main->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(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -384,22 +386,22 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(source[i], &destination[i]->array[destination[i]->used]); + main->setting.state.status = f_string_dynamic_append_nulless(source[i], &destination[i]->array[destination[i]->used]); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(source[i], &destination_value[i]->array[destination_value[i]->used]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(source[i], &destination_value[i]->array[destination_value[i]->used]); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); return; } diff --git a/level_3/fake/c/main/make/operate.c b/level_3/fake/c/main/make/operate.c index 553e783..59a7b4d 100644 --- a/level_3/fake/c/main/make/operate.c +++ b/level_3/fake/c/main/make/operate.c @@ -9,35 +9,37 @@ extern "C" { if (!data || !data->main) return; - if (!((++data->main->program.signal_check) % fake_signal_check_d)) { - if (fll_program_standard_signal_received(&data->main->program)) { - fll_program_print_signal_received(&data->main->program.warning, data->main->program.signal_received); + fake_main_t * const main = data->main; - data->main->setting.state.status = F_status_set_error(F_interrupt); + if (!((++main->program.signal_check) % fake_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); return; } } - fake_make_print_message_now_making(&data->main->program.message, data->main->setting.fakefile); + fake_make_print_message_now_making(&main->program.message, main->setting.fakefile); f_array_lengths_t section_stack = f_array_lengths_t_initialize; fake_make_data_t data_make = fake_make_data_t_initialize; data_make.data = data; - data_make.main = data->main; + data_make.main = main; - data->main->setting.state.status = f_string_dynamics_increase(data->main->setting.state.step_small, &data_make.path.stack); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &data_make.path.stack); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_print_error(&data_make.main->program.error, macro_fake_f(f_string_dynamics_increase)); return; } - data->main->setting.state.status = f_path_current(F_true, &data_make.path.stack.array[0]); + main->setting.state.status = f_path_current(F_true, &data_make.path.stack.array[0]); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_print_error(&data_make.main->program.error, macro_fake_f(f_path_current)); fake_make_data_delete(&data_make); @@ -45,9 +47,9 @@ extern "C" { return; } - data->main->setting.state.status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id); + main->setting.state.status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_print_error(&data_make.main->program.error, macro_fake_f(f_directory_open)); fake_make_data_delete(&data_make); @@ -59,9 +61,9 @@ extern "C" { fake_make_load_parameters(&data_make); - fake_make_load_fakefile(&data_make, data->main->program.pipe & fll_program_data_pipe_input_e); + fake_make_load_fakefile(&data_make, main->program.pipe & fll_program_data_pipe_input_e); - if (F_status_is_error(data->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_make_data_delete(&data_make); return; @@ -70,7 +72,7 @@ extern "C" { if (!data_make.main->buffer.used) { fake_make_data_delete(&data_make); - data->main->setting.state.status = F_data_not; + main->setting.state.status = F_data_not; return; } @@ -78,135 +80,135 @@ extern "C" { if (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; - data_make.error.context = data->main->program.context.set.error; - data_make.error.notable = data->main->program.context.set.notable; + data_make.error.context = main->program.context.set.error; + data_make.error.notable = main->program.context.set.notable; data_make.error.to.stream = F_type_error_d; data_make.error.to.id = F_type_descriptor_error_d; - data_make.error.set = &data->main->program.context.set; + data_make.error.set = &main->program.context.set; } else if (data_make.setting_make.fail == fake_make_operation_fail_warn_e) { data_make.error.prefix = fl_print_warning_s; data_make.error.suffix = f_string_empty_s; - data_make.error.context = data->main->program.context.set.warning; - data_make.error.notable = data->main->program.context.set.notable; + data_make.error.context = main->program.context.set.warning; + data_make.error.notable = main->program.context.set.notable; data_make.error.to.stream = F_type_output_d; data_make.error.to.id = F_type_descriptor_output_d; - data_make.error.set = &data->main->program.context.set; + data_make.error.set = &main->program.context.set; } else { data_make.error.to.stream = 0; data_make.error.prefix = f_string_empty_s; data_make.error.suffix = f_string_empty_s; data_make.error.to.id = -1; - data_make.error.set = &data->main->program.context.set; + data_make.error.set = &main->program.context.set; } - data_make.error.verbosity = data->main->program.message.verbosity; - data_make.error.custom = data->main; + data_make.error.verbosity = main->program.message.verbosity; + data_make.error.custom = main; - if (data->main->program.parameters.remaining.used) { + if (main->program.parameters.remaining.used) { f_array_length_t i = 0; f_array_length_t j = 0; f_string_range_t range = f_string_range_t_initialize; f_array_length_t index = 0; - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; // Validate the remaining parameters. - for (i = 0; i < data->main->program.parameters.remaining.used; ++i) { + for (i = 0; i < main->program.parameters.remaining.used; ++i) { - index = data->main->program.parameters.remaining.array[i]; + index = main->program.parameters.remaining.array[i]; - if (!data->main->program.parameters.arguments.array[index].used) { - data->main->setting.state.status = F_status_set_error(F_parameter); + if (!main->program.parameters.arguments.array[index].used) { + main->setting.state.status = F_status_set_error(F_parameter); break; } range.start = 0; - range.stop = data->main->program.parameters.arguments.array[index].used - 1; + range.stop = main->program.parameters.arguments.array[index].used - 1; for (j = 0; j < data_make.fakefile.used; ++j) { - if (f_compare_dynamic_partial(data->main->program.parameters.arguments.array[index], data_make.main->buffer, range, data_make.fakefile.array[j].name) == F_equal_to) break; + if (f_compare_dynamic_partial(main->program.parameters.arguments.array[index], data_make.main->buffer, range, data_make.fakefile.array[j].name) == F_equal_to) break; } // for if (j == data_make.fakefile.used) { - data->main->setting.state.status = F_status_set_error(F_parameter); + main->setting.state.status = F_status_set_error(F_parameter); break; } } // for - if (F_status_is_error(data->main->setting.state.status)) { - fake_make_print_error_argument_invalid_section(&data->main->program.error, data->main->program.parameters.arguments.array[data->main->program.parameters.remaining.array[i]]); + if (F_status_is_error(main->setting.state.status)) { + fake_make_print_error_argument_invalid_section(&main->program.error, main->program.parameters.arguments.array[main->program.parameters.remaining.array[i]]); } else { int result = 0; - for (i = 0; i < data->main->program.parameters.remaining.used; ++i) { + for (i = 0; i < main->program.parameters.remaining.used; ++i) { - index = data->main->program.parameters.remaining.array[i]; + index = main->program.parameters.remaining.array[i]; range.start = 0; - range.stop = data->main->program.parameters.arguments.array[index].used - 1; + range.stop = main->program.parameters.arguments.array[index].used - 1; for (j = 0; j < data_make.fakefile.used; ++j) { - if (f_compare_dynamic_partial(data->main->program.parameters.arguments.array[index], data_make.main->buffer, range, data_make.fakefile.array[j].name) == F_equal_to) { + if (f_compare_dynamic_partial(main->program.parameters.arguments.array[index], data_make.main->buffer, range, data_make.fakefile.array[j].name) == F_equal_to) { { int result = fake_make_operate_section(&data_make, j, §ion_stack); - if (data->main->setting.state.status == F_child) { - data->main->program.child = result; + if (main->setting.state.status == F_child) { + main->program.child = result; break; } } - const f_status_t status = data->main->setting.state.status; + const f_status_t status = main->setting.state.status; - data->main->setting.state.status = f_path_change_at(data_make.path.top.id); + main->setting.state.status = f_path_change_at(data_make.path.top.id); - if (F_status_is_error(data->main->setting.state.status)) { - fake_make_print_warning_cannot_change_back(&data->main->program.warning, data_make.path.stack.array[0]); + if (F_status_is_error(main->setting.state.status)) { + fake_make_print_warning_cannot_change_back(&main->program.warning, data_make.path.stack.array[0]); } - data->main->setting.state.status = status; + main->setting.state.status = status; break; } - if (F_status_is_error(data->main->setting.state.status)) break; + if (F_status_is_error(main->setting.state.status)) break; } // for - if (data->main->setting.state.status == F_child || F_status_is_error(data->main->setting.state.status)) break; + if (main->setting.state.status == F_child || F_status_is_error(main->setting.state.status)) break; } // for } } else { if (data_make.id_main == data_make.fakefile.used) { - fake_make_print_error_fakefile_section_missing(&data->main->program.error, data->file_data_build_fakefile, fake_make_item_main_s); + fake_make_print_error_fakefile_section_missing(&main->program.error, data->file_data_build_fakefile, fake_make_item_main_s); - data->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { { const int result = fake_make_operate_section(&data_make, data_make.id_main, §ion_stack); - if (data->main->setting.state.status == F_child) { - data->main->program.child = result; + if (main->setting.state.status == F_child) { + main->program.child = result; } } - if (data->main->setting.state.status != F_child) { - const f_status_t status = data->main->setting.state.status; + if (main->setting.state.status != F_child) { + const f_status_t status = main->setting.state.status; - data->main->setting.state.status = f_path_change_at(data_make.path.top.id); + main->setting.state.status = f_path_change_at(data_make.path.top.id); - if (F_status_is_error(data->main->setting.state.status)) { - fake_make_print_warning_cannot_change_back(&data->main->program.warning, data_make.path.stack.array[0]); + if (F_status_is_error(main->setting.state.status)) { + fake_make_print_warning_cannot_change_back(&main->program.warning, data_make.path.stack.array[0]); } - data->main->setting.state.status = status; + main->setting.state.status = status; } } } @@ -217,8 +219,8 @@ extern "C" { f_array_lengths_resize(0, §ion_stack); fake_make_data_delete(&data_make); - if (F_status_is_error_not(data->main->setting.state.status)) { - data->main->setting.state.status = F_none; + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_ @@ -230,11 +232,13 @@ extern "C" { if (F_status_is_error(data_make->main->setting.state.status)) return; if (!content.used) return; + fake_main_t * const main = data_make->main; + // Pre-allocate the known arguments size. - data_make->main->setting.state.status = f_string_dynamics_increase_by(content.used, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase_by(content.used, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status) || data_make->main->setting.state.status == F_string_too_large) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_string_too_large) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); return; } @@ -243,7 +247,7 @@ extern "C" { const f_string_static_t vocabulary_define = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_define_s, 0, F_iki_vocabulary_0002_define_s_length); const f_string_static_t vocabulary_parameter = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_parameter_s, 0, F_iki_vocabulary_0002_parameter_s_length); - f_iki_data_t *iki_data = &data_make->main->cache_iki; + f_iki_data_t *iki_data = &main->cache_iki; f_string_range_t range = f_string_range_t_initialize; f_string_map_multis_t *parameter = &data_make->setting_make.parameter; @@ -348,19 +352,19 @@ extern "C" { &data_make->parameter_value.work, }; - data_make->main->setting.state.flag = 0; - data_make->main->setting.state.handle = 0; - data_make->main->setting.state.data = 0; + main->setting.state.flag = 0; + main->setting.state.handle = 0; + main->setting.state.data = 0; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); return; } - data_make->main->cache_arguments.array[data_make->main->cache_arguments.used].used = 0; + main->cache_arguments.array[main->cache_arguments.used].used = 0; for (; i < content.used; ++i) { @@ -369,17 +373,17 @@ extern "C" { // Skip content that is unused, but quoted content, even if empty, should remain. if (content.array[i].start > content.array[i].stop) { if (quotes.array[i]) { - ++data_make->main->cache_arguments.used; + ++main->cache_arguments.used; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); break; } - data_make->main->cache_arguments.array[data_make->main->cache_arguments.used].used = 0; + main->cache_arguments.array[main->cache_arguments.used].used = 0; } continue; @@ -387,11 +391,11 @@ extern "C" { range = content.array[i]; - fl_iki_read(&data_make->main->buffer, &range, iki_data, &data_make->main->setting.state); + fl_iki_read(&main->buffer, &range, iki_data, &main->setting.state); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_set_fine(data_make->main->setting.state.status) != F_interrupt) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fl_iki_read)); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) != F_interrupt) { + fake_print_error(&main->program.error, macro_fake_f(fl_iki_read)); } break; @@ -399,7 +403,7 @@ extern "C" { // Apply the IKI delimits to the buffer. for (j = 0; j < iki_data->delimits.used; ++j) { - data_make->main->buffer.string[iki_data->delimits.array[j]] = f_iki_syntax_placeholder_s.string[0]; + main->buffer.string[iki_data->delimits.array[j]] = f_iki_syntax_placeholder_s.string[0]; } // for if (iki_data->variable.used) { @@ -409,10 +413,10 @@ extern "C" { range.start = content.array[i].start; range.stop = iki_data->variable.array[0].start - 1; - data_make->main->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->main->buffer, range, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_partial_append_nulless(main->buffer, range, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; } @@ -424,31 +428,31 @@ extern "C" { is = 0; - data_make->main->setting.state.status = f_compare_dynamic_partial_string(vocabulary_define.string, data_make->main->buffer, vocabulary_define.used, iki_data->vocabulary.array[j]); + main->setting.state.status = f_compare_dynamic_partial_string(vocabulary_define.string, main->buffer, vocabulary_define.used, iki_data->vocabulary.array[j]); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { is = 2; iki_type |= 0x2; } - else if (data_make->main->setting.state.status == F_equal_to_not) { - data_make->main->setting.state.status = f_compare_dynamic_partial_string(vocabulary_parameter.string, data_make->main->buffer, vocabulary_parameter.used, iki_data->vocabulary.array[j]); + else if (main->setting.state.status == F_equal_to_not) { + main->setting.state.status = f_compare_dynamic_partial_string(vocabulary_parameter.string, main->buffer, vocabulary_parameter.used, iki_data->vocabulary.array[j]); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { is = 1; iki_type |= 0x1; } - else if (data_make->main->setting.state.status == F_equal_to_not) { - data_make->main->setting.state.status = f_compare_dynamic_partial_string(vocabulary_context.string, data_make->main->buffer, vocabulary_context.used, iki_data->vocabulary.array[j]); + else if (main->setting.state.status == F_equal_to_not) { + main->setting.state.status = f_compare_dynamic_partial_string(vocabulary_context.string, main->buffer, vocabulary_context.used, iki_data->vocabulary.array[j]); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { is = 3; iki_type |= 0x4; } } } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_compare_dynamic_partial)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_compare_dynamic_partial)); break; } @@ -457,22 +461,22 @@ extern "C" { unmatched = F_true; // Check against reserved parameter names and if matches use them instead. - if (f_compare_dynamic_partial_string(fake_make_parameter_variable_return_s.string, data_make->main->buffer, fake_make_parameter_variable_return_s.used, iki_data->content.array[j]) == F_equal_to) { + if (f_compare_dynamic_partial_string(fake_make_parameter_variable_return_s.string, main->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_make->main->setting.state.status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } } else { - data_make->main->setting.state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append(f_string_ascii_0_s, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); break; } @@ -480,30 +484,30 @@ extern "C" { unmatched = F_false; } - else if (f_compare_dynamic_partial_string(fake_make_parameter_variable_top_s.string, data_make->main->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) { + else if (f_compare_dynamic_partial_string(fake_make_parameter_variable_top_s.string, main->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - data_make->main->setting.state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); break; } - data_make->main->setting.state.status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append(data_make->path.stack.array[0], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); break; } // For safe path handling, always append the trailing slash. - data_make->main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_assure)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure)); break; } @@ -511,30 +515,30 @@ extern "C" { unmatched = F_false; } - else if (f_compare_dynamic_partial_string(fake_make_parameter_variable_current_s.string, data_make->main->buffer, fake_make_parameter_variable_current_s.used, iki_data->content.array[j]) == F_equal_to) { + else if (f_compare_dynamic_partial_string(fake_make_parameter_variable_current_s.string, main->buffer, fake_make_parameter_variable_current_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - data_make->main->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->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->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, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); break; } - data_make->main->setting.state.status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); break; } // For safe path handling, always append the trailing slash. - data_make->main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_assure)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure)); break; } @@ -545,7 +549,7 @@ extern "C" { else { for (k = 0; k < 39; ++k) { - if (f_compare_dynamic_partial_string(reserved_name[k].string, data_make->main->buffer, reserved_name[k].used, iki_data->content.array[j]) != F_equal_to) { + if (f_compare_dynamic_partial_string(reserved_name[k].string, main->buffer, reserved_name[k].used, iki_data->content.array[j]) != F_equal_to) { continue; } @@ -565,10 +569,10 @@ extern "C" { } // for } // for - data_make->main->setting.state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); break; } @@ -578,19 +582,19 @@ extern "C" { if (!reserved_value[k]->array[l].used) continue; if (separate) { - data_make->main->setting.state.status = f_string_dynamic_append(f_string_space_s, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append(f_string_space_s, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); break; } } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -608,23 +612,23 @@ extern "C" { // Unquoted use separate parameters rather then being separated by a space. if (separate) { - ++data_make->main->cache_arguments.used; + ++main->cache_arguments.used; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); break; } - data_make->main->cache_arguments.array[data_make->main->cache_arguments.used].used = 0; + main->cache_arguments.array[main->cache_arguments.used].used = 0; } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -636,14 +640,14 @@ extern "C" { break; } // for - if (F_status_is_error(data_make->main->setting.state.status)) break; + if (F_status_is_error(main->setting.state.status)) break; } - if (unmatched && F_status_is_error_not(data_make->main->setting.state.status)) { + if (unmatched && F_status_is_error_not(main->setting.state.status)) { for (k = 0; k < parameter->used; ++k) { // Check against IKI variable list. - if (f_compare_dynamic_partial_dynamic(parameter->array[k].name, data_make->main->buffer, iki_data->content.array[j]) != F_equal_to) { + if (f_compare_dynamic_partial_dynamic(parameter->array[k].name, main->buffer, iki_data->content.array[j]) != F_equal_to) { continue; } @@ -663,10 +667,10 @@ extern "C" { } // for } // for - data_make->main->setting.state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_increase_by)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_increase_by)); break; } @@ -678,10 +682,10 @@ extern "C" { if (separate) { if (quotes.array[i]) { - data_make->main->setting.state.status = f_string_dynamic_append(f_string_space_s, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append(f_string_space_s, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); break; } @@ -689,24 +693,24 @@ extern "C" { // Unquoted use separate parameters rather then being separated by a space. else { - ++data_make->main->cache_arguments.used; + ++main->cache_arguments.used; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); break; } - data_make->main->cache_arguments.array[data_make->main->cache_arguments.used].used = 0; + main->cache_arguments.array[main->cache_arguments.used].used = 0; } } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -714,25 +718,25 @@ extern "C" { separate = F_true; } // for - if (F_status_is_error(data_make->main->setting.state.status)) break; + if (F_status_is_error(main->setting.state.status)) break; } break; } // for } - if (F_status_is_error(data_make->main->setting.state.status)) break; + if (F_status_is_error(main->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_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_operate_expand_build)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_operate_expand_build)); break; } - if (data_make->main->setting.state.status == F_true) { + if (main->setting.state.status == F_true) { iki_type |= 0x8; } } @@ -740,21 +744,21 @@ 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_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_operate_expand_environment)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_operate_expand_environment)); break; } - if (data_make->main->setting.state.status == F_true) { + if (main->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_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_operate_expand_context)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_operate_expand_context)); break; } @@ -768,10 +772,10 @@ extern "C" { range.start = iki_data->variable.array[j].stop + 1; range.stop = iki_data->variable.array[j + 1].start - 1; - data_make->main->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->main->buffer, range, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_partial_append_nulless(main->buffer, range, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; } @@ -779,56 +783,56 @@ extern "C" { } } // for - if (F_status_is_error(data_make->main->setting.state.status)) break; + if (F_status_is_error(main->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_make->main->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->main->buffer, range, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_partial_append_nulless(main->buffer, range, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; } } 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->main->cache_arguments.used; + ++main->cache_arguments.used; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); break; } - data_make->main->cache_arguments.array[data_make->main->cache_arguments.used].used = 0; + main->cache_arguments.array[main->cache_arguments.used].used = 0; } } else { - data_make->main->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->main->buffer, content.array[i], &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_partial_append_nulless(main->buffer, content.array[i], &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_partial_append_nulless)); break; } - ++data_make->main->cache_arguments.used; + ++main->cache_arguments.used; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase)); break; } - data_make->main->cache_arguments.array[data_make->main->cache_arguments.used].used = 0; + main->cache_arguments.array[main->cache_arguments.used].used = 0; } } // for } @@ -837,10 +841,15 @@ extern "C" { #ifndef _di_fake_make_operate_expand_build_ void fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { + if (!data_make || !data_make->main) return; + if (F_status_is_error(data_make->main->setting.state.status)) return; + + fake_main_t * const main = data_make->main; + bool unmatched = F_true; uint8_t i = 0; - fake_string_dynamic_reset(&data_make->main->cache_1); + fake_string_dynamic_reset(&main->cache_1); { const f_string_static_t uint8_name[] = { @@ -857,12 +866,12 @@ extern "C" { for (; i < 3; ++i) { - data_make->main->setting.state.status = f_compare_dynamic_partial_string(uint8_name[i].string, data_make->main->buffer, uint8_name[i].used, range_name); + main->setting.state.status = f_compare_dynamic_partial_string(uint8_name[i].string, main->buffer, uint8_name[i].used, range_name); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { unmatched = F_false; - data_make->main->setting.state.status = f_conversion_number_unsigned_to_string(uint8_value[i], f_conversion_data_base_10_c, &data_make->main->cache_1); + main->setting.state.status = f_conversion_number_unsigned_to_string(uint8_value[i], f_conversion_data_base_10_c, &main->cache_1); break; } @@ -892,16 +901,16 @@ extern "C" { for (i = 0; i < 7; ++i) { - data_make->main->setting.state.status = f_compare_dynamic_partial_string(bool_name[i].string, data_make->main->buffer, bool_name[i].used, range_name); + main->setting.state.status = f_compare_dynamic_partial_string(bool_name[i].string, main->buffer, bool_name[i].used, range_name); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { unmatched = F_false; if (bool_value[i]) { - data_make->main->setting.state.status = f_string_dynamic_append(fake_common_setting_bool_yes_s, &data_make->main->cache_1); + main->setting.state.status = f_string_dynamic_append(fake_common_setting_bool_yes_s, &main->cache_1); } else { - data_make->main->setting.state.status = f_string_dynamic_append(fake_common_setting_bool_no_s, &data_make->main->cache_1); + main->setting.state.status = f_string_dynamic_append(fake_common_setting_bool_no_s, &main->cache_1); } break; @@ -952,12 +961,12 @@ extern "C" { for (i = 0; i < 17; ++i) { - data_make->main->setting.state.status = f_compare_dynamic_partial_string(dynamic_name[i].string, data_make->main->buffer, dynamic_name[i].used, range_name); + main->setting.state.status = f_compare_dynamic_partial_string(dynamic_name[i].string, main->buffer, dynamic_name[i].used, range_name); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { unmatched = F_false; - data_make->main->setting.state.status = f_string_dynamic_append_nulless(dynamic_value[i], &data_make->main->cache_1); + main->setting.state.status = f_string_dynamic_append_nulless(dynamic_value[i], &main->cache_1); break; } @@ -1086,15 +1095,15 @@ extern "C" { for (i = 0; i < 36; ++i) { - data_make->main->setting.state.status = f_compare_dynamic_partial_string(dynamics_name[i].string, data_make->main->buffer, dynamics_name[i].used, range_name); + main->setting.state.status = f_compare_dynamic_partial_string(dynamics_name[i].string, main->buffer, dynamics_name[i].used, range_name); - if (data_make->main->setting.state.status == F_equal_to) { + if (main->setting.state.status == F_equal_to) { unmatched = F_false; for (j = 0; j < dynamics_value[i].used; ++j) { - data_make->main->setting.state.status = f_string_dynamic_mash(f_string_space_s, dynamics_value[i].array[j], &data_make->main->cache_1); - if (F_status_is_error(data_make->main->setting.state.status)) break; + main->setting.state.status = f_string_dynamic_mash(f_string_space_s, dynamics_value[i].array[j], &main->cache_1); + if (F_status_is_error(main->setting.state.status)) break; } // for if (dynamics_flag[i]) { @@ -1106,31 +1115,31 @@ extern "C" { } // for } - if (F_status_is_error(data_make->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; if (unmatched) { - data_make->main->setting.state.status = F_false; + main->setting.state.status = F_false; return; } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(data_make->main->cache_1, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_1, &main->cache_arguments.array[main->cache_arguments.used]); - if (F_status_is_error_not(data_make->main->setting.state.status) && !quote) { - ++data_make->main->cache_arguments.used; + if (F_status_is_error_not(main->setting.state.status) && !quote) { + ++main->cache_arguments.used; - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); } - if (F_status_is_error(data_make->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; - if (data_make->main->cache_1.used) { - data_make->main->setting.state.status = F_true; + if (main->cache_1.used) { + main->setting.state.status = F_true; return; } - data_make->main->setting.state.status = F_data_not; + main->setting.state.status = F_data_not; } #endif // _di_fake_make_operate_expand_build_ @@ -1139,6 +1148,8 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + const f_string_static_t *context = 0; const f_string_static_t context_name[] = { @@ -1154,20 +1165,20 @@ extern "C" { }; const f_color_set_t context_value[] = { - data_make->main->program.context.set.error, - data_make->main->program.context.set.important, - data_make->main->program.context.set.normal, - data_make->main->program.context.set.notable, - data_make->main->program.context.set.reset, - data_make->main->program.context.set.standout, - data_make->main->program.context.set.success, - data_make->main->program.context.set.title, - data_make->main->program.context.set.warning, + main->program.context.set.error, + main->program.context.set.important, + main->program.context.set.normal, + main->program.context.set.notable, + main->program.context.set.reset, + main->program.context.set.standout, + main->program.context.set.success, + main->program.context.set.title, + main->program.context.set.warning, }; for (f_array_length_t i = 0; i < 9; ++i) { - if (f_compare_dynamic_partial_string(context_name[i].string, data_make->main->buffer, context_name[i].used, range_name) == F_equal_to) { + if (f_compare_dynamic_partial_string(context_name[i].string, main->buffer, context_name[i].used, range_name) == F_equal_to) { context = context_value[i].before; break; @@ -1175,11 +1186,11 @@ extern "C" { } // for if (context) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(*context, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_string_dynamic_append_nulless(*context, &main->cache_arguments.array[main->cache_arguments.used]); + if (F_status_is_error(main->setting.state.status)) return; } - data_make->main->setting.state.status = F_true; + main->setting.state.status = F_true; } #endif // _di_fake_make_operate_expand_context_ @@ -1188,49 +1199,44 @@ extern "C" { if (!data_make || !data_make->main) return; - data_make->main->setting.state.status = F_none; + fake_main_t * const main = data_make->main; - fake_string_dynamic_reset(&data_make->main->cache_1); - fake_string_dynamic_reset(&data_make->main->cache_2); + main->setting.state.status = F_none; - data_make->main->setting.state.status = f_string_dynamic_increase_by((range_name.stop - range_name.start) + 2, &data_make->main->cache_1); + fake_string_dynamic_reset(&main->cache_1); + fake_string_dynamic_reset(&main->cache_2); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_partial_append_nulless(data_make->main->buffer, range_name, &data_make->main->cache_1); + main->setting.state.status = f_string_dynamic_increase_by((range_name.stop - range_name.start) + 2, &main->cache_1); + + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_partial_append_nulless(main->buffer, range_name, &main->cache_1); } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_environment_get(data_make->main->cache_1, &data_make->main->cache_2); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_environment_get(main->cache_1, &main->cache_2); } - if (F_status_is_error(data_make->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; - if (data_make->main->setting.state.status == F_exist_not) { - data_make->main->setting.state.status = F_false; + if (main->setting.state.status == F_exist_not) { + main->setting.state.status = F_false; return; } - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); + main->setting.state.status = f_string_dynamics_increase(main->setting.state.step_small, &main->cache_arguments); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_increase_by(data_make->main->cache_2.used + 1, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_increase_by(main->cache_2.used + 1, &main->cache_arguments.array[main->cache_arguments.used]); } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(data_make->main->cache_2, &data_make->main->cache_arguments.array[data_make->main->cache_arguments.used]); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_2, &main->cache_arguments.array[main->cache_arguments.used]); } - if (F_status_is_error(data_make->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; - if (!quote) { - ++data_make->main->cache_arguments.used; - - data_make->main->setting.state.status = f_string_dynamics_increase(data_make->main->setting.state.step_small, &data_make->main->cache_arguments); - if (F_status_is_error(data_make->main->setting.state.status)) return; - } - - data_make->main->setting.state.status = data_make->main->cache_2.used ? F_true : F_data_not; + main->setting.state.status = main->cache_2.used ? F_true : F_data_not; } #endif // _di_fake_make_operate_expand_environment_ @@ -1240,8 +1246,10 @@ extern "C" { if (!data_make || !data_make->main || !section_stack) return 0; if (F_status_is_error(data_make->main->setting.state.status) || data_make->main->setting.state.status == F_child) return data_make->main->program.child; + fake_main_t * const main = data_make->main; + if (id_section >= data_make->fakefile.used) { - data_make->main->setting.state.status = F_status_set_error(F_parameter); + main->setting.state.status = F_status_set_error(F_parameter); fake_print_error(&data_make->error, macro_fake_f(fake_make_operate_section)); @@ -1249,9 +1257,9 @@ extern "C" { } // Add the operation id to the operation stack. - data_make->main->setting.state.status = f_array_lengths_increase(data_make->main->setting.state.step_small, section_stack); + main->setting.state.status = f_array_lengths_increase(main->setting.state.step_small, section_stack); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_print_error(&data_make->error, macro_fake_f(f_array_lengths_increase)); return 0; @@ -1261,7 +1269,7 @@ extern "C" { const f_fss_named_t *section = &data_make->fakefile.array[id_section]; - fake_make_print_message_processing_section(&data_make->main->program.message, data_make->main->buffer, *section); + fake_make_print_message_processing_section(&main->program.message, main->buffer, *section); if (!section->objects.used) { --section_stack->used; @@ -1350,34 +1358,30 @@ extern "C" { f_array_length_t i = 0; f_array_length_t j = 0; - for (i = 0; i < section->objects.used; ++i, data_make->main->setting.state.status = F_none) { - - for (j = 0; j < data_make->main->cache_arguments.size; ++j) { - data_make->main->cache_arguments.array[j].used = 0; - } // for + for (i = 0; i < section->objects.used; ++i, main->setting.state.status = F_none) { - fake_string_dynamics_reset(&data_make->main->cache_arguments); + fake_string_dynamics_reset(&main->cache_arguments); state_process.condition = 0; state_process.condition_result = 0; state_process.operation_previous = state_process.operation; state_process.operation = 0; - if (!((++data_make->main->program.signal_check) % fake_signal_check_short_d)) { - if (fll_program_standard_signal_received(&data_make->main->program)) { - fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received); + if (!((++main->program.signal_check) % fake_signal_check_short_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data_make->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); break; } - data_make->main->program.signal_check = 0; + main->program.signal_check = 0; } for (j = 0; j < fake_max_operation_d; ++j) { - if (f_compare_dynamic_partial_string(operations_name[j].string, data_make->main->buffer, operations_name[j].used, section->objects.array[i]) == F_equal_to) { + if (f_compare_dynamic_partial_string(operations_name[j].string, main->buffer, operations_name[j].used, section->objects.array[i]) == F_equal_to) { state_process.operation = operations_type[j]; break; @@ -1385,15 +1389,15 @@ extern "C" { } // for if (!state_process.operation) { - fake_print_error_operation_unknown(&data_make->error, data_make->main->buffer, section->name, section->objects.array[i]); + fake_print_error_operation_unknown(&data_make->error, main->buffer, section->name, section->objects.array[i]); - data_make->main->setting.state.status = F_status_set_error(F_valid_not); + main->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->error, data_make->main->buffer, section->name, section->objects.array[i], fake_max_stack_d); + fake_print_error_operation_stack_max(&data_make->error, main->buffer, section->name, section->objects.array[i], fake_max_stack_d); - data_make->main->setting.state.status = F_status_set_error(F_recurse); + main->setting.state.status = F_status_set_error(F_recurse); } } @@ -1405,7 +1409,7 @@ extern "C" { fake_make_operate_validate(data_make, section->name, &state_process, section_stack); } - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->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; @@ -1418,38 +1422,38 @@ 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_make->main->setting.state.status == F_child) return result; + if (main->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_make->main->setting.state.status) == F_interrupt) break; + if (F_status_set_fine(main->setting.state.status) == F_interrupt) break; - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->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_make->main->setting.state.status) == F_signal_abort && !section_stack->used) { + if (F_status_set_fine(main->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; - data_make->error.context = data_make->main->program.context.set.error; - data_make->error.notable = data_make->main->program.context.set.notable; - data_make->main->program.error.to.stream = F_type_error_d; - data_make->main->program.error.to.id = F_type_descriptor_error_d; - data_make->error.set = &data_make->main->program.context.set; + data_make->error.context = main->program.context.set.error; + data_make->error.notable = main->program.context.set.notable; + main->program.error.to.stream = F_type_error_d; + main->program.error.to.id = F_type_descriptor_error_d; + data_make->error.set = &main->program.context.set; } - fake_print_error_operation_failed(&data_make->error, data_make->main->buffer, section->name, section->objects.array[i]); + fake_print_error_operation_failed(&data_make->error, main->buffer, section->name, section->objects.array[i]); // F_signal_abort is used by the break section operation. - if (F_status_set_fine(data_make->main->setting.state.status) == F_signal_abort) break; + if (F_status_set_fine(main->setting.state.status) == F_signal_abort) break; // F_signal_abort is used by the exit section operation. - if (F_status_set_fine(data_make->main->setting.state.status) == F_signal_quit) { + if (F_status_set_fine(main->setting.state.status) == F_signal_quit) { if (!section_stack->used) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } break; @@ -1457,27 +1461,27 @@ extern "C" { if (data_make->setting_make.fail == fake_make_operation_fail_exit_e) break; } - else if (data_make->main->setting.state.status == F_signal_abort) { + else if (main->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_make->main->setting.state.status == F_signal_quit) { + else if (main->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_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } break; } - else if (data_make->main->setting.state.status == F_failure) { + else if (main->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_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; state_process.success = F_false; } else { @@ -1485,19 +1489,19 @@ extern "C" { } } // for - if (F_status_set_error(data_make->main->setting.state.status) == F_interrupt) return 0; + if (F_status_set_error(main->setting.state.status) == F_interrupt) return 0; - if (i == section->objects.used && F_status_is_error_not(data_make->main->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->main->program.error, state_process.operation); + if (i == section->objects.used && F_status_is_error_not(main->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(&main->program.error, state_process.operation); - fake_print_error_operation_failed(&data_make->error, data_make->main->buffer, section->name, section->objects.array[section->objects.used - 1]); + fake_print_error_operation_failed(&data_make->error, main->buffer, section->name, section->objects.array[section->objects.used - 1]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->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_make->main->setting.state.status) && section_stack->used > 1) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (state_process.success == F_false && F_status_is_error_not(main->setting.state.status) && section_stack->used > 1) { + main->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 9673068..907d26d 100644 --- a/level_3/fake/c/main/make/operate_block.c +++ b/level_3/fake/c/main/make/operate_block.c @@ -57,7 +57,9 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; - if (F_status_is_error(data_make->main->setting.state.status)) { + fake_main_t * const main = data_make->main; + + if (F_status_is_error(main->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 3773b59..916d2e5 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -125,8 +125,10 @@ extern "C" { return; } - data_make->main->setting.state.status = f_string_dynamic_increase_by(source.used, destination); - if (F_status_is_error(data_make->main->setting.state.status)) return; + fake_main_t * const main = data_make->main; + + main->setting.state.status = f_string_dynamic_increase_by(source.used, destination); + if (F_status_is_error(main->setting.state.status)) return; for (f_array_length_t i = 0; i < source.used; ++i) { @@ -138,8 +140,8 @@ extern "C" { // A slash by itself at the end of the string is invalid. if (++i >= source.used) break; - data_make->main->setting.state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + if (F_status_is_error(main->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 +211,18 @@ extern "C" { if (buffer.used > 2) { uint32_t codepoint = 0; - data_make->main->setting.state.status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint); + main->setting.state.status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (!(data_make->main->setting.state.status == F_failure || data_make->main->setting.state.status == F_utf_not || data_make->main->setting.state.status == F_complete_not_utf || data_make->main->setting.state.status == F_utf_fragment || data_make->main->setting.state.status == F_valid_not)) { + if (F_status_is_error(main->setting.state.status)) { + if (!(main->setting.state.status == F_failure || main->setting.state.status == F_utf_not || main->setting.state.status == F_complete_not_utf || main->setting.state.status == F_utf_fragment || main->setting.state.status == F_valid_not)) { break; } } else { // Reserve 4-bytes (the max size of a Unicode UTF-8 sequence). - data_make->main->setting.state.status = f_string_dynamic_increase_by(4, destination); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_string_dynamic_increase_by(4, destination); + if (F_status_is_error(main->setting.state.status)) return; if (!codepoint) { destination->string[destination->used++] = f_string_null_s.string[0]; @@ -229,10 +231,10 @@ extern "C" { { f_string_t address = destination->string + destination->used; - data_make->main->setting.state.status = f_utf_unicode_from(codepoint, 4, &address); + main->setting.state.status = f_utf_unicode_from(codepoint, 4, &address); } - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { destination->string[destination->used] = 0; } else { @@ -262,16 +264,16 @@ extern "C" { } } else { - data_make->main->setting.state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); - if (F_status_is_error(data_make->main->setting.state.status)) return; + main->setting.state.status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + if (F_status_is_error(main->setting.state.status)) return; destination->string[destination->used++] = source.string[i]; } } // for - if (F_status_is_error(data_make->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_buffer_escape_ @@ -286,10 +288,12 @@ extern "C" { return; } - if (fll_program_standard_signal_received(&data_make->main->program)) { - fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received); + fake_main_t * const main = data_make->main; + + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data_make->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } @@ -304,25 +308,25 @@ extern "C" { data_make->environment.used = 0; if (data_make->setting_build.flag & data_build_setting_flag_has_environment_e) { - data_make->main->setting.state.status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment); + main->setting.state.status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fl_environment_load_names)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fl_environment_load_names)); return; } } else { - data_make->main->setting.state.status = f_environment_get_all(&data_make->environment); + main->setting.state.status = f_environment_get_all(&data_make->environment); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_environment_get_all)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_environment_get_all)); return; } } - fake_make_print_verbose_operate_program(&data_make->main->program.message, program, arguments); + fake_make_print_verbose_operate_program(&main->program.message, program, arguments); // Child processes should receive all signals, without blocking. f_signal_how_t signals = f_signal_how_t_initialize; @@ -333,24 +337,24 @@ extern "C" { int return_code = 0; - data_make->main->setting.state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); + main->setting.state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); - if (fll_program_standard_signal_received(&data_make->main->program)) { - fll_program_print_signal_received(&data_make->main->program.warning, data_make->main->program.signal_received); + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); - data_make->main->setting.state.status = F_status_set_error(F_interrupt); + main->setting.state.status = F_status_set_error(F_interrupt); return; } - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_set_fine(data_make->main->setting.state.status) == F_interrupt) return; + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_interrupt) return; - if (F_status_set_fine(data_make->main->setting.state.status) == F_file_found_not) { - fake_make_print_error_program_not_found(&data_make->main->program.error, program); + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_make_print_error_program_not_found(&main->program.error, program); } - else if (F_status_set_fine(data_make->main->setting.state.status) != F_failure) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fll_execute_program)); + else if (F_status_set_fine(main->setting.state.status) != F_failure) { + fake_print_error(&main->program.error, macro_fake_f(fll_execute_program)); } } @@ -365,52 +369,54 @@ extern "C" { if (!data_make || !data_make->main) return; - const f_status_t status_original = data_make->main->setting.state.status; + fake_main_t * const main = data_make->main; + + const f_status_t status_original = main->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; - data_make->main->setting.state.status = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number); + main->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->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_conversion_number_signed_to_string)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_conversion_number_signed_to_string)); f_string_dynamic_resize(0, &number); return; } - data_make->main->setting.state.status = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); + main->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(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); return; } - fake_make_print_error_program_failed(&data_make->main->program.error, return_code); + fake_make_print_error_program_failed(&main->program.error, return_code); - data_make->main->setting.state.status = (data_make->setting_make.fail == fake_make_operation_fail_exit_e) ? F_status_set_error(F_failure) : F_failure; + main->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(status_original)) { - data_make->main->setting.state.status = f_string_dynamic_append(f_string_ascii_1_s, &data_make->setting_make.parameter.array[0].value.array[0]); + main->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->main->setting.state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->setting_make.parameter.array[0].value.array[0]); + main->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(data_make->main->setting.state.status)) { - fll_error_print(&data_make->error, F_status_set_fine(data_make->main->setting.state.status), macro_fake_f(f_string_dynamic_append), F_true); + if (F_status_is_error(main->setting.state.status)) { + fll_error_print(&data_make->error, F_status_set_fine(main->setting.state.status), macro_fake_f(f_string_dynamic_append), F_true); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_process_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 03b8968..aaeb45d 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -9,21 +9,23 @@ extern "C" { if (!data_make || !data_make->main) return; - data_make->main->setting.state.status = F_none; + fake_main_t * const main = data_make->main; - if (!data_make->main->cache_arguments.used || f_compare_dynamic(fake_make_operation_argument_success_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { - data_make->main->setting.state.status = F_signal_abort; + main->setting.state.status = F_none; + + if (!main->cache_arguments.used || f_compare_dynamic(fake_make_operation_argument_success_s, main->cache_arguments.array[0]) == F_equal_to) { + main->setting.state.status = F_signal_abort; } - else if (f_compare_dynamic(fake_make_operation_argument_failure_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { - data_make->main->setting.state.status = F_status_set_error(F_signal_abort); + else if (f_compare_dynamic(fake_make_operation_argument_failure_s, main->cache_arguments.array[0]) == F_equal_to) { + main->setting.state.status = F_status_set_error(F_signal_abort); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } - fake_make_print_verbose_operate_break(&data_make->main->program.message, data_make->main->cache_arguments); + fake_make_print_verbose_operate_break(&main->program.message, main->cache_arguments); } #endif // _di_fake_make_operate_process_type_break_ @@ -32,10 +34,12 @@ extern "C" { if (!data_make || !data_make->main) return; - fake_build_operate(data_make->data, data_make->main->cache_arguments.used ? &data_make->main->cache_arguments : 0, F_false); - if (F_status_set_fine(data_make->main->setting.state.status) == F_interrupt) return; + fake_main_t * const main = data_make->main; + + fake_build_operate(data_make->data, main->cache_arguments.used ? &main->cache_arguments : 0, F_false); + if (F_status_set_fine(main->setting.state.status) == F_interrupt) return; - fake_make_operate_process_return(data_make, F_status_is_error(data_make->main->setting.state.status) ? 1 : 0); + fake_make_operate_process_return(data_make, F_status_is_error(main->setting.state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_build_ @@ -44,10 +48,12 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + fake_clean_operate(data_make->data); - if (F_status_set_fine(data_make->main->setting.state.status) == F_interrupt) return; + if (F_status_set_fine(main->setting.state.status) == F_interrupt) return; - fake_make_operate_process_return(data_make, F_status_is_error(data_make->main->setting.state.status) ? 1 : 0); + fake_make_operate_process_return(data_make, F_status_is_error(main->setting.state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_clean_ @@ -56,12 +62,14 @@ extern "C" { if (!data_make || !data_make->main) return 0; + fake_main_t * const main = data_make->main; + const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_compiler); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_execute)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_execute)); } - else if (data_make->main->setting.state.status == F_child) { + else if (main->setting.state.status == F_child) { return result; } @@ -76,7 +84,9 @@ extern "C" { if (!data_make || !data_make->main) return; - data_make->main->setting.state.status = F_none; + fake_main_t * const main = data_make->main; + + main->setting.state.status = F_none; if (state_process->condition == fake_make_operation_if_type_if_define_e) { fake_make_operate_process_type_if_define(data_make, F_false, state_process); @@ -84,9 +94,9 @@ extern "C" { else if (state_process->condition == fake_make_operation_if_type_if_equal_e) { state_process->condition_result = fake_condition_result_true_e; - for (f_array_length_t i = 2; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 2; i < main->cache_arguments.used; ++i) { - if (f_compare_dynamic(data_make->main->cache_arguments.array[1], data_make->main->cache_arguments.array[i]) == F_equal_to_not) { + if (f_compare_dynamic(main->cache_arguments.array[1], main->cache_arguments.array[i]) == F_equal_to_not) { state_process->condition_result = fake_condition_result_false_e; break; @@ -99,13 +109,13 @@ extern "C" { f_array_length_t i = 1; f_array_length_t j = 0; - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - for (j = i + 1; j < data_make->main->cache_arguments.used; ++j) { + for (j = i + 1; j < main->cache_arguments.used; ++j) { - if (f_compare_dynamic(data_make->main->cache_arguments.array[i], data_make->main->cache_arguments.array[j]) == F_equal_to) { + if (f_compare_dynamic(main->cache_arguments.array[i], main->cache_arguments.array[j]) == F_equal_to) { state_process->condition_result = fake_condition_result_false_e; - i = data_make->main->cache_arguments.used; + i = main->cache_arguments.used; break; } @@ -197,12 +207,14 @@ extern "C" { if (!data_make || !data_make->main) return; - const f_array_length_t total = data_make->main->cache_arguments.used - 1; + fake_main_t * const main = data_make->main; + + const f_array_length_t total = main->cache_arguments.used - 1; f_string_static_t destination = f_string_static_t_initialize; f_directory_recurse_copy_t recurse = f_directory_recurse_copy_t_initialize; - if (data_make->main->program.error.verbosity > f_console_verbosity_normal_e) { - recurse.state.custom = data_make->main; + if (main->program.error.verbosity > f_console_verbosity_normal_e) { + recurse.state.custom = main; recurse.verbose = clone ? fake_print_verbose_recursive_clone : fake_print_verbose_recursive_copy; } @@ -210,56 +222,56 @@ extern "C" { recurse.flag = f_file_stat_flag_group_e | f_file_stat_flag_owner_e; } else { - macro_f_mode_t_set_default_umask(recurse.mode, data_make->main->program.umask); + macro_f_mode_t_set_default_umask(recurse.mode, main->program.umask); } bool existing = F_true; f_array_length_t i = 0; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; recurse.flag |= f_file_stat_flag_reference_e; } // In this case, the destination could be a file, so confirm this. - if (data_make->main->cache_arguments.used == 2 + i) { - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[1]); + if (main->cache_arguments.used == 2 + i) { + main->setting.state.status = f_directory_is(main->cache_arguments.array[1]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_is), data_make->main->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), main->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); f_directory_recurse_copy_delete(&recurse); return; } - if (data_make->main->setting.state.status == F_false || data_make->main->setting.state.status == F_file_found_not || data_make->main->setting.state.status == F_data_not) { + if (main->setting.state.status == F_false || main->setting.state.status == F_file_found_not || main->setting.state.status == F_data_not) { existing = F_false; } } for (; i < total; ++i) { - destination.used = data_make->main->cache_arguments.array[total].used + 1; + destination.used = main->cache_arguments.array[total].used + 1; if (existing) { - fake_string_dynamic_reset(&data_make->main->cache_argument); + fake_string_dynamic_reset(&main->cache_argument); - data_make->main->setting.state.status = f_file_name_base(data_make->main->cache_arguments.array[i], &data_make->main->cache_argument); + main->setting.state.status = f_file_name_base(main->cache_arguments.array[i], &main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_name_base), data_make->main->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_name_base), main->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); f_directory_recurse_copy_delete(&recurse); return; } - destination.used += data_make->main->cache_argument.used + 1; + destination.used += main->cache_argument.used + 1; } f_char_t destination_string[destination.used + 1]; @@ -271,24 +283,24 @@ extern "C" { destination_string[destination.used - 2] = 0; } - memcpy(destination_string, data_make->main->cache_arguments.array[total].string, sizeof(f_char_t) * data_make->main->cache_arguments.array[total].used); + memcpy(destination_string, main->cache_arguments.array[total].string, sizeof(f_char_t) * main->cache_arguments.array[total].used); if (existing) { - if (destination_string[data_make->main->cache_arguments.array[total].used - 1] == f_path_separator_s.string[0]) { - memcpy(destination_string + data_make->main->cache_arguments.array[total].used, data_make->main->cache_argument.string, sizeof(f_char_t) * data_make->main->cache_argument.used); + if (destination_string[main->cache_arguments.array[total].used - 1] == f_path_separator_s.string[0]) { + memcpy(destination_string + main->cache_arguments.array[total].used, main->cache_argument.string, sizeof(f_char_t) * main->cache_argument.used); --destination.used; } else { - memcpy(destination_string + data_make->main->cache_arguments.array[total].used + 1, data_make->main->cache_argument.string, sizeof(f_char_t) * data_make->main->cache_arguments.array[i].used); + memcpy(destination_string + main->cache_arguments.array[total].used + 1, main->cache_argument.string, sizeof(f_char_t) * main->cache_arguments.array[i].used); - destination_string[data_make->main->cache_arguments.array[total].used] = f_path_separator_s.string[0]; + destination_string[main->cache_arguments.array[total].used] = f_path_separator_s.string[0]; } } - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[i]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[i]); - if (data_make->main->setting.state.status == F_true) { + if (main->setting.state.status == F_true) { if (clone) { recurse.flag |= f_directory_recurse_copy_flag_clone_e; } @@ -296,38 +308,38 @@ extern "C" { recurse.flag -= recurse.flag & f_directory_recurse_copy_flag_clone_e; } - fl_directory_copy(data_make->main->cache_arguments.array[i], destination, &recurse); + fl_directory_copy(main->cache_arguments.array[i], destination, &recurse); if (F_status_is_error(recurse.state.status)) { - data_make->main->setting.state.status = recurse.state.status; + main->setting.state.status = recurse.state.status; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(fl_directory_copy), data_make->main->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(fl_directory_copy), main->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } - else if (data_make->main->setting.state.status == F_false) { + else if (main->setting.state.status == F_false) { if (clone) { - data_make->main->setting.state.status = f_file_clone(data_make->main->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); + main->setting.state.status = f_file_clone(main->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); } else { - data_make->main->setting.state.status = f_file_copy(data_make->main->cache_arguments.array[i], destination, recurse.mode, recurse.size_block, recurse.flag); + main->setting.state.status = f_file_copy(main->cache_arguments.array[i], destination, recurse.mode, recurse.size_block, recurse.flag); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->main->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), main->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); break; } - fake_make_print_verbose_operate_copy(&data_make->main->program.message, clone, data_make->main->cache_arguments.array[i], destination); + fake_make_print_verbose_operate_copy(&main->program.message, clone, main->cache_arguments.array[i], destination); } - else if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_is), data_make->main->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e); + else if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), main->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); break; } @@ -335,8 +347,8 @@ extern "C" { f_directory_recurse_copy_delete(&recurse); - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = F_none; + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_process_type_copy_ @@ -346,20 +358,22 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { - data_make->main->setting.state.status = f_environment_set(data_make->main->cache_arguments.array[0], data_make->main->cache_arguments.array[1], F_true); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 1) { + main->setting.state.status = f_environment_set(main->cache_arguments.array[0], main->cache_arguments.array[1], F_true); } else { - data_make->main->setting.state.status = f_environment_set(data_make->main->cache_arguments.array[0], f_string_empty_s, F_true); + main->setting.state.status = f_environment_set(main->cache_arguments.array[0], f_string_empty_s, F_true); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_environment_set)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_environment_set)); } else { - fake_make_print_verbose_operate_define(&data_make->main->program.message, data_make->main->cache_arguments.array[0]); + fake_make_print_verbose_operate_define(&main->program.message, main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_process_type_define_ @@ -369,77 +383,79 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + const int recursion_max = all ? F_directory_max_descriptors_d : 0; struct stat file_stat; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; - for (f_array_length_t i = 0; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 0; i < main->cache_arguments.used; ++i) { memset(&file_stat, 0, sizeof(struct stat)); - data_make->main->setting.state.status = f_file_stat(data_make->main->cache_arguments.array[i], F_false, &file_stat); + main->setting.state.status = f_file_stat(main->cache_arguments.array[i], F_false, &file_stat); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_set_fine(data_make->main->setting.state.status) == F_file_found_not) { - fake_make_print_warning_file_not_found(&data_make->main->program.warning, data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_make_print_warning_file_not_found(&main->program.warning, main->cache_arguments.array[i]); - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stat), data_make->main->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stat), main->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } else if (macro_f_file_type_is_directory(file_stat.st_mode)) { - if (data_make->main->program.error.verbosity >= f_console_verbosity_verbose_e) { - data_make->main->setting.state.status = f_directory_remove_custom(data_make->main->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely); + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { + main->setting.state.status = f_directory_remove_custom(main->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely); } else { - data_make->main->setting.state.status = f_directory_remove(data_make->main->cache_arguments.array[i], recursion_max, F_false); + main->setting.state.status = f_directory_remove(main->cache_arguments.array[i], recursion_max, F_false); } - if (F_status_set_fine(data_make->main->setting.state.status) == F_file_found_not) { - fake_make_print_verbose_operate_file_not_found(&data_make->main->program.message, F_true, data_make->main->cache_arguments.array[i]); + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_make_print_verbose_operate_file_not_found(&main->program.message, F_true, main->cache_arguments.array[i]); - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_remove), data_make->main->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_remove), main->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } else { - data_make->main->setting.state.status = f_file_remove(data_make->main->cache_arguments.array[i]); + main->setting.state.status = f_file_remove(main->cache_arguments.array[i]); - if (F_status_set_fine(data_make->main->setting.state.status) == F_file_found_not) { - if (data_make->main->program.error.verbosity >= f_console_verbosity_verbose_e) { - fake_make_print_verbose_operate_file_not_found(&data_make->main->program.message, F_false, data_make->main->cache_arguments.array[i]); + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { + fake_make_print_verbose_operate_file_not_found(&main->program.message, F_false, main->cache_arguments.array[i]); } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_remove), data_make->main->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_remove), main->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - fake_make_print_verbose_operate_delete(&data_make->main->program.message, data_make->main->cache_arguments.array[i]); + fake_make_print_verbose_operate_delete(&main->program.message, main->cache_arguments.array[i]); } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_deletes_ @@ -448,31 +464,33 @@ extern "C" { if (!data_make || !data_make->main) return; - data_make->main->setting.state.status = F_none; + fake_main_t * const main = data_make->main; + + main->setting.state.status = F_none; - if (!data_make->main->cache_arguments.used || f_compare_dynamic(fake_make_operation_argument_success_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { - data_make->main->setting.state.status = F_signal_quit; + if (!main->cache_arguments.used || f_compare_dynamic(fake_make_operation_argument_success_s, main->cache_arguments.array[0]) == F_equal_to) { + main->setting.state.status = F_signal_quit; } - else if (f_compare_dynamic(fake_make_operation_argument_failure_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { - data_make->main->setting.state.status = F_status_set_error(F_signal_quit); + else if (f_compare_dynamic(fake_make_operation_argument_failure_s, main->cache_arguments.array[0]) == F_equal_to) { + main->setting.state.status = F_status_set_error(F_signal_quit); // Forcing exit forces fail mode. 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; - data_make->error.context = data_make->main->program.context.set.error; - data_make->error.notable = data_make->main->program.context.set.notable; - data_make->main->program.error.to.stream = F_type_error_d; - data_make->main->program.error.to.id = F_type_descriptor_error_d; - data_make->error.set = &data_make->main->program.context.set; + data_make->error.context = main->program.context.set.error; + data_make->error.notable = main->program.context.set.notable; + main->program.error.to.stream = F_type_error_d; + main->program.error.to.id = F_type_descriptor_error_d; + data_make->error.set = &main->program.context.set; } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } - fake_make_print_verbose_operate_exiting_as(&data_make->main->program.message, data_make->main->cache_arguments); + fake_make_print_verbose_operate_exiting_as(&main->program.message, main->cache_arguments); } #endif // _di_fake_make_operate_process_type_exit_ @@ -481,33 +499,35 @@ extern "C" { if (!data_make || !data_make->main) return; - if (f_compare_dynamic(fake_make_operation_argument_exit_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { + fake_main_t * const main = data_make->main; + + if (f_compare_dynamic(fake_make_operation_argument_exit_s, main->cache_arguments.array[0]) == F_equal_to) { 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; - data_make->error.context = data_make->main->program.context.set.error; - data_make->error.notable = data_make->main->program.context.set.notable; - data_make->main->program.error.to.stream = F_type_error_d; - data_make->main->program.error.to.id = F_type_descriptor_error_d; - data_make->error.set = &data_make->main->program.context.set; + data_make->error.context = main->program.context.set.error; + data_make->error.notable = main->program.context.set.notable; + main->program.error.to.stream = F_type_error_d; + main->program.error.to.id = F_type_descriptor_error_d; + data_make->error.set = &main->program.context.set; } - else if (f_compare_dynamic(fake_make_operation_argument_warn_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { + else if (f_compare_dynamic(fake_make_operation_argument_warn_s, main->cache_arguments.array[0]) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_warn_e; data_make->error.prefix = fl_print_warning_s; data_make->error.suffix = f_string_empty_s; - data_make->error.context = data_make->main->program.context.set.warning; - data_make->error.notable = data_make->main->program.context.set.notable; - data_make->main->program.error.to.stream = F_type_output_d; - data_make->main->program.error.to.id = F_type_descriptor_output_d; - data_make->error.set = &data_make->main->program.context.set; + data_make->error.context = main->program.context.set.warning; + data_make->error.notable = main->program.context.set.notable; + main->program.error.to.stream = F_type_output_d; + main->program.error.to.id = F_type_descriptor_output_d; + data_make->error.set = &main->program.context.set; } else { data_make->setting_make.fail = fake_make_operation_fail_ignore_e; - data_make->main->program.error.to.stream = 0; - data_make->main->program.error.to.id = -1; + main->program.error.to.stream = 0; + main->program.error.to.id = -1; } - fake_make_print_verbose_operate_set_failure_state(&data_make->main->program.message, data_make->setting_make.fail); + fake_make_print_verbose_operate_set_failure_state(&main->program.message, data_make->setting_make.fail); } #endif // _di_fake_make_operate_process_type_fail_ @@ -516,52 +536,54 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + gid_t id = 0; bool dereference = F_true; f_array_length_t i = 0; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - id = (gid_t) fake_make_get_id(data_make, F_false, data_make->main->cache_arguments.array[i++]); + id = (gid_t) fake_make_get_id(data_make, F_false, main->cache_arguments.array[i++]); - if (F_status_is_error(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (F_status_is_error(main->setting.state.status)) { + main->setting.state.status = F_status_set_error(F_failure); } - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); continue; } if (all) { - data_make->main->setting.state.status = fll_file_role_change_all(data_make->main->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); + main->setting.state.status = fll_file_role_change_all(main->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); } else { - data_make->main->setting.state.status = f_file_role_change(data_make->main->cache_arguments.array[i], -1, id, dereference); + main->setting.state.status = f_file_role_change(main->cache_arguments.array[i], -1, id, dereference); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_make_print_verbose_operate_set_role(&data_make->main->program.message, all ? 0x1 : 0x0, data_make->main->cache_arguments.array[i], (f_number_unsigned_t) id); + fake_make_print_verbose_operate_set_role(&main->program.message, all ? 0x1 : 0x0, main->cache_arguments.array[i], (f_number_unsigned_t) id); } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_groups_ @@ -570,13 +592,15 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + state_process->condition_result = fake_condition_result_true_e; // Multiple properties may pass and so if any of them fail, then they all fail. if (if_not) { - for (f_array_length_t i = 2; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 2; i < main->cache_arguments.used; ++i) { - if (f_environment_exists(data_make->main->cache_arguments.array[i]) == F_true) { + if (f_environment_exists(main->cache_arguments.array[i]) == F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -584,9 +608,9 @@ extern "C" { } // for } else { - for (f_array_length_t i = 1; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 1; i < main->cache_arguments.used; ++i) { - if (f_environment_exists(data_make->main->cache_arguments.array[i]) != F_true) { + if (f_environment_exists(main->cache_arguments.array[i]) != F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -601,12 +625,14 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; - if (i == data_make->main->cache_arguments.used) { + if (i == main->cache_arguments.used) { if (if_not) { state_process->condition_result = fake_condition_result_true_e; } @@ -614,41 +640,41 @@ extern "C" { state_process->condition_result = fake_condition_result_false_e; } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } state_process->condition_result = fake_condition_result_true_e; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - data_make->main->setting.state.status = f_file_exists(data_make->main->cache_arguments.array[i], dereference); + main->setting.state.status = f_file_exists(main->cache_arguments.array[i], dereference); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_exists), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_exists), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } if (if_not) { - if (data_make->main->setting.state.status == F_true) { + if (main->setting.state.status == F_true) { state_process->condition_result = fake_condition_result_false_e; break; } } else { - if (data_make->main->setting.state.status != F_true) { + if (main->setting.state.status != F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -656,7 +682,7 @@ extern "C" { } } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_exist_ @@ -665,6 +691,8 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + // block = 0x1 (0000 0001) link = 0x10 (0001 0000) // character = 0x2 (0000 0010) regular = 0x20 (0010 0000) // directory = 0x4 (0000 0100) socket = 0x40 (0100 0000) @@ -674,14 +702,14 @@ extern "C" { f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - if (i == data_make->main->cache_arguments.used) { + if (i == main->cache_arguments.used) { if (if_not) { state_process->condition_result = fake_condition_result_true_e; } @@ -689,38 +717,38 @@ extern "C" { state_process->condition_result = fake_condition_result_false_e; } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - if (f_compare_dynamic(fake_make_operation_argument_if_is_for_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_if_is_for_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; break; } - if (f_compare_dynamic(f_file_type_name_block_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(f_file_type_name_block_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x1; } - else if (f_compare_dynamic(f_file_type_name_character_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_character_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x2; } - else if (f_compare_dynamic(f_file_type_name_directory_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_directory_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x4; } - else if (f_compare_dynamic(f_file_type_name_fifo_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_fifo_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x8; } - else if (f_compare_dynamic(f_file_type_name_link_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_link_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x10; } - else if (f_compare_dynamic(f_file_type_name_regular_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_regular_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x20; } - else if (f_compare_dynamic(f_file_type_name_socket_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_socket_s, main->cache_arguments.array[i]) == F_equal_to) { type |= 0x40; } } // for @@ -730,16 +758,16 @@ extern "C" { state_process->condition_result = fake_condition_result_true_e; - for (; i < data_make->main->cache_arguments.used; ++i, mode_file = 0) { + for (; i < main->cache_arguments.used; ++i, mode_file = 0) { - data_make->main->setting.state.status = f_file_mode_read(data_make->main->cache_arguments.array[i], dereference, &mode_file); + main->setting.state.status = f_file_mode_read(main->cache_arguments.array[i], dereference, &mode_file); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_mode_read), data_make->main->cache_arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_mode_read), main->cache_arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -782,7 +810,7 @@ extern "C" { } } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_is_ @@ -791,6 +819,8 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + f_string_range_t range = f_string_range_t_initialize; f_number_unsigned_t number_left = 0; f_number_unsigned_t number_right = 0; @@ -800,56 +830,56 @@ extern "C" { f_array_length_t i = 1; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; state_process->condition_result = fake_condition_result_true_e; range.start = 0; - range.stop = data_make->main->cache_arguments.array[i].used - 1; + range.stop = main->cache_arguments.array[i].used - 1; - if (data_make->main->cache_arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) { + if (main->cache_arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } - else if (data_make->main->cache_arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) { + else if (main->cache_arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) { range.start = 1; is_negative_left = F_true; } if (range.start > range.stop) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->main->cache_arguments.array[i], range, &number_left); + main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, main->cache_arguments.array[i], range, &number_left); } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - for (i = 2; i < data_make->main->cache_arguments.used; ++i, data_make->main->setting.state.status = F_none, number_left = number_right, is_negative_left = is_negative_right) { + if (F_status_is_error_not(main->setting.state.status)) { + for (i = 2; i < main->cache_arguments.used; ++i, main->setting.state.status = F_none, number_left = number_right, is_negative_left = is_negative_right) { - if (data_make->main->cache_arguments.array[i].used) { + if (main->cache_arguments.array[i].used) { range.start = 0; - range.stop = data_make->main->cache_arguments.array[i].used - 1; + range.stop = main->cache_arguments.array[i].used - 1; is_negative_right = F_false; - if (data_make->main->cache_arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) { + if (main->cache_arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } - else if (data_make->main->cache_arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) { + else if (main->cache_arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) { range.start = 1; is_negative_right = F_true; } if (range.start > range.stop) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->main->cache_arguments.array[i], range, &number_right); + main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, main->cache_arguments.array[i], range, &number_right); } } else { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->main->setting.state.status)) break; + if (F_status_is_error(main->setting.state.status)) break; if (state_process->condition == fake_make_operation_if_type_if_greater_e) { @@ -914,20 +944,20 @@ extern "C" { } // for } - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; if ((i == 1 && number_left > F_number_t_size_unsigned_d) || (i > 1 && number_right > F_number_t_size_unsigned_d)) { - fake_make_print_error_out_of_range_number(&data_make->main->program.error, data_make->main->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d); + fake_make_print_error_out_of_range_number(&main->program.error, main->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d); } else { - fake_make_print_error_unsupported_number(&data_make->main->program.error, data_make->main->cache_arguments.array[i]); + fake_make_print_error_unsupported_number(&main->program.error, main->cache_arguments.array[i]); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_process_type_if_greater_if_lesser_ @@ -937,41 +967,43 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + uid_t id = 0; f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - id = (uid_t) fake_make_get_id(data_make, F_true, data_make->main->cache_arguments.array[i++]); + id = (uid_t) fake_make_get_id(data_make, F_true, main->cache_arguments.array[i++]); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id)); + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } state_process->condition_result = fake_condition_result_true_e; - for (uid_t id_file = 0; i < data_make->main->cache_arguments.used; ++i, id_file = 0) { + for (uid_t id_file = 0; i < main->cache_arguments.used; ++i, id_file = 0) { - data_make->main->setting.state.status = f_file_group_read(data_make->main->cache_arguments.array[i], dereference, &id_file); + main->setting.state.status = f_file_group_read(main->cache_arguments.array[i], dereference, &id_file); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_group_read), data_make->main->cache_arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_group_read), main->cache_arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -992,7 +1024,7 @@ extern "C" { } } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_group_ @@ -1001,37 +1033,39 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + f_file_mode_t mode_rule = 0; mode_t mode_match = 0; bool is = F_false; - if (f_compare_dynamic(fake_make_operation_argument_is_s, data_make->main->cache_arguments.array[if_not ? 2 : 1]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_is_s, main->cache_arguments.array[if_not ? 2 : 1]) == F_equal_to) { is = F_true; } { uint8_t mode_replace = 0; - fake_make_get_id_mode(data_make, data_make->main->cache_arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace); + fake_make_get_id_mode(data_make, main->cache_arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id_mode)); + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id_mode)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - data_make->main->setting.state.status = f_file_mode_to_mode(mode_rule, &mode_match); + main->setting.state.status = f_file_mode_to_mode(mode_rule, &mode_match); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(&data_make->main->program.error, macro_fake_f(f_file_mode_to_mode)); + fake_print_error(&main->program.error, macro_fake_f(f_file_mode_to_mode)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1041,16 +1075,16 @@ extern "C" { state_process->condition_result = fake_condition_result_true_e; - for (f_array_length_t i = if_not ? 4 : 3; i < data_make->main->cache_arguments.used; ++i, mode_file = 0) { + for (f_array_length_t i = if_not ? 4 : 3; i < main->cache_arguments.used; ++i, mode_file = 0) { - data_make->main->setting.state.status = f_file_mode_read(data_make->main->cache_arguments.array[i], F_true, &mode_file); + main->setting.state.status = f_file_mode_read(main->cache_arguments.array[i], F_true, &mode_file); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_mode_read), data_make->main->cache_arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_mode_read), main->cache_arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1089,7 +1123,7 @@ extern "C" { } } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_mode_ @@ -1098,41 +1132,43 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + uid_t id = 0; f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - id = (uid_t) fake_make_get_id(data_make, F_true, data_make->main->cache_arguments.array[i++]); + id = (uid_t) fake_make_get_id(data_make, F_true, main->cache_arguments.array[i++]); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id)); + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } state_process->condition_result = fake_condition_result_true_e; - for (uid_t id_file = 0; i < data_make->main->cache_arguments.used; ++i, id_file = 0) { + for (uid_t id_file = 0; i < main->cache_arguments.used; ++i, id_file = 0) { - data_make->main->setting.state.status = f_file_owner_read(data_make->main->cache_arguments.array[i], dereference, &id_file); + main->setting.state.status = f_file_owner_read(main->cache_arguments.array[i], dereference, &id_file); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_owner_read), data_make->main->cache_arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_owner_read), main->cache_arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1153,7 +1189,7 @@ extern "C" { } } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_owner_ @@ -1162,6 +1198,8 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + const f_string_static_t reserved_name[] = { fake_make_parameter_variable_build_s, fake_make_parameter_variable_color_s, @@ -1199,28 +1237,28 @@ extern "C" { }; const bool reserved_parameter[] = { - data_make->main->setting.build.used, + main->setting.build.used, F_true, - data_make->main->setting.data.used, - data_make->main->setting.defines.used, - data_make->main->setting.fakefile.used, - data_make->main->setting.modes.used, - data_make->main->setting.process.used, - data_make->main->setting.settings.used, - data_make->main->setting.sources.used, + main->setting.data.used, + main->setting.defines.used, + main->setting.fakefile.used, + main->setting.modes.used, + main->setting.process.used, + main->setting.settings.used, + main->setting.sources.used, F_true, - data_make->main->setting.work.used, - data_make->main->program.parameters.array[fake_parameter_build_e].result & f_console_result_value_e, - (data_make->main->program.parameters.array[fake_parameter_light_e].result & f_console_result_found_e) || (data_make->main->program.parameters.array[fake_parameter_dark_e].result & f_console_result_found_e) || (data_make->main->program.parameters.array[fake_parameter_no_color_e].result & f_console_result_found_e), - data_make->main->program.parameters.array[fake_parameter_data_e].result & f_console_result_value_e, - data_make->main->program.parameters.array[fake_parameter_define_e].result & f_console_result_value_e, - data_make->main->program.parameters.array[fake_parameter_fakefile_e].result & f_console_result_value_e, - data_make->main->program.parameters.array[fake_parameter_mode_e].result & f_console_result_value_e, - data_make->main->program.parameters.array[fake_parameter_process_e].result & f_console_result_value_e, - data_make->main->program.parameters.array[fake_parameter_settings_e].result & f_console_result_value_e, - data_make->main->program.parameters.array[fake_parameter_sources_e].result & f_console_result_value_e, - (data_make->main->program.parameters.array[fake_parameter_verbosity_quiet_e].result & f_console_result_found_e) || (data_make->main->program.parameters.array[fake_parameter_verbosity_normal_e].result & f_console_result_found_e) || (data_make->main->program.parameters.array[fake_parameter_verbosity_verbose_e].result & f_console_result_found_e) || (data_make->main->program.parameters.array[fake_parameter_verbosity_debug_e].result & f_console_result_found_e), - data_make->main->program.parameters.array[fake_parameter_work_e].result & f_console_result_value_e, + main->setting.work.used, + main->program.parameters.array[fake_parameter_build_e].result & f_console_result_value_e, + (main->program.parameters.array[fake_parameter_light_e].result & f_console_result_found_e) || (main->program.parameters.array[fake_parameter_dark_e].result & f_console_result_found_e) || (main->program.parameters.array[fake_parameter_no_color_e].result & f_console_result_found_e), + main->program.parameters.array[fake_parameter_data_e].result & f_console_result_value_e, + main->program.parameters.array[fake_parameter_define_e].result & f_console_result_value_e, + main->program.parameters.array[fake_parameter_fakefile_e].result & f_console_result_value_e, + main->program.parameters.array[fake_parameter_mode_e].result & f_console_result_value_e, + main->program.parameters.array[fake_parameter_process_e].result & f_console_result_value_e, + main->program.parameters.array[fake_parameter_settings_e].result & f_console_result_value_e, + main->program.parameters.array[fake_parameter_sources_e].result & f_console_result_value_e, + (main->program.parameters.array[fake_parameter_verbosity_quiet_e].result & f_console_result_found_e) || (main->program.parameters.array[fake_parameter_verbosity_normal_e].result & f_console_result_found_e) || (main->program.parameters.array[fake_parameter_verbosity_verbose_e].result & f_console_result_found_e) || (main->program.parameters.array[fake_parameter_verbosity_debug_e].result & f_console_result_found_e), + main->program.parameters.array[fake_parameter_work_e].result & f_console_result_value_e, data_make->parameter_value.build.used, data_make->parameter_value.color.used, data_make->parameter_value.data.used, @@ -1243,11 +1281,11 @@ extern "C" { state_process->condition_result = fake_condition_result_true_e; // Multiple properties may pass and so if any of them fail, then they all fail. - for (; i < data_make->main->cache_arguments.used && !result; ++i) { + for (; i < main->cache_arguments.used && !result; ++i) { for (j = 0; j < 33; ++j) { - if (f_compare_dynamic(reserved_name[j], data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(reserved_name[j], main->cache_arguments.array[i]) == F_equal_to) { result = reserved_parameter[j] ? 2 : 1; break; @@ -1257,7 +1295,7 @@ extern "C" { if (!result) { for (j = 0; j < data_make->setting_make.parameter.used; ++j) { - if (f_compare_dynamic(data_make->main->cache_arguments.array[i], data_make->setting_make.parameter.array[j].name) == F_equal_to) { + if (f_compare_dynamic(main->cache_arguments.array[i], data_make->setting_make.parameter.array[j].name) == F_equal_to) { result = 2; break; @@ -1269,7 +1307,7 @@ extern "C" { } } - if (result == 2 && i + 1 < data_make->main->cache_arguments.used) { + if (result == 2 && i + 1 < main->cache_arguments.used) { result = 0; } } // for @@ -1294,15 +1332,17 @@ 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 0; + if (!data_make || !data_make->main) return 0; + + fake_main_t * const main = data_make->main; const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_indexer); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_execute)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_execute)); } - if (data_make->main->setting.state.status == F_child) return result; + if (main->setting.state.status == F_child) return result; fake_make_operate_process_return(data_make, result); @@ -1315,65 +1355,67 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + // 0x1 = force, 0x2 = strict. uint8_t flag = 0; - if (data_make->main->cache_arguments.used > 2) { - if (f_compare_dynamic(fake_make_operation_argument_force_s, data_make->main->cache_arguments.array[1]) != F_equal_to) { + if (main->cache_arguments.used > 2) { + if (f_compare_dynamic(fake_make_operation_argument_force_s, main->cache_arguments.array[1]) != F_equal_to) { flag |= 0x1; } - else if (f_compare_dynamic(fake_make_operation_argument_strict_s, data_make->main->cache_arguments.array[1]) == F_equal_to) { + else if (f_compare_dynamic(fake_make_operation_argument_strict_s, main->cache_arguments.array[1]) == F_equal_to) { flag |= 0x2; } - if (data_make->main->cache_arguments.used > 3) { - if (f_compare_dynamic(fake_make_operation_argument_force_s, data_make->main->cache_arguments.array[2]) != F_equal_to) { + if (main->cache_arguments.used > 3) { + if (f_compare_dynamic(fake_make_operation_argument_force_s, main->cache_arguments.array[2]) != F_equal_to) { flag |= 0x1; } - else if (f_compare_dynamic(fake_make_operation_argument_strict_s, data_make->main->cache_arguments.array[2]) == F_equal_to) { + else if (f_compare_dynamic(fake_make_operation_argument_strict_s, main->cache_arguments.array[2]) == F_equal_to) { flag |= 0x2; } } } - if ((flag & 0x1) && f_file_exists(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], F_false) == F_true) { - if (f_directory_is(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]) == F_true) { - data_make->main->setting.state.status = f_directory_remove(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], F_directory_max_descriptors_d, F_false); + if ((flag & 0x1) && f_file_exists(main->cache_arguments.array[main->cache_arguments.used - 1], F_false) == F_true) { + if (f_directory_is(main->cache_arguments.array[main->cache_arguments.used - 1]) == F_true) { + main->setting.state.status = f_directory_remove(main->cache_arguments.array[main->cache_arguments.used - 1], F_directory_max_descriptors_d, F_false); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_remove), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_remove), main->cache_arguments.array[main->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } else { - data_make->main->setting.state.status = f_file_remove(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + main->setting.state.status = f_file_remove(main->cache_arguments.array[main->cache_arguments.used - 1]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_remove), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_remove), main->cache_arguments.array[main->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } } - data_make->main->setting.state.status = f_file_link(data_make->main->cache_arguments.array[0], data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + main->setting.state.status = f_file_link(main->cache_arguments.array[0], main->cache_arguments.array[main->cache_arguments.used - 1]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_link), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_link), main->cache_arguments.array[main->cache_arguments.used - 1], f_file_operation_link_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_make_print_verbose_operate_symbolic_link(&data_make->main->program.message, data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], data_make->main->cache_arguments.array[0]); + fake_make_print_verbose_operate_symbolic_link(&main->program.message, main->cache_arguments.array[main->cache_arguments.used - 1], main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_link_ @@ -1382,17 +1424,19 @@ extern "C" { if (!data_make || !data_make->main) return; - data_make->main->setting.state.status = F_none; + fake_main_t * const main = data_make->main; + + main->setting.state.status = F_none; f_file_mode_t mode_rule = 0; uint8_t replace = 0; - fake_make_get_id_mode(data_make, data_make->main->cache_arguments.array[0], &mode_rule, &replace); + fake_make_get_id_mode(data_make, main->cache_arguments.array[0], &mode_rule, &replace); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id_mode)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id_mode)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1400,47 +1444,47 @@ extern "C" { mode_t mode = 0; mode_t mode_file = 0; - for (f_array_length_t i = 1; i < data_make->main->cache_arguments.used; ++i, mode = 0) { + for (f_array_length_t i = 1; i < main->cache_arguments.used; ++i, mode = 0) { - data_make->main->setting.state.status = f_file_mode_read(data_make->main->cache_arguments.array[i], F_true, &mode_file); + main->setting.state.status = f_file_mode_read(main->cache_arguments.array[i], F_true, &mode_file); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_mode_read), data_make->main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_mode_read), main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - data_make->main->setting.state.status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode); + main->setting.state.status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_mode_determine), data_make->main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_mode_determine), main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } if (all) { - data_make->main->setting.state.status = fll_file_mode_set_all(data_make->main->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); + main->setting.state.status = fll_file_mode_set_all(main->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); } else { - data_make->main->setting.state.status = f_file_mode_set(data_make->main->cache_arguments.array[i], mode); + main->setting.state.status = f_file_mode_set(main->cache_arguments.array[i], mode); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, all ? macro_fake_f(fll_file_mode_set_all) : macro_fake_f(f_file_mode_set), data_make->main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, all ? macro_fake_f(fll_file_mode_set_all) : macro_fake_f(f_file_mode_set), main->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_make_print_verbose_operate_set_mode(&data_make->main->program.message, data_make->main->cache_arguments.array[i], mode); + fake_make_print_verbose_operate_set_mode(&main->program.message, main->cache_arguments.array[i], mode); } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_modes_ @@ -1449,13 +1493,15 @@ extern "C" { if (!data_make || !data_make->main) return; - const f_array_length_t total = data_make->main->cache_arguments.used -1; + fake_main_t * const main = data_make->main; + + const f_array_length_t total = main->cache_arguments.used -1; f_directory_recurse_copy_t recurse = f_directory_recurse_copy_t_initialize; f_string_static_t destination = f_string_static_t_initialize; - if (data_make->main->program.error.verbosity > f_console_verbosity_normal_e) { - recurse.state.custom = data_make->main; + if (main->program.error.verbosity > f_console_verbosity_normal_e) { + recurse.state.custom = main; recurse.verbose = fake_print_verbose_recursive_move; } @@ -1463,44 +1509,44 @@ extern "C" { bool existing = F_true; // In this case, the destination could be a file, so confirm this. - if (data_make->main->cache_arguments.used == 2) { - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[1]); + if (main->cache_arguments.used == 2) { + main->setting.state.status = f_directory_is(main->cache_arguments.array[1]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_is), data_make->main->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), main->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); f_directory_recurse_copy_delete(&recurse); return; } - if (data_make->main->setting.state.status == F_false || data_make->main->setting.state.status == F_file_found_not) { + if (main->setting.state.status == F_false || main->setting.state.status == F_file_found_not) { existing = F_false; } } for (f_array_length_t i = 0; i < total; ++i) { - destination.used = data_make->main->cache_arguments.array[total].used; + destination.used = main->cache_arguments.array[total].used; if (existing) { - fake_string_dynamic_reset(&data_make->main->cache_argument); + fake_string_dynamic_reset(&main->cache_argument); - data_make->main->setting.state.status = f_file_name_base(data_make->main->cache_arguments.array[i], &data_make->main->cache_argument); + main->setting.state.status = f_file_name_base(main->cache_arguments.array[i], &main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_name_base), data_make->main->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_name_base), main->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); f_directory_recurse_copy_delete(&recurse); return; } - destination.used += data_make->main->cache_argument.used + 1; + destination.used += main->cache_argument.used + 1; } f_char_t destination_string[destination.used + 1]; @@ -1511,29 +1557,29 @@ extern "C" { destination_string[destination.used - 1] = 0; } - memcpy(destination_string, data_make->main->cache_arguments.array[total].string, sizeof(f_char_t) * data_make->main->cache_arguments.array[total].used); + memcpy(destination_string, main->cache_arguments.array[total].string, sizeof(f_char_t) * main->cache_arguments.array[total].used); if (existing) { - if (destination_string[data_make->main->cache_arguments.array[total].used - 1] == f_path_separator_s.string[0]) { - memcpy(destination_string + data_make->main->cache_arguments.array[total].used, data_make->main->cache_argument.string, sizeof(f_char_t) * data_make->main->cache_argument.used); + if (destination_string[main->cache_arguments.array[total].used - 1] == f_path_separator_s.string[0]) { + memcpy(destination_string + main->cache_arguments.array[total].used, main->cache_argument.string, sizeof(f_char_t) * main->cache_argument.used); --destination.used; } else { - memcpy(destination_string + data_make->main->cache_arguments.array[total].used + 1, data_make->main->cache_argument.string, sizeof(f_char_t) * data_make->main->cache_arguments.array[i].used); + memcpy(destination_string + main->cache_arguments.array[total].used + 1, main->cache_argument.string, sizeof(f_char_t) * main->cache_arguments.array[i].used); - destination_string[data_make->main->cache_arguments.array[total].used] = f_path_separator_s.string[0]; + destination_string[main->cache_arguments.array[total].used] = f_path_separator_s.string[0]; } } - fll_file_move(data_make->main->cache_arguments.array[i], destination, &recurse); + fll_file_move(main->cache_arguments.array[i], destination, &recurse); if (F_status_is_error(recurse.state.status)) { - data_make->main->setting.state.status = recurse.state.status; + main->setting.state.status = recurse.state.status; - fake_print_error_file(&data_make->main->program.error, macro_fake_f(fll_file_move), data_make->main->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(fll_file_move), main->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); f_directory_recurse_copy_delete(&recurse); @@ -1543,7 +1589,7 @@ extern "C" { f_directory_recurse_copy_delete(&recurse); - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_move_ @@ -1552,11 +1598,13 @@ extern "C" { if (!data_make || !data_make->main) return 0; + fake_main_t * const main = data_make->main; + f_array_length_t id_section = 0; for (; id_section < data_make->fakefile.used; ++id_section) { - if (f_compare_dynamic_partial_string(data_make->main->cache_arguments.array[0].string, data_make->main->buffer, data_make->main->cache_arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) { + if (f_compare_dynamic_partial_string(main->cache_arguments.array[0].string, main->buffer, main->cache_arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) { break; } } // for @@ -1566,11 +1614,11 @@ extern "C" { const int result = fake_make_operate_section(data_make, id_section, section_stack); // Ensure that a break only happens within its active state_process->operation stack. - if (data_make->main->setting.state.status == F_signal_abort) { - data_make->main->setting.state.status = F_none; + if (main->setting.state.status == F_signal_abort) { + main->setting.state.status = F_none; } - else if (F_status_set_fine(data_make->main->setting.state.status) == F_signal_abort) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + else if (F_status_set_fine(main->setting.state.status) == F_signal_abort) { + main->setting.state.status = F_status_set_error(F_failure); } return result; @@ -1582,54 +1630,56 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + uid_t id = 0; bool dereference = F_true; f_array_length_t i = 0; - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - id = (uid_t) fake_make_get_id(data_make, F_true, data_make->main->cache_arguments.array[i++]); + id = (uid_t) fake_make_get_id(data_make, F_true, main->cache_arguments.array[i++]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_get_id)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_get_id)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); continue; } if (all) { - data_make->main->setting.state.status = fll_file_role_change_all(data_make->main->cache_arguments.array[i], id, -1, dereference, fake_max_recursion_depth_d); + main->setting.state.status = fll_file_role_change_all(main->cache_arguments.array[i], id, -1, dereference, fake_max_recursion_depth_d); } else { - data_make->main->setting.state.status = f_file_role_change(data_make->main->cache_arguments.array[i], id, -1, dereference); + main->setting.state.status = f_file_role_change(main->cache_arguments.array[i], id, -1, dereference); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->main->cache_arguments.array[i], f_file_operation_change_owner_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), main->cache_arguments.array[i], f_file_operation_change_owner_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_make_print_verbose_operate_set_role(&data_make->main->program.message, all ? 0x3 : 0x2, data_make->main->cache_arguments.array[i], (f_number_unsigned_t) id); + fake_make_print_verbose_operate_set_role(&main->program.message, all ? 0x3 : 0x2, main->cache_arguments.array[i], (f_number_unsigned_t) id); } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_owners_ @@ -1638,12 +1688,14 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + bool found = F_false; f_array_length_t i = 0; for (; i < data_make->setting_make.parameter.used; ++i) { - if (f_compare_dynamic(data_make->main->cache_arguments.array[0], data_make->setting_make.parameter.array[i].name) == F_equal_to) { + if (f_compare_dynamic(main->cache_arguments.array[0], data_make->setting_make.parameter.array[i].name) == F_equal_to) { found = F_true; break; @@ -1653,44 +1705,44 @@ extern "C" { if (found) { for (f_array_length_t j = 0; j < data_make->setting_make.parameter.array[i].value.size; ++j) { - data_make->main->setting.state.status = f_string_dynamic_resize(0, &data_make->setting_make.parameter.array[i].value.array[j]); + main->setting.state.status = f_string_dynamic_resize(0, &data_make->setting_make.parameter.array[i].value.array[j]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_resize)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_resize)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } // for if (data_make->setting_make.parameter.array[i].value.size) { - data_make->main->setting.state.status = f_string_dynamics_resize(0, &data_make->setting_make.parameter.array[i].value); + main->setting.state.status = f_string_dynamics_resize(0, &data_make->setting_make.parameter.array[i].value); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_resize)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_resize)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } } else { - data_make->main->setting.state.status = f_string_map_multis_resize(fake_allocation_small_d, &data_make->setting_make.parameter); + main->setting.state.status = f_string_map_multis_resize(fake_allocation_small_d, &data_make->setting_make.parameter); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_map_multis_resize)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_map_multis_resize)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - data_make->main->setting.state.status = f_string_dynamic_append_nulless(data_make->main->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1700,32 +1752,32 @@ extern "C" { data_make->setting_make.parameter.array[i].value.used = 0; - if (data_make->main->cache_arguments.used > 1) { - data_make->main->setting.state.status = f_string_dynamics_resize(data_make->main->cache_arguments.used - 1, &data_make->setting_make.parameter.array[i].value); + if (main->cache_arguments.used > 1) { + main->setting.state.status = f_string_dynamics_resize(main->cache_arguments.used - 1, &data_make->setting_make.parameter.array[i].value); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_resize)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_resize)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } for (f_array_length_t j = 0; j < data_make->setting_make.parameter.array[i].value.size; ++j) { - data_make->main->setting.state.status = f_string_dynamic_append_nulless(data_make->main->cache_arguments.array[j + 1], &data_make->setting_make.parameter.array[i].value.array[j]); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_arguments.array[j + 1], &data_make->setting_make.parameter.array[i].value.array[j]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } ++data_make->setting_make.parameter.array[i].value.used; } // for } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_parameter_ @@ -1734,40 +1786,42 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + f_string_dynamic_t *argument = &data_make->path.stack.array[data_make->path.stack.used - 1]; f_string_dynamic_resize(0, argument); --data_make->path.stack.used; - data_make->main->setting.state.status = f_path_change(*argument); + main->setting.state.status = f_path_change(*argument); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_path_change), *argument); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->program.error.verbosity >= f_console_verbosity_verbose_e) { + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { fake_make_path_relative(data_make, *argument); // The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function. - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_path_relative)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_path_relative)); - fake_make_print_verbose_operate_set_path(&data_make->main->program.message, *argument); + fake_make_print_verbose_operate_set_path(&main->program.message, *argument); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_make_print_verbose_operate_set_path(&data_make->main->program.message, data_make->main->cache_argument); + fake_make_print_verbose_operate_set_path(&main->program.message, main->cache_argument); } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_pop_ @@ -1776,64 +1830,66 @@ extern "C" { if (!data_make || !data_make->main) return; - fake_string_dynamic_reset(&data_make->main->cache_1); + fake_main_t * const main = data_make->main; + + fake_string_dynamic_reset(&main->cache_1); { f_array_length_t i = 0; // Pre-allocate the cache to reduce allocations. { - f_array_length_t total = data_make->main->cache_arguments.used; + f_array_length_t total = main->cache_arguments.used; - for (; i < data_make->main->cache_arguments.used; ++i) { - total += data_make->main->cache_arguments.array[i].used; + for (; i < main->cache_arguments.used; ++i) { + total += main->cache_arguments.array[i].used; } // for - data_make->main->setting.state.status = f_string_dynamic_increase_by(total, &data_make->main->cache_1); + main->setting.state.status = f_string_dynamic_increase_by(total, &main->cache_1); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_file_stream_open)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_stream_open)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - for (i = 0; i < data_make->main->cache_arguments.used; ++i) { + for (i = 0; i < main->cache_arguments.used; ++i) { if (i) { - data_make->main->setting.state.status = f_string_dynamic_append(f_string_space_s, &data_make->main->cache_1); + main->setting.state.status = f_string_dynamic_append(f_string_space_s, &main->cache_1); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - fake_make_operate_process_buffer_escape(data_make, data_make->main->cache_arguments.array[i], &data_make->main->cache_1); + fake_make_operate_process_buffer_escape(data_make, main->cache_arguments.array[i], &main->cache_1); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_file_stream_open)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_stream_open)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } // for } - f_file_stream_lock(data_make->main->program.message.to); + f_file_stream_lock(main->program.message.to); - fll_print_dynamic_raw(data_make->main->cache_1, data_make->main->program.message.to); - fll_print_dynamic_raw(f_string_eol_s, data_make->main->program.message.to); + fll_print_dynamic_raw(main->cache_1, main->program.message.to); + fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); - f_file_stream_unlock(data_make->main->program.message.to); + f_file_stream_unlock(main->program.message.to); - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_print_ @@ -1842,10 +1898,12 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + fake_skeleton_operate(data_make->data); - if (F_status_set_fine(data_make->main->setting.state.status) == F_interrupt) return; + if (F_status_set_fine(main->setting.state.status) == F_interrupt) return; - fake_make_operate_process_return(data_make, F_status_is_error(data_make->main->setting.state.status) ? 1 : 0); + fake_make_operate_process_return(data_make, F_status_is_error(main->setting.state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_skeleton_ @@ -1854,75 +1912,77 @@ extern "C" { if (!data_make || !data_make->main) return; - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[0]); + fake_main_t * const main = data_make->main; - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[0]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[0]); - if (F_status_set_fine(data_make->main->setting.state.status) == F_false) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[0]); + + if (F_status_set_fine(main->setting.state.status) == F_false) { + main->setting.state.status = F_status_set_error(F_failure); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - data_make->main->setting.state.status = f_path_change(data_make->main->cache_arguments.array[0]); + main->setting.state.status = f_path_change(main->cache_arguments.array[0]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_path_change), data_make->main->cache_arguments.array[0]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_path_change), main->cache_arguments.array[0]); } else { - data_make->main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->path.stack); + main->setting.state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->path.stack); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_set_fine(data_make->main->setting.state.status) == F_array_too_large) { + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_array_too_large) { fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_string_dynamics_increase_by), fake_common_file_path_stack_s); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamics_increase_by)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } // Copy the entire real path, including the trailing NULL. - ++data_make->main->cache_argument.used; + ++main->cache_argument.used; - data_make->main->setting.state.status = f_string_dynamic_append_nulless(data_make->main->cache_argument, &data_make->path.stack.array[data_make->path.stack.used]); + main->setting.state.status = f_string_dynamic_append_nulless(main->cache_argument, &data_make->path.stack.array[data_make->path.stack.used]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_nulless)); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->program.error.verbosity >= f_console_verbosity_verbose_e) { + if (main->program.error.verbosity >= f_console_verbosity_verbose_e) { fake_make_path_relative(data_make, data_make->path.stack.array[data_make->path.stack.used]); // The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function. - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(fake_make_path_relative)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_make_path_relative)); - fake_make_print_verbose_operate_set_path(&data_make->main->program.message, data_make->path.stack.array[data_make->path.stack.used]); + fake_make_print_verbose_operate_set_path(&main->program.message, data_make->path.stack.array[data_make->path.stack.used]); } else { - fake_make_print_verbose_operate_set_path(&data_make->main->program.message, data_make->main->cache_argument); + fake_make_print_verbose_operate_set_path(&main->program.message, main->cache_argument); } } ++data_make->path.stack.used; } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_to_ @@ -1931,19 +1991,21 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + { - data_make->main->setting.state.status = f_path_change_at(data_make->path.top.id); + main->setting.state.status = f_path_change_at(data_make->path.top.id); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_path_change), data_make->main->cache_arguments.array[0]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_stack_max(&data_make->error, macro_fake_f(f_path_change), main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - fake_make_print_verbose_operate_set_path(&data_make->main->program.message, f_string_empty_s); + fake_make_print_verbose_operate_set_path(&main->program.message, f_string_empty_s); // Clear stack, except for the project root. for (f_array_length_t i = 1; i < data_make->path.stack.used; ++i) { @@ -1952,7 +2014,7 @@ extern "C" { data_make->path.stack.used = 1; - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_top_ @@ -1961,49 +2023,51 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + f_mode_t mode = f_mode_t_initialize; - macro_f_mode_t_set_default_umask(mode, data_make->main->program.umask); + macro_f_mode_t_set_default_umask(mode, main->program.umask); - for (f_array_length_t i = 1; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 1; i < main->cache_arguments.used; ++i) { - if (f_compare_dynamic(fake_make_operation_argument_file_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { - data_make->main->setting.state.status = f_file_touch(data_make->main->cache_arguments.array[i], mode.regular, F_false); + if (f_compare_dynamic(fake_make_operation_argument_file_s, main->cache_arguments.array[0]) == F_equal_to) { + main->setting.state.status = f_file_touch(main->cache_arguments.array[i], mode.regular, F_false); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_is_error_not(fl_path_canonical(data_make->main->cache_arguments.array[i], &data_make->main->cache_argument))) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_touch), data_make->main->cache_argument, f_file_operation_touch_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_is_error_not(fl_path_canonical(main->cache_arguments.array[i], &main->cache_argument))) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_touch), main->cache_argument, f_file_operation_touch_s, fll_error_file_type_file_e); } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_touch), data_make->main->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_touch), main->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - else if (f_compare_dynamic(fake_make_operation_argument_directory_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { - data_make->main->setting.state.status = f_directory_touch(data_make->main->cache_arguments.array[i], mode.directory); + else if (f_compare_dynamic(fake_make_operation_argument_directory_s, main->cache_arguments.array[0]) == F_equal_to) { + main->setting.state.status = f_directory_touch(main->cache_arguments.array[i], mode.directory); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_is_error_not(fl_path_canonical(data_make->main->cache_arguments.array[i], &data_make->main->cache_argument))) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_touch), data_make->main->cache_argument, f_file_operation_touch_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_is_error_not(fl_path_canonical(main->cache_arguments.array[i], &main->cache_argument))) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_touch), main->cache_argument, f_file_operation_touch_s, fll_error_file_type_directory_e); } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_touch), data_make->main->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_touch), main->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - fake_make_print_verbose_operate_touch(&data_make->main->program.message, data_make->main->cache_arguments.array[i]); + fake_make_print_verbose_operate_touch(&main->program.message, main->cache_arguments.array[i]); } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_touch_ @@ -2012,88 +2076,90 @@ extern "C" { if (!data_make || !data_make->main) return; + fake_main_t * const main = data_make->main; + f_file_t file = f_file_t_initialize; - data_make->main->setting.state.status = f_file_exists(data_make->main->cache_arguments.array[0], F_true); + main->setting.state.status = f_file_exists(main->cache_arguments.array[0], F_true); - if (data_make->main->cache_arguments.used == 1 || data_make->main->setting.state.status == F_false) { - data_make->main->setting.state.status = f_file_stream_open(data_make->main->cache_arguments.array[0], f_file_open_mode_truncate_s, &file); + if (main->cache_arguments.used == 1 || main->setting.state.status == F_false) { + main->setting.state.status = f_file_stream_open(main->cache_arguments.array[0], f_file_open_mode_truncate_s, &file); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_is_error_not(fl_path_canonical(data_make->main->cache_arguments.array[0], &data_make->main->cache_argument))) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stream_open), data_make->main->cache_argument, f_file_operation_open_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_is_error_not(fl_path_canonical(main->cache_arguments.array[0], &main->cache_argument))) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_open), main->cache_argument, f_file_operation_open_s, fll_error_file_type_file_e); } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stream_open), data_make->main->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_open), main->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } // Keep the stream open if there is a string to write to it. - if (data_make->main->cache_arguments.used > 1) { - data_make->main->setting.state.status = F_false; + if (main->cache_arguments.used > 1) { + main->setting.state.status = F_false; } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; f_file_stream_flush(file); f_file_stream_close(&file); } } - if (F_status_is_error_not(data_make->main->setting.state.status) && data_make->main->cache_arguments.used > 1) { - if (data_make->main->setting.state.status != F_false) { - data_make->main->setting.state.status = f_file_stream_open(data_make->main->cache_arguments.array[0], f_file_open_mode_append_s, &file); + if (F_status_is_error_not(main->setting.state.status) && main->cache_arguments.used > 1) { + if (main->setting.state.status != F_false) { + main->setting.state.status = f_file_stream_open(main->cache_arguments.array[0], f_file_open_mode_append_s, &file); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_is_error_not(fl_path_canonical(data_make->main->cache_arguments.array[0], &data_make->main->cache_argument))) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stream_open), data_make->main->cache_argument, f_file_operation_open_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_is_error_not(fl_path_canonical(main->cache_arguments.array[0], &main->cache_argument))) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_open), main->cache_argument, f_file_operation_open_s, fll_error_file_type_file_e); } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stream_open), data_make->main->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_open), main->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); } } } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - for (f_array_length_t i = 1; i < data_make->main->cache_arguments.used; ++i) { + if (F_status_is_error_not(main->setting.state.status)) { + for (f_array_length_t i = 1; i < main->cache_arguments.used; ++i) { - fake_string_dynamic_reset(&data_make->main->cache_1); + fake_string_dynamic_reset(&main->cache_1); - fake_make_operate_process_buffer_escape(data_make, data_make->main->cache_arguments.array[i], &data_make->main->cache_1); + fake_make_operate_process_buffer_escape(data_make, main->cache_arguments.array[i], &main->cache_1); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_is_error_not(fl_path_canonical(data_make->main->cache_arguments.array[0], &data_make->main->cache_argument))) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->main->cache_argument, f_file_operation_write_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_is_error_not(fl_path_canonical(main->cache_arguments.array[0], &main->cache_argument))) { + fake_print_error_file(&main->program.error, macro_fake_f(fake_make_operate_process_buffer_escape), main->cache_argument, f_file_operation_write_s, fll_error_file_type_file_e); } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->main->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(fake_make_operate_process_buffer_escape), main->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); } break; } - data_make->main->setting.state.status = f_file_stream_write(file, data_make->main->cache_1, 0); + main->setting.state.status = f_file_stream_write(file, main->cache_1, 0); - if (F_status_is_error(data_make->main->setting.state.status)) { - if (F_status_is_error_not(fl_path_canonical(data_make->main->cache_arguments.array[0], &data_make->main->cache_argument))) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stream_write), data_make->main->cache_argument, f_file_operation_write_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_is_error_not(fl_path_canonical(main->cache_arguments.array[0], &main->cache_argument))) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_write), main->cache_argument, f_file_operation_write_s, fll_error_file_type_file_e); } else { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_stream_write), data_make->main->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_stream_write), main->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); } break; } - if (i + 1 < data_make->main->cache_arguments.used) { - data_make->main->setting.state.status = f_file_stream_write(file, f_string_ascii_space_s, 0); + if (i + 1 < main->cache_arguments.used) { + main->setting.state.status = f_file_stream_write(file, f_string_ascii_space_s, 0); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_file_stream_write)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_file_stream_write)); break; } @@ -2105,7 +2171,7 @@ extern "C" { f_file_stream_close(&file); } - data_make->main->setting.state.status = F_status_is_error(data_make->main->setting.state.status) ? F_status_set_error(F_failure) : F_none; + main->setting.state.status = F_status_is_error(main->setting.state.status) ? F_status_set_error(F_failure) : F_none; } #endif // _di_fake_make_operate_process_type_write_ diff --git a/level_3/fake/c/main/make/operate_validate.c b/level_3/fake/c/main/make/operate_validate.c index 735e69e..ea36cc7 100644 --- a/level_3/fake/c/main/make/operate_validate.c +++ b/level_3/fake/c/main/make/operate_validate.c @@ -95,7 +95,7 @@ extern "C" { #ifndef _di_fake_make_operate_validate_define_name_ f_status_t fake_make_operate_validate_define_name(const f_string_static_t name) { - if (!name.used) return F_none; + if (!name.used) return F_data_not; if (!isalpha(name.string[0]) && name.string[0] != '_') return F_false; for (f_array_length_t i = 1; i < name.used; ++i) { diff --git a/level_3/fake/c/main/make/operate_validate.h b/level_3/fake/c/main/make/operate_validate.h index 0271b69..cb97446 100644 --- a/level_3/fake/c/main/make/operate_validate.h +++ b/level_3/fake/c/main/make/operate_validate.h @@ -100,7 +100,7 @@ extern "C" { * The variable name string to validate. * * @return - * F_none if there is no string to validate (used = 0). + * F_data_not if there is no string to validate (used = 0). * F_true on valid. * F_false on invalid. * 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 6ddf878..f34c4a7 100644 --- a/level_3/fake/c/main/make/operate_validate_type.c +++ b/level_3/fake/c/main/make/operate_validate_type.c @@ -9,27 +9,29 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (main->cache_arguments.used > 1) { + fake_print_error_too_many_arguments(&main->program.error); + + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->cache_arguments.used) { - if (f_compare_dynamic(fake_make_operation_argument_success_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - if (f_compare_dynamic(fake_make_operation_argument_failure_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, fake_make_operation_break_s, data_make->main->cache_arguments.array[0]); + if (main->cache_arguments.used) { + if (f_compare_dynamic(fake_make_operation_argument_success_s, main->cache_arguments.array[0]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_failure_s, main->cache_arguments.array[0]) == F_equal_to_not) { + fake_make_print_error_unsupported_type(&main->program.error, fake_make_operation_break_s, main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_validate_type_break_ @@ -38,46 +40,48 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { - if (data_make->main->cache_arguments.array[0].used) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { + if (main->cache_arguments.array[0].used) { f_string_static_t path_file = f_string_static_t_initialize; - path_file.used = data_make->data->path_data_build.used + data_make->main->cache_arguments.array[0].used; + path_file.used = data_make->data->path_data_build.used + main->cache_arguments.array[0].used; f_char_t path_file_string[path_file.used + 1]; path_file.string = path_file_string; path_file_string[path_file.used] = 0; memcpy(path_file_string, data_make->data->path_data_build.string, sizeof(f_char_t) * data_make->data->path_data_build.used); - memcpy(path_file_string + data_make->data->path_data_build.used, data_make->main->cache_arguments.array[0].string, sizeof(f_char_t) * data_make->main->cache_arguments.array[0].used); + memcpy(path_file_string + data_make->data->path_data_build.used, main->cache_arguments.array[0].string, sizeof(f_char_t) * main->cache_arguments.array[0].used); - data_make->main->setting.state.status = f_file_is(path_file, F_file_type_regular_d, F_false); + main->setting.state.status = f_file_is(path_file, F_file_type_regular_d, F_false); - if (data_make->main->setting.state.status == F_file_found_not || F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file_simple(&data_make->main->program.error, macro_fake_f(f_file_is), path_file, f_file_operation_find_s, fll_error_file_type_file_e); + if (main->setting.state.status == F_file_found_not || F_status_is_error(main->setting.state.status)) { + fake_print_error_file_simple(&main->program.error, macro_fake_f(f_file_is), path_file, f_file_operation_find_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (!data_make->main->setting.state.status) { - fake_make_print_error_file_type(&data_make->main->program.message, f_file_type_name_regular_s, path_file); + if (!main->setting.state.status) { + fake_make_print_error_file_type(&main->program.message, f_file_type_name_regular_s, path_file); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } else { - fake_make_print_error_file_name_empty(&data_make->main->program.error); + fake_make_print_error_file_name_empty(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_validate_type_build_ @@ -86,13 +90,15 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { + fake_print_error_too_many_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_clean_top_skeleton_ @@ -102,42 +108,44 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 1) { f_status_t status = F_none; - for (f_array_length_t i = 0; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 0; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } // for - for (f_array_length_t i = 0; i < data_make->main->cache_arguments.used - 1; ++i) { + for (f_array_length_t i = 0; i < main->cache_arguments.used - 1; ++i) { - if (f_file_exists(data_make->main->cache_arguments.array[i], F_true) != F_true) { - fake_print_error_file_simple(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + if (f_file_exists(main->cache_arguments.array[i], F_true) != F_true) { + fake_print_error_file_simple(&main->program.error, macro_fake_f(f_file_is), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } } // for - if (data_make->main->cache_arguments.used > 2) { + if (main->cache_arguments.used > 2) { // The last file must be a directory. - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[main->cache_arguments.used - 1]); - if (data_make->main->setting.state.status == F_false || data_make->main->setting.state.status == F_file_found_not) { - fake_make_print_error_content_not_directory(&data_make->main->program.error, "last", data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + if (main->setting.state.status == F_false || main->setting.state.status == F_file_found_not) { + fake_make_print_error_content_not_directory(&main->program.error, "last", main->cache_arguments.array[main->cache_arguments.used - 1]); status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_is), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), main->cache_arguments.array[main->cache_arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e); status = F_status_set_error(F_failure); } @@ -145,27 +153,27 @@ extern "C" { else { // When the first file is a directory, then the second, if it exists, must also be a directory. - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[0]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[0]); - if (data_make->main->setting.state.status == F_true) { - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[1]); + if (main->setting.state.status == F_true) { + main->setting.state.status = f_directory_is(main->cache_arguments.array[1]); - if (data_make->main->setting.state.status == F_false) { - fake_make_print_error_content_not_directory(&data_make->main->program.error, "second", data_make->main->cache_arguments.array[1]); + if (main->setting.state.status == F_false) { + fake_make_print_error_content_not_directory(&main->program.error, "second", main->cache_arguments.array[1]); status = F_status_set_error(F_failure); } } } - data_make->main->setting.state.status = status; + main->setting.state.status = status; return; } - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } #endif // _di_fake_make_operate_validate_type_clone_ @@ -174,18 +182,20 @@ extern "C" { if (!data_make || !data_make->main) return; - if (!data_make->main->cache_arguments.used) { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; + + if (!main->cache_arguments.used) { + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else if (data_make->setting_build.build_compiler.used) { - fake_make_print_error_compiler_not_specified(&data_make->main->program.error, fake_make_operation_compile_s); + fake_make_print_error_compiler_not_specified(&main->program.error, fake_make_operation_compile_s); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_compile_ @@ -195,26 +205,28 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + if (state_process->operation == fake_make_operation_type_if_e) { if (state_process->operation_previous == fake_make_operation_type_if_e) { - fake_make_print_error_after_condition_must_not(&data_make->main->program.error); + fake_make_print_error_after_condition_must_not(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } else { if (!(state_process->operation_previous == fake_make_operation_type_if_e || state_process->operation_previous == fake_make_operation_type_and_e || state_process->operation_previous == fake_make_operation_type_or_e)) { - fake_make_print_error_after_condition_may_only(&data_make->main->program.error); + fake_make_print_error_after_condition_may_only(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } - if (data_make->main->cache_arguments.used) { + if (main->cache_arguments.used) { const f_string_static_t if_type_strings[] = { fake_make_operation_argument_if_define_s, fake_make_operation_argument_if_equal_s, @@ -303,7 +315,7 @@ extern "C" { if_and_or = fake_make_operation_if_s; } - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[k]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[k]) == F_equal_to) { ++k; dereference = F_false; } @@ -349,7 +361,7 @@ extern "C" { // Skip the "if not XXX" types as they are determined later on. if (i > 12 && i < 21) continue; - if (f_compare_dynamic(if_type_strings[i], data_make->main->cache_arguments.array[k]) == F_equal_to) { + if (f_compare_dynamic(if_type_strings[i], main->cache_arguments.array[k]) == F_equal_to) { state_process->condition = if_type_codes[i]; break; @@ -357,9 +369,9 @@ extern "C" { } // for if (i == 23) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, if_and_or, data_make->main->cache_arguments.array[k]); + fake_make_print_error_unsupported_type(&main->program.error, if_and_or, main->cache_arguments.array[k]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -370,17 +382,17 @@ extern "C" { // Identify and convert to the appropriate if not condition. if (state_process->condition == fake_make_operation_if_type_if_not_e) { - if (data_make->main->cache_arguments.used < 1 + k) { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + if (main->cache_arguments.used < 1 + k) { + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } for (; j < 7; ++j) { - if (f_compare_dynamic(if_not_type_strings[j], data_make->main->cache_arguments.array[k]) == F_equal_to) { + if (f_compare_dynamic(if_not_type_strings[j], main->cache_arguments.array[k]) == F_equal_to) { state_process->condition = if_not_type_codes[j]; break; @@ -388,9 +400,9 @@ extern "C" { } // for if (j == 7) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, if_and_or, data_make->main->cache_arguments.array[k]); + fake_make_print_error_unsupported_type(&main->program.error, if_and_or, main->cache_arguments.array[k]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -399,37 +411,37 @@ extern "C" { j = 7; } - if (j == 7 && data_make->main->cache_arguments.used >= if_type_minimum[i] || j < 7 && data_make->main->cache_arguments.used >= if_not_type_minimum[j]) { + if (j == 7 && main->cache_arguments.used >= if_type_minimum[i] || j < 7 && main->cache_arguments.used >= if_not_type_minimum[j]) { if (state_process->condition == fake_make_operation_if_type_if_success_e || state_process->condition == fake_make_operation_if_type_if_failure_e) { // The success and failure operations minimum is also the maximum. - if (data_make->main->cache_arguments.used > if_type_minimum[i]) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + if (main->cache_arguments.used > if_type_minimum[i]) { + fake_print_error_too_many_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } return; } if (state_process->condition == fake_make_operation_if_type_if_equal_e || state_process->condition == fake_make_operation_if_type_if_equal_not_e) { - if (data_make->main->cache_arguments.used < 2 + k) { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + if (main->cache_arguments.used < 2 + k) { + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } return; } if (state_process->condition == fake_make_operation_if_type_if_exist_e || state_process->condition == fake_make_operation_if_type_if_not_exist_e) { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } @@ -437,11 +449,11 @@ extern "C" { if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_is_e || state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition > fake_make_operation_if_type_if_not_exist_e && state_process->condition < fake_make_operation_if_type_if_success_e) { if (state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition == fake_make_operation_if_type_if_not_mode_e) { - if (f_compare_dynamic(fake_make_operation_argument_is_s, data_make->main->cache_arguments.array[k]) == F_equal_to_not) { - if (f_compare_dynamic(fake_make_operation_argument_has_s, data_make->main->cache_arguments.array[k]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_is_s, main->cache_arguments.array[k]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_has_s, main->cache_arguments.array[k]) == F_equal_to_not) { if (j == 6) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, fake_make_operation_mode_s, data_make->main->cache_arguments.array[k]); + fake_make_print_error_unsupported_type(&main->program.error, fake_make_operation_mode_s, main->cache_arguments.array[k]); } else { f_char_t message[4 + fake_make_operation_mode_s.used + 1]; @@ -451,10 +463,10 @@ extern "C" { f_string_static_t message_s = macro_f_string_static_t_initialize(message, 0, 4 + fake_make_operation_mode_s.used); - fake_make_print_error_unsupported_type(&data_make->main->program.error, message_s, data_make->main->cache_arguments.array[k]); + fake_make_print_error_unsupported_type(&main->program.error, message_s, main->cache_arguments.array[k]); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -463,10 +475,10 @@ extern "C" { f_file_mode_t mode_rule = 0; uint8_t replace = 0; - fake_make_get_id_mode(data_make, data_make->main->cache_arguments.array[++k], &mode_rule, &replace); + fake_make_get_id_mode(data_make, main->cache_arguments.array[++k], &mode_rule, &replace); - if (F_status_is_error(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (F_status_is_error(main->setting.state.status)) { + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -474,10 +486,10 @@ 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) { - fake_make_get_id(data_make, F_false, data_make->main->cache_arguments.array[k++]); + fake_make_get_id(data_make, F_false, main->cache_arguments.array[k++]); - if (F_status_is_error(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (F_status_is_error(main->setting.state.status)) { + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -492,53 +504,53 @@ extern "C" { // fifo = 0x8 (0000 1000) invalid = 0x80 (1000 0000) uint8_t type_file = 0; - for (i = k; i < data_make->main->cache_arguments.used; ++i) { + for (i = k; i < main->cache_arguments.used; ++i) { - if (f_compare_dynamic(fake_make_operation_argument_if_is_for_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_if_is_for_s, main->cache_arguments.array[i]) == F_equal_to) { ++i; break; } - if (f_compare_dynamic(f_file_type_name_block_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(f_file_type_name_block_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x1; } - else if (f_compare_dynamic(f_file_type_name_character_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_character_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x2; } - else if (f_compare_dynamic(f_file_type_name_directory_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_directory_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x4; } - else if (f_compare_dynamic(f_file_type_name_fifo_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_fifo_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x8; } - else if (f_compare_dynamic(f_file_type_name_link_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_link_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x10; } - else if (f_compare_dynamic(f_file_type_name_regular_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_regular_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x20; } - else if (f_compare_dynamic(f_file_type_name_socket_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + else if (f_compare_dynamic(f_file_type_name_socket_s, main->cache_arguments.array[i]) == F_equal_to) { type_file |= 0x40; } else { - fake_make_print_error_unsupported_type(&data_make->main->program.error, f_file_type_name_file_s, data_make->main->cache_arguments.array[i]); + fake_make_print_error_unsupported_type(&main->program.error, f_file_type_name_file_s, main->cache_arguments.array[i]); type_file |= 0x80; } } // for if (type_file & 0x80) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } 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) { - fake_make_get_id(data_make, F_true, data_make->main->cache_arguments.array[k++]); + fake_make_get_id(data_make, F_true, main->cache_arguments.array[k++]); - if (F_status_is_error(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (F_status_is_error(main->setting.state.status)) { + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -546,49 +558,49 @@ extern "C" { i = k; } - if (i < data_make->main->cache_arguments.used) { + if (i < main->cache_arguments.used) { f_status_t status = F_none; - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); status = F_status_set_error(F_failure); } else if (state_process->condition != fake_make_operation_if_type_if_exist_e && state_process->condition != fake_make_operation_if_type_if_is_e) { // The existence tests do not need to happen here for *_if_exists and *_if_is as those two types will handle performing them during the process stage. - data_make->main->setting.state.status = f_file_exists(data_make->main->cache_arguments.array[i], dereference); + main->setting.state.status = f_file_exists(main->cache_arguments.array[i], dereference); - if (data_make->main->setting.state.status == F_false) { - data_make->main->setting.state.status = F_status_set_error(F_file_found_not); + if (main->setting.state.status == F_false) { + main->setting.state.status = F_status_set_error(F_file_found_not); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_exists), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_exists), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } } } // for - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } return; } if (state_process->condition == fake_make_operation_if_type_if_greater_e || state_process->condition == fake_make_operation_if_type_if_greater_equal_e || state_process->condition == fake_make_operation_if_type_if_less_e || state_process->condition == fake_make_operation_if_type_if_less_equal_e) { - if (data_make->main->cache_arguments.used < 2 + k) { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + if (main->cache_arguments.used < 2 + k) { + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -597,55 +609,55 @@ extern "C" { f_string_range_t range = f_string_range_t_initialize; f_number_unsigned_t number = 0; - for (i = k; i < data_make->main->cache_arguments.used; ++i, data_make->main->setting.state.status = F_none) { + for (i = k; i < main->cache_arguments.used; ++i, main->setting.state.status = F_none) { - if (data_make->main->cache_arguments.array[i].used) { + if (main->cache_arguments.array[i].used) { range.start = 0; - range.stop = data_make->main->cache_arguments.array[i].used - 1; + range.stop = main->cache_arguments.array[i].used - 1; - if (data_make->main->cache_arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) { + if (main->cache_arguments.array[i].string[0] == f_string_ascii_plus_s.string[0]) { range.start = 1; } - else if (data_make->main->cache_arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) { + else if (main->cache_arguments.array[i].string[0] == f_string_ascii_minus_s.string[0]) { range.start = 1; } if (range.start > range.stop) { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->main->cache_arguments.array[i], range, &number); + main->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, main->cache_arguments.array[i], range, &number); } } else { - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { status = F_status_set_error(F_failure); if (number > F_number_t_size_unsigned_d) { - fake_make_print_error_out_of_range_number(&data_make->main->program.error, data_make->main->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d); + fake_make_print_error_out_of_range_number(&main->program.error, main->cache_arguments.array[i], F_number_t_size_unsigned_d, F_number_t_size_unsigned_d); } else { - fake_make_print_error_unsupported_number(&data_make->main->program.error, data_make->main->cache_arguments.array[i]); + fake_make_print_error_unsupported_number(&main->program.error, main->cache_arguments.array[i]); } } } // for - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } return; } } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_condition_ @@ -655,43 +667,45 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 1) { f_status_t status = F_none; f_array_length_t i = 0; - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); status = F_status_set_error(F_failure); } } // for - for (i = 0; i < data_make->main->cache_arguments.used - 1; ++i) { + for (i = 0; i < main->cache_arguments.used - 1; ++i) { - if (f_file_exists(data_make->main->cache_arguments.array[i], F_true) != F_true) { - fake_print_error_file_simple(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + if (f_file_exists(main->cache_arguments.array[i], F_true) != F_true) { + fake_print_error_file_simple(&main->program.error, macro_fake_f(f_file_is), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } } // for - if (data_make->main->cache_arguments.used > 2) { + if (main->cache_arguments.used > 2) { // The last file must be a directory. - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[main->cache_arguments.used - 1]); - if (data_make->main->setting.state.status == F_false || data_make->main->setting.state.status == F_file_found_not) { - fake_make_print_error_content_not_directory(&data_make->main->program.error, "last", data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + if (main->setting.state.status == F_false || main->setting.state.status == F_file_found_not) { + fake_make_print_error_content_not_directory(&main->program.error, "last", main->cache_arguments.array[main->cache_arguments.used - 1]); status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_is), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), main->cache_arguments.array[main->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); status = F_status_set_error(F_failure); } @@ -699,25 +713,25 @@ extern "C" { else { // When the first file is a directory, then the second, if it exists, must also be a directory. - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[0]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[0]); - if (data_make->main->setting.state.status == F_true) { - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[1]); + if (main->setting.state.status == F_true) { + main->setting.state.status = f_directory_is(main->cache_arguments.array[1]); - if (data_make->main->setting.state.status == F_false) { - fake_make_print_error_content_not_directory(&data_make->main->program.error, "second", data_make->main->cache_arguments.array[1]); + if (main->setting.state.status == F_false) { + fake_make_print_error_content_not_directory(&main->program.error, "second", main->cache_arguments.array[1]); status = F_status_set_error(F_failure); } } } - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_copy_ @@ -727,27 +741,29 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { - fake_make_operate_validate_define_name(data_make->main->cache_arguments.array[0]); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { + main->setting.state.status = fake_make_operate_validate_define_name(main->cache_arguments.array[0]); - if (data_make->main->setting.state.status == F_true) { - data_make->main->setting.state.status = F_none; + if (main->setting.state.status == F_true) { + main->setting.state.status = F_none; return; } - if (data_make->main->setting.state.status == F_none) { - fake_make_print_error_define_name_empty(&data_make->main->program.error); + if (main->setting.state.status == F_data_not) { + fake_make_print_error_define_name_empty(&main->program.error); } else { - fake_make_print_error_define_invalid_character(&data_make->main->program.error, data_make->main->cache_arguments.array[0]); + fake_make_print_error_define_invalid_character(&main->program.error, main->cache_arguments.array[0]); } } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } #endif // _di_fake_make_operate_validate_type_define_ @@ -756,26 +772,28 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { f_status_t status = F_none; - for (f_array_length_t i = 0; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 0; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); status = F_status_set_error(F_failure); } } // for - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_delete_ @@ -785,39 +803,41 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; + fake_main_t * const main = data_make->main; + if (state_process->operation_previous == fake_make_operation_type_else_e) { - fake_make_print_error_after_condition_must_not(&data_make->main->program.error); + fake_make_print_error_after_condition_must_not(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } if (state_process->operation_previous == fake_make_operation_type_if_e || state_process->operation_previous == fake_make_operation_type_and_e || state_process->operation_previous == fake_make_operation_type_or_e) { - fake_make_print_error_after_condition_must_not(&data_make->main->program.error); + fake_make_print_error_after_condition_must_not(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } if (!state_process->block) { - fake_make_print_error_after_condition_no_preceding(&data_make->main->program.error); + fake_make_print_error_after_condition_no_preceding(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->cache_arguments.used) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + if (main->cache_arguments.used) { + fake_print_error_too_many_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_validate_type_else_ @@ -826,27 +846,29 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 1) { + fake_print_error_too_many_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->cache_arguments.used) { - if (f_compare_dynamic(fake_make_operation_argument_success_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - if (f_compare_dynamic(fake_make_operation_argument_failure_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, fake_make_operation_exit_s, data_make->main->cache_arguments.array[0]); + if (main->cache_arguments.used) { + if (f_compare_dynamic(fake_make_operation_argument_success_s, main->cache_arguments.array[0]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_failure_s, main->cache_arguments.array[0]) == F_equal_to_not) { + fake_make_print_error_unsupported_type(&main->program.error, fake_make_operation_exit_s, main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_make_operate_validate_type_exit_ @@ -855,25 +877,27 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { - if (f_compare_dynamic(fake_make_operation_argument_exit_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - if (f_compare_dynamic(fake_make_operation_argument_warn_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - if (f_compare_dynamic(fake_make_operation_argument_ignore_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, fake_make_operation_fail_s, data_make->main->cache_arguments.array[0]); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { + if (f_compare_dynamic(fake_make_operation_argument_exit_s, main->cache_arguments.array[0]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_warn_s, main->cache_arguments.array[0]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_ignore_s, main->cache_arguments.array[0]) == F_equal_to_not) { + fake_make_print_error_unsupported_type(&main->program.error, fake_make_operation_fail_s, main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_fail_ @@ -883,18 +907,20 @@ extern "C" { if (!data_make || !data_make->main) return; - if (!data_make->main->cache_arguments.used) { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (!main->cache_arguments.used) { + fake_print_error_requires_more_arguments(&main->program.error); + + main->setting.state.status = F_status_set_error(F_failure); } else if (!data_make->setting_build.build_indexer.used) { - fake_make_print_error_indexer_not_specified(&data_make->main->program.error, fake_make_operation_index_s); + fake_make_print_error_indexer_not_specified(&main->program.error, fake_make_operation_index_s); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_index_ @@ -904,76 +930,78 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 4) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 4) { + fake_print_error_too_many_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->cache_arguments.used > 1) { + if (main->cache_arguments.used > 1) { f_status_t status = F_none; // 0x1 = force, 0x2 = strict. uint8_t flag = 0; - if (data_make->main->cache_arguments.used > 2) { - if (f_compare_dynamic(fake_make_operation_argument_force_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { + if (main->cache_arguments.used > 2) { + if (f_compare_dynamic(fake_make_operation_argument_force_s, main->cache_arguments.array[0]) == F_equal_to) { flag |= 0x1; } - else if (f_compare_dynamic(fake_make_operation_argument_strict_s, data_make->main->cache_arguments.array[0]) == F_equal_to) { + else if (f_compare_dynamic(fake_make_operation_argument_strict_s, main->cache_arguments.array[0]) == F_equal_to) { flag |= 0x2; } else { - fake_print_error_operation_link_argument_unknown(&data_make->error, data_make->main->cache_arguments.array[0]); + fake_print_error_operation_link_argument_unknown(&data_make->error, main->cache_arguments.array[0]); status = F_status_set_error(F_failure); } - if (data_make->main->cache_arguments.used > 3) { - if (f_compare_dynamic(fake_make_operation_argument_force_s, data_make->main->cache_arguments.array[1]) == F_equal_to) { + if (main->cache_arguments.used > 3) { + if (f_compare_dynamic(fake_make_operation_argument_force_s, main->cache_arguments.array[1]) == F_equal_to) { flag |= 0x1; } - else if (f_compare_dynamic(fake_make_operation_argument_strict_s, data_make->main->cache_arguments.array[1]) == F_equal_to) { + else if (f_compare_dynamic(fake_make_operation_argument_strict_s, main->cache_arguments.array[1]) == F_equal_to) { flag |= 0x2; } else { - fake_print_error_operation_link_argument_unknown(&data_make->error, data_make->main->cache_arguments.array[1]); + fake_print_error_operation_link_argument_unknown(&data_make->error, main->cache_arguments.array[1]); status = F_status_set_error(F_failure); } } } - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[main->cache_arguments.used - 1]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[main->cache_arguments.used - 1]); status = F_status_set_error(F_failure); } else { if (!(flag & 0x1)) { - if (!data_make->main->cache_argument.used || f_file_exists(data_make->main->cache_argument, F_false) == F_true) { - fake_print_error_operation_link_point_exists(&data_make->error, data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + if (!main->cache_argument.used || f_file_exists(main->cache_argument, F_false) == F_true) { + fake_print_error_operation_link_point_exists(&data_make->error, main->cache_arguments.array[main->cache_arguments.used - 1]); status = F_status_set_error(F_failure); } } - if (f_path_is_absolute(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2]) == F_true) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2]); + if (f_path_is_absolute(main->cache_arguments.array[main->cache_arguments.used - 2]) == F_true) { + fake_make_assure_inside_project(data_make, main->cache_arguments.array[main->cache_arguments.used - 2]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_arguments.array[main->cache_arguments.used - 2]); status = F_status_set_error(F_failure); } - if ((flag & 0x2) && F_status_is_error_not(data_make->main->setting.state.status)) { - if (f_file_exists(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2], F_false) != F_true) { - fake_print_error_operation_link_target_exists_not(&data_make->error, data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2]); + if ((flag & 0x2) && F_status_is_error_not(main->setting.state.status)) { + if (f_file_exists(main->cache_arguments.array[main->cache_arguments.used - 2], F_false) != F_true) { + fake_print_error_operation_link_target_exists_not(&data_make->error, main->cache_arguments.array[main->cache_arguments.used - 2]); status = F_status_set_error(F_failure); } @@ -981,61 +1009,61 @@ extern "C" { } // The target path is relative to the point path so construct the path for performing checks. - else if (data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2].used) { + else if (main->cache_arguments.array[main->cache_arguments.used - 2].used) { // The cache_path contains the full path to the point file, save this so that the cache_path can be re-used. - f_char_t full_string[data_make->main->cache_argument.used + 1]; - f_string_static_t full = macro_f_string_static_t_initialize(full_string, 0, data_make->main->cache_argument.used); + f_char_t full_string[main->cache_argument.used + 1]; + f_string_static_t full = macro_f_string_static_t_initialize(full_string, 0, main->cache_argument.used); - memcpy(full_string, data_make->main->cache_argument.string, sizeof(f_char_t) * data_make->main->cache_argument.used); - full_string[data_make->main->cache_argument.used] = 0; + memcpy(full_string, main->cache_argument.string, sizeof(f_char_t) * main->cache_argument.used); + full_string[main->cache_argument.used] = 0; - data_make->main->cache_argument.used = 0; + main->cache_argument.used = 0; - data_make->main->setting.state.status = f_file_name_directory(full, &data_make->main->cache_argument); + main->setting.state.status = f_file_name_directory(full, &main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_name_directory), full, f_file_operation_analyze_s, fll_error_file_type_path_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_name_directory), full, f_file_operation_analyze_s, fll_error_file_type_path_e); status = F_status_set_error(F_failure); } - if (F_status_is_error_not(data_make->main->setting.state.status)) { - data_make->main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->main->cache_argument); + if (F_status_is_error_not(main->setting.state.status)) { + main->setting.state.status = f_string_dynamic_append_assure(f_path_separator_s, &main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append_assure)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append_assure)); status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = f_string_dynamic_append(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 2], &data_make->main->cache_argument); + main->setting.state.status = f_string_dynamic_append(main->cache_arguments.array[main->cache_arguments.used - 2], &main->cache_argument); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error(&data_make->main->program.error, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(f_string_dynamic_append)); status = F_status_set_error(F_failure); } } - if (F_status_is_error_not(data_make->main->setting.state.status)) { + if (F_status_is_error_not(main->setting.state.status)) { // The cache_path is used by fake_make_assure_inside_project(), so copy the contents into another buffer. - f_char_t target_string[data_make->main->cache_argument.used + 1]; - f_string_static_t target = macro_f_string_static_t_initialize(target_string, 0, data_make->main->cache_argument.used); + f_char_t target_string[main->cache_argument.used + 1]; + f_string_static_t target = macro_f_string_static_t_initialize(target_string, 0, main->cache_argument.used); - memcpy(target_string, data_make->main->cache_argument.string, sizeof(f_char_t) * data_make->main->cache_argument.used); - target_string[data_make->main->cache_argument.used] = 0; + memcpy(target_string, main->cache_argument.string, sizeof(f_char_t) * main->cache_argument.used); + target_string[main->cache_argument.used] = 0; fake_make_assure_inside_project(data_make, target); - if (F_status_is_error(data_make->main->setting.state.status)) { + if (F_status_is_error(main->setting.state.status)) { fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), target); status = F_status_set_error(F_failure); } - if ((flag & 0x2) && F_status_is_error_not(data_make->main->setting.state.status)) { + if ((flag & 0x2) && F_status_is_error_not(main->setting.state.status)) { if (f_file_exists(target, F_false) != F_true) { fake_print_error_operation_link_target_exists_not(&data_make->error, target); @@ -1046,18 +1074,18 @@ extern "C" { } } else { - fake_make_print_error_target_file_name_empty(&data_make->main->program.error); + fake_make_print_error_target_file_name_empty(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_link_ @@ -1067,54 +1095,56 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 1) { { f_status_t status = F_none; - for (f_array_length_t i = 0; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 0; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); status = F_status_set_error(F_failure); } } // for if (F_status_is_error_not(status)) { - for (f_array_length_t i = 0; i < data_make->main->cache_arguments.used - 1; ++i) { + for (f_array_length_t i = 0; i < main->cache_arguments.used - 1; ++i) { - if (f_file_exists(data_make->main->cache_arguments.array[i], F_true) != F_true) { - fake_print_error_file_simple(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + if (f_file_exists(main->cache_arguments.array[i], F_true) != F_true) { + fake_print_error_file_simple(&main->program.error, macro_fake_f(f_file_is), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } } // for } - data_make->main->setting.state.status = status; + main->setting.state.status = status; - if (F_status_is_error(data_make->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; } - if (data_make->main->cache_arguments.used > 2) { + if (main->cache_arguments.used > 2) { // The last file must be a directory. - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[main->cache_arguments.used - 1]); - if (data_make->main->setting.state.status == F_false || data_make->main->setting.state.status == F_file_found_not) { - fake_make_print_error_content_not_directory(&data_make->main->program.error, "last", data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1]); + if (main->setting.state.status == F_false || main->setting.state.status == F_file_found_not) { + fake_make_print_error_content_not_directory(&main->program.error, "last", main->cache_arguments.array[main->cache_arguments.used - 1]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_directory_is), data_make->main->cache_arguments.array[data_make->main->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_is), main->cache_arguments.array[main->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1122,27 +1152,27 @@ extern "C" { else { // When the first file is a directory, then the second, if it exists, must also be a directory. - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[0]); + main->setting.state.status = f_directory_is(main->cache_arguments.array[0]); - if (data_make->main->setting.state.status == F_true) { - data_make->main->setting.state.status = f_directory_is(data_make->main->cache_arguments.array[1]); + if (main->setting.state.status == F_true) { + main->setting.state.status = f_directory_is(main->cache_arguments.array[1]); - if (data_make->main->setting.state.status == F_false) { - fake_make_print_error_content_not_directory(&data_make->main->program.error, "second", data_make->main->cache_arguments.array[1]); + if (main->setting.state.status == F_false) { + fake_make_print_error_content_not_directory(&main->program.error, "second", main->cache_arguments.array[1]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } } - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_move_ @@ -1152,28 +1182,30 @@ extern "C" { if (!data_make || !data_make->main || !section_stack) return; - if (data_make->main->cache_arguments.used > 1) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (main->cache_arguments.used > 1) { + fake_print_error_too_many_arguments(&main->program.error); + + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->cache_arguments.used == 1) { + if (main->cache_arguments.used == 1) { f_array_length_t id_section = 0; for (; id_section < data_make->fakefile.used; ++id_section) { - if (f_compare_dynamic_partial_string(data_make->main->cache_arguments.array[0].string, data_make->main->buffer, data_make->main->cache_arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) { + if (f_compare_dynamic_partial_string(main->cache_arguments.array[0].string, main->buffer, main->cache_arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) { break; } } // for if (id_section == data_make->fakefile.used) { - fake_make_print_error_operation_section_not_found(&data_make->main->program.error, data_make->main->cache_arguments.array[0]); + fake_make_print_error_operation_section_not_found(&main->program.error, main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } @@ -1181,20 +1213,20 @@ extern "C" { for (f_array_length_t i = 0; i < section_stack->used; ++i) { if (section_stack->array[i] == id_section) { - fake_make_print_error_operation_recursion(&data_make->main->program.error, data_make->main->buffer, data_make->fakefile.array[id_section].name); + fake_make_print_error_operation_recursion(&main->program.error, main->buffer, data_make->fakefile.array[id_section].name); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } } // for - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_operate_ @@ -1204,7 +1236,9 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { const f_string_static_t reserved_name[] = { fake_make_parameter_variable_build_s, fake_make_parameter_variable_color_s, @@ -1245,19 +1279,19 @@ extern "C" { for (f_array_length_t i = 0; i < 33; ++i) { - if (f_compare_dynamic(reserved_name[i], data_make->main->cache_arguments.array[0]) == F_equal_to) { - fake_make_print_error_reserved_parameter_name(&data_make->main->program.error, reserved_name[i]); + if (f_compare_dynamic(reserved_name[i], main->cache_arguments.array[0]) == F_equal_to) { + fake_make_print_error_reserved_parameter_name(&main->program.error, reserved_name[i]); status = F_status_set_error(F_failure); } } // for - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_parameter_ @@ -1267,44 +1301,46 @@ extern "C" { if (!data_make || !data_make->main || !state_process) return; - if (data_make->main->cache_arguments.used) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { f_array_length_t i = 1; if (state_process->operation == fake_make_operation_type_group_e || state_process->operation == fake_make_operation_type_groups_e || state_process->operation == fake_make_operation_type_owner_e || state_process->operation == fake_make_operation_type_owners_e) { - if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, data_make->main->cache_arguments.array[i]) == F_equal_to) { + if (f_compare_dynamic(fake_make_operation_argument_no_dereference_s, main->cache_arguments.array[i]) == F_equal_to) { i = 2; } } - if (data_make->main->cache_arguments.used > i) { + if (main->cache_arguments.used > i) { f_status_t status = F_none; - for (; i < data_make->main->cache_arguments.used; ++i) { + for (; i < main->cache_arguments.used; ++i) { - data_make->main->setting.state.status = f_file_is(data_make->main->cache_arguments.array[i], F_file_type_regular_d, F_false); + main->setting.state.status = f_file_is(main->cache_arguments.array[i], F_file_type_regular_d, F_false); - if (data_make->main->setting.state.status == F_file_found_not) { - fake_print_error_file_simple(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + if (main->setting.state.status == F_file_found_not) { + fake_print_error_file_simple(&main->program.error, macro_fake_f(f_file_is), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->main->setting.state.status)) { - if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->main->program.error.to.stream) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_directory_e); + if (F_status_is_error(main->setting.state.status)) { + if (data_make->error.verbosity != f_console_verbosity_quiet_e && main->program.error.to.stream) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_is), main->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_directory_e); } status = F_status_set_error(F_failure); } } // for - data_make->main->setting.state.status = status; + main->setting.state.status = status; } } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_permission_ @@ -1314,21 +1350,23 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (main->cache_arguments.used) { + fake_print_error_too_many_arguments(&main->program.error); + + main->setting.state.status = F_status_set_error(F_failure); return; } if (data_make->path.stack.used == 1) { - fake_make_print_error_pop_last_path(&data_make->main->program.error); + fake_make_print_error_pop_last_path(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_pop_ @@ -1338,13 +1376,15 @@ extern "C" { if (!data_make || !data_make->main) return; - if (!data_make->main->cache_arguments.used) { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; + + if (!main->cache_arguments.used) { + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_run_ @@ -1354,55 +1394,57 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { - fake_print_error_too_many_arguments(&data_make->main->program.error); + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used > 1) { + fake_print_error_too_many_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->cache_arguments.used) { - if (data_make->main->cache_arguments.array[0].used) { - data_make->main->setting.state.status = f_file_is(data_make->main->cache_arguments.array[0], F_file_type_directory_d, F_false); + if (main->cache_arguments.used) { + if (main->cache_arguments.array[0].used) { + main->setting.state.status = f_file_is(main->cache_arguments.array[0], F_file_type_directory_d, F_false); - if (data_make->main->setting.state.status == F_file_found_not) { - fake_print_error_file_simple(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->main->cache_arguments.array[0], f_file_operation_find_s, fll_error_file_type_file_e); + if (main->setting.state.status == F_file_found_not) { + fake_print_error_file_simple(&main->program.error, macro_fake_f(f_file_is), main->cache_arguments.array[0], f_file_operation_find_s, fll_error_file_type_file_e); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (F_status_is_error(data_make->main->setting.state.status)) { - if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->main->program.error.to.stream) { - fake_print_error_file(&data_make->main->program.error, macro_fake_f(f_file_is), data_make->data->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + if (data_make->error.verbosity != f_console_verbosity_quiet_e && main->program.error.to.stream) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_is), data_make->data->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e); } - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - if (data_make->main->setting.state.status) { - data_make->main->setting.state.status = F_none; + if (main->setting.state.status) { + main->setting.state.status = F_none; } else { - fake_make_print_error_content_not_directory(&data_make->main->program.error, 0, data_make->main->cache_arguments.array[0]); + fake_make_print_error_content_not_directory(&main->program.error, 0, main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } else { - fake_make_print_error_file_name_empty(&data_make->main->program.error); + fake_make_print_error_file_name_empty(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_to_ @@ -1412,34 +1454,36 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used > 1) { - if (f_compare_dynamic(fake_make_operation_argument_file_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - if (f_compare_dynamic(fake_make_operation_argument_directory_s, data_make->main->cache_arguments.array[0]) == F_equal_to_not) { - fake_make_print_error_unsupported_type(&data_make->main->program.error, f_file_type_name_file_s, data_make->main->cache_arguments.array[0]); + fake_main_t * const main = data_make->main; - data_make->main->setting.state.status = F_status_set_error(F_failure); + if (main->cache_arguments.used > 1) { + if (f_compare_dynamic(fake_make_operation_argument_file_s, main->cache_arguments.array[0]) == F_equal_to_not) { + if (f_compare_dynamic(fake_make_operation_argument_directory_s, main->cache_arguments.array[0]) == F_equal_to_not) { + fake_make_print_error_unsupported_type(&main->program.error, f_file_type_name_file_s, main->cache_arguments.array[0]); + + main->setting.state.status = F_status_set_error(F_failure); } } f_status_t status = F_none; - for (f_array_length_t i = 1; i < data_make->main->cache_arguments.used; ++i) { + for (f_array_length_t i = 1; i < main->cache_arguments.used; ++i) { - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[i]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[i]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[i]); status = F_status_set_error(F_failure); } } // for - data_make->main->setting.state.status = status; + main->setting.state.status = status; } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_touch_ @@ -1449,30 +1493,32 @@ extern "C" { if (!data_make || !data_make->main) return; - if (data_make->main->cache_arguments.used) { - if (!data_make->main->cache_arguments.array[0].used) { + fake_main_t * const main = data_make->main; + + if (main->cache_arguments.used) { + if (!main->cache_arguments.array[0].used) { fake_print_error_argument_empty(&data_make->error, 1); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); return; } - fake_make_assure_inside_project(data_make, data_make->main->cache_arguments.array[0]); + fake_make_assure_inside_project(data_make, main->cache_arguments.array[0]); - if (F_status_is_error(data_make->main->setting.state.status)) { - fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->main->cache_argument.used ? data_make->main->cache_argument : data_make->main->cache_arguments.array[0]); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_operation_path_outside(&data_make->error, macro_fake_f(fake_make_assure_inside_project), main->cache_argument.used ? main->cache_argument : main->cache_arguments.array[0]); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } else { - data_make->main->setting.state.status = F_none; + main->setting.state.status = F_none; } } else { - fake_print_error_requires_more_arguments(&data_make->main->program.error); + fake_print_error_requires_more_arguments(&main->program.error); - data_make->main->setting.state.status = F_status_set_error(F_failure); + main->setting.state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_write_ diff --git a/level_3/fake/c/main/make/print/verbose.c b/level_3/fake/c/main/make/print/verbose.c index 6a65020..a66e9f0 100644 --- a/level_3/fake/c/main/make/print/verbose.c +++ b/level_3/fake/c/main/make/print/verbose.c @@ -10,7 +10,7 @@ extern "C" { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not; - fake_print_context_simple_variable(print, "Breaking as", arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, 0); + fake_print_context_simple_variable(print, "Breaking as ", arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, 0); return F_none; } @@ -39,7 +39,7 @@ extern "C" { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not; - fake_print_context_simple_variable(print, "Defined environment variable", variable, 0); + fake_print_context_simple_variable(print, "Defined environment variable ", variable, 0); return F_none; } @@ -51,7 +51,7 @@ extern "C" { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not; - fake_print_context_simple_variable(print, "Removed", path, 0); + fake_print_context_simple_variable(print, "Removed ", path, 0); return F_none; } @@ -63,7 +63,7 @@ extern "C" { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not; - fake_print_context_simple_variable(print, "Exiting as", arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, 0); + fake_print_context_simple_variable(print, "Exiting as ", arguments.used ? arguments.array[0] : fake_make_operation_argument_success_s, 0); return F_none; } @@ -165,7 +165,7 @@ extern "C" { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not; - fake_print_context_simple_variable(print, "Changed project path to", path, 0); + fake_print_context_simple_variable(print, "Changed project path to ", path, 0); return F_none; } @@ -211,7 +211,7 @@ extern "C" { if (!print) return F_status_set_error(F_output_not); if (print->verbosity < f_console_verbosity_verbose_e) return F_output_not; - fake_print_context_simple_variable(print, "Touched", path, 0); + fake_print_context_simple_variable(print, "Touched ", path, 0); return F_none; } diff --git a/level_3/fake/c/main/print/error.c b/level_3/fake/c/main/print/error.c index 3b3fe01..83b1a64 100644 --- a/level_3/fake/c/main/print/error.c +++ b/level_3/fake/c/main/print/error.c @@ -458,9 +458,12 @@ extern "C" { f_array_length_t line = 1; f_state_t state = f_state_t_initialize; + const f_status_t status = main->setting.state.status; f_fss_count_lines(buffer, operation_name.start, &line, &main->setting.state); + main->setting.state.status = status; + f_file_stream_lock(print->to); fl_print_format("%[%QThe section operation '%]", print->to, print->context, print->prefix, print->context); @@ -584,9 +587,12 @@ extern "C" { f_array_length_t line = 1; f_state_t state = f_state_t_initialize; + const f_status_t status = main->setting.state.status; f_fss_count_lines(buffer, operation_name.start, &line, &main->setting.state); + main->setting.state.status = status; + f_file_stream_lock(print->to); fl_print_format("%[%QThe section operation '%]", print->to, print->context, print->prefix, print->context); @@ -615,9 +621,12 @@ extern "C" { f_array_length_t line = 1; f_state_t state = f_state_t_initialize; + const f_status_t status = main->setting.state.status; f_fss_count_lines(buffer, operation_name.start, &line, &main->setting.state); + main->setting.state.status = status; + f_file_stream_lock(print->to); fl_print_format("%[%QThe section operation '%]", print->to, print->context, print->prefix, print->context); diff --git a/level_3/fake/c/main/skeleton.c b/level_3/fake/c/main/skeleton.c index 95b446e..37b2e2f 100644 --- a/level_3/fake/c/main/skeleton.c +++ b/level_3/fake/c/main/skeleton.c @@ -9,11 +9,13 @@ extern "C" { if (!data || !data->main) return; - if (data->main->program.message.verbosity != f_console_verbosity_quiet_e && data->main->program.message.verbosity != f_console_verbosity_error_e) { - fake_print_message_generating_skeleton(&data->main->program.message); + fake_main_t * const main = data->main; - if (data->main->program.message.verbosity >= f_console_verbosity_verbose_e) { - fll_print_dynamic(f_string_eol_s, data->main->program.message.to); + if (main->program.message.verbosity != f_console_verbosity_quiet_e && main->program.message.verbosity != f_console_verbosity_error_e) { + fake_print_message_generating_skeleton(&main->program.message); + + if (main->program.message.verbosity >= f_console_verbosity_verbose_e) { + fll_print_dynamic(f_string_eol_s, main->program.message.to); } } @@ -50,19 +52,19 @@ extern "C" { const f_string_static_t path[] = { data->path_build, - data->main->setting.data, + main->setting.data, data->path_data_build, data->path_data_documentation, data->path_data_settings, data->path_documents, data->path_licenses, - data->main->setting.sources, + main->setting.sources, sources, sources_bash, sources_c, sources_cpp, sources_script, - data->main->setting.work, + main->setting.work, data->path_work_includes, data->path_work_libraries, data->path_work_libraries_script, @@ -79,40 +81,40 @@ extern "C" { fake_skeleton_operate_directory_create(data, path[i]); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error(&data->main->program.error, macro_fake_f(fake_skeleton_operate_directory_create)); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error(&main->program.error, macro_fake_f(fake_skeleton_operate_directory_create)); return; } } // for - if (data->main->program.message.verbosity >= f_console_verbosity_verbose_e) { - fll_print_dynamic(f_string_eol_s, data->main->program.message.to); + if (main->program.message.verbosity >= f_console_verbosity_verbose_e) { + fll_print_dynamic(f_string_eol_s, main->program.message.to); } } 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->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; 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->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; 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->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; 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->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; 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->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; fake_skeleton_operate_file_create(data, data->file_documents_readme, F_false, f_string_empty_s); - if (F_status_is_error(data->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; 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->main->setting.state.status)) return; + if (F_status_is_error(main->setting.state.status)) return; - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_skeleton_operate_ @@ -121,47 +123,49 @@ extern "C" { if (!data || !data->main || !path.used) return; - data->main->setting.state.status = f_directory_exists(path); + fake_main_t * const main = data->main; + + main->setting.state.status = f_directory_exists(path); - if (data->main->setting.state.status == F_true) { - fake_print_verbose_directory_exists(&data->main->program.message, path); + if (main->setting.state.status == F_true) { + fake_print_verbose_directory_exists(&main->program.message, path); - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } - if (data->main->setting.state.status == F_false) { - fake_print_warning_path_exists_not_directory(&data->main->program.warning, path); + if (main->setting.state.status == F_false) { + fake_print_warning_path_exists_not_directory(&main->program.warning, path); - data->main->setting.state.status = F_status_set_warning(F_failure); + main->setting.state.status = F_status_set_warning(F_failure); return; } - if (data->main->setting.state.status == F_file_found_not) { - data->main->setting.state.status = f_directory_create(path, F_file_mode_all_rwx_d); + if (main->setting.state.status == F_file_found_not) { + main->setting.state.status = f_directory_create(path, F_file_mode_all_rwx_d); - if (F_status_is_error(data->main->setting.state.status)) { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found_not) { - fake_print_error_directory_create_parent_missing(&data->main->program.error, path); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_print_error_directory_create_parent_missing(&main->program.error, path); } else { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_create), path, f_file_operation_create_s, fll_error_file_type_directory_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_create), path, f_file_operation_create_s, fll_error_file_type_directory_e); } return; } - fake_print_verbose_create_directory(&data->main->program.message, path); + fake_print_verbose_create_directory(&main->program.message, path); } - else if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_directory_exists), path, f_file_operation_create_s, fll_error_file_type_directory_e); + else if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_directory_exists), path, f_file_operation_create_s, fll_error_file_type_directory_e); return; } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_skeleton_operate_directory_create_ @@ -170,58 +174,60 @@ extern "C" { if (!data || !data->main || !path.used) return; - data->main->setting.state.status = f_file_is(path, F_file_type_regular_d, F_false); + fake_main_t * const main = data->main; + + main->setting.state.status = f_file_is(path, F_file_type_regular_d, F_false); - if (data->main->setting.state.status == F_true) { - fake_print_verbose_file_exists(&data->main->program.message, path); + if (main->setting.state.status == F_true) { + fake_print_verbose_file_exists(&main->program.message, path); - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } // symbolic links might also be fine. - if (data->main->setting.state.status == F_false) { - data->main->setting.state.status = f_file_is(path, F_file_type_link_d, F_false); + if (main->setting.state.status == F_false) { + main->setting.state.status = f_file_is(path, F_file_type_link_d, F_false); - if (data->main->setting.state.status == F_true) { - fake_print_verbose_file_exists_as_link(&data->main->program.message, path); + if (main->setting.state.status == F_true) { + fake_print_verbose_file_exists_as_link(&main->program.message, path); - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; return; } } - if (data->main->setting.state.status == F_false) { - fake_print_verbose_file_exists_not_regular_or_link(&data->main->program.message, path); + if (main->setting.state.status == F_false) { + fake_print_verbose_file_exists_not_regular_or_link(&main->program.message, path); - data->main->setting.state.status = F_status_set_warning(F_none); + main->setting.state.status = F_status_set_warning(F_none); return; } - if (F_status_set_fine(data->main->setting.state.status) == F_file_found_not) { + if (F_status_set_fine(main->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; } - data->main->setting.state.status = f_file_create(path, mode, F_true); + main->setting.state.status = f_file_create(path, mode, F_true); - if (F_status_is_error(data->main->setting.state.status)) { - if (F_status_set_fine(data->main->setting.state.status) == F_file_found_not) { - fake_print_error_file_create_parent_missing(&data->main->program.error, path); + if (F_status_is_error(main->setting.state.status)) { + if (F_status_set_fine(main->setting.state.status) == F_file_found_not) { + fake_print_error_file_create_parent_missing(&main->program.error, path); } else { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_create), path, f_file_operation_create_s, fll_error_file_type_file_e); + fake_print_error_file(&main->program.error, macro_fake_f(f_file_create), path, f_file_operation_create_s, fll_error_file_type_file_e); } return; } - fake_print_verbose_create_file(&data->main->program.message, path); + fake_print_verbose_create_file(&main->program.message, path); if (content.used) { f_file_t file = f_file_t_initialize; @@ -229,18 +235,18 @@ extern "C" { file.flag = F_file_flag_append_wo_d; file.size_write = content.used; - data->main->setting.state.status = f_file_open(path, 0, &file); + main->setting.state.status = f_file_open(path, 0, &file); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_open), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_open), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); return; } - data->main->setting.state.status = f_file_write(file, content, 0); + main->setting.state.status = f_file_write(file, content, 0); - if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_write), path, fake_common_file_populate_pre_s, fll_error_file_type_file_e); + if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.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); @@ -248,19 +254,19 @@ extern "C" { return; } - fake_print_verbose_file_pre_populated(&data->main->program.message, path); + fake_print_verbose_file_pre_populated(&main->program.message, path); f_file_stream_flush(file); f_file_stream_close(&file); } } - else if (F_status_is_error(data->main->setting.state.status)) { - fake_print_error_file(&data->main->program.error, macro_fake_f(f_file_is), path, f_file_operation_create_s, fll_error_file_type_file_e); + else if (F_status_is_error(main->setting.state.status)) { + fake_print_error_file(&main->program.error, macro_fake_f(f_file_is), path, f_file_operation_create_s, fll_error_file_type_file_e); return; } - data->main->setting.state.status = F_none; + main->setting.state.status = F_none; } #endif // _di_fake_skeleton_operate_file_create_ -- 1.8.3.1