From: Kevin Day Date: Mon, 6 Mar 2023 01:47:20 +0000 (-0600) Subject: Progress: Continue program related work, focusing in Featureless Make. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=8a0a957cf9d90ca754117b6713c908705d8c3f54;p=fll Progress: Continue program related work, focusing in Featureless Make. --- diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index 418443e..be20ee5 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -814,6 +814,8 @@ extern "C" { #ifndef _di_fake_build_path_source_length_ void fake_build_path_source_length(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) { + if (!data || !data_build || !setting_path_source || !source) return; + source->used = 0; if (setting_path_source->used) { @@ -837,7 +839,9 @@ extern "C" { #endif // _di_fake_build_path_source_length_ #ifndef _di_fake_build_path_source_string_ - void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) { + void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source) { + + if (!data || !data_build || !setting_path_source) return; source->used = 0; @@ -867,9 +871,10 @@ extern "C" { #endif // _di_fake_build_path_source_string_ #ifndef _di_fake_build_sources_add_ - f_status_t fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) { + void fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) { + + if (!data || !data_build || !generic || !specific || !arguments) return; - f_status_t status = F_none; f_array_length_t i = 0; f_array_length_t j = 0; @@ -897,19 +902,25 @@ extern "C" { source.used += sources[i]->array[j].used; source.string[source.used] = 0; - status = fll_execute_arguments_add(source, arguments); - if (F_status_is_error(status)) return status; + data->setting.state.status = fll_execute_arguments_add(source, arguments); + if (F_status_is_error(data->setting.state.status)) return; } // for } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_build_sources_add_ #ifndef _di_fake_build_sources_object_add_ - f_status_t fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) { + void fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) { + + if (!data || !data_build || !generic || !specific || !arguments) return; + + if (!generic->used && !specific->used) { + data->setting.state.status = F_none; - if (!generic->used && !specific->used) return F_none; + return; + } f_string_static_t source = f_string_static_t_initialize; @@ -938,10 +949,10 @@ extern "C" { source_string[source.used] = 0; - const f_status_t status = fll_execute_arguments_add(source, arguments); - if (F_status_is_error(status)) return status; + data->setting.state.status = fll_execute_arguments_add(source, arguments); + if (F_status_is_error(data->setting.state.status)) return; - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_build_sources_object_add_ @@ -970,6 +981,9 @@ extern "C" { if (F_status_is_error(data->setting.state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_touch), file, f_file_operation_touch_s, fll_error_file_type_file_e); } + else { + data->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 d386c8f..e3433ac 100644 --- a/level_3/fake/c/main/build.h +++ b/level_3/fake/c/main/build.h @@ -255,6 +255,8 @@ extern "C" { * * @param data * The program data. + * + * This does not alter data.setting.state.status. * @param data_build * The build data. * @param setting_path_source @@ -274,6 +276,8 @@ extern "C" { * * @param data * The program data. + * + * This does not alter data.setting.state.status. * @param data_build * The build data. * @param setting_path_source @@ -293,6 +297,11 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: fll_execute_arguments_add() * @param data_build * The build data. * @param generic @@ -302,13 +311,10 @@ extern "C" { * @param arguments * The execute arguments array being updated. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see fll_execute_arguments_add() */ #ifndef _di_fake_build_sources_add_ - extern f_status_t fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments); + extern void fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments); #endif // _di_fake_build_sources_add_ /** @@ -316,6 +322,11 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: fll_execute_arguments_add() * @param data_build * The build data. * @param generic @@ -325,13 +336,10 @@ extern "C" { * @param arguments * The execute arguments array being updated. * - * @return - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. + * @see fll_execute_arguments_add() */ #ifndef _di_fake_build_sources_object_add_ - extern f_status_t fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments); + extern void fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments); #endif // _di_fake_build_sources_object_add_ /** @@ -339,15 +347,21 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: f_file_touch() * @param file * The file path to touch. - * @param status - * The return status. * * @see f_file_touch() + * @see fll_program_print_signal_received() */ #ifndef _di_fake_build_touch_ - extern void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file, f_status_t *status); + extern void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file); #endif // _di_fake_build_touch_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/clean.c b/level_3/fake/c/main/clean.c index 5647654..00b3c3e 100644 --- a/level_3/fake/c/main/clean.c +++ b/level_3/fake/c/main/clean.c @@ -5,7 +5,9 @@ extern "C" { #endif #ifndef _di_fake_clean_operate_ - f_status_t fake_clean_operate(fake_data_t * const data) { + void fake_clean_operate(fake_data_t * const data) { + + if (!data) return; if (data->main->message.verbosity != f_console_verbosity_quiet_e && data->main->message.verbosity != f_console_verbosity_error_e) { f_file_stream_lock(data->main->message.to); @@ -17,30 +19,29 @@ extern "C" { f_file_stream_unlock(data->main->message.to); } - f_status_t status = F_none; + data->setting.state.status = F_none; if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { - status = f_directory_remove_custom(data->setting->build, F_directory_max_descriptors_d, F_true, fake_clean_remove_recursively_verbosely); + data->setting.state.status = f_directory_remove_custom(data->setting->build, F_directory_max_descriptors_d, F_true, fake_clean_remove_recursively_verbosely); } else { - status = f_directory_remove(data->setting->build, F_directory_max_descriptors_d, F_true); + data->setting.state.status = f_directory_remove(data->setting->build, F_directory_max_descriptors_d, F_true); } - if (F_status_set_fine(status) == F_file_found_not || F_status_set_fine(status) == F_directory) { + if (F_status_set_fine(data->setting.state.status) == F_file_found_not || F_status_set_fine(data->setting.state.status) == F_directory) { if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { fll_print_format("The build directory '%[%Q%]' does not exist.%r", data->main->warning.to, data->main->context.set.notable, data->setting->build, data->main->context.set.notable, f_string_eol_s); } - status = F_none; + data->setting.state.status = F_none; } - if (F_status_is_error(status)) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_directory_remove), data->setting->build, f_file_operation_delete_s, fll_error_file_type_directory_e); - - return status; + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_remove), data->setting->build, f_file_operation_delete_s, fll_error_file_type_directory_e); + } + else { + data->setting.state.status = F_none; } - - return F_none; } #endif // _di_fake_clean_operate_ diff --git a/level_3/fake/c/main/clean.h b/level_3/fake/c/main/clean.h index 5f7ed08..29fbb77 100644 --- a/level_3/fake/c/main/clean.h +++ b/level_3/fake/c/main/clean.h @@ -22,15 +22,19 @@ extern "C" { * @param data * The program data. * - * @return - * F_none on success. + * This alters data.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on interrupt signal received. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * Errors (with error bit) from: f_directory_remove() + * Errors (with error bit) from: f_directory_remove_custom() * - * Status codes (with error bit) are returned on any problem. + * @see f_directory_remove() + * @see f_directory_remove_custom() */ #ifndef _di_fake_clean_operate_ - extern f_status_t fake_clean_operate(fake_data_t * const data); + extern void fake_clean_operate(fake_data_t * const data); #endif // _di_fake_clean_operate_ /** diff --git a/level_3/fake/c/main/common/print.c b/level_3/fake/c/main/common/print.c index ffbe626..df99329 100644 --- a/level_3/fake/c/main/common/print.c +++ b/level_3/fake/c/main/common/print.c @@ -95,9 +95,9 @@ extern "C" { "fake_build_sources_object_add", "fake_execute", "fake_make_assure_inside_project", - "fake_make_get_id_group", + "fake_make_get_id", "fake_make_get_id_mode", - "fake_make_get_id_owner", + "fake_make_get_id", "fake_make_operate_expand_build", "fake_make_operate_expand_context", "fake_make_operate_expand_environment", diff --git a/level_3/fake/c/main/common/print.h b/level_3/fake/c/main/common/print.h index fd48ee5..be4eb98 100644 --- a/level_3/fake/c/main/common/print.h +++ b/level_3/fake/c/main/common/print.h @@ -128,9 +128,8 @@ extern "C" { fake_f_fake_build_sources_object_add_e, fake_f_fake_execute_e, fake_f_fake_make_assure_inside_project_e, - fake_f_fake_make_get_id_group_e, + fake_f_fake_make_get_id_e, fake_f_fake_make_get_id_mode_e, - fake_f_fake_make_get_id_owner_e, fake_f_fake_make_operate_expand_build_e, fake_f_fake_make_operate_expand_context_e, fake_f_fake_make_operate_expand_environment_e, diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index f70c618..79740ec 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -60,14 +60,15 @@ extern "C" { setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &data.file_data_build_fakefile); - if (F_status_is_error(setting->state.status)) { - fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_append)); - } - else { + if (F_status_is_error_not(setting->state.status)) { setting->fakefile.used = 0; setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &setting->fakefile); } + + if (F_status_is_error(setting->state.status)) { + fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_append)); + } } { @@ -88,7 +89,7 @@ extern "C" { if (has_clean) { data.operation = setting->operations.array[i]; - setting->state.status = fake_validate_parameter_paths(&data); + fake_validate_parameter_paths(&data); if (F_status_is_error_not(setting->state.status) && !(main->pipe & fll_program_data_pipe_input_e)) { setting->state.status = f_file_is( @@ -106,7 +107,6 @@ extern "C" { fake_print_error_file( setting, main->error, - F_status_set_fine(setting->state.status), macro_fake_f(f_file_is), setting->operations.array[i] == fake_operation_build_e ? data.file_data_build_settings @@ -144,33 +144,33 @@ extern "C" { if (data.operation == fake_operation_build_e) { if (check_paths) { - setting->state.status = fake_validate_parameter_paths(&data); + fake_validate_parameter_paths(&data); check_paths = F_false; } if (F_status_is_error_not(setting->state.status)) { - setting->state.status = fake_build_operate(&data, 0, main->pipe & fll_program_data_pipe_input_e); + fake_build_operate(&data, 0, main->pipe & fll_program_data_pipe_input_e); } } else if (data.operation == fake_operation_clean_e) { - setting->state.status = fake_clean_operate(&data); + fake_clean_operate(&data); // Reset in case next operation needs files. check_paths = F_true; } else if (data.operation == fake_operation_make_e) { if (check_paths) { - setting->state.status = fake_validate_parameter_paths(&data); + fake_validate_parameter_paths(&data); check_paths = F_false; } if (F_status_is_error_not(setting->state.status)) { - setting->state.status = fake_make_operate(&data); + fake_make_operate(&data); if (setting->state.status == F_child) break; } } else if (data.operation == fake_operation_skeleton_e) { - setting->state.status = fake_skeleton_operate(&data); + fake_skeleton_operate(&data); // Skeleton is supposed to guarantee these. check_paths = F_false; @@ -207,6 +207,8 @@ extern "C" { } else if (setting->state.status != F_child) { if (F_status_is_error_not(setting->state.status)) { + setting->state.status = F_none; + fake_print_operation_all_complete(setting, main->message); } @@ -220,9 +222,10 @@ extern "C" { #endif // _di_fake_main_ #ifndef _di_fake_execute_ - int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t * const status) { + int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments) { - if (F_status_is_error(*status)) return 1; + if (!data) return; + if (F_status_is_error(data->setting.state.status)) return 1; if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { f_file_stream_lock(data->main->message.to); @@ -253,31 +256,31 @@ extern "C" { fl_execute_parameter_t parameter = macro_fl_execute_parameter_t_initialize(0, 0, &environment, &signals, 0); - *status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); + data->setting.state.status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); if (!((++data->main->signal_check) % fake_signal_check_d)) { if (fll_program_standard_signal_received(data->main)) { fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); return 0; } } - if (*status == F_child) return return_code; + if (data->setting.state.status == F_child) return return_code; } else { - *status = F_status_set_error(F_file_found_not); + data->setting.state.status = F_status_set_error(F_file_found_not); } if (return_code != 0) { - *status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } - else if (F_status_is_error(*status)) { + else if (F_status_is_error(data->setting.state.status)) { return_code = 1; - if (F_status_set_fine(*status) == F_file_found_not) { + if (F_status_set_fine(data->setting.state.status) == F_file_found_not) { if (data->main->error.verbosity > f_console_verbosity_quiet_e) { f_file_stream_lock(data->main->error.to); @@ -289,7 +292,7 @@ extern "C" { } } else { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_program)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_program)); } } @@ -427,13 +430,17 @@ extern "C" { #endif // _di_fake_pipe_buffer_ #ifndef _di_fake_validate_parameter_paths_ - f_status_t fake_validate_parameter_paths(fake_data_t * const data) { + void fake_validate_parameter_paths(fake_data_t * const data) { + + if (!data) return; if (!((++data->main->signal_check) % fake_signal_check_d)) { if (fll_program_standard_signal_received(data->main)) { fll_program_print_signal_received(data->main->warning, data->setting->line_first, data->main->signal_received); - return F_status_set_error(F_interrupt); + data->setting.state.status = F_status_set_error(F_interrupt); + + return } } @@ -466,7 +473,7 @@ extern "C" { struct stat directory_stat; - f_status_t status = F_none; + data->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) { @@ -494,9 +501,9 @@ extern "C" { requireds[1] = F_none; // fake_long_data_s } else { - status = f_file_exists(data->main->parameters.arguments.array[index], F_true); + data->setting.state.status = f_file_exists(data->main->parameters.arguments.array[index], F_true); - if (F_status_is_error_not(status) && status == F_true) { + if (F_status_is_error_not(data->setting.state.status) && data->setting.state.status == F_true) { requireds[1] = F_none; // fake_long_data_s } } @@ -508,15 +515,17 @@ extern "C" { if (requireds[i] != F_none && values[i].used) { memset(&directory_stat, 0, sizeof(struct stat)); - status = f_file_stat(values[i], F_true, &directory_stat); + data->setting.state.status = f_file_stat(values[i], F_true, &directory_stat); - if (status == F_status_set_error(F_file_found_not)) status = F_status_set_error(F_directory_found_not); + if (data->setting.state.status == F_status_set_error(F_file_found_not)) { + data->setting.state.status = F_status_set_error(F_directory_found_not); + } - if (F_status_is_error(status)) { - if (F_status_set_fine(status) != F_directory_found_not || requireds[i]) { - fake_print_error_file(data->setting, data->main->error, status, macro_fake_f(f_file_stat), values[i], f_file_operation_access_s, fll_error_file_type_directory_e); + if (F_status_is_error(data->setting.state.status)) { + if (F_status_set_fine(data->setting.state.status) != F_directory_found_not || requireds[i]) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stat), values[i], f_file_operation_access_s, fll_error_file_type_directory_e); - return status; + return; } } } @@ -529,11 +538,13 @@ extern "C" { f_file_stream_unlock(data->main->error.to); - return F_status_set_error(F_directory_found_not); + data->setting.state.status = F_status_set_error(F_directory_found_not); + + return; } } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_validate_parameter_paths_ diff --git a/level_3/fake/c/main/fake.h b/level_3/fake/c/main/fake.h index 41595ec..69a2efa 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -145,31 +145,31 @@ extern "C" { /** * Execute main program. * - * If main.signal is non-zero, then this blocks and handles the following signals: - * - F_signal_abort - * - F_signal_broken_pipe - * - F_signal_hangup - * - F_signal_interrupt - * - F_signal_quit - * - F_signal_termination - * * @param main * The main program data. * @param setting * The main program settings. - * Must be of type (fake_setting_t *). - * - * This is used by the main thread and should not be modified within individual threads. * * This alters setting.state.status: * F_none on success. * F_child if this is a child process returning. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. - * F_parameter (with error bit) if main is NULL or setting is NULL. + * F_interrupt (with error bit) on interrupt signal received. * - * @param arguments - * The parameters passed to the process. + * Errors (with error bit) from: f_string_dynamic_append() + * Errors (with error bit) from: fake_build_operate() + * Errors (with error bit) from: fake_make_operate() + * Errors (with error bit) from: fake_path_generate() + * Errors (with error bit) from: fake_skeleton_operate() + * Errors (with error bit) from: fake_validate_parameter_paths() + * + * @see f_string_dynamic_append() + * @see fll_program_standard_signal_received() + * @see fake_build_operate() + * @see fake_make_operate() + * @see fake_path_generate() + * @see fake_skeleton_operate() + * @see fake_validate_parameter_paths() */ #ifndef _di_fake_main_ extern void fake_main(fll_program_data_t * const main, fake_setting_t * const setting); @@ -182,20 +182,29 @@ extern "C" { * * @param data * The program data. + * + * This alters setting.state.status: + * F_none on success. + * F_child if this is a child process returning. + * + * F_interrupt (with error bit) on interrupt signal received. + * F_failure (with error bit) on execution failure. + * F_file_found_not (with error bit) on could not execute program because program is not found. + * + * Errors (with error bit) from: fll_execute_program() * @param environment * The environment variable data. * @param program * The program to be executed. * @param arguments * The arguments to be passed to the program. - * @param status - * The return status. * * @return * The return code result from execution. * A value of 1 is returned if status has the error bit set. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * @see fll_execute_program() + * @see fll_program_standard_signal_received() */ #ifndef _di_fake_execute_ extern int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t * const status); @@ -232,6 +241,7 @@ extern "C" { * @see f_file_stream_open() * @see f_file_stream_read() * @see f_string_dynamic_increase_by() + * @see fll_program_standard_signal_received() */ #ifndef _di_fake_file_buffer_ extern void fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, const bool required, f_string_dynamic_t * const buffer); @@ -255,6 +265,7 @@ extern "C" { * * @see f_file_stream_read_block() * @see f_string_dynamic_increase_by() + * @see fll_program_standard_signal_received() */ #ifndef _di_fake_pipe_buffer_ extern void fake_pipe_buffer(fake_data_t * const data, f_string_dynamic_t * const buffer); @@ -268,15 +279,20 @@ extern "C" { * @param data * The program data. * - * @return - * F_none on success. + * This alters data.setting.state.status: + * F_none on success. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * F_interrupt (with error bit) on interrupt signal received. + * + * Errors (with error bit) from: f_file_exists() + * Errors (with error bit) from: f_file_stat() * - * Status codes (with error bit) are returned on any problem. + * @see f_file_exists() + * @see f_file_stat() + * @see fll_program_standard_signal_received() */ #ifndef _di_fake_validate_parameter_paths_ - extern f_status_t fake_validate_parameter_paths(fake_data_t * const data); + extern void fake_validate_parameter_paths(fake_data_t * const data); #endif // _di_fake_validate_parameter_paths_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make.c b/level_3/fake/c/main/make.c index 3e2ebc9..5d9b947 100644 --- a/level_3/fake/c/main/make.c +++ b/level_3/fake/c/main/make.c @@ -5,161 +5,150 @@ extern "C" { #endif #ifndef _di_fake_make_assure_inside_project_ - f_status_t fake_make_assure_inside_project(fake_make_data_t * const data_make, const f_string_static_t path) { + void fake_make_assure_inside_project(fake_make_data_t * const data_make, const f_string_static_t path) { + + if (!data_make) return; data_make->cache_path.used = 0; - f_status_t status = fll_path_canonical(path, &data_make->cache_path); - if (F_status_is_error(status)) return status; + data.setting.state.status = fll_path_canonical(path, &data_make->cache_path); + if (F_status_is_error(data.setting.state.status)) return; if (data_make->cache_path.used < data_make->path.stack.array[0].used) { - return F_status_set_error(F_false); + data.setting.state.status = F_status_set_error(F_false); + + return; } const f_string_range_t range = macro_f_string_range_t_initialize2(data_make->path.stack.array[0].used); if (range.start <= range.stop) { - status = fl_string_dynamic_partial_compare(data_make->path.stack.array[0], data_make->cache_path, range, range); - if (F_status_is_error(status)) return status; + data.setting.state.status = fl_string_dynamic_partial_compare(data_make->path.stack.array[0], data_make->cache_path, range, range); + if (F_status_is_error(data.setting.state.status)) return; - if (status) { - if (data_make->cache_path.used == data_make->path.stack.array[0].used) { - return F_true; - } + if (data.setting.state.status) { + if (data_make->cache_path.used == data_make->path.stack.array[0].used || data_make->cache_path.string[data_make->path.stack.array[0].used] == f_path_separator_s.string[0]) { + data.setting.state.status = F_true; - if (data_make->cache_path.string[data_make->path.stack.array[0].used] == f_path_separator_s.string[0]) { - return F_true; + return; } } } - return F_status_set_error(F_false); + data.setting.state.status = F_status_set_error(F_false); } #endif // _di_fake_make_assure_inside_project_ -#ifndef _di_fake_make_get_id_group_ - f_status_t fake_make_get_id_group(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, gid_t *id) { +#ifndef _di_fake_make_get_id_ + void fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer, void *id) { - f_number_unsigned_t number = 0; + if (!data || !id) return; + + if (!buffer.used) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); + data.setting.state.status = F_status_set_error(F_parameter); - if (F_status_is_error(status)) { - status = F_status_set_fine(status); + return; + } - if (status == F_number) { - status = f_account_group_id_by_name(buffer, id); + f_number_unsigned_t number = 0; - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_account_group_id_by_name)); + data.setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); - return F_status_set_error(status); - } + if (F_status_is_error(data.setting.state.status)) { + if (F_status_set_fine(data.setting.state.status) == F_number) { - if (status == F_exist_not) { - fake_print_error_group_not_found(data->setting, data->main->error, buffer); + data.setting.state.status = is_owner + ? f_account_id_by_name(buffer, (uid_t *) id) + : f_account_group_id_by_name(buffer, (gid_t *) id); - return F_status_set_error(F_failure); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error( + data_make->setting, + data_make->main->error, + macro_fake_f(is_owner + ? f_account_id_by_name + : f_account_group_id_by_name + ) + ); + } + else { + if (data.setting.state.status == F_exist_not) { + fake_print_error_group_not_found(data_make->setting, data_make->main->error, buffer); + + data.setting.state.status = F_status_set_error(F_exist_not); + } + else { + data.setting.state.status = F_none; + } } - - return F_none; + } + else { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect)); } - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect)); - - return F_status_set_error(status); + return; } if (number > F_type_size_32_unsigned_d) { - fake_print_error_number_too_large(data->setting, data->main->error, buffer); - } + fake_print_error_number_too_large(data_make->setting, data_make->main->error, buffer); - *id = (gid_t) number; + data.setting.state.status = F_status_set_error(F_failure); - return status; + return; + } + + *id = is_owner ? (uid_t) number : (gid_t) number; } -#endif // _di_fake_make_get_id_group_ +#endif // _di_fake_make_get_id_ #ifndef _di_fake_make_get_id_mode_ - f_status_t fake_make_get_id_mode(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) { + void fake_make_get_id_mode(fake_make_data_t * const data_make, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) { + + if (!data_make || !mode || !replace) return; if (!buffer.used) { - fake_print_error(data->setting, data->main->error, F_parameter, macro_fake_f(fake_make_get_id_mode)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); - return F_status_set_error(F_parameter); + data.setting.state.status = F_status_set_error(F_parameter); + + return; } - const f_status_t status = f_file_mode_from_string(buffer, data->main->umask, mode, replace); + data.setting.state.status = f_file_mode_from_string(buffer, data->main->umask, mode, replace); - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_syntax) { - fake_print_error_mode_invalid(data->setting, data->main->error, buffer); + if (F_status_is_error(data.setting.state.status)) { + if (F_status_set_fine(data.setting.state.status) == F_syntax) { + fake_print_error_mode_invalid(data_make->setting, data_make->main->error, buffer); } else { - fake_print_error(data->setting, print, status, macro_fake_f(fll_execute_arguments_add)); - } - - return status; - } - - return F_none; - } -#endif // _di_fake_make_get_id_mode_ - -#ifndef _di_fake_make_get_id_owner_ - f_status_t fake_make_get_id_owner(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, uid_t *id) { - - f_number_unsigned_t number = 0; - - f_status_t status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); - - if (F_status_is_error(status)) { - status = F_status_set_fine(status); - - if (status == F_number) { - status = f_account_id_by_name(buffer, id); - - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_account_id_by_name)); - - return F_status_set_error(status); - } - - if (status == F_exist_not) { - fake_print_error_user_not_found(data->setting, data->main->error, buffer); - - return F_status_set_error(F_failure); - } - - return F_none; + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); } - - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fl_conversion_dynamic_to_unsigned_detect)); - - return F_status_set_error(status); } - - if (number > F_type_size_32_unsigned_d) { - fake_print_error_number_too_large(data->setting, data->main->error, buffer); + else { + data.setting.state.status = F_none; } - - *id = (uid_t) number; - - return status; } -#endif // _di_fake_make_get_id_owner_ +#endif // _di_fake_make_get_id_mode_ #ifndef _di_fake_make_path_relative_ - f_status_t fake_make_path_relative(fake_make_data_t * const data_make, const f_string_static_t path) { + void fake_make_path_relative(fake_make_data_t * const data_make, const f_string_static_t path) { + + if (!data_make) return; data_make->cache_path.used = 0; if (!path.used || path.used == data_make->path.stack.array[0].used) { - return F_none; + data.setting.state.status = F_none; + + return; } if (path.used < data_make->path.stack.array[0].used) { - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } f_string_range_t range = f_string_range_t_initialize; @@ -167,13 +156,13 @@ extern "C" { range.start = data_make->path.stack.array[0].used + 1; range.stop = range.start + (path.used - range.start) - 1; - f_status_t status = f_string_dynamic_partial_append(path, range, &data_make->cache_path); - if (F_status_is_error(status)) return status; + data.setting.state.status = f_string_dynamic_partial_append(path, range, &data_make->cache_path); + if (F_status_is_error(data.setting.state.status)) return; - status = f_string_dynamic_terminate(&data_make->cache_path); - if (F_status_is_error(status)) return status; + data.setting.state.status = f_string_dynamic_terminate(&data_make->cache_path); + if (F_status_is_error(data.setting.state.status)) return; - return status; + data.setting.state.status = F_none; } #endif // _di_fake_make_path_relative_ diff --git a/level_3/fake/c/main/make.h b/level_3/fake/c/main/make.h index c72fb96..5489cf4 100644 --- a/level_3/fake/c/main/make.h +++ b/level_3/fake/c/main/make.h @@ -22,48 +22,64 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * The data_make.cache_path will be updated to reflect the full path to this file. + * + * This alters data_make.setting.state.status: + * F_true if inside the project. + * F_false (with error bit) if path exists outside of the root project path. + * + * Errors (with error bit) from: fll_path_canonical() * @param path * file path to get the real path of. * - * @return - * F_true if inside the project. - * F_false (with error bit) if path exists outside of the root project path. - * - * Status codes (with error bit) are returned on any problem. + * @see fll_path_canonical() */ #ifndef _di_fake_make_assure_inside_project_ - extern f_status_t fake_make_assure_inside_project(fake_make_data_t * const data_make, const f_string_static_t path); + extern void fake_make_assure_inside_project(fake_make_data_t * const data_make, const f_string_static_t path); #endif // _di_fake_make_assure_inside_project_ /** * Get the group id from either a string representing the number or a string representing the name. * - * @param data - * The program data. - * @param print - * The error/warning print data. + * @param data_make + * All make related setting data, including data from the fakefile and the build settings file. + * The data_make.cache_path will be updated to reflect the full path to this file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * F_exist_not (with error bit) if there is no owner or group by the given name. + * F_parameter (with error bit) on invalid parameter. + * + * Errors (with error bit) from: fl_conversion_dynamic_to_unsigned_detect() + * @param * @param buffer * The string containing the name or number. * @param id - * The detected group id. - * - * @return - * F_none on success. - * F_exist_not if there is no group by the given name. + * The detected owner id or group id. + * When is_owner is TRUE, then this must be of type (uid_t *). + * When is_owner is TRUE, then this must be of type (gid_t *). * - * Status codes (with error bit) are returned on any problem. + * @see fl_conversion_dynamic_to_unsigned_detect() */ -#ifndef _di_fake_make_get_id_group_ - f_status_t fake_make_get_id_group(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, gid_t *id); -#endif // _di_fake_make_get_id_group_ +#ifndef _di_fake_make_get_id_ + extern void fake_make_get_id(fake_make_data_t * const data_make, const bool is_owner, const f_string_static_t buffer, void *id); +#endif // _di_fake_make_get_id_ /** * Get the mode id from either a string representing the number or a string representing the mode. * - * @param data - * The program data. - * @param print - * The error/warning print data. + * @param data_make + * All make related setting data, including data from the fakefile and the build settings file. + * The data_make.cache_path will be updated to reflect the full path to this file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * F_parameter (with error bit) on invalid parameter. + * + * Errors (with error bit) from: f_file_mode_from_string() * @param buffer * The string containing the name or number. * @param mode @@ -73,52 +89,34 @@ extern "C" { * The determined modes that are to be replaced, such as: F_file_mode_t_replace_owner_d. * This uses bitwise data. * - * @return - * F_none on success. - * F_exist_not if there is no mode by the given name. - * - * Status codes (with error bit) are returned on any problem. + * @see f_file_mode_from_string() */ #ifndef _di_fake_make_get_id_mode_ - f_status_t fake_make_get_id_mode(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace); + extern void fake_make_get_id_mode(fake_make_data_t * const data_make, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace); #endif // _di_fake_make_get_id_mode_ /** - * Get the user id from either a string representing the number or a string representing the name. - * - * @param data - * The program data. - * @param print - * The error/warning print data. - * @param buffer - * The string containing the name or number. - * @param id - * The detected user id. - * - * @return - * F_none on success. - * F_exist_not if there is no user by the given name. - * - * Status codes (with error bit) are returned on any problem. - */ -#ifndef _di_fake_make_get_id_owner_ - f_status_t fake_make_get_id_owner(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, uid_t *id); -#endif // _di_fake_make_get_id_owner_ - -/** * Get a path, relative to the project root. * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * The relative path is stored in data_make.cache_path. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * F_parameter (with error bit) on invalid parameter. + * + * Errors (with error bit) from: f_file_mode_from_string() * @param path * The NULL terminated path to get the relative path of. * - * @return - * Status codes (with error bit) are returned on any problem. + * @see f_string_dynamic_partial_append() + * @see f_string_dynamic_terminate() */ #ifndef _di_fake_make_path_relative_ - extern f_status_t fake_make_path_relative(fake_make_data_t * const data_make, const f_string_static_t path); + extern void fake_make_path_relative(fake_make_data_t * const data_make, const f_string_static_t path); #endif // _di_fake_make_path_relative_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make/operate_process.c b/level_3/fake/c/main/make/operate_process.c index c8f7f3f..98d42a4 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -349,59 +349,59 @@ extern "C" { #endif // _di_fake_make_operate_process_execute_ #ifndef _di_fake_make_operate_process_return_ - f_status_t fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code) { + void fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code) { - f_status_t status = F_none; + if (!data_make) return; data_make->setting_make.parameter.array[0].value.array[0].used = 0; - if (!return_code) { - if (F_status_is_error(status)) { - status = f_string_dynamic_append(f_string_ascii_1_s, &data_make->setting_make.parameter.array[0].value.array[0]); - } - else { - 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(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_append)); - } - - return status; - } - if (return_code) { f_string_dynamic_t number = f_string_dynamic_t_initialize; - status = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number); + result = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number); if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_conversion_number_signed_to_string)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_conversion_number_signed_to_string)); f_string_dynamic_resize(0, &number); - return status; + data_make->setting.state.status = result; + + return; } - status = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); + result = f_string_dynamic_append(number, &data_make->setting_make.parameter.array[0].value.array[0]); f_string_dynamic_resize(0, &number); - } - else { - 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(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_append)); + if (F_status_is_error(result)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); - return status; - } + data_make->setting.state.status = result; + + return; + } + + fake_make_print_error_program_failed(data_make->setting, data_make->main->error, return_code); + + data_make->setting.state.status = data_make->setting_make.fail == fake_make_operation_fail_type_exit_e ? F_status_set_error(F_failure) : F_failure; - fake_make_print_error_program_failed(data_make->setting, data_make->main->error, return_code); + return; + } - if (data_make->setting_make.fail == fake_make_operation_fail_exit_e) return F_status_set_error(F_failure); + if (F_status_is_error(data_make->setting.state.status)) { + data_make->setting.state.status = f_string_dynamic_append(f_string_ascii_1_s, &data_make->setting_make.parameter.array[0].value.array[0]); + } + else { + data_make->setting.state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->setting_make.parameter.array[0].value.array[0]); + } - return F_failure; + if (F_status_is_error(result)) { + fll_error_print(data_make->error, F_status_set_fine(result), "f_string_dynamic_append", F_true); + } + else { + data_make->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 6f3bca5..ac1b897 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -5,23 +5,25 @@ extern "C" { #endif #ifndef _di_fake_make_operate_process_type_break_ - f_status_t fake_make_operate_process_type_break(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_break(fake_make_data_t * const data_make) { - f_status_t status = F_none; + if (!data_make) return; + + data.setting.state.status = F_none; if (!data_make->cache_arguments.used || fl_string_dynamic_compare(fake_make_operation_argument_success_s, data_make->cache_arguments.array[0]) == F_equal_to) { - status = F_signal_abort; + data.setting.state.status = F_signal_abort; } else if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, data_make->cache_arguments.array[0]) == F_equal_to) { - status = F_status_set_error(F_signal_abort); + data.setting.state.status = F_status_set_error(F_signal_abort); } else { - return F_none; + data.setting.state.status = F_none; + + return; } fake_make_print_verbose_operate_break(data_make->setting, data_make->main->message, data_make->cache_arguments); - - return status; } #endif // _di_fake_make_operate_process_type_break_ @@ -38,37 +40,43 @@ extern "C" { #endif // _di_fake_make_operate_process_type_build_ #ifndef _di_fake_make_operate_process_type_clean_ - f_status_t fake_make_operate_process_type_clean(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_clean(fake_make_data_t * const data_make) { - const f_status_t status = fake_clean_operate(data_make->data); - if (F_status_set_fine(status) == F_interrupt) return status; + if (!data_make) return; - return fake_make_operate_process_return(data_make, F_status_is_error(status) ? 1 : 0); + data->setting.state.status = fake_clean_operate(data_make->data); + if (F_status_set_fine(data->setting.state.status) == F_interrupt) return; + + data->setting.state.status = fake_make_operate_process_return(data_make, F_status_is_error(data->setting.state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_clean_ #ifndef _di_fake_make_operate_process_type_compile_ - int fake_make_operate_process_type_compile(fake_make_data_t * const data_make, f_status_t * const status) { + int fake_make_operate_process_type_compile(fake_make_data_t * const data_make) { - const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_compiler, data_make->cache_arguments, status); + if (!data_make) return; + + const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_compiler, data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fake_execute)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute)); } - else if (*status == F_child) { - return result; + else if (data->setting.state.status == F_child) { + return; } - *status = fake_make_operate_process_return(data_make, result); + data->setting.state.status = fake_make_operate_process_return(data_make, result); return 0; } #endif // _di_fake_make_operate_process_type_compile_ #ifndef _di_fake_make_operate_process_type_condition_ - f_status_t fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process) { + void fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process) { - f_status_t status = F_none; + if (!data_make) return; + + data->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); @@ -105,7 +113,7 @@ extern "C" { } // for } else if (state_process->condition == fake_make_operation_if_type_if_exist_e) { - status = fake_make_operate_process_type_if_exist(data_make, F_false, state_process); + fake_make_operate_process_type_if_exist(data_make, F_false, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_failure_e) { if (state_process->success) { @@ -116,16 +124,16 @@ extern "C" { } } else 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) { - status = fake_make_operate_process_type_if_greater_if_lesser(data_make, state_process); + fake_make_operate_process_type_if_greater_if_lesser(data_make, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_group_e) { - status = fake_make_operate_process_type_if_group(data_make, F_false, state_process); + fake_make_operate_process_type_if_group(data_make, F_false, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_is_e) { - status = fake_make_operate_process_type_if_is(data_make, F_false, state_process); + fake_make_operate_process_type_if_is(data_make, F_false, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_mode_e) { - status = fake_make_operate_process_type_if_mode(data_make, F_false, state_process); + fake_make_operate_process_type_if_mode(data_make, F_false, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_define_e) { fake_make_operate_process_type_if_define(data_make, F_true, state_process); @@ -134,22 +142,22 @@ extern "C" { fake_make_operate_process_type_if_parameter(data_make, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_exist_e) { - status = fake_make_operate_process_type_if_exist(data_make, F_true, state_process); + fake_make_operate_process_type_if_exist(data_make, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_group_e) { - status = fake_make_operate_process_type_if_group(data_make, F_true, state_process); + fake_make_operate_process_type_if_group(data_make, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_is_e) { - status = fake_make_operate_process_type_if_is(data_make, F_true, state_process); + fake_make_operate_process_type_if_is(data_make, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_mode_e) { - status = fake_make_operate_process_type_if_mode(data_make, F_true, state_process); + fake_make_operate_process_type_if_mode(data_make, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_owner_e) { - status = fake_make_operate_process_type_if_owner(data_make, F_true, state_process); + fake_make_operate_process_type_if_owner(data_make, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_owner_e) { - status = fake_make_operate_process_type_if_owner(data_make, F_false, state_process); + fake_make_operate_process_type_if_owner(data_make, F_false, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_parameter_e) { fake_make_operate_process_type_if_parameter(data_make, F_false, state_process); @@ -181,16 +189,15 @@ extern "C" { } } } - - return status; } #endif // _di_fake_make_operate_process_type_condition_ #ifndef _di_fake_make_operate_process_type_copy_ - f_status_t fake_make_operate_process_type_copy(fake_make_data_t * const data_make, const bool clone) { + void fake_make_operate_process_type_copy(fake_make_data_t * const data_make, const bool clone) { + + if (!data_make) return; f_status_t status = F_none; - f_status_t status_file = F_none; const f_array_length_t total = data_make->cache_arguments.used - 1; f_string_static_t destination = f_string_static_t_initialize; @@ -198,6 +205,8 @@ extern "C" { f_directory_recurse_t recurse = f_directory_recurse_t_initialize; f_mode_t mode = f_mode_t_initialize; + data->setting.state.status = F_none; + if (clone) { if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { recurse.output = data_make->main->message.to; @@ -225,15 +234,17 @@ extern "C" { // In this case, the destination could be a file, so confirm this. if (data_make->cache_arguments.used == 2 + i) { - status = f_directory_is(data_make->cache_arguments.array[1]); + data->setting.state.status = f_directory_is(data_make->cache_arguments.array[1]); - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } - if (status == F_false || status == F_file_found_not || status == F_data_not) { + if (data->setting.state.status == F_false || data->setting.state.status == F_file_found_not || data->setting.state.status == F_data_not) { existing = F_false; } } @@ -245,12 +256,14 @@ extern "C" { if (existing) { data_make->cache_path.used = 0; - status = f_file_name_base(data_make->cache_arguments.array[i], &data_make->cache_path); + data->setting.state.status = f_file_name_base(data_make->cache_arguments.array[i], &data_make->cache_path); - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } destination.used += data_make->cache_path.used + 1; @@ -280,159 +293,175 @@ extern "C" { } } - status_file = f_directory_is(data_make->cache_arguments.array[i]); + status = f_directory_is(data_make->cache_arguments.array[i]); - if (status_file == F_true) { + if (status == F_true) { if (clone) { - status_file = fl_directory_clone(data_make->cache_arguments.array[i], destination, recurse); + status = fl_directory_clone(data_make->cache_arguments.array[i], destination, recurse); } else { - status_file = fl_directory_copy(data_make->cache_arguments.array[i], destination, mode, recurse); + status = fl_directory_copy(data_make->cache_arguments.array[i], destination, mode, recurse); } - if (F_status_is_error(status_file)) { - fake_print_error_file(data_make->setting, data_make->main->error, status_file, clone ? macro_fake_f(fl_directory_clone) : macro_fake_f(fl_directory_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); + if (F_status_is_error(status)) { + fake_print_error_file(data_make->setting, data_make->main->error, clone ? macro_fake_f(fl_directory_clone) : macro_fake_f(fl_directory_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); - status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } } - else if (status_file == F_false) { + else if (status == F_false) { if (clone) { - status_file = f_file_clone(data_make->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); + status = f_file_clone(data_make->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); } else { - status_file = f_file_copy(data_make->cache_arguments.array[i], destination, mode, recurse.size_block, recurse.flag); + status = f_file_copy(data_make->cache_arguments.array[i], destination, mode, recurse.size_block, recurse.flag); } - if (F_status_is_error(status_file)) { - fake_print_error_file(data_make->setting, data_make->main->error, status_file, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e); + if (F_status_is_error(status)) { + fake_print_error_file(data_make->setting, data_make->main->error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e); f_directory_recurse_delete(&recurse); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } fake_make_print_verbose_operate_copy(data_make->setting, data_make->main->message, clone, data_make->cache_arguments.array[i], destination); } - else if (F_status_is_error(status_file)) { - fake_print_error_file(data_make->setting, data_make->main->error, status_file, macro_fake_f(f_directory_is), data_make->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e); + else if (F_status_is_error(status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e); f_directory_recurse_delete(&recurse); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } } // for f_directory_recurse_delete(&recurse); - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_copy_ #ifndef _di_fake_make_operate_process_type_define_ - f_status_t fake_make_operate_process_type_define(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_define(fake_make_data_t * const data_make) { - f_status_t status = F_none; + if (!data_make) return; + + data->setting.state.status = F_none; if (data_make->cache_arguments.used > 1) { - status = f_environment_set(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1], F_true); + data->setting.state.status = f_environment_set(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1], F_true); } else { - status = f_environment_set(data_make->cache_arguments.array[0], f_string_empty_s, F_true); + data->setting.state.status = f_environment_set(data_make->cache_arguments.array[0], f_string_empty_s, F_true); } - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_environment_set)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_set)); } else { fake_make_print_verbose_operate_define(data_make->setting, data_make->main->message, data_make->cache_arguments.array[0]); - } - return status; + data->setting.state.status = F_none; + } } #endif // _di_fake_make_operate_process_type_define_ #ifndef _di_fake_make_operate_process_type_deletes_ - f_status_t fake_make_operate_process_type_deletes(fake_make_data_t * const data_make, const bool all) { + void fake_make_operate_process_type_deletes(fake_make_data_t * const data_make, const bool all) { - f_status_t status = F_none; + if (!data_make) return; const int recursion_max = all ? F_directory_max_descriptors_d : 0; struct stat file_stat; + data->setting.state.status = F_none; + for (f_array_length_t i = 0; i < data_make->cache_arguments.used; ++i) { memset(&file_stat, 0, sizeof(struct stat)); - status = f_file_stat(data_make->cache_arguments.array[i], F_false, &file_stat); + data->setting.state.status = f_file_stat(data_make->cache_arguments.array[i], F_false, &file_stat); - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_is_error(data->setting.state.status)) { + if (F_status_set_fine(data->setting.state.status) == F_file_found_not) { fake_make_print_warning_file_not_found(data_make->setting, data_make->main->warning, data_make->cache_arguments.array[i]); - status = F_none; + data->setting.state.status = F_none; } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stat), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stat), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->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->error.verbosity >= f_console_verbosity_verbose_e) { - status = f_directory_remove_custom(data_make->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely); + data->setting.state.status = f_directory_remove_custom(data_make->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely); } else { - status = f_directory_remove(data_make->cache_arguments.array[i], recursion_max, F_false); + data->setting.state.status = f_directory_remove(data_make->cache_arguments.array[i], recursion_max, F_false); } - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_set_fine(data->setting.state.status) == F_file_found_not) { fake_make_print_verbose_operate_file_not_found(data_make->setting, data_make->main->message, F_true, data_make->cache_arguments.array[i]); - status = F_none; + data->setting.state.status = F_none; } - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } } else { - status = f_file_remove(data_make->cache_arguments.array[i]); + data->setting.state.status = f_file_remove(data_make->cache_arguments.array[i]); - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_set_fine(data->setting.state.status) == F_file_found_not) { if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { fake_make_print_verbose_operate_file_not_found(data_make->setting, data_make->main->message, F_false, data_make->cache_arguments.array[i]); } - status = F_none; + data->setting.state.status = F_none; } - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } } fake_make_print_verbose_operate_delete(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i]); } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_deletes_ #ifndef _di_fake_make_operate_process_type_exit_ - f_status_t fake_make_operate_process_type_exit(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_exit(fake_make_data_t * const data_make) { - f_status_t status = F_none; + if (!data_make) return; + + data->setting.state.status = F_none; if (!data_make->cache_arguments.used || fl_string_dynamic_compare(fake_make_operation_argument_success_s, data_make->cache_arguments.array[0]) == F_equal_to) { - status = F_signal_quit; + data->setting.state.status = F_signal_quit; } else if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, data_make->cache_arguments.array[0]) == F_equal_to) { - status = F_status_set_error(F_signal_quit); + data->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; @@ -445,18 +474,20 @@ extern "C" { data_make->error.set = &data_make->main->context.set; } else { - return F_none; + data->setting.state.status = F_none; + + return; } fake_make_print_verbose_operate_exiting_as(data_make->setting, data_make->main->message, data_make->cache_arguments); - - return status; } #endif // _di_fake_make_operate_process_type_exit_ #ifndef _di_fake_make_operate_process_type_fail_ void fake_make_operate_process_type_fail(fake_make_data_t * const data_make) { + if (!data_make) return; + if (fl_string_dynamic_compare(fake_make_operation_argument_exit_s, data_make->cache_arguments.array[0]) == F_equal_to) { data_make->setting_make.fail = fake_make_operation_fail_exit_e; data_make->error.prefix = fl_print_error_s; @@ -488,55 +519,64 @@ extern "C" { #endif // _di_fake_make_operate_process_type_fail_ #ifndef _di_fake_make_operate_process_type_groups_ - f_status_t fake_make_operate_process_type_groups(fake_make_data_t * const data_make, const bool all) { + void fake_make_operate_process_type_groups(fake_make_data_t * const data_make, const bool all) { - f_status_t status = F_none; + if (!data_make) return; gid_t id = 0; bool dereference = F_true; f_array_length_t i = 0; + data->setting.state.status = F_none; + if (fl_string_dynamic_compare(fake_make_operation_argument_no_dereference_s, data_make->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - status = fake_make_get_id_group(data_make->data, data_make->error, data_make->cache_arguments.array[i++], &id); - if (F_status_is_error(status)) return F_status_set_error(F_failure); + data->setting.state.status = fake_make_get_id(data_make, data_make->cache_arguments.array[i++], (void *) &id); + + if (F_status_is_error(data->setting.state.status)) { + data->setting.state.status = F_status_set_error(F_failure); + } for (; i < data_make->cache_arguments.used; ++i) { - status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); + data->setting.state.status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(status)) { - fake_print_error_operation_path_outside(data_make->setting, data_make->error, status, macro_fake_f(fake_make_assure_inside_project), data_make->cache_path.used ? data_make->cache_path : data_make->cache_arguments.array[i]); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_operation_path_outside(data_make->setting, data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->cache_path.used ? data_make->cache_path : data_make->cache_arguments.array[i]); continue; } if (all) { - status = fll_file_role_change_all(data_make->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); + data->setting.state.status = fll_file_role_change_all(data_make->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); } else { - status = f_file_role_change(data_make->cache_arguments.array[i], -1, id, dereference); + data->setting.state.status = f_file_role_change(data_make->cache_arguments.array[i], -1, id, dereference); } - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, all ? macro_fake_f(fll_file_role_change_all) : macro_fake_f(f_file_role_change), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } fake_make_print_verbose_operate_set_role(data_make->setting, data_make->main->message, all ? 0x1 : 0x0, data_make->cache_arguments.array[i], (f_number_unsigned_t) id); } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_groups_ #ifndef _di_fake_make_operate_process_type_if_define_ void fake_make_operate_process_type_if_define(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + if (!data_make || !state_process) return; + state_process->condition_result = fake_condition_result_true_e; // Multiple properties may pass and so if any of them fail, then they all fail. @@ -564,12 +604,15 @@ extern "C" { #endif // _di_fake_make_operate_process_type_if_define_ #ifndef _di_fake_make_operate_process_type_if_exist_ - f_status_t fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + void fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + + if (!data_make || !state_process) return; - f_status_t status = F_none; f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; + data->setting.state.status = F_none; + if (i == data_make->cache_arguments.used) { if (if_not) { state_process->condition_result = fake_condition_result_true_e; @@ -578,7 +621,9 @@ extern "C" { state_process->condition_result = fake_condition_result_false_e; } - return F_none; + data->setting.state.status = F_none; + + return; } state_process->condition_result = fake_condition_result_true_e; @@ -590,25 +635,27 @@ extern "C" { for (; i < data_make->cache_arguments.used; ++i) { - status = f_file_exists(data_make->cache_arguments.array[i], dereference); + data->setting.state.status = f_file_exists(data_make->cache_arguments.array[i], dereference); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } if (if_not) { - if (status == F_true) { + if (data->setting.state.status == F_true) { state_process->condition_result = fake_condition_result_false_e; break; } } else { - if (status != F_true) { + if (data->setting.state.status != F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -616,14 +663,14 @@ extern "C" { } } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_exist_ #ifndef _di_fake_make_operate_process_type_if_is_ - f_status_t fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + void fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { - f_status_t status = F_none; + if (!data_make || !state_process) return; // block = 0x1 (0000 0001) link = 0x10 (0001 0000) // character = 0x2 (0000 0010) regular = 0x20 (0010 0000) @@ -634,6 +681,8 @@ extern "C" { f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; + data->setting.state.status = F_none; + if (fl_string_dynamic_compare(fake_make_operation_argument_no_dereference_s, data_make->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; @@ -647,7 +696,9 @@ extern "C" { state_process->condition_result = fake_condition_result_false_e; } - return F_none; + data->setting.state.status = F_none; + + return; } for (; i < data_make->cache_arguments.used; ++i) { @@ -688,14 +739,16 @@ extern "C" { for (; i < data_make->cache_arguments.used; ++i, mode_file = 0) { - status = f_file_mode_read(data_make->cache_arguments.array[i], dereference, &mode_file); + data->setting.state.status = f_file_mode_read(data_make->cache_arguments.array[i], dereference, &mode_file); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } if (macro_f_file_type_is_block(mode_file)) { @@ -736,14 +789,14 @@ extern "C" { } } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_is_ #ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_ - f_status_t fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, fake_state_process_t *state_process) { + void fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, fake_state_process_t *state_process) { - f_status_t status = F_none; + if (!data_make || !state_process) return; f_string_range_t range = f_string_range_t_initialize; f_number_unsigned_t number_left = 0; @@ -754,6 +807,7 @@ extern "C" { f_array_length_t i = 1; + data->setting.state.status = F_none; state_process->condition_result = fake_condition_result_true_e; range.start = 0; @@ -768,14 +822,14 @@ extern "C" { } if (range.start > range.stop) { - status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } else { - status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->cache_arguments.array[i], range, &number_left); + data->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->cache_arguments.array[i], range, &number_left); } - if (F_status_is_error_not(status)) { - for (i = 2; i < data_make->cache_arguments.used; ++i, status = F_none, number_left = number_right, is_negative_left = is_negative_right) { + if (F_status_is_error_not(data->setting.state.status)) { + for (i = 2; i < data_make->cache_arguments.used; ++i, data->setting.state.status = F_none, number_left = number_right, is_negative_left = is_negative_right) { if (data_make->cache_arguments.array[i].used) { range.start = 0; @@ -792,17 +846,17 @@ extern "C" { } if (range.start > range.stop) { - status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } else { - status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->cache_arguments.array[i], range, &number_right); + data->setting.state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->cache_arguments.array[i], range, &number_right); } } else { - status = F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); } - if (F_status_is_error(status)) break; + if (F_status_is_error(data->setting.state.status)) break; if (state_process->condition == fake_make_operation_if_type_if_greater_e) { @@ -867,7 +921,7 @@ extern "C" { } // for } - if (F_status_is_error(status)) { + if (F_status_is_error(data->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)) { @@ -877,48 +931,56 @@ extern "C" { fake_make_print_error_unsupported_number(data_make->setting, data_make->main->error, data_make->cache_arguments.array[i]); } - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + } + else { + data->setting.state.status = F_none; } - - return F_none; } #endif // _di_fake_make_operate_process_type_if_greater_if_lesser_ #ifndef _di_fake_make_operate_process_type_if_group_ - f_status_t fake_make_operate_process_type_if_group(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + void fake_make_operate_process_type_if_group(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + + if (!data_make || !state_process) return; - f_status_t status = F_none; uid_t id = 0; f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; + data->setting.state.status = F_none; + if (fl_string_dynamic_compare(fake_make_operation_argument_no_dereference_s, data_make->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - status = fake_make_get_id_group(data_make->data, data_make->error, data_make->cache_arguments.array[i++], &id); + data->setting.state.status = fake_make_get_id(data_make, data_make->cache_arguments.array[i++], (void *) &id); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_get_id_group)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - return F_status_set_error(F_failure); + data->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->cache_arguments.used; ++i, id_file = 0) { - status = f_file_group_read(data_make->cache_arguments.array[i], dereference, &id_file); + data->setting.state.status = f_file_group_read(data_make->cache_arguments.array[i], dereference, &id_file); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_group_read), data_make->cache_arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_group_read), data_make->cache_arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } if (if_not) { @@ -937,14 +999,15 @@ extern "C" { } } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_group_ #ifndef _di_fake_make_operate_process_type_if_mode_ - f_status_t fake_make_operate_process_type_if_mode(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + void fake_make_operate_process_type_if_mode(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + + if (!data_make || !state_process) return; - f_status_t status = F_none; f_file_mode_t mode_rule = 0; mode_t mode_match = 0; bool is = F_false; @@ -956,24 +1019,28 @@ extern "C" { { uint8_t mode_replace = 0; - status = fake_make_get_id_mode(data_make->data, data_make->error, data_make->cache_arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace); + data.setting.state.status = fake_make_get_id_mode(data_make->data, data_make->error, data_make->cache_arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace); - if (F_status_is_error(status)) { + if (F_status_is_error(data.setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_get_id_mode)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } - status = f_file_mode_to_mode(mode_rule, &mode_match); + data.setting.state.status = f_file_mode_to_mode(mode_rule, &mode_match); - if (F_status_is_error(status)) { + if (F_status_is_error(data.setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_mode_to_mode)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_to_mode)); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } } @@ -983,14 +1050,16 @@ extern "C" { for (f_array_length_t i = if_not ? 4 : 3; i < data_make->cache_arguments.used; ++i, mode_file = 0) { - status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); + data.setting.state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); - if (F_status_is_error(status)) { + if (F_status_is_error(data.setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } if (if_not) { @@ -1027,45 +1096,52 @@ extern "C" { } } // for - return F_none; + data.setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_mode_ #ifndef _di_fake_make_operate_process_type_if_owner_ - f_status_t fake_make_operate_process_type_if_owner(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + void fake_make_operate_process_type_if_owner(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + + if (!data_make || !state_process) return; - f_status_t status = F_none; uid_t id = 0; f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; + data->setting.state.status = F_none; + if (fl_string_dynamic_compare(fake_make_operation_argument_no_dereference_s, data_make->cache_arguments.array[i]) == F_equal_to) { ++i; dereference = F_false; } - status = fake_make_get_id_owner(data_make->data, data_make->error, data_make->cache_arguments.array[i++], &id); + data->setting.state.status = fake_make_get_id(data_make->data, data_make->error, data_make->cache_arguments.array[i++], (void *) &id); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_get_id_owner)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - return F_status_set_error(F_failure); + data->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->cache_arguments.used; ++i, id_file = 0) { - status = f_file_owner_read(data_make->cache_arguments.array[i], dereference, &id_file); + data->setting.state.status = f_file_owner_read(data_make->cache_arguments.array[i], dereference, &id_file); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting.state.status)) { state_process->condition_result = fake_condition_result_error_e; - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_owner_read), data_make->cache_arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_owner_read), data_make->cache_arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data->setting.state.status = F_status_set_error(F_failure); + + return; } if (if_not) { @@ -1084,13 +1160,15 @@ extern "C" { } } // for - return F_none; + data->setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_owner_ #ifndef _di_fake_make_operate_process_type_if_parameter_ void fake_make_operate_process_type_if_parameter(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process) { + if (!data_make || !state_process) return; + const f_string_static_t reserved_name[] = { fake_make_parameter_variable_build_s, fake_make_parameter_variable_color_s, @@ -1221,24 +1299,28 @@ extern "C" { #endif // _di_fake_make_operate_process_type_if_parameter_ #ifndef _di_fake_make_operate_process_type_index_ - int fake_make_operate_process_type_index(fake_make_data_t * const data_make, f_status_t * const status) { + int fake_make_operate_process_type_index(fake_make_data_t * const data_make) { + + if (!data_make) return; - const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_indexer, data_make->cache_arguments, status); + const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_indexer, data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fake_execute)); + if (F_status_is_error(data->setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute)); } - if (*status == F_child) return result; + if (data->setting.state.status == F_child) return result; - *status = fake_make_operate_process_return(data_make, result); + data->setting.state.status = fake_make_operate_process_return(data_make, result); return 0; } #endif // _di_fake_make_operate_process_type_index_ #ifndef _di_fake_make_operate_process_type_link_ - f_status_t fake_make_operate_process_type_link(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_link(fake_make_data_t * const data_make) { + + if (!data_make) return; f_status_t status = F_none; @@ -1299,19 +1381,23 @@ extern "C" { #endif // _di_fake_make_operate_process_type_link_ #ifndef _di_fake_make_operate_process_type_modes_ - f_status_t fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all) { + void fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all) { - f_status_t status = F_none; + if (!data_make) return; + + data.setting.state.status = F_none; f_file_mode_t mode_rule = 0; uint8_t replace = 0; - status = fake_make_get_id_mode(data_make->data, data_make->error, data_make->cache_arguments.array[0], &mode_rule, &replace); + data.setting.state.status = fake_make_get_id_mode(data_make->data, data_make->error, data_make->cache_arguments.array[0], &mode_rule, &replace); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_get_id_mode)); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } mode_t mode = 0; @@ -1319,44 +1405,52 @@ extern "C" { for (f_array_length_t i = 1; i < data_make->cache_arguments.used; ++i, mode = 0) { - status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); + data.setting.state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } - status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode); + data.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(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_mode_determine), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_determine), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } if (all) { - status = fll_file_mode_set_all(data_make->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); + data.setting.state.status = fll_file_mode_set_all(data_make->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); } else { - status = f_file_mode_set(data_make->cache_arguments.array[i], mode); + data.setting.state.status = f_file_mode_set(data_make->cache_arguments.array[i], mode); } - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, all ? macro_fake_f(fll_file_mode_set_all) : macro_fake_f(f_file_mode_set), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, all ? macro_fake_f(fll_file_mode_set_all) : macro_fake_f(f_file_mode_set), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } fake_make_print_verbose_operate_set_mode(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i], mode); } // for - return F_none; + data.setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_modes_ #ifndef _di_fake_make_operate_process_type_move_ - f_status_t fake_make_operate_process_type_move(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_move(fake_make_data_t * const data_make) { + + if (!data_make) return; f_status_t status = F_none; @@ -1445,6 +1539,8 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_operate_ int fake_make_operate_process_type_operate(fake_make_data_t * const data_make, f_array_lengths_t * const section_stack, f_status_t * const status) { + if (!data_make) return; + f_array_length_t id_section = 0; for (; id_section < data_make->fakefile.used; ++id_section) { @@ -1473,6 +1569,8 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_owners_ f_status_t fake_make_operate_process_type_owners(fake_make_data_t * const data_make, const bool all) { + if (!data_make) return; + uid_t id = 0; bool dereference = F_true; f_array_length_t i = 0; @@ -1482,10 +1580,10 @@ extern "C" { dereference = F_false; } - f_status_t status = fake_make_get_id_owner(data_make->data, data_make->error, data_make->cache_arguments.array[i++], &id); + f_status_t status = fake_make_get_id(data_make->data, data_make->error, data_make->cache_arguments.array[i++], (void *) &id); if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_get_id_owner)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); return F_status_set_error(F_failure); } @@ -1523,6 +1621,8 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_parameter_ f_status_t fake_make_operate_process_type_parameter(fake_make_data_t * const data_make) { + if (!data_make) return; + f_status_t status = F_none; bool found = F_false; @@ -1611,42 +1711,50 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_pop_ f_status_t fake_make_operate_process_type_pop(fake_make_data_t * const data_make) { + if (!data_make) return; + 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; - f_status_t status = f_path_change(*argument); + data.setting.state.status = f_path_change(*argument); - if (F_status_is_error(status)) { - fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, F_status_set_fine(status), macro_fake_f(f_path_change), *argument); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, macro_fake_f(f_path_change), *argument); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { - status = fake_make_path_relative(data_make, *argument); + 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(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_path_relative)); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_path_relative)); fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, *argument); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, data_make->cache_path); } - return F_none; + data.setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_pop_ #ifndef _di_fake_make_operate_process_type_print_ f_status_t fake_make_operate_process_type_print(fake_make_data_t * const data_make) { + if (!data_make) return; + f_status_t status = F_none; data_make->cache_1.used = 0; @@ -1707,65 +1815,77 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_skeleton_ f_status_t fake_make_operate_process_type_skeleton(fake_make_data_t * const data_make) { + if (!data_make) return; + const f_status_t status = fake_skeleton_operate(data_make->data); if (F_status_set_fine(status) == F_interrupt) return status; - return fake_make_operate_process_return(data_make, F_status_is_error(status) ? 1 : 0); + data->setting.state.status = fake_make_operate_process_return(data_make, F_status_is_error(status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_skeleton_ #ifndef _di_fake_make_operate_process_type_to_ - f_status_t fake_make_operate_process_type_to(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_to(fake_make_data_t * const data_make) { - f_status_t status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]); + if (!data_make) return; - if (F_status_is_error(status)) { - fake_print_error_operation_path_outside(data_make->setting, data_make->error, status, macro_fake_f(fake_make_assure_inside_project), data_make->cache_path.used ? data_make->cache_path : data_make->cache_arguments.array[0]); + data.setting.state.status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]); - if (F_status_set_fine(status) == F_false) { - status = F_status_set_error(F_failure); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error_operation_path_outside(data_make->setting, data_make->error, macro_fake_f(fake_make_assure_inside_project), data_make->cache_path.used ? data_make->cache_path : data_make->cache_arguments.array[0]); + + if (F_status_set_fine(data.setting.state.status) == F_false) { + data.setting.state.status = F_status_set_error(F_failure); } - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } - status = f_path_change(data_make->cache_arguments.array[0]); + data.setting.state.status = f_path_change(data_make->cache_arguments.array[0]); - if (F_status_is_error(status)) { - fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, F_status_set_fine(status), macro_fake_f(f_path_change), data_make->cache_arguments.array[0]); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, macro_fake_f(f_path_change), data_make->cache_arguments.array[0]); } else { - status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->path.stack); + data.setting.state.status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->path.stack); - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_array_too_large) { + if (F_status_is_error(data.setting.state.status)) { + if (F_status_set_fine(data.setting.state.status) == F_array_too_large) { fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, F_array_too_large, macro_fake_f(f_string_dynamics_increase_by), fake_common_file_path_stack_s); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamics_increase_by)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } // Copy the entire real path, including the trailing NULL. ++data_make->cache_path.used; - status = f_string_dynamic_append_nulless(data_make->cache_path, &data_make->path.stack.array[data_make->path.stack.used]); + data.setting.state.status = f_string_dynamic_append_nulless(data_make->cache_path, &data_make->path.stack.array[data_make->path.stack.used]); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - return F_status_set_error(F_failure); + data.setting.state.status = F_status_set_error(F_failure); + + return; } if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { - status = fake_make_path_relative(data_make, data_make->path.stack.array[data_make->path.stack.used]); + data.setting.state.status = 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(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_path_relative)); + if (F_status_is_error(data.setting.state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_path_relative)); fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, data_make->path.stack.array[data_make->path.stack.used]); } @@ -1777,13 +1897,15 @@ extern "C" { ++data_make->path.stack.used; } - return F_none; + data.setting.state.status = F_none; } #endif // _di_fake_make_operate_process_type_to_ #ifndef _di_fake_make_operate_process_type_top_ f_status_t fake_make_operate_process_type_top(fake_make_data_t * const data_make) { + if (!data_make) return; + { f_status_t status = f_path_change_at(data_make->path.top.id); @@ -1810,6 +1932,8 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_touch_ f_status_t fake_make_operate_process_type_touch(fake_make_data_t * const data_make) { + if (!data_make) return; + f_status_t status = F_none; f_mode_t mode = f_mode_t_initialize; @@ -1856,6 +1980,8 @@ extern "C" { #ifndef _di_fake_make_operate_process_type_write_ f_status_t fake_make_operate_process_type_write(fake_make_data_t * const data_make) { + if (!data_make) return; + f_file_t file = f_file_t_initialize; f_status_t status = f_file_exists(data_make->cache_arguments.array[0], F_true); diff --git a/level_3/fake/c/main/make/operate_process_type.h b/level_3/fake/c/main/make/operate_process_type.h index 379044c..9a52427 100644 --- a/level_3/fake/c/main/make/operate_process_type.h +++ b/level_3/fake/c/main/make/operate_process_type.h @@ -22,13 +22,14 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * - * @return - * F_none on success. + * This alters data_make.setting.state.status: + * F_none on success but not breaking. + * F_signal_abort on normal break * - * F_failure (with error bit) on any error. + * F_signal_abort (with error bit) on break on error. */ #ifndef _di_fake_make_operate_process_type_break_ - extern f_status_t fake_make_operate_process_type_break(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_break(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_break_ /** @@ -37,18 +38,16 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * - * @return - * F_interrupt (with error bit) on interrupt. + * This alters data_make.setting.state.status: + * Success from: fake_build_operate() * - * Success from: fake_make_operate_process_return(). - * - * Errors (with error bit) from: fake_make_operate_process_return(). + * Errors (with error bit) from: fake_build_operate() * * @see fake_build_operate() * @see fake_make_operate_process_return() */ #ifndef _di_fake_make_operate_process_type_build_ - extern f_status_t fake_make_operate_process_type_build(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_build(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_build_ /** @@ -57,18 +56,16 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * - * @return - * F_interrupt (with error bit) on interrupt. - * - * Success from: fake_make_operate_process_return(). + * This alters data_make.setting.state.status: + * Success from: fake_clean_operate() * - * Errors (with error bit) from: fake_make_operate_process_return(). + * Errors (with error bit) from: fake_clean_operate() * * @see fake_clean_operate() * @see fake_make_operate_process_return() */ #ifndef _di_fake_make_operate_process_type_clean_ - extern f_status_t fake_make_operate_process_type_clean(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_clean(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_clean_ /** @@ -76,12 +73,11 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param status - * The status code. * - * Success from: fake_execute(). + * This alters data_make.setting.state.status: + * Success from: fake_execute() * - * Errors (with error bit) from: fake_execute(). + * Errors (with error bit) from: fake_execute() * * @return * The return code of the compile operation. @@ -89,7 +85,7 @@ extern "C" { * @see fake_execute() */ #ifndef _di_fake_make_operate_process_type_compile_ - extern int fake_make_operate_process_type_compile(fake_make_data_t * const data_make, f_status_t * const status); + extern int fake_make_operate_process_type_compile(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_compile_ /** @@ -97,6 +93,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param state_process * The operation and if-condition states. * @@ -106,7 +111,7 @@ extern "C" { * F_failure (with error bit) on any error. */ #ifndef _di_fake_make_operate_process_type_condition_ - extern f_status_t fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process); + extern void fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process); #endif // _di_fake_make_operate_process_type_condition_ /** @@ -114,15 +119,19 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param clone * If TRUE, perform a copy that is a clone (preserved timestamps, roles, and permissions). * If FALSE, perforrm a normaly copy without preserving properties. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_directory_is() * @see f_file_clone() * @see f_file_copy() @@ -131,7 +140,7 @@ extern "C" { * @see fl_directory_copy() */ #ifndef _di_fake_make_operate_process_type_copy_ - extern f_status_t fake_make_operate_process_type_copy(fake_make_data_t * const data_make, const bool clone); + extern void fake_make_operate_process_type_copy(fake_make_data_t * const data_make, const bool clone); #endif // _di_fake_make_operate_process_type_copy_ /** @@ -140,6 +149,13 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * Success from: f_environment_set(). * @@ -148,7 +164,7 @@ extern "C" { * @see f_environment_set() */ #ifndef _di_fake_make_operate_process_type_define_ - extern f_status_t fake_make_operate_process_type_define(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_define(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_define_ /** @@ -156,22 +172,26 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param all * If TRUE, then if the path is a directory, then recursively apply to all paths within the directory. * If FALSE, then only apply to the given path. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_file_remove() * @see f_file_stat() * @see f_directory_remove() * @see f_directory_remove_custom() */ #ifndef _di_fake_make_operate_process_type_deletes_ - extern f_status_t fake_make_operate_process_type_deletes(fake_make_data_t * const data_make, const bool all); + extern void fake_make_operate_process_type_deletes(fake_make_data_t * const data_make, const bool all); #endif // _di_fake_make_operate_process_type_deletes_ /** @@ -180,6 +200,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on unknown exit type (only success and failure are known). * F_signal_quit to designate exit on success. @@ -188,7 +217,7 @@ extern "C" { * F_signal_quit (with error bit) to designate exit on failure. */ #ifndef _di_fake_make_operate_process_type_exit_ - extern f_status_t fake_make_operate_process_type_exit(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_exit(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_exit_ /** @@ -196,6 +225,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () */ #ifndef _di_fake_make_operate_process_type_fail_ extern void fake_make_operate_process_type_fail(fake_make_data_t * const data_make); @@ -206,6 +244,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param all * If TRUE, then if the path is a directory, then recursively apply to all paths within the directory. * If FALSE, then only apply to the given path. @@ -219,10 +266,10 @@ extern "C" { * @see fll_file_role_change_all() * * @see fake_make_assure_inside_project() - * @see fake_make_get_id_group() + * @see fake_make_get_id() */ #ifndef _di_fake_make_operate_process_type_groups_ - extern f_status_t fake_make_operate_process_type_groups(fake_make_data_t * const data_make, const bool all); + extern void fake_make_operate_process_type_groups(fake_make_data_t * const data_make, const bool all); #endif // _di_fake_make_operate_process_type_groups_ /** @@ -230,6 +277,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -245,6 +301,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -259,7 +324,7 @@ extern "C" { * @see f_file_exists() */ #ifndef _di_fake_make_operate_process_type_if_exist_ - extern f_status_t fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); + extern void fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); #endif // _di_fake_make_operate_process_type_if_exist_ /** @@ -267,6 +332,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param state_process * The operation process state. * @@ -278,7 +352,7 @@ extern "C" { * @see fl_conversion_dynamic_partial_to_unsigned_detect() */ #ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_ - extern f_status_t fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, fake_state_process_t *state_process); + extern void fake_make_operate_process_type_if_greater_if_lesser(fake_make_data_t * const data_make, fake_state_process_t *state_process); #endif // _di_fake_make_operate_process_type_if_greater_if_lesser_ /** @@ -286,6 +360,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -299,10 +382,10 @@ extern "C" { * * @see f_file_group_read() * - * @see fake_make_get_id_group() + * @see fake_make_get_id() */ #ifndef _di_fake_make_operate_process_type_if_group_ - extern f_status_t fake_make_operate_process_type_if_group(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); + extern void fake_make_operate_process_type_if_group(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); #endif // _di_fake_make_operate_process_type_if_group_ /** @@ -310,6 +393,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -324,7 +416,7 @@ extern "C" { * @see f_file_mode_read() */ #ifndef _di_fake_make_operate_process_type_if_is_ - extern f_status_t fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); + extern void fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); #endif // _di_fake_make_operate_process_type_if_is_ /** @@ -332,6 +424,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -349,7 +450,7 @@ extern "C" { * @see fake_make_get_id_mode() */ #ifndef _di_fake_make_operate_process_type_if_mode_ - extern f_status_t fake_make_operate_process_type_if_mode(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); + extern void fake_make_operate_process_type_if_mode(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); #endif // _di_fake_make_operate_process_type_if_mode_ /** @@ -357,6 +458,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -370,10 +480,10 @@ extern "C" { * * @see f_file_owner_read() * - * @see fake_make_get_id_owner() + * @see fake_make_get_id() */ #ifndef _di_fake_make_operate_process_type_if_owner_ - extern f_status_t fake_make_operate_process_type_if_owner(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); + extern void fake_make_operate_process_type_if_owner(fake_make_data_t * const data_make, const bool if_not, fake_state_process_t *state_process); #endif // _di_fake_make_operate_process_type_if_owner_ /** @@ -381,6 +491,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. @@ -396,6 +515,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param status * F_child on child process returning. * @@ -419,6 +547,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -427,7 +564,7 @@ extern "C" { * @see f_file_link() */ #ifndef _di_fake_make_operate_process_type_link_ - extern f_status_t fake_make_operate_process_type_link(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_link(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_link_ /** @@ -435,6 +572,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param all * If TRUE, then if the path is a directory, then recursively apply to all paths within the directory. * If FALSE, then only apply to the given path. @@ -452,7 +598,7 @@ extern "C" { * @see fake_make_get_id_mode() */ #ifndef _di_fake_make_operate_process_type_modes_ - extern f_status_t fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all); + extern void fake_make_operate_process_type_modes(fake_make_data_t * const data_make, const bool all); #endif // _di_fake_make_operate_process_type_modes_ /** @@ -461,6 +607,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -471,7 +626,7 @@ extern "C" { * @see fll_file_move() */ #ifndef _di_fake_make_operate_process_type_move_ - extern f_status_t fake_make_operate_process_type_move(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_move(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_move_ /** @@ -479,6 +634,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param section_stack * The current operation stack. * @param status @@ -502,6 +666,15 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param all * If TRUE, then if the path is a directory, then recursively apply to all paths within the directory. * If FALSE, then only apply to the given path. @@ -515,10 +688,10 @@ extern "C" { * @see fll_file_role_change_all() * * @see fake_make_assure_inside_project() - * @see fake_make_get_id_owner() + * @see fake_make_get_id() */ #ifndef _di_fake_make_operate_process_type_owners_ - extern f_status_t fake_make_operate_process_type_owners(fake_make_data_t * const data_make, const bool all); + extern void fake_make_operate_process_type_owners(fake_make_data_t * const data_make, const bool all); #endif // _di_fake_make_operate_process_type_owners_ /** @@ -527,6 +700,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -537,7 +719,7 @@ extern "C" { * @see f_string_map_multis_resize() */ #ifndef _di_fake_make_operate_process_type_parameter_ - extern f_status_t fake_make_operate_process_type_parameter(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_parameter(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_parameter_ /** @@ -549,6 +731,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -560,7 +751,7 @@ extern "C" { * @see fake_make_path_relative() */ #ifndef _di_fake_make_operate_process_type_pop_ - extern f_status_t fake_make_operate_process_type_pop(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_pop(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_pop_ /** @@ -569,6 +760,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * This resets and uses data_make.cache_1. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () * @param arguments * The arguments for print operation. * @@ -582,7 +782,7 @@ extern "C" { * @see f_string_dynamic_increase_by() */ #ifndef _di_fake_make_operate_process_type_print_ - extern f_status_t fake_make_operate_process_type_print(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_print(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_print_ /** @@ -591,6 +791,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_interrupt (with error bit) on interrupt. * @@ -602,7 +811,7 @@ extern "C" { * @see fake_skeleton_operate() */ #ifndef _di_fake_make_operate_process_type_skeleton_ - extern f_status_t fake_make_operate_process_type_skeleton(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_skeleton(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_skeleton_ /** @@ -611,10 +820,18 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * - * @return - * F_none on success. + * This alters data_make.setting.state.status: + * F_none on success. * - * F_failure (with error bit) on any error. + * F_failure (with error bit) on any error. + * + * F_failure (with error bit) on any error. + * + * Errors (with error bit) from: f_path_change() + * Errors (with error bit) from: f_string_dynamic_append() + * Errors (with error bit) from: f_string_dynamics_increase_by() + * Errors (with error bit) from: fake_make_assure_inside_project() + * Errors (with error bit) from: fake_make_path_relative() * * @see f_path_change() * @see f_string_dynamic_append() @@ -624,7 +841,7 @@ extern "C" { * @see fake_make_path_relative() */ #ifndef _di_fake_make_operate_process_type_to_ - extern f_status_t fake_make_operate_process_type_to(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_to(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_to_ /** @@ -633,6 +850,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -642,7 +868,7 @@ extern "C" { * @see f_string_dynamic_resize() */ #ifndef _di_fake_make_operate_process_type_top_ - extern f_status_t fake_make_operate_process_type_top(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_top(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_top_ /** @@ -651,6 +877,15 @@ extern "C" { * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -660,7 +895,7 @@ extern "C" { * @see f_file_touch() */ #ifndef _di_fake_make_operate_process_type_touch_ - extern f_status_t fake_make_operate_process_type_touch(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_touch(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_touch_ /** @@ -670,6 +905,15 @@ extern "C" { * All make related setting data, including data from the fakefile and the build settings file. * This resets and uses data_make.cache_1. * + * This alters data_make.setting.state.status: + * F_none on success. + * + * F_failure (with error bit) on any error. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: () + * * @return * F_none on success. * @@ -680,7 +924,7 @@ extern "C" { * @see f_file_stream_write() */ #ifndef _di_fake_make_operate_process_type_write_ - extern f_status_t fake_make_operate_process_type_write(fake_make_data_t * const data_make); + extern void fake_make_operate_process_type_write(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_write_ #ifdef __cplusplus 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 f40047c..15a4d8b 100644 --- a/level_3/fake/c/main/make/operate_validate_type.c +++ b/level_3/fake/c/main/make/operate_validate_type.c @@ -428,7 +428,7 @@ extern "C" { else if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_not_group_e) { gid_t id = 0; - if (F_status_is_error(fake_make_get_id_group(data_make->data, data_make->error, data_make->cache_arguments.array[k++], &id))) { + if (F_status_is_error(fake_make_get_id(data_make, data_make->cache_arguments.array[k++], (void *) &id))) { return F_status_set_error(F_failure); } @@ -483,7 +483,7 @@ extern "C" { else if (state_process->condition == fake_make_operation_if_type_if_owner_e || state_process->condition == fake_make_operation_if_type_if_not_owner_e) { uid_t id = 0; - if (F_status_is_error(fake_make_get_id_owner(data_make->data, data_make->error, data_make->cache_arguments.array[k++], &id))) { + if (F_status_is_error(fake_make_get_id(data_make->data, data_make->error, data_make->cache_arguments.array[k++], (void *) &id))) { return F_status_set_error(F_failure); } diff --git a/level_3/fake/c/main/skeleton.h b/level_3/fake/c/main/skeleton.h index 4a303ae..16b4356 100644 --- a/level_3/fake/c/main/skeleton.h +++ b/level_3/fake/c/main/skeleton.h @@ -30,7 +30,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_ - extern f_status_t fake_skeleton_operate(fake_data_t * const data); + extern void fake_skeleton_operate(fake_data_t * const data); #endif // _di_fake_skeleton_operate_ /** @@ -48,7 +48,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_directory_create_ - extern f_status_t fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path); + extern void fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path); #endif // _di_fake_skeleton_operate_directory_create_ /** @@ -71,7 +71,7 @@ extern "C" { * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_skeleton_operate_file_create_ - extern f_status_t fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content); + extern void fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content); #endif // _di_fake_skeleton_operate_file_create_ /** diff --git a/level_3/fake/data/projects/example/return_code.fakefile b/level_3/fake/data/projects/example/return_code.fakefile new file mode 100644 index 0000000..e6da3ba --- /dev/null +++ b/level_3/fake/data/projects/example/return_code.fakefile @@ -0,0 +1,29 @@ +# fss-0005 iki-0002 +# +# This is an example showing the return status code results. +# This simulates a success and a failure return result. +# + +setting: + # Set failure to "warng" to not exit (options are "exit" (default), "warn", and "ignore". + fail warn + +main: + print + print "Simulating Success Return:" + + # The fake program probably exists, so use it for success. + run fake +v + + print "Return code is 'parameter:"return"'." + + + print + print "Simulating Failure Return:" + + # Trigger an error, if "exit" doesn't exist then this is an error but if it does then exit with value 1 to represent an error. + shell exit 1 + + print "Return code is 'parameter:"return"'." + + exit success