From 51e015541362d6a902b3b8438c434abbc6e6b26c Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 11 Mar 2023 22:27:47 -0600 Subject: [PATCH] Progress: Continue program related work, focusing on Featureless Make. I'm seeing a lot of places where I can perform optimizations. I am ignoring these cases for now. --- level_0/f_directory/c/directory/type.h | 2 - level_0/f_execute/c/execute.c | 1018 +++++----------------- level_1/fl_directory/c/private-directory.h | 2 +- level_3/fake/c/main/build.c | 86 +- level_3/fake/c/main/build.h | 2 +- level_3/fake/c/main/build/library.c | 132 +-- level_3/fake/c/main/build/library.h | 31 +- level_3/fake/c/main/build/load.c | 26 +- level_3/fake/c/main/build/object.c | 53 +- level_3/fake/c/main/build/object.h | 33 +- level_3/fake/c/main/build/objects.c | 14 +- level_3/fake/c/main/build/program.c | 70 +- level_3/fake/c/main/build/program.h | 33 +- level_3/fake/c/main/build/skeleton.c | 2 +- level_3/fake/c/main/clean.c | 2 +- level_3/fake/c/main/common.c | 27 +- level_3/fake/c/main/common/print.c | 1 - level_3/fake/c/main/common/print.h | 1 - level_3/fake/c/main/fake.c | 32 +- level_3/fake/c/main/fake.h | 2 +- level_3/fake/c/main/fake/path_generate.c | 20 +- level_3/fake/c/main/main.c | 3 + level_3/fake/c/main/make.c | 24 +- level_3/fake/c/main/make/load_fakefile.c | 227 ++--- level_3/fake/c/main/make/load_fakefile.h | 72 +- level_3/fake/c/main/make/load_parameters.c | 52 +- level_3/fake/c/main/make/operate.c | 401 +++++---- level_3/fake/c/main/make/operate.h | 78 +- level_3/fake/c/main/make/operate_process.c | 113 ++- level_3/fake/c/main/make/operate_process.h | 78 +- level_3/fake/c/main/make/operate_process_type.c | 702 +++++++-------- level_3/fake/c/main/make/operate_process_type.h | 280 ++---- level_3/fake/c/main/make/operate_validate.c | 6 +- level_3/fake/c/main/make/operate_validate_type.c | 370 ++++---- level_3/fake/c/main/print/verbose.c | 71 +- level_3/fake/c/main/print/verbose.h | 59 +- level_3/fake/c/main/skeleton.c | 2 +- 37 files changed, 1780 insertions(+), 2347 deletions(-) diff --git a/level_0/f_directory/c/directory/type.h b/level_0/f_directory/c/directory/type.h index 9b3647a..a69ae6b 100644 --- a/level_0/f_directory/c/directory/type.h +++ b/level_0/f_directory/c/directory/type.h @@ -183,7 +183,6 @@ extern "C" { 0, \ 0, \ 0, \ - 0, \ } #define macro_f_directory_recurse_t_initialize_1(max_depth, size_block, flag, depth, mode, state, listing, source, source_top, destination, destination_top, verbose) { \ @@ -213,7 +212,6 @@ extern "C" { 0, \ 0, \ 0, \ - 0, \ verbose, \ } #endif // _di_f_directory_recurse_t_ diff --git a/level_0/f_execute/c/execute.c b/level_0/f_execute/c/execute.c index e0b60b7..c63bbc2 100644 --- a/level_0/f_execute/c/execute.c +++ b/level_0/f_execute/c/execute.c @@ -7,413 +7,108 @@ extern "C" { #ifndef _di_f_execute_status_from_status_ uint8_t f_execute_status_from_status(f_status_t status) { - if (F_status_set_fine(status) == F_none) { - return F_execute_none; - } - - if (F_status_set_fine(status) == F_access) { - return F_execute_access; - } - - if (F_status_set_fine(status) == F_buffer) { - return F_execute_buffer; - } - - if (F_status_set_fine(status) == F_busy) { - return F_execute_busy; - } - - if (F_status_set_fine(status) == F_capability) { - return F_execute_capability; - } - - if (F_status_set_fine(status) == F_control_group) { - return F_execute_control_group; - } - - if (F_status_set_fine(status) == F_child) { - return F_execute_child; - } - - if (F_status_set_fine(status) == F_directory_not) { - return F_execute_directory_not; - } - - if (F_status_set_fine(status) == F_execute_not) { - return F_execute_bad; - } - - if (F_status_set_fine(status) == F_failure) { - return F_execute_failure; - } - - if (F_status_set_fine(status) == F_file_found_not) { - return F_execute_file_found_not; - } - - if (F_status_set_fine(status) == F_file_type_directory) { - return F_execute_file_type_directory; - } - - if (F_status_set_fine(status) == F_fork_not) { - return F_execute_fork_not; - } - - if (F_status_set_fine(status) == F_format_not) { - return F_execute_format_not; - } - - if (F_status_set_fine(status) == F_group) { - return F_execute_group; - } - - if (F_status_set_fine(status) == F_input_output) { - return F_execute_input_output; - } - - if (F_status_set_fine(status) == F_limit) { - return F_execute_limit; - } - - if (F_status_set_fine(status) == F_loop) { - return F_execute_loop; - } - - if (F_status_set_fine(status) == F_memory_not) { - return F_execute_memory_not; - } - - if (F_status_set_fine(status) == F_name_not) { - return F_execute_name_not; - } - - if (F_status_set_fine(status) == F_nice) { - return F_execute_nice; - } - - if (F_status_set_fine(status) == F_parameter) { - return F_execute_parameter; - } - - if (F_status_set_fine(status) == F_pipe) { - return F_execute_pipe; - } - - if (F_status_set_fine(status) == F_processor) { - return F_execute_processor; - } - - if (F_status_set_fine(status) == F_prohibited) { - return F_execute_prohibited; - } - - if (F_status_set_fine(status) == F_resource_not) { - return F_execute_resource_not; - } - - if (F_status_set_fine(status) == F_schedule) { - return F_execute_schedule; - } - - if (F_status_set_fine(status) == F_terminal) { - return F_execute_terminal; - } - - if (F_status_set_fine(status) == F_terminal_known_not) { - return F_execute_terminal_known_not; - } - - if (F_status_set_fine(status) == F_terminal_not) { - return F_execute_terminal_not; - } - - if (F_status_set_fine(status) == F_terminal_prohibited) { - return F_execute_terminal_prohibited; - } - - if (F_status_set_fine(status) == F_terminal_valid_not) { - return F_execute_terminal_valid_not; - } - - if (F_status_set_fine(status) == F_too_large) { - return F_execute_too_large; - } - - if (F_status_set_fine(status) == F_user) { - return F_execute_user; - } - - if (F_status_set_fine(status) == F_valid_not) { - return F_execute_valid_not; - } - - if (F_status_set_fine(status) == F_call_not) { - return F_execute_invoke_not; - } - - if (F_status_set_fine(status) == F_found_not) { - return F_execute_found_not; - } - - if (F_status_set_fine(status) == F_exit) { - return F_execute_exit_parameter; - } - - if (F_status_set_fine(status) == F_signal_hangup) { - return F_execute_signal_hangup; - } - - if (F_status_set_fine(status) == F_signal_interrupt) { - return F_execute_signal_interrupt; - } - - if (F_status_set_fine(status) == F_signal_quit) { - return F_execute_signal_quit; - } - - if (F_status_set_fine(status) == F_signal_illegal) { - return F_execute_signal_illegal; - } - - if (F_status_set_fine(status) == F_signal_trap) { - return F_execute_signal_trap; - } - - if (F_status_set_fine(status) == F_signal_abort) { - return F_execute_signal_abort; - } - - if (F_status_set_fine(status) == F_signal_bus_error) { - return F_execute_signal_bus_error; - } - - if (F_status_set_fine(status) == F_signal_floating_point_error) { - return F_execute_signal_floating_point_error; - } - - if (F_status_set_fine(status) == F_signal_kill) { - return F_execute_signal_kill; - } - - if (F_status_set_fine(status) == F_signal_user_1) { - return F_execute_signal_user_1; - } - - if (F_status_set_fine(status) == F_signal_segmentation_fault) { - return F_execute_signal_segmentation_fault; - } - - if (F_status_set_fine(status) == F_signal_user_2) { - return F_execute_signal_user_2; - } - - if (F_status_set_fine(status) == F_signal_broken_pipe) { - return F_execute_signal_broken_pipe; - } - - if (F_status_set_fine(status) == F_signal_alarm_clock) { - return F_execute_signal_alarm_clock; - } - - if (F_status_set_fine(status) == F_signal_termination) { - return F_execute_signal_termination; - } - - if (F_status_set_fine(status) == F_signal_stack_fault) { - return F_execute_signal_stack_fault; - } - - if (F_status_set_fine(status) == F_signal_child) { - return F_execute_signal_child; - } - - if (F_status_set_fine(status) == F_signal_continue) { - return F_execute_signal_continue; - } - - if (F_status_set_fine(status) == F_signal_stop) { - return F_execute_signal_stop; - } - - if (F_status_set_fine(status) == F_signal_keyboard_stop) { - return F_execute_signal_keyboard_stop; - } - - if (F_status_set_fine(status) == F_signal_tty_in) { - return F_execute_signal_tty_in; - } - - if (F_status_set_fine(status) == F_signal_tty_out) { - return F_execute_signal_tty_out; - } - - if (F_status_set_fine(status) == F_signal_urgent) { - return F_execute_signal_urgent; - } - - if (F_status_set_fine(status) == F_signal_cpu_limit) { - return F_execute_signal_cpu_limit; - } - - if (F_status_set_fine(status) == F_signal_file_size_limit) { - return F_execute_signal_file_size_limit; - } - - if (F_status_set_fine(status) == F_signal_virtual_alarm_clock) { - return F_execute_signal_virtual_alarm_clock; - } - - if (F_status_set_fine(status) == F_signal_profile_alarm_clock) { - return F_execute_signal_profile_alarm_clock; - } - - if (F_status_set_fine(status) == F_signal_window_size_change) { - return F_execute_signal_window_size_change; - } - - if (F_status_set_fine(status) == F_signal_pollable_event) { - return F_execute_signal_pollable_event; - } - - if (F_status_set_fine(status) == F_signal_power_failure) { - return F_execute_signal_power_failure; - } - - if (F_status_set_fine(status) == F_signal_bad_system_call) { - return F_execute_signal_bad_system_call; - } - - if (F_status_set_fine(status) == F_signal_reserved_32) { - return F_execute_signal_reserved_32; - } - - if (F_status_set_fine(status) == F_signal_reserved_33) { - return F_execute_signal_reserved_33; - } - - if (F_status_set_fine(status) == F_signal_reserved_34) { - return F_execute_signal_reserved_34; - } - - if (F_status_set_fine(status) == F_signal_reserved_35) { - return F_execute_signal_reserved_35; - } - - if (F_status_set_fine(status) == F_signal_reserved_36) { - return F_execute_signal_reserved_36; - } - - if (F_status_set_fine(status) == F_signal_reserved_37) { - return F_execute_signal_reserved_37; - } - - if (F_status_set_fine(status) == F_signal_reserved_38) { - return F_execute_signal_reserved_38; - } - - if (F_status_set_fine(status) == F_signal_reserved_39) { - return F_execute_signal_reserved_39; - } - - if (F_status_set_fine(status) == F_signal_reserved_40) { - return F_execute_signal_reserved_40; - } - - if (F_status_set_fine(status) == F_signal_reserved_41) { - return F_execute_signal_reserved_41; - } - - if (F_status_set_fine(status) == F_signal_reserved_42) { - return F_execute_signal_reserved_42; - } - - if (F_status_set_fine(status) == F_signal_reserved_43) { - return F_execute_signal_reserved_43; - } - - if (F_status_set_fine(status) == F_signal_reserved_44) { - return F_execute_signal_reserved_44; - } - - if (F_status_set_fine(status) == F_signal_reserved_45) { - return F_execute_signal_reserved_45; - } - - if (F_status_set_fine(status) == F_signal_reserved_46) { - return F_execute_signal_reserved_46; - } - - if (F_status_set_fine(status) == F_signal_reserved_47) { - return F_execute_signal_reserved_47; - } - - if (F_status_set_fine(status) == F_signal_reserved_48) { - return F_execute_signal_reserved_48; - } - - if (F_status_set_fine(status) == F_signal_reserved_49) { - return F_execute_signal_reserved_49; - } - - if (F_status_set_fine(status) == F_signal_reserved_50) { - return F_execute_signal_reserved_50; - } - - if (F_status_set_fine(status) == F_signal_reserved_51) { - return F_execute_signal_reserved_51; - } - - if (F_status_set_fine(status) == F_signal_reserved_52) { - return F_execute_signal_reserved_52; - } - - if (F_status_set_fine(status) == F_signal_reserved_53) { - return F_execute_signal_reserved_53; - } - - if (F_status_set_fine(status) == F_signal_reserved_54) { - return F_execute_signal_reserved_54; - } - - if (F_status_set_fine(status) == F_signal_reserved_55) { - return F_execute_signal_reserved_55; - } - - if (F_status_set_fine(status) == F_signal_reserved_56) { - return F_execute_signal_reserved_56; - } - - if (F_status_set_fine(status) == F_signal_reserved_57) { - return F_execute_signal_reserved_57; - } - - if (F_status_set_fine(status) == F_signal_reserved_58) { - return F_execute_signal_reserved_58; - } - - if (F_status_set_fine(status) == F_signal_reserved_59) { - return F_execute_signal_reserved_59; - } - - if (F_status_set_fine(status) == F_signal_reserved_60) { - return F_execute_signal_reserved_60; - } - - if (F_status_set_fine(status) == F_signal_reserved_61) { - return F_execute_signal_reserved_61; - } - - if (F_status_set_fine(status) == F_signal_reserved_62) { - return F_execute_signal_reserved_62; - } - - if (F_status_set_fine(status) == F_signal_reserved_63) { - return F_execute_signal_reserved_63; - } - - if (F_status_set_fine(status) == F_signal_reserved_64) { - return F_execute_signal_reserved_64; - } + if (F_status_set_fine(status) == F_none) return F_execute_none; + if (F_status_set_fine(status) == F_access) return F_execute_access; + if (F_status_set_fine(status) == F_buffer) return F_execute_buffer; + if (F_status_set_fine(status) == F_busy) return F_execute_busy; + if (F_status_set_fine(status) == F_capability) return F_execute_capability; + if (F_status_set_fine(status) == F_control_group) return F_execute_control_group; + if (F_status_set_fine(status) == F_child) return F_execute_child; + if (F_status_set_fine(status) == F_directory_not) return F_execute_directory_not; + if (F_status_set_fine(status) == F_execute_not) return F_execute_bad; + if (F_status_set_fine(status) == F_failure) return F_execute_failure; + if (F_status_set_fine(status) == F_file_found_not) return F_execute_file_found_not; + if (F_status_set_fine(status) == F_file_type_directory) return F_execute_file_type_directory; + if (F_status_set_fine(status) == F_fork_not) return F_execute_fork_not; + if (F_status_set_fine(status) == F_format_not) return F_execute_format_not; + if (F_status_set_fine(status) == F_group) return F_execute_group; + if (F_status_set_fine(status) == F_input_output) return F_execute_input_output; + if (F_status_set_fine(status) == F_limit) return F_execute_limit; + if (F_status_set_fine(status) == F_loop) return F_execute_loop; + if (F_status_set_fine(status) == F_memory_not) return F_execute_memory_not; + if (F_status_set_fine(status) == F_name_not) return F_execute_name_not; + if (F_status_set_fine(status) == F_nice) return F_execute_nice; + if (F_status_set_fine(status) == F_parameter) return F_execute_parameter; + if (F_status_set_fine(status) == F_pipe) return F_execute_pipe; + if (F_status_set_fine(status) == F_processor) return F_execute_processor; + if (F_status_set_fine(status) == F_prohibited) return F_execute_prohibited; + if (F_status_set_fine(status) == F_resource_not) return F_execute_resource_not; + if (F_status_set_fine(status) == F_schedule) return F_execute_schedule; + if (F_status_set_fine(status) == F_terminal) return F_execute_terminal; + if (F_status_set_fine(status) == F_terminal_known_not) return F_execute_terminal_known_not; + if (F_status_set_fine(status) == F_terminal_not) return F_execute_terminal_not; + if (F_status_set_fine(status) == F_terminal_prohibited) return F_execute_terminal_prohibited; + if (F_status_set_fine(status) == F_terminal_valid_not) return F_execute_terminal_valid_not; + if (F_status_set_fine(status) == F_too_large) return F_execute_too_large; + if (F_status_set_fine(status) == F_user) return F_execute_user; + if (F_status_set_fine(status) == F_valid_not) return F_execute_valid_not; + if (F_status_set_fine(status) == F_call_not) return F_execute_invoke_not; + if (F_status_set_fine(status) == F_found_not) return F_execute_found_not; + if (F_status_set_fine(status) == F_exit) return F_execute_exit_parameter; + if (F_status_set_fine(status) == F_signal_hangup) return F_execute_signal_hangup; + if (F_status_set_fine(status) == F_signal_interrupt) return F_execute_signal_interrupt; + if (F_status_set_fine(status) == F_signal_quit) return F_execute_signal_quit; + if (F_status_set_fine(status) == F_signal_illegal) return F_execute_signal_illegal; + if (F_status_set_fine(status) == F_signal_trap) return F_execute_signal_trap; + if (F_status_set_fine(status) == F_signal_abort) return F_execute_signal_abort; + if (F_status_set_fine(status) == F_signal_bus_error) return F_execute_signal_bus_error; + if (F_status_set_fine(status) == F_signal_floating_point_error) return F_execute_signal_floating_point_error; + if (F_status_set_fine(status) == F_signal_kill) return F_execute_signal_kill; + if (F_status_set_fine(status) == F_signal_user_1) return F_execute_signal_user_1; + if (F_status_set_fine(status) == F_signal_segmentation_fault) return F_execute_signal_segmentation_fault; + if (F_status_set_fine(status) == F_signal_user_2) return F_execute_signal_user_2; + if (F_status_set_fine(status) == F_signal_broken_pipe) return F_execute_signal_broken_pipe; + if (F_status_set_fine(status) == F_signal_alarm_clock) return F_execute_signal_alarm_clock; + if (F_status_set_fine(status) == F_signal_termination) return F_execute_signal_termination; + if (F_status_set_fine(status) == F_signal_stack_fault) return F_execute_signal_stack_fault; + if (F_status_set_fine(status) == F_signal_child) return F_execute_signal_child; + if (F_status_set_fine(status) == F_signal_continue) return F_execute_signal_continue; + if (F_status_set_fine(status) == F_signal_stop) return F_execute_signal_stop; + if (F_status_set_fine(status) == F_signal_keyboard_stop) return F_execute_signal_keyboard_stop; + if (F_status_set_fine(status) == F_signal_tty_in) return F_execute_signal_tty_in; + if (F_status_set_fine(status) == F_signal_tty_out) return F_execute_signal_tty_out; + if (F_status_set_fine(status) == F_signal_urgent) return F_execute_signal_urgent; + if (F_status_set_fine(status) == F_signal_cpu_limit) return F_execute_signal_cpu_limit; + if (F_status_set_fine(status) == F_signal_file_size_limit) return F_execute_signal_file_size_limit; + if (F_status_set_fine(status) == F_signal_virtual_alarm_clock) return F_execute_signal_virtual_alarm_clock; + if (F_status_set_fine(status) == F_signal_profile_alarm_clock) return F_execute_signal_profile_alarm_clock; + if (F_status_set_fine(status) == F_signal_window_size_change) return F_execute_signal_window_size_change; + if (F_status_set_fine(status) == F_signal_pollable_event) return F_execute_signal_pollable_event; + if (F_status_set_fine(status) == F_signal_power_failure) return F_execute_signal_power_failure; + if (F_status_set_fine(status) == F_signal_bad_system_call) return F_execute_signal_bad_system_call; + if (F_status_set_fine(status) == F_signal_reserved_32) return F_execute_signal_reserved_32; + if (F_status_set_fine(status) == F_signal_reserved_33) return F_execute_signal_reserved_33; + if (F_status_set_fine(status) == F_signal_reserved_34) return F_execute_signal_reserved_34; + if (F_status_set_fine(status) == F_signal_reserved_35) return F_execute_signal_reserved_35; + if (F_status_set_fine(status) == F_signal_reserved_36) return F_execute_signal_reserved_36; + if (F_status_set_fine(status) == F_signal_reserved_37) return F_execute_signal_reserved_37; + if (F_status_set_fine(status) == F_signal_reserved_38) return F_execute_signal_reserved_38; + if (F_status_set_fine(status) == F_signal_reserved_39) return F_execute_signal_reserved_39; + if (F_status_set_fine(status) == F_signal_reserved_40) return F_execute_signal_reserved_40; + if (F_status_set_fine(status) == F_signal_reserved_41) return F_execute_signal_reserved_41; + if (F_status_set_fine(status) == F_signal_reserved_42) return F_execute_signal_reserved_42; + if (F_status_set_fine(status) == F_signal_reserved_43) return F_execute_signal_reserved_43; + if (F_status_set_fine(status) == F_signal_reserved_44) return F_execute_signal_reserved_44; + if (F_status_set_fine(status) == F_signal_reserved_45) return F_execute_signal_reserved_45; + if (F_status_set_fine(status) == F_signal_reserved_46) return F_execute_signal_reserved_46; + if (F_status_set_fine(status) == F_signal_reserved_47) return F_execute_signal_reserved_47; + if (F_status_set_fine(status) == F_signal_reserved_48) return F_execute_signal_reserved_48; + if (F_status_set_fine(status) == F_signal_reserved_49) return F_execute_signal_reserved_49; + if (F_status_set_fine(status) == F_signal_reserved_50) return F_execute_signal_reserved_50; + if (F_status_set_fine(status) == F_signal_reserved_51) return F_execute_signal_reserved_51; + if (F_status_set_fine(status) == F_signal_reserved_52) return F_execute_signal_reserved_52; + if (F_status_set_fine(status) == F_signal_reserved_53) return F_execute_signal_reserved_53; + if (F_status_set_fine(status) == F_signal_reserved_54) return F_execute_signal_reserved_54; + if (F_status_set_fine(status) == F_signal_reserved_55) return F_execute_signal_reserved_55; + if (F_status_set_fine(status) == F_signal_reserved_56) return F_execute_signal_reserved_56; + if (F_status_set_fine(status) == F_signal_reserved_57) return F_execute_signal_reserved_57; + if (F_status_set_fine(status) == F_signal_reserved_58) return F_execute_signal_reserved_58; + if (F_status_set_fine(status) == F_signal_reserved_59) return F_execute_signal_reserved_59; + if (F_status_set_fine(status) == F_signal_reserved_60) return F_execute_signal_reserved_60; + if (F_status_set_fine(status) == F_signal_reserved_61) return F_execute_signal_reserved_61; + if (F_status_set_fine(status) == F_signal_reserved_62) return F_execute_signal_reserved_62; + if (F_status_set_fine(status) == F_signal_reserved_63) return F_execute_signal_reserved_63; + if (F_status_set_fine(status) == F_signal_reserved_64) return F_execute_signal_reserved_64; return F_execute_code_last; } @@ -422,413 +117,108 @@ extern "C" { #ifndef _di_f_execute_status_to_status_ f_status_t f_execute_status_to_status(uint8_t status) { - if (status == F_execute_none) { - return F_none; - } - - if (status == F_execute_access) { - return F_access; - } - - if (status == F_execute_bad) { - return F_execute_not; - } - - if (status == F_execute_buffer) { - return F_buffer; - } - - if (status == F_execute_busy) { - return F_busy; - } - - if (status == F_execute_capability) { - return F_capability; - } - - if (status == F_execute_control_group) { - return F_control_group; - } - - if (status == F_execute_child) { - return F_child; - } - - if (status == F_execute_directory_not) { - return F_directory_not; - } - - if (status == F_execute_failure) { - return F_failure; - } - - if (status == F_execute_file_found_not) { - return F_file_found_not; - } - - if (status == F_execute_file_type_directory) { - return F_file_type_directory; - } - - if (status == F_execute_fork_not) { - return F_fork_not; - } - - if (status == F_execute_format_not) { - return F_format_not; - } - - if (status == F_execute_group) { - return F_group; - } - - if (status == F_execute_input_output) { - return F_input_output; - } - - if (status == F_execute_limit) { - return F_limit; - } - - if (status == F_execute_loop) { - return F_loop; - } - - if (status == F_execute_memory_not) { - return F_memory_not; - } - - if (status == F_execute_name_not) { - return F_name_not; - } - - if (status == F_execute_nice) { - return F_nice; - } - - if (status == F_execute_parameter) { - return F_parameter; - } - - if (status == F_execute_pipe) { - return F_pipe; - } - - if (status == F_execute_processor) { - return F_processor; - } - - if (status == F_execute_prohibited) { - return F_prohibited; - } - - if (status == F_execute_resource_not) { - return F_resource_not; - } - - if (status == F_execute_schedule) { - return F_schedule; - } - - if (status == F_execute_terminal) { - return F_terminal; - } - - if (status == F_execute_terminal_known_not) { - return F_terminal_known_not; - } - - if (status == F_execute_terminal_not) { - return F_terminal_not; - } - - if (status == F_execute_terminal_prohibited) { - return F_terminal_prohibited; - } - - if (status == F_execute_terminal_valid_not) { - return F_terminal_valid_not; - } - - if (status == F_execute_too_large) { - return F_too_large; - } - - if (status == F_execute_user) { - return F_user; - } - - if (status == F_execute_valid_not) { - return F_valid_not; - } - - if (status == F_execute_invoke_not) { - return F_call_not; - } - - if (status == F_execute_found_not) { - return F_found_not; - } - - if (status == F_execute_exit_parameter) { - return F_exit; - } - - if (status == F_execute_signal_hangup) { - return F_signal_hangup; - } - - if (status == F_execute_signal_interrupt) { - return F_signal_interrupt; - } - - if (status == F_execute_signal_quit) { - return F_signal_quit; - } - - if (status == F_execute_signal_illegal) { - return F_signal_illegal; - } - - if (status == F_execute_signal_trap) { - return F_signal_trap; - } - - if (status == F_execute_signal_abort) { - return F_signal_abort; - } - - if (status == F_execute_signal_bus_error) { - return F_signal_bus_error; - } - - if (status == F_execute_signal_floating_point_error) { - return F_signal_floating_point_error; - } - - if (status == F_execute_signal_kill) { - return F_signal_kill; - } - - if (status == F_execute_signal_user_1) { - return F_signal_user_1; - } - - if (status == F_execute_signal_segmentation_fault) { - return F_signal_segmentation_fault; - } - - if (status == F_execute_signal_user_2) { - return F_signal_user_2; - } - - if (status == F_execute_signal_broken_pipe) { - return F_signal_broken_pipe; - } - - if (status == F_execute_signal_alarm_clock) { - return F_signal_alarm_clock; - } - - if (status == F_execute_signal_termination) { - return F_signal_termination; - } - - if (status == F_execute_signal_stack_fault) { - return F_signal_stack_fault; - } - - if (status == F_execute_signal_child) { - return F_signal_child; - } - - if (status == F_execute_signal_continue) { - return F_signal_continue; - } - - if (status == F_execute_signal_stop) { - return F_signal_stop; - } - - if (status == F_execute_signal_keyboard_stop) { - return F_signal_keyboard_stop; - } - - if (status == F_execute_signal_tty_in) { - return F_signal_tty_in; - } - - if (status == F_execute_signal_tty_out) { - return F_signal_tty_out; - } - - if (status == F_execute_signal_urgent) { - return F_signal_urgent; - } - - if (status == F_execute_signal_cpu_limit) { - return F_signal_cpu_limit; - } - - if (status == F_execute_signal_file_size_limit) { - return F_signal_file_size_limit; - } - - if (status == F_execute_signal_virtual_alarm_clock) { - return F_signal_virtual_alarm_clock; - } - - if (status == F_execute_signal_profile_alarm_clock) { - return F_signal_profile_alarm_clock; - } - - if (status == F_execute_signal_window_size_change) { - return F_signal_window_size_change; - } - - if (status == F_execute_signal_pollable_event) { - return F_signal_pollable_event; - } - - if (status == F_execute_signal_power_failure) { - return F_signal_power_failure; - } - - if (status == F_execute_signal_bad_system_call) { - return F_signal_bad_system_call; - } - - if (status == F_execute_signal_reserved_32) { - return F_signal_reserved_32; - } - - if (status == F_execute_signal_reserved_33) { - return F_signal_reserved_33; - } - - if (status == F_execute_signal_reserved_34) { - return F_signal_reserved_34; - } - - if (status == F_execute_signal_reserved_35) { - return F_signal_reserved_35; - } - - if (status == F_execute_signal_reserved_36) { - return F_signal_reserved_36; - } - - if (status == F_execute_signal_reserved_37) { - return F_signal_reserved_37; - } - - if (status == F_execute_signal_reserved_38) { - return F_signal_reserved_38; - } - - if (status == F_execute_signal_reserved_39) { - return F_signal_reserved_39; - } - - if (status == F_execute_signal_reserved_40) { - return F_signal_reserved_40; - } - - if (status == F_execute_signal_reserved_41) { - return F_signal_reserved_41; - } - - if (status == F_execute_signal_reserved_42) { - return F_signal_reserved_42; - } - - if (status == F_execute_signal_reserved_43) { - return F_signal_reserved_43; - } - - if (status == F_execute_signal_reserved_44) { - return F_signal_reserved_44; - } - - if (status == F_execute_signal_reserved_45) { - return F_signal_reserved_45; - } - - if (status == F_execute_signal_reserved_46) { - return F_signal_reserved_46; - } - - if (status == F_execute_signal_reserved_47) { - return F_signal_reserved_47; - } - - if (status == F_execute_signal_reserved_48) { - return F_signal_reserved_48; - } - - if (status == F_execute_signal_reserved_49) { - return F_signal_reserved_49; - } - - if (status == F_execute_signal_reserved_50) { - return F_signal_reserved_50; - } - - if (status == F_execute_signal_reserved_51) { - return F_signal_reserved_51; - } - - if (status == F_execute_signal_reserved_52) { - return F_signal_reserved_52; - } - - if (status == F_execute_signal_reserved_53) { - return F_signal_reserved_53; - } - - if (status == F_execute_signal_reserved_54) { - return F_signal_reserved_54; - } - - if (status == F_execute_signal_reserved_55) { - return F_signal_reserved_55; - } - - if (status == F_execute_signal_reserved_56) { - return F_signal_reserved_56; - } - - if (status == F_execute_signal_reserved_57) { - return F_signal_reserved_57; - } - - if (status == F_execute_signal_reserved_58) { - return F_signal_reserved_58; - } - - if (status == F_execute_signal_reserved_59) { - return F_signal_reserved_59; - } - - if (status == F_execute_signal_reserved_60) { - return F_signal_reserved_60; - } - - if (status == F_execute_signal_reserved_61) { - return F_signal_reserved_61; - } - - if (status == F_execute_signal_reserved_62) { - return F_signal_reserved_62; - } - - if (status == F_execute_signal_reserved_63) { - return F_signal_reserved_63; - } - - if (status == F_execute_signal_reserved_64) { - return F_signal_reserved_64; - } + if (status == F_execute_none) return F_none; + if (status == F_execute_access) return F_access; + if (status == F_execute_bad) return F_execute_not; + if (status == F_execute_buffer) return F_buffer; + if (status == F_execute_busy) return F_busy; + if (status == F_execute_capability) return F_capability; + if (status == F_execute_control_group) return F_control_group; + if (status == F_execute_child) return F_child; + if (status == F_execute_directory_not) return F_directory_not; + if (status == F_execute_failure) return F_failure; + if (status == F_execute_file_found_not) return F_file_found_not; + if (status == F_execute_file_type_directory) return F_file_type_directory; + if (status == F_execute_fork_not) return F_fork_not; + if (status == F_execute_format_not) return F_format_not; + if (status == F_execute_group) return F_group; + if (status == F_execute_input_output) return F_input_output; + if (status == F_execute_limit) return F_limit; + if (status == F_execute_loop) return F_loop; + if (status == F_execute_memory_not) return F_memory_not; + if (status == F_execute_name_not) return F_name_not; + if (status == F_execute_nice) return F_nice; + if (status == F_execute_parameter) return F_parameter; + if (status == F_execute_pipe) return F_pipe; + if (status == F_execute_processor) return F_processor; + if (status == F_execute_prohibited) return F_prohibited; + if (status == F_execute_resource_not) return F_resource_not; + if (status == F_execute_schedule) return F_schedule; + if (status == F_execute_terminal) return F_terminal; + if (status == F_execute_terminal_known_not) return F_terminal_known_not; + if (status == F_execute_terminal_not) return F_terminal_not; + if (status == F_execute_terminal_prohibited) return F_terminal_prohibited; + if (status == F_execute_terminal_valid_not) return F_terminal_valid_not; + if (status == F_execute_too_large) return F_too_large; + if (status == F_execute_user) return F_user; + if (status == F_execute_valid_not) return F_valid_not; + if (status == F_execute_invoke_not) return F_call_not; + if (status == F_execute_found_not) return F_found_not; + if (status == F_execute_exit_parameter) return F_exit; + if (status == F_execute_signal_hangup) return F_signal_hangup; + if (status == F_execute_signal_interrupt) return F_signal_interrupt; + if (status == F_execute_signal_quit) return F_signal_quit; + if (status == F_execute_signal_illegal) return F_signal_illegal; + if (status == F_execute_signal_trap) return F_signal_trap; + if (status == F_execute_signal_abort) return F_signal_abort; + if (status == F_execute_signal_bus_error) return F_signal_bus_error; + if (status == F_execute_signal_floating_point_error) return F_signal_floating_point_error; + if (status == F_execute_signal_kill) return F_signal_kill; + if (status == F_execute_signal_user_1) return F_signal_user_1; + if (status == F_execute_signal_segmentation_fault) return F_signal_segmentation_fault; + if (status == F_execute_signal_user_2) return F_signal_user_2; + if (status == F_execute_signal_broken_pipe) return F_signal_broken_pipe; + if (status == F_execute_signal_alarm_clock) return F_signal_alarm_clock; + if (status == F_execute_signal_termination) return F_signal_termination; + if (status == F_execute_signal_stack_fault) return F_signal_stack_fault; + if (status == F_execute_signal_child) return F_signal_child; + if (status == F_execute_signal_continue) return F_signal_continue; + if (status == F_execute_signal_stop) return F_signal_stop; + if (status == F_execute_signal_keyboard_stop) return F_signal_keyboard_stop; + if (status == F_execute_signal_tty_in) return F_signal_tty_in; + if (status == F_execute_signal_tty_out) return F_signal_tty_out; + if (status == F_execute_signal_urgent) return F_signal_urgent; + if (status == F_execute_signal_cpu_limit) return F_signal_cpu_limit; + if (status == F_execute_signal_file_size_limit) return F_signal_file_size_limit; + if (status == F_execute_signal_virtual_alarm_clock) return F_signal_virtual_alarm_clock; + if (status == F_execute_signal_profile_alarm_clock) return F_signal_profile_alarm_clock; + if (status == F_execute_signal_window_size_change) return F_signal_window_size_change; + if (status == F_execute_signal_pollable_event) return F_signal_pollable_event; + if (status == F_execute_signal_power_failure) return F_signal_power_failure; + if (status == F_execute_signal_bad_system_call) return F_signal_bad_system_call; + if (status == F_execute_signal_reserved_32) return F_signal_reserved_32; + if (status == F_execute_signal_reserved_33) return F_signal_reserved_33; + if (status == F_execute_signal_reserved_34) return F_signal_reserved_34; + if (status == F_execute_signal_reserved_35) return F_signal_reserved_35; + if (status == F_execute_signal_reserved_36) return F_signal_reserved_36; + if (status == F_execute_signal_reserved_37) return F_signal_reserved_37; + if (status == F_execute_signal_reserved_38) return F_signal_reserved_38; + if (status == F_execute_signal_reserved_39) return F_signal_reserved_39; + if (status == F_execute_signal_reserved_40) return F_signal_reserved_40; + if (status == F_execute_signal_reserved_41) return F_signal_reserved_41; + if (status == F_execute_signal_reserved_42) return F_signal_reserved_42; + if (status == F_execute_signal_reserved_43) return F_signal_reserved_43; + if (status == F_execute_signal_reserved_44) return F_signal_reserved_44; + if (status == F_execute_signal_reserved_45) return F_signal_reserved_45; + if (status == F_execute_signal_reserved_46) return F_signal_reserved_46; + if (status == F_execute_signal_reserved_47) return F_signal_reserved_47; + if (status == F_execute_signal_reserved_48) return F_signal_reserved_48; + if (status == F_execute_signal_reserved_49) return F_signal_reserved_49; + if (status == F_execute_signal_reserved_50) return F_signal_reserved_50; + if (status == F_execute_signal_reserved_51) return F_signal_reserved_51; + if (status == F_execute_signal_reserved_52) return F_signal_reserved_52; + if (status == F_execute_signal_reserved_53) return F_signal_reserved_53; + if (status == F_execute_signal_reserved_54) return F_signal_reserved_54; + if (status == F_execute_signal_reserved_55) return F_signal_reserved_55; + if (status == F_execute_signal_reserved_56) return F_signal_reserved_56; + if (status == F_execute_signal_reserved_57) return F_signal_reserved_57; + if (status == F_execute_signal_reserved_58) return F_signal_reserved_58; + if (status == F_execute_signal_reserved_59) return F_signal_reserved_59; + if (status == F_execute_signal_reserved_60) return F_signal_reserved_60; + if (status == F_execute_signal_reserved_61) return F_signal_reserved_61; + if (status == F_execute_signal_reserved_62) return F_signal_reserved_62; + if (status == F_execute_signal_reserved_63) return F_signal_reserved_63; + if (status == F_execute_signal_reserved_64) return F_signal_reserved_64; return F_status_set_error(F_known_not); } diff --git a/level_1/fl_directory/c/private-directory.h b/level_1/fl_directory/c/private-directory.h index fe846eb..82c482f 100644 --- a/level_1/fl_directory/c/private-directory.h +++ b/level_1/fl_directory/c/private-directory.h @@ -66,7 +66,7 @@ extern "C" { * F_array_too_large (with error bit) if a buffer would exceed max length. * F_failure (with error bit) for any other failure, failures might be populated with individual status codes. * - * @see fl_directory_clone() + * @see fl_directory_copy() */ #if !defined(_di_fl_directory_copy_) extern void private_fl_directory_copy_recurse_file(const f_string_static_t file, f_directory_recurse_t * const recurse) F_attribute_visibility_internal_d; diff --git a/level_3/fake/c/main/build.c b/level_3/fake/c/main/build.c index d984220..42697b3 100644 --- a/level_3/fake/c/main/build.c +++ b/level_3/fake/c/main/build.c @@ -183,8 +183,8 @@ extern "C" { data->setting->state.status = f_string_dynamic_resize(source.used, &path_source); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_resize)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_resize)); f_string_dynamic_resize(0, &path_source); @@ -194,13 +194,9 @@ extern "C" { memcpy(path_source.string, source.string, sizeof(f_char_t) * source.used); f_directory_recurse_t recurse = f_directory_recurse_t_initialize; - - if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { - recurse.output = data->main->message.to; - recurse.verbose = fake_print_verbose_copy; - } - - recurse.failures = &failures; + recurse.verbose = &fake_print_verbose_copy; + //recurse.failures = &failures; // @fixme this now needs to be handled by a callback in recurse (recurse.state.handle)., maybe make this a callback on f_directory_recurse_t? + recurse.mode = mode; for (f_array_length_t i = 0; i < files.used; ++i) { @@ -222,8 +218,8 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(files.array[i], &path_source); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -235,31 +231,33 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(destination, &destination_directory); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } data->setting->state.status = f_file_name_base(path_source, &destination_directory); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_file_name_base)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base)); break; } - data->setting->state.status = fl_directory_copy(path_source, destination_directory, mode, recurse); + fl_directory_copy(path_source, destination_directory, &recurse); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { if (data->main->error.verbosity >= f_console_verbosity_verbose_e) { + /* // @fixme for (f_array_length_t j = 0; j < failures.used; ++j) { fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(fl_directory_copy), fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true); } // for + */ if (F_status_set_fine(data->setting->state.status) != F_failure) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(fl_directory_copy)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fl_directory_copy)); } } else if (data->main->error.verbosity > f_console_verbosity_quiet_e) { @@ -275,8 +273,8 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(destination, &destination_file); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -284,8 +282,8 @@ extern "C" { if (perserve_offset && perserve_offset < path_source.used) { data->setting->state.status = f_string_dynamic_append_nulless(destination, &destination_directory); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -295,24 +293,24 @@ extern "C" { data->setting->state.status = f_file_name_directory(buffer, &destination_directory); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_file_name_directory)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory)); break; } data->setting->state.status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d); - if (F_status_is_error(setting->state.status)) { - fake_print_error_file(data->setting, data->main->error, data->setting->state.status, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(fl_directory_create), destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e); break; } data->setting->state.status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_append)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_append)); break; } @@ -320,8 +318,8 @@ extern "C" { else { data->setting->state.status = f_file_name_base(path_source, &destination_file); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_file_name_base)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base)); break; } @@ -329,8 +327,8 @@ extern "C" { data->setting->state.status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, f_file_stat_flag_reference_e); - if (F_status_is_error(setting->state.status)) { - fake_print_error_build_operation_file(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error_build_operation_file(data->setting, data->main->error, macro_fake_f(f_file_copy), f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true); break; } @@ -339,8 +337,8 @@ extern "C" { fll_print_format("Copied file '%Q' to '%Q'.%r", data->main->message.to, path_source, destination_file, f_string_eol_s); } } - else if (F_status_is_error(setting->state.status)) { - fake_print_error_file(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e); + else if (F_status_is_error(data->setting->state.status)) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_directory_is), path_source, f_file_operation_create_s, fll_error_file_type_file_e); break; } @@ -348,8 +346,6 @@ extern "C" { data->setting->state.status = F_none; } // for - macro_f_directory_statuss_t_delete_simple(failures); - f_directory_recurse_delete(&recurse); f_string_dynamic_resize(0, &path_source); @@ -363,7 +359,7 @@ extern "C" { #ifndef _di_fake_build_execute_process_script_ int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage) { - if (!data) return; + if (!data) return 0; if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!process_script.used) return 0; @@ -422,7 +418,7 @@ extern "C" { data->setting->state.status = fll_execute_arguments_add(argument, &arguments); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); f_string_dynamics_resize(0, &arguments); @@ -440,7 +436,7 @@ extern "C" { if (F_status_is_error(data->setting->state.status)) break; } // for - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_mash)); f_string_dynamic_resize(0, &defines); @@ -490,7 +486,7 @@ extern "C" { f_string_dynamic_resize(0, &defines); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add_parameter_set)); f_string_dynamics_resize(0, &arguments); @@ -509,8 +505,8 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(process_script, &path); } - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); f_string_dynamic_resize(0, &path); f_string_dynamics_resize(0, &arguments); @@ -537,7 +533,7 @@ extern "C" { data->setting->state.status = F_status_set_error(F_interrupt); } else if (data->setting->state.status != F_child) { - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { if (F_status_set_fine(data->setting->state.status) == F_failure) { fake_print_error_failure_script(data->setting, data->main->error, path); } @@ -568,7 +564,7 @@ extern "C" { data->setting->state.status = f_file_name_base(path, name); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base)); return; @@ -978,7 +974,7 @@ extern "C" { data->setting->state.status = f_file_touch(file, mode.regular, F_false); - if (F_status_is_error(setting->state.status)) { + 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 { diff --git a/level_3/fake/c/main/build.h b/level_3/fake/c/main/build.h index e3433ac..5362c7c 100644 --- a/level_3/fake/c/main/build.h +++ b/level_3/fake/c/main/build.h @@ -182,7 +182,7 @@ extern "C" { * @see fll_execute_arguments_add() */ #ifndef _di_fake_build_objects_add_ - extern f_status_t fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments); + extern void fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments); #endif // _di_fake_build_objects_add_ /** diff --git a/level_3/fake/c/main/build/library.c b/level_3/fake/c/main/build/library.c index 5c265f7..750381d 100644 --- a/level_3/fake/c/main/build/library.c +++ b/level_3/fake/c/main/build/library.c @@ -5,40 +5,44 @@ extern "C" { #endif #ifndef _di_fake_build_library_script_ - int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (!data) return 0; - fake_build_touch(data, file_stage, status); + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; + + fake_build_touch(data, file_stage); return 0; } #endif // _di_fake_build_library_script_ #ifndef _di_fake_build_library_shared_ - int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { + + if (!data || !data_build) return 0; - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0; fake_build_print_compile_library_shared(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments); + data->setting->state.status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(*data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); f_string_dynamics_resize(0, &arguments); return 0; } - *status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments); + data->setting->state.status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_sources_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add)); f_string_dynamics_resize(0, &arguments); @@ -286,14 +290,14 @@ extern "C" { if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(values[i], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for - fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_library_e, &arguments, status); + fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_library_e, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); f_string_dynamics_resize(0, &arguments); @@ -302,12 +306,12 @@ extern "C" { } { - const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status); + const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments); f_string_dynamics_resize(0, &arguments); - if (F_status_is_error(*status)) return 0; - if (*status == F_child) return result; + if (F_status_is_error(data->setting->state.status)) return 0; + if (data->setting->state.status == F_child) return result; } if (parameter_file_name_major.used) { @@ -321,19 +325,19 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name.string, sizeof(f_char_t) * parameter_file_name.used); - *status = f_file_link(parameter_file_name_major, parameter_file_path); + data->setting->state.status = f_file_link(parameter_file_name_major, parameter_file_path); - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_major); } else { - if (F_status_set_fine(*status) == F_file_found) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_set_fine(data->setting->state.status) == F_file_found) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -352,13 +356,13 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_major.string, sizeof(f_char_t) * parameter_file_name_major.used); - *status = f_file_link(parameter_file_name_minor, parameter_file_path); + data->setting->state.status = f_file_link(parameter_file_name_minor, parameter_file_path); - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_minor); } else { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), F_status_set_fine(*status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), F_status_set_fine(data->setting->state.status) == F_file_found ? parameter_file_path : parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -375,19 +379,19 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_minor.string, sizeof(f_char_t) * parameter_file_name_minor.used); - *status = f_file_link(parameter_file_name_micro, parameter_file_path); + data->setting->state.status = f_file_link(parameter_file_name_micro, parameter_file_path); - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_micro); } else { - if (F_status_set_fine(*status) == F_file_found) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_set_fine(data->setting->state.status) == F_file_found) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -403,19 +407,19 @@ extern "C" { memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used); memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_micro.string, sizeof(f_char_t) * parameter_file_name_micro.used); - *status = f_file_link(parameter_file_name_nano, parameter_file_path); + data->setting->state.status = f_file_link(parameter_file_name_nano, parameter_file_path); - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { fake_build_print_linked_file(data->setting, data->main->message, parameter_file_path, parameter_file_name_nano); } else { - if (F_status_set_fine(*status) == F_file_found) { - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); + if (F_status_set_fine(data->setting->state.status) == F_file_found) { + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } - fake_print_error_file(data->setting, data->main->error, *status, macro_fake_f(f_file_link), parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e); + fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_link), parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e); return 0; } @@ -423,16 +427,18 @@ extern "C" { } } - fake_build_touch(data, file_stage, status); + fake_build_touch(data, file_stage); return 0; } #endif // _di_fake_build_library_shared_ #ifndef _di_fake_build_library_static_ - int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { + + if (!data || !data_build) return 0; - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0; fake_build_print_compile_library_static(data->setting, data->main->message); @@ -447,11 +453,11 @@ extern "C" { if (!data_build->setting.build_indexer_arguments.array[i].used) continue; - *status = fll_execute_arguments_add(data_build->setting.build_indexer_arguments.array[i], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(data_build->setting.build_indexer_arguments.array[i], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { f_string_static_t destination = f_string_static_t_initialize; destination.used = data->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used; destination.used += data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used; @@ -473,10 +479,10 @@ extern "C" { memcpy(destination_string + destination.used, fake_build_parameter_library_name_suffix_static_s.string, sizeof(f_char_t) * fake_build_parameter_library_name_suffix_static_s.used); destination.used += fake_build_parameter_library_name_suffix_static_s.used; - *status = fll_execute_arguments_add(destination, &arguments); + data->setting->state.status = fll_execute_arguments_add(destination, &arguments); } - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { f_string_static_t source = f_string_static_t_initialize; f_array_length_t j = 0; @@ -491,35 +497,35 @@ extern "C" { source_path.used = 0; - *status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); + data->setting->state.status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_get_file_name_without_extension)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_get_file_name_without_extension)); break; } - *status = f_file_name_directory(sources[i]->array[j], &source_path); + data->setting->state.status = f_file_name_directory(sources[i]->array[j], &source_path); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_file_name_directory)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory)); break; } if (source_path.used) { - *status = f_string_dynamic_prepend(data->path_build_objects, &source_path); + data->setting->state.status = f_string_dynamic_prepend(data->path_build_objects, &source_path); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_prepend)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_prepend)); break; } - *status = f_string_dynamic_append_assure(f_path_separator_s, &source_path); + data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &source_path); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_assure)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure)); break; } @@ -545,10 +551,10 @@ extern "C" { memcpy(source_string + data->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used); } - *status = fll_execute_arguments_add(source, &arguments); + data->setting->state.status = fll_execute_arguments_add(source, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); break; } @@ -558,7 +564,7 @@ extern "C" { int result = data->main->child; - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { result = fake_execute(data, data_build->environment, data_build->setting.build_indexer, arguments, status); } @@ -566,8 +572,8 @@ extern "C" { f_string_dynamic_resize(0, &source_path); f_string_dynamics_resize(0, &arguments); - if (F_status_is_error_not(*status) && *status != F_child) { - fake_build_touch(data, file_stage, status); + if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status != F_child) { + fake_build_touch(data, file_stage); } return result; diff --git a/level_3/fake/c/main/build/library.h b/level_3/fake/c/main/build/library.h index 5d25b07..176563c 100644 --- a/level_3/fake/c/main/build/library.h +++ b/level_3/fake/c/main/build/library.h @@ -26,23 +26,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_library_script_ - extern int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_library_script_ /** @@ -50,23 +51,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_library_shared_ - extern int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_library_shared_ /** @@ -74,14 +76,17 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. * * Status codes (with error bit) are returned on any problem. * @@ -90,7 +95,7 @@ extern "C" { * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_library_static_ - extern int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_library_static_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/build/load.c b/level_3/fake/c/main/build/load.c index f7f1910..ea6aa68 100644 --- a/level_3/fake/c/main/build/load.c +++ b/level_3/fake/c/main/build/load.c @@ -30,7 +30,7 @@ extern "C" { data->setting->state.status = fl_environment_load_name(variables[i], environment); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fl_environment_load_name)); return; @@ -60,7 +60,7 @@ extern "C" { data->setting->state.status = fl_environment_load_names(data_build->setting.environment, environment); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fl_environment_load_names)); } else { @@ -132,7 +132,7 @@ extern "C" { if (process_pipe) { fake_pipe_buffer(data, &buffer); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { buffer.used = 0; } else { @@ -155,13 +155,13 @@ extern "C" { data->setting->state.status = fll_fss_extended_read(buffer, &range, &objects, &contents, 0, 0, &delimits, 0, &data->setting.state); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_fss(data->setting, data->main->error, macro_fake_f(fll_fss_extended_read), data->file_data_build_settings, range, F_true); } else { data->setting->state.status = f_fss_apply_delimit(state, delimits, &buffer); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_fss_apply_delimit)); } else { @@ -671,7 +671,7 @@ extern "C" { fake_build_print_error_setting_too_long(data->setting, data->main->warning, path_file); } else if (!error_printed) { - fake_print_error(data->setting, data->main->error, *status, function); + fake_print_error(data->setting, data->main->error, function); } } else { @@ -1111,7 +1111,7 @@ extern "C" { *status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append)); break; } @@ -1176,7 +1176,7 @@ extern "C" { *status = f_path_directory_cleanup(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_path_directory_cleanup)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_path_directory_cleanup)); break; } @@ -1185,7 +1185,7 @@ extern "C" { *status = f_string_dynamic_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, settings_single_destination[i]); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_increase_by)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by)); break; } @@ -1193,7 +1193,7 @@ extern "C" { *status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_nulless)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; } @@ -1268,7 +1268,7 @@ extern "C" { *status = f_string_dynamic_append_assure(f_path_separator_s, &setting->path_sources); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_assure)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure)); return; } @@ -1397,7 +1397,7 @@ extern "C" { data->setting->state.status = f_file_name_base(data->file_data_build_settings, &settings_file_base); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_base)); return; @@ -1431,7 +1431,7 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(fake_build_stage_built_s, values[i]); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); break; diff --git a/level_3/fake/c/main/build/object.c b/level_3/fake/c/main/build/object.c index 4ff746d..aca9afe 100644 --- a/level_3/fake/c/main/build/object.c +++ b/level_3/fake/c/main/build/object.c @@ -5,30 +5,32 @@ extern "C" { #endif #ifndef _di_fake_build_object_script_ - int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (!data || !data_build) return 0; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; - fake_build_touch(data, file_stage, status); + fake_build_touch(data, file_stage); return 0; } #endif // _di_fake_build_object_script_ #ifndef _di_fake_build_object_shared_ - int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (!data || !data_build) return 0; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0; fake_build_print_compile_object_shared(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments); + data->setting->state.status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_sources_object_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_object_add)); f_string_dynamics_resize(0, &arguments); @@ -57,15 +59,15 @@ extern "C" { if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(values[i], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for } fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e, &arguments, status); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_arguments_standard_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_arguments_standard_add)); macro_f_string_dynamics_t_delete_simple(arguments); @@ -76,8 +78,8 @@ extern "C" { macro_f_string_dynamics_t_delete_simple(arguments); - if (F_status_is_error_not(*status) && *status != F_child) { - fake_build_touch(data, file_stage, status); + if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status != F_child) { + fake_build_touch(data, file_stage); } return result; @@ -85,19 +87,20 @@ extern "C" { #endif // _di_fake_build_object_shared_ #ifndef _di_fake_build_object_static_ - int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (!data || !data_build) return 0; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0; fake_build_print_compile_object_static(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments); + data->setting->state.status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_sources_object_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_object_add)); f_string_dynamics_resize(0, &arguments); @@ -126,15 +129,15 @@ extern "C" { if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(values[i], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for } fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e, &arguments, status); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_arguments_standard_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_arguments_standard_add)); macro_f_string_dynamics_t_delete_simple(arguments); @@ -145,8 +148,8 @@ extern "C" { macro_f_string_dynamics_t_delete_simple(arguments); - if (F_status_is_error_not(*status) && *status != F_child) { - fake_build_touch(data, file_stage, status); + if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status != F_child) { + fake_build_touch(data, file_stage); } return result; diff --git a/level_3/fake/c/main/build/object.h b/level_3/fake/c/main/build/object.h index db5dade..50b0a33 100644 --- a/level_3/fake/c/main/build/object.h +++ b/level_3/fake/c/main/build/object.h @@ -26,23 +26,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_object_script_ - extern int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_object_script_ /** @@ -53,23 +54,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_object_shared_ - extern int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_object_shared_ /** @@ -80,23 +82,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_object_static_ - extern int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_object_static_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/build/objects.c b/level_3/fake/c/main/build/objects.c index c448108..f2afde0 100644 --- a/level_3/fake/c/main/build/objects.c +++ b/level_3/fake/c/main/build/objects.c @@ -17,7 +17,7 @@ extern "C" { *status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static, &arguments); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_objects_add)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); f_string_dynamics_resize(0, &arguments); @@ -62,7 +62,7 @@ extern "C" { *status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_get_file_name_without_extension)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_get_file_name_without_extension)); break; } @@ -70,7 +70,7 @@ extern "C" { *status = f_file_name_directory(sources[i]->array[j], &destination_path); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_file_name_directory)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_file_name_directory)); break; } @@ -79,7 +79,7 @@ extern "C" { *status = f_string_dynamic_prepend(data->path_build_objects, &destination_path); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_prepend)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_prepend)); break; } @@ -87,7 +87,7 @@ extern "C" { *status = f_string_dynamic_append_assure(f_path_separator_s, &destination_path); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(f_string_dynamic_append_assure)); + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_assure)); break; } @@ -165,7 +165,7 @@ extern "C" { fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e, &arguments, status); if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); break; } @@ -185,7 +185,7 @@ extern "C" { f_string_dynamics_resize(0, &arguments); if (F_status_is_error_not(*status) && *status != F_child) { - fake_build_touch(data, file_stage, status); + fake_build_touch(data, file_stage); } return result; diff --git a/level_3/fake/c/main/build/program.c b/level_3/fake/c/main/build/program.c index cb9ec32..3f513ff 100644 --- a/level_3/fake/c/main/build/program.c +++ b/level_3/fake/c/main/build/program.c @@ -5,47 +5,47 @@ extern "C" { #endif #ifndef _di_fake_build_program_script_ - int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; - fake_build_touch(data, file_stage, status); + fake_build_touch(data, file_stage); return 0; } #endif // _di_fake_build_program_script_ #ifndef _di_fake_build_program_shared_ - int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0; fake_build_print_compile_program_shared(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments); + data->setting->state.status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); f_string_dynamics_resize(0, &arguments); return 0; } - *status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments); + data->setting->state.status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_sources_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add)); f_string_dynamics_resize(0, &arguments); return 0; } - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { f_string_static_t parameter_file_name_path = f_string_static_t_initialize; parameter_file_name_path.used = data->path_build_programs_shared.used + data_build->setting.build_name.used; @@ -65,13 +65,13 @@ extern "C" { if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(values[i], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for } // If project-specific library sources exist, then the -lbuild_name needs to be added to the arguments. - if (F_status_is_error_not(*status) && data_build->setting.build_sources_library.used) { + if (F_status_is_error_not(data->setting->state.status) && data_build->setting.build_sources_library.used) { f_string_static_t link_project_library = f_string_static_t_initialize; link_project_library.used = fake_build_parameter_library_link_file_s.used + data_build->setting.build_name.used; @@ -82,13 +82,13 @@ extern "C" { memcpy(link_project_library_string, fake_build_parameter_library_link_file_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_file_s.used); memcpy(link_project_library_string + fake_build_parameter_library_link_file_s.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used); - *status = fll_execute_arguments_add(link_project_library, &arguments); + data->setting->state.status = fll_execute_arguments_add(link_project_library, &arguments); } fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_program_e, &arguments, status); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); macro_f_string_dynamics_t_delete_simple(arguments); @@ -99,8 +99,8 @@ extern "C" { macro_f_string_dynamics_t_delete_simple(arguments); - if (F_status_is_error_not(*status) && *status != F_child) { - fake_build_touch(data, file_stage, status); + if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status != F_child) { + fake_build_touch(data, file_stage); } return result; @@ -108,36 +108,36 @@ extern "C" { #endif // _di_fake_build_program_shared_ #ifndef _di_fake_build_program_static_ - int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) { + int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage) { - if (F_status_is_error(*status) || f_file_exists(file_stage, F_true) == F_true || *status == F_child) return data->main->child; + if (F_status_is_error(data->setting->state.status) || f_file_exists(file_stage, F_true) == F_true || data->setting->state.status == F_child) return data->main->child; if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0; fake_build_print_compile_program_static(data->setting, data->main->message); f_string_dynamics_t arguments = f_string_dynamics_t_initialize; - *status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments); + data->setting->state.status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_objects_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_objects_add)); f_string_dynamics_resize(0, &arguments); return 0; } - *status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments); + data->setting->state.status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fake_build_sources_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_build_sources_add)); f_string_dynamics_resize(0, &arguments); return 0; } - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { f_string_static_t source_library = f_string_static_t_initialize; source_library.used = data->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used; @@ -182,15 +182,15 @@ extern "C" { if (!values[i].used) continue; - *status = fll_execute_arguments_add(values[i], &arguments); - if (F_status_is_error(*status)) break; + data->setting->state.status = fll_execute_arguments_add(values[i], &arguments); + if (F_status_is_error(data->setting->state.status)) break; } // for } fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_program_e, &arguments, status); - if (F_status_is_error(*status)) { - fake_print_error(data->setting, data->main->error, *status, macro_fake_f(fll_execute_arguments_add)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_execute_arguments_add)); macro_f_string_dynamics_t_delete_simple(arguments); @@ -201,8 +201,8 @@ extern "C" { macro_f_string_dynamics_t_delete_simple(arguments); - if (F_status_is_error_not(*status) && *status != F_child) { - fake_build_touch(data, file_stage, status); + if (F_status_is_error_not(data->setting->state.status) && data->setting->state.status != F_child) { + fake_build_touch(data, file_stage); } return result; diff --git a/level_3/fake/c/main/build/program.h b/level_3/fake/c/main/build/program.h index 536e4d9..b9fff3b 100644 --- a/level_3/fake/c/main/build/program.h +++ b/level_3/fake/c/main/build/program.h @@ -27,23 +27,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_program_script_ - extern int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_program_script_ /** @@ -51,23 +52,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_program_shared_ - extern int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_program_shared_ /** @@ -75,23 +77,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data.setting.state.status: + * F_none on success. + * + * Status codes (with error bit) are returned on any problem. * @param data_build * The build data. * @param mode * The file mode. * @param file_stage * The specific stage file path. - * @param status - * F_none on success. - * - * Status codes (with error bit) are returned on any problem. * * @return * The return code of the execution process. * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_build_program_static_ - extern int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status); + extern int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage); #endif // _di_fake_build_program_static_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/build/skeleton.c b/level_3/fake/c/main/build/skeleton.c index 7352d9d..feab20c 100644 --- a/level_3/fake/c/main/build/skeleton.c +++ b/level_3/fake/c/main/build/skeleton.c @@ -107,7 +107,7 @@ extern "C" { } } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { if (F_status_set_fine(data->setting->state.status) == F_file_found) { data->setting->state.status = F_none; diff --git a/level_3/fake/c/main/clean.c b/level_3/fake/c/main/clean.c index 3d9c5d1..1b899f8 100644 --- a/level_3/fake/c/main/clean.c +++ b/level_3/fake/c/main/clean.c @@ -36,7 +36,7 @@ extern "C" { data->setting->state.status = F_none; } - if (F_status_is_error(setting->state.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 { diff --git a/level_3/fake/c/main/common.c b/level_3/fake/c/main/common.c index 3d6e007..3372efb 100644 --- a/level_3/fake/c/main/common.c +++ b/level_3/fake/c/main/common.c @@ -38,14 +38,19 @@ extern "C" { main->output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d; { + const uint16_t step_original = setting->state.step_small; fake_data_t data = fake_data_t_initialize; data.main = main; data.setting = setting; + setting->state.step_small = 4; + f_console_parameter_process(arguments, &main->parameters, &setting->state.status, (void *) &data); + + setting->state.step_small = step_original; } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_console_parameter_process)); @@ -67,7 +72,7 @@ extern "C" { setting->state.status = fll_program_parameter_process_context(choices, modes, F_true, main); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); fake_print_error(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_process_context)); @@ -100,7 +105,7 @@ extern "C" { setting->state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, main); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); fake_print_error(setting, main->error, setting->state.status, macro_fake_f(fll_program_parameter_process_verbosity)); @@ -270,7 +275,7 @@ extern "C" { // @todo fix this to print an error about the actual invalid character so that it can be investigated. - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); if (fake_print_error_fallback(setting, main->error, setting->state.status, macro_fake_f(f_utf_is_word_dash_plus)) == F_false) { @@ -293,7 +298,7 @@ extern "C" { if (cleanups[i]) { setting->state.status = f_path_directory_cleanup(main->parameters.arguments.array[index], variable[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); if (main->error.verbosity > f_console_verbosity_quiet_e) { @@ -313,7 +318,7 @@ extern "C" { if (variable[i]->size) { setting->state.status = f_string_dynamic_resize(0, variable[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_resize)); @@ -344,7 +349,7 @@ extern "C" { if (variable[i]->size) { setting->state.status = f_string_dynamic_resize(0, variable[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_resize)); @@ -395,7 +400,7 @@ extern "C" { if (main->parameters.array[parameters[i]].result & f_console_result_value_e) { setting->state.status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[parameters[i]].values, variable[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { if (main->error.verbosity > f_console_verbosity_quiet_e) { fake_print_line_first(setting, main->message); @@ -414,7 +419,7 @@ extern "C" { setting->state.status = f_utf_is_word_dash_plus(main->parameters.arguments.array[i].string + j, width_max, F_false); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); // @todo fix this to print an error about the actual invalid character so that it can be investigated. @@ -448,7 +453,7 @@ extern "C" { setting->state.status = f_uint8s_increase_by(1, &setting->operations); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(main->setting->state.status)) { fake_print_line_first(setting, main->message); fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_uint8s_increase_by)); @@ -475,7 +480,7 @@ extern "C" { f_console_parameters_t * const parameters = (f_console_parameters_t * const) void_parameters; fake_data_t * const data = (fake_data_t * const) void_data; - state->state->status = f_uint8s_increase(fake_default_allocation_small_d, &data->setting->operations); + state->state->status = f_uint8s_increase(fake_allocation_small_d, &data->setting->operations); if (F_status_is_error(state->state->status)) { fake_print_line_first(setting, main->message); diff --git a/level_3/fake/c/main/common/print.c b/level_3/fake/c/main/common/print.c index df99329..e2e8b7a 100644 --- a/level_3/fake/c/main/common/print.c +++ b/level_3/fake/c/main/common/print.c @@ -67,7 +67,6 @@ extern "C" { "f_uint8s_increase_by", "f_utf_is_word_dash_plus", "fl_conversion_dynamic_to_unsigned_detect", - "fl_directory_clone", "fl_directory_copy", "fl_directory_create", "fl_environment_load_name", diff --git a/level_3/fake/c/main/common/print.h b/level_3/fake/c/main/common/print.h index be4eb98..4942a07 100644 --- a/level_3/fake/c/main/common/print.h +++ b/level_3/fake/c/main/common/print.h @@ -100,7 +100,6 @@ extern "C" { fake_f_f_uint8s_increase_by_e, fake_f_f_utf_is_word_dash_plus_e, fake_f_fl_conversion_dynamic_to_unsigned_detect_e, - fake_f_fl_directory_clone_e, fake_f_fl_directory_copy_e, fake_f_fl_directory_create_e, fake_f_fl_environment_load_name_e, diff --git a/level_3/fake/c/main/fake.c b/level_3/fake/c/main/fake.c index f6073eb..7c64c22 100644 --- a/level_3/fake/c/main/fake.c +++ b/level_3/fake/c/main/fake.c @@ -9,7 +9,7 @@ extern "C" { if (!main || !setting) return; - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_line_last(setting, main->message); return; @@ -49,7 +49,7 @@ extern "C" { fake_path_generate(&data); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_data_delete(&data); return; @@ -66,7 +66,7 @@ extern "C" { setting->state.status = f_string_dynamic_append(f_string_ascii_minus_s, &setting->fakefile); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(setting, main->error, setting->state.status, macro_fake_f(f_string_dynamic_append)); } } @@ -103,7 +103,7 @@ extern "C" { setting->state.status = F_status_set_error(F_file_not); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file( setting, main->error, @@ -190,12 +190,12 @@ extern "C" { main->signal_check = 0; } - if (F_status_is_error(setting->state.status)) break; + if (F_status_is_error(data->setting->state.status)) break; } // for } } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { if (F_status_set_fine(setting->state.status) == F_interrupt) { fake_print_operation_cancelled(setting, main->message, data.operation); } @@ -277,7 +277,7 @@ extern "C" { if (return_code != 0) { data->setting->state.status = F_status_set_error(F_failure); } - else if (F_status_is_error(setting->state.status)) { + else if (F_status_is_error(data->setting->state.status)) { return_code = 1; if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { @@ -315,7 +315,7 @@ extern "C" { data->setting->state.status = f_file_exists(path_file, F_true); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_exists), path_file, f_file_operation_find_s, fll_error_file_type_file_e); return; @@ -327,7 +327,7 @@ extern "C" { data->setting->state.status = f_file_size(path_file, F_true, &size_file); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, , macro_fake_f(f_file_size), path_file, f_file_operation_read_s, fll_error_file_type_file_e); return; @@ -339,7 +339,7 @@ extern "C" { data->setting->state.status = f_string_dynamic_increase_by(size_file, buffer); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24); fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by), path_file, message, fll_error_file_type_file_e); @@ -354,7 +354,7 @@ extern "C" { data->setting->state.status = f_file_stream_open(path_file, f_string_empty_s, &file); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stream_open), path_file, f_file_operation_open_s, fll_error_file_type_file_e); return; @@ -365,7 +365,7 @@ extern "C" { f_file_stream_flush(file); f_file_stream_close(&file); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_read), path_file, f_file_operation_read_s, fll_error_file_type_file_e); } else { @@ -391,11 +391,11 @@ extern "C" { file.id = F_type_descriptor_input_d; file.stream = F_type_input_d; - file.size_read = fake_default_allocation_pipe_d; + file.size_read = fake_allocation_pipe_d; data->setting->state.status = f_string_dynamic_increase_by(fake_max_initial_buffer_d, buffer); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24); fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_string_dynamic_increase_by), f_string_ascii_minus_s, message, fll_error_file_type_file_e); @@ -420,7 +420,7 @@ extern "C" { } while (F_status_is_fine(data->setting->state.status) && data->setting->state.status != F_interrupt && data->setting->state.status != F_none_eof); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error_file(data->setting, data->main->error, macro_fake_f(f_file_stream_read_block), f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_file_e); } else { @@ -521,7 +521,7 @@ extern "C" { data->setting->state.status = F_status_set_error(F_directory_found_not); } - if (F_status_is_error(setting->state.status)) { + 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); diff --git a/level_3/fake/c/main/fake.h b/level_3/fake/c/main/fake.h index 69a2efa..8bc15a7 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -207,7 +207,7 @@ extern "C" { * @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); + 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); #endif // _di_fake_execute_ /** diff --git a/level_3/fake/c/main/fake/path_generate.c b/level_3/fake/c/main/fake/path_generate.c index 79dacab..04bfd48 100644 --- a/level_3/fake/c/main/fake/path_generate.c +++ b/level_3/fake/c/main/fake/path_generate.c @@ -57,8 +57,8 @@ extern "C" { fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(fake_path_generate_string_dynamic)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic)); return; } @@ -102,7 +102,7 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -170,7 +170,7 @@ extern "C" { fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic)); return; @@ -230,7 +230,7 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -252,7 +252,7 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(data->setting->work, values[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -277,7 +277,7 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; @@ -317,7 +317,7 @@ extern "C" { data->setting->state.status = fake_path_generate_string_dynamic(data, sources[i], values[i], parameters_size[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data->setting, data->main->error, macro_fake_f(fake_path_generate_string_dynamic)); return; @@ -348,8 +348,8 @@ extern "C" { data->setting->state.status = f_string_dynamic_append_nulless(sources[i], values[i]); - if (F_status_is_error(setting->state.status)) { - fake_print_error(data->setting, data->main->error, data->setting->state.status, macro_fake_f(f_string_dynamic_append_nulless)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; } diff --git a/level_3/fake/c/main/main.c b/level_3/fake/c/main/main.c index 9525042..24478e9 100644 --- a/level_3/fake/c/main/main.c +++ b/level_3/fake/c/main/main.c @@ -7,6 +7,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { setting.flag |= fake_main_flag_enable_documents_e; setting.flag |= fake_main_flag_enable_shared_e; setting.flag |= fake_main_flag_enable_static_e; + setting.state.step_large = fake_allocation_large_d; + setting.state.step_small = fake_allocation_small_d; + setting.state.custom = (void *) &data; f_console_parameter_t parameters[] = fake_console_parameter_t_initialize; data.parameters.array = parameters; diff --git a/level_3/fake/c/main/make.c b/level_3/fake/c/main/make.c index 5d9b947..eaf2291 100644 --- a/level_3/fake/c/main/make.c +++ b/level_3/fake/c/main/make.c @@ -47,23 +47,23 @@ extern "C" { if (!buffer.used) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - data.setting.state.status = F_status_set_error(F_parameter); + data_make->setting->state.status = F_status_set_error(F_parameter); return; } f_number_unsigned_t number = 0; - data.setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); + data_make->setting->state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, buffer, &number); - if (F_status_is_error(data.setting.state.status)) { - if (F_status_set_fine(data.setting.state.status) == F_number) { + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->setting->state.status) == F_number) { - data.setting.state.status = is_owner + data_make->setting->state.status = is_owner ? f_account_id_by_name(buffer, (uid_t *) id) : f_account_group_id_by_name(buffer, (gid_t *) id); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error( data_make->setting, data_make->main->error, @@ -74,13 +74,13 @@ extern "C" { ); } else { - if (data.setting.state.status == F_exist_not) { + if (data_make->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); + data_make->setting->state.status = F_status_set_error(F_exist_not); } else { - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; } } } @@ -116,10 +116,10 @@ extern "C" { return; } - data.setting.state.status = f_file_mode_from_string(buffer, data->main->umask, mode, replace); + data_make->setting->state.status = f_file_mode_from_string(buffer, data->main->umask, mode, replace); - if (F_status_is_error(data.setting.state.status)) { - if (F_status_set_fine(data.setting.state.status) == F_syntax) { + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->setting->state.status) == F_syntax) { fake_print_error_mode_invalid(data_make->setting, data_make->main->error, buffer); } else { diff --git a/level_3/fake/c/main/make/load_fakefile.c b/level_3/fake/c/main/make/load_fakefile.c index 4f7e910..5509309 100644 --- a/level_3/fake/c/main/make/load_fakefile.c +++ b/level_3/fake/c/main/make/load_fakefile.c @@ -5,14 +5,15 @@ extern "C" { #endif #ifndef _di_fake_make_load_fakefile_ - void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe, f_status_t * const status) { + void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe) { - if (F_status_is_error(*status)) return; + if (!data_make) return; + if (F_status_is_error(data->setting->state.status)) return; if (fll_program_standard_signal_received(data_make->main)) { fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting->state.status = F_status_set_error(F_interrupt); return; } @@ -20,21 +21,21 @@ extern "C" { data_make->fakefile.used = 0; if (process_pipe) { - *status = fake_pipe_buffer(data_make->data, &data_make->buffer); + fake_pipe_buffer(data_make->data, &data_make->buffer); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { data_make->buffer.used = 0; } else { - *status = f_string_dynamic_append_assure(f_string_eol_s, &data_make->buffer); + data->setting->state.status = f_string_dynamic_append_assure(f_string_eol_s, &data_make->buffer); } } - if (F_status_is_error_not(*status)) { - *status = fake_file_buffer(data_make->data, data_make->data->file_data_build_fakefile, process_pipe ? F_false : F_true, &data_make->buffer); + if (F_status_is_error_not(data->setting->state.status)) { + fake_file_buffer(data_make->data, data_make->data->file_data_build_fakefile, process_pipe ? F_false : F_true, &data_make->buffer); } - if (F_status_is_error(*status)) return; + if (F_status_is_error(data->setting->state.status)) return; if (!data_make->buffer.used) { fake_make_print_warning_fakefile_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile); @@ -49,18 +50,17 @@ extern "C" { { f_string_range_t range = macro_f_string_range_t_initialize2(data_make->buffer.used); f_fss_comments_t comments = f_fss_comments_t_initialize; - f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); - *status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments); + fll_fss_basic_list_read(data_make->buffer, data->setting->state, &range, &list_objects, &list_contents, &delimits, 0, &comments); - if (F_status_is_error(*status)) { - fake_print_error_fss(data_make->setting, data_make->main->error, *status, macro_fake_f(fll_fss_basic_list_read), data_make->data->file_data_build_fakefile, range, F_true); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_basic_list_read), data_make->data->file_data_build_fakefile, range, F_true); } else { - *status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + data->setting->state.status = f_fss_apply_delimit(state, delimits, &data_make->buffer); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_fss_apply_delimit)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit)); } delimits.used = 0; @@ -68,7 +68,7 @@ extern "C" { macro_f_fss_comments_t_delete_simple(comments); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { macro_f_fss_objects_t_delete_simple(list_objects); macro_f_fss_contents_t_delete_simple(list_contents); macro_f_fss_delimits_t_delete_simple(delimits); @@ -82,14 +82,13 @@ extern "C" { bool missing_settings = F_true; f_fss_set_t settings = f_fss_set_t_initialize; - f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); if (list_objects.used > data_make->fakefile.size) { - macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used); + macro_f_fss_nameds_t_resize((data->setting->state.status), data_make->fakefile, list_objects.used); } - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(macro_f_fss_nameds_t_resize)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(macro_f_fss_nameds_t_resize)); macro_f_fss_set_t_delete_simple(settings); macro_f_fss_objects_t_delete_simple(list_objects); @@ -108,7 +107,7 @@ extern "C" { if (fll_program_standard_signal_received(data_make->main)) { fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received); - *status = F_status_set_error(F_interrupt); + data->setting->state.status = F_status_set_error(F_interrupt); break; } @@ -126,18 +125,18 @@ extern "C" { delimits.used = 0; content_range = list_contents.array[i].array[0]; - *status = fll_fss_extended_read(data_make->buffer, state, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0); + data->setting->state.status = fll_fss_extended_read(data_make->buffer, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0, &data->setting->state); - if (F_status_is_error(*status)) { - fake_print_error_fss(data_make->setting, data_make->main->error, *status, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true); break; } - *status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + data->setting->state.status = f_fss_apply_delimit(state, delimits, &data_make->buffer); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_fss_apply_delimit)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit)); break; } @@ -167,18 +166,18 @@ extern "C" { if (list_contents.array[i].used) { content_range = list_contents.array[i].array[0]; - *status = fll_fss_extended_read(data_make->buffer, state, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0); + fll_fss_extended_read(data_make->buffer, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0, &data->setting->state); - if (F_status_is_error(*status)) { - fake_print_error_fss(data_make->setting, data_make->main->error, *status, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error_fss(data_make->setting, data_make->main->error, macro_fake_f(fll_fss_extended_read), data_make->data->file_data_build_fakefile, content_range, F_true); break; } - *status = f_fss_apply_delimit(state, delimits, &data_make->buffer); + data->setting->state.status = f_fss_apply_delimit(state, delimits, &data_make->buffer); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_fss_apply_delimit)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_fss_apply_delimit)); break; } @@ -192,7 +191,7 @@ extern "C" { macro_f_fss_contents_t_delete_simple(list_contents); macro_f_fss_delimits_t_delete_simple(delimits); - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { macro_f_fss_set_t_delete_simple(settings); return; @@ -201,7 +200,7 @@ extern "C" { if (missing_main) { fake_make_print_error_fakefile_section_missing(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, fake_make_item_main_s); - *status = F_status_set_error(F_failure); + data->setting->state.status = F_status_set_error(F_failure); macro_f_fss_set_t_delete_simple(settings); @@ -212,22 +211,22 @@ extern "C" { { f_string_t function_name = macro_fake_f(macro_f_string_map_multis_t_resize); - macro_f_string_map_multis_t_resize(*status, data_make->setting_make.parameter, fake_default_allocation_small_d); + data->setting->state.status = f_string_map_multis_resize(data->setting->state.step_small, &data_make->setting_make.parameter); - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { data_make->setting_make.parameter.used = 1; function_name = macro_fake_f(f_string_dynamic_append); - *status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].name); + data->setting->state.status = f_string_dynamic_append(fake_make_setting_return_s, &data_make->setting_make.parameter.array[0].name); } - if (F_status_is_error_not(*status)) { + if (F_status_is_error_not(data->setting->state.status)) { function_name = macro_fake_f(f_string_dynamics_resize); - *status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value); + data->setting->state.status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value); } - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, function_name); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, function_name); macro_f_fss_set_t_delete_simple(settings); @@ -252,8 +251,8 @@ extern "C" { fake_make_load_fakefile_setting_compiler(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_compiler); } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_environment_s.string, data_make->buffer, fake_make_setting_environment_s.used, settings.objects.array[i]) == F_equal_to) { - *status = fake_make_load_fakefile_setting_environment(data_make, &settings.contents.array[i]); - if (F_status_is_error(*status)) break; + data->setting->state.status = fake_make_load_fakefile_setting_environment(data_make, &settings.contents.array[i]); + if (F_status_is_error(data->setting->state.status)) break; } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_fail_s.string, data_make->buffer, fake_make_setting_fail_s.used, settings.objects.array[i]) == F_equal_to) { fake_make_load_fakefile_setting_fail(data_make, &settings.objects.array[i], &settings.contents.array[i]); @@ -262,27 +261,27 @@ extern "C" { fake_make_load_fakefile_setting_indexer(data_make, &settings.objects.array[i], &settings.contents.array[i], &range_indexer); } else if (fl_string_dynamic_partial_compare_string(fake_make_setting_parameter_s.string, data_make->buffer, fake_make_setting_parameter_s.used, settings.objects.array[i]) == F_equal_to) { - *status = fake_make_load_fakefile_setting_parameter(data_make, &settings.objects.array[i], &settings.contents.array[i]); - if (F_status_is_error(*status)) break; + data->setting->state.status = fake_make_load_fakefile_setting_parameter(data_make, &settings.objects.array[i], &settings.contents.array[i]); + if (F_status_is_error(data->setting->state.status)) break; } } // for - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { macro_f_fss_set_t_delete_simple(settings); return; } } - if (F_status_is_error_not(*status) && data_make->setting_make.load_build) { - fake_build_load_setting(data_make->data, 0, F_false, &data_make->setting_build, status); + if (F_status_is_error_not(data->setting->state.status) && data_make->setting_make.load_build) { + fake_build_load_setting(data_make->data, 0, F_false, &data_make->setting_build); - if (F_status_is_error(*status) && *status != F_status_set_error(F_interrupt)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fake_build_load_setting)); + if (F_status_is_error(data->setting->state.status) && data->setting->state.status != F_status_set_error(F_interrupt)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_build_load_setting)); } } - if (F_status_is_error(*status)) { + if (F_status_is_error(data->setting->state.status)) { macro_f_fss_set_t_delete_simple(settings); return; @@ -292,18 +291,18 @@ extern "C" { if (range_compiler) { data_make->setting_build.build_compiler.used = 0; - *status = f_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler); + data->setting->state.status = f_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler); } - if (F_status_is_error_not(*status) && range_indexer) { + if (F_status_is_error_not(data->setting->state.status) && range_indexer) { data_make->setting_build.build_indexer.used = 0; - *status = f_string_dynamic_partial_append(data_make->buffer, *range_indexer, &data_make->setting_build.build_indexer); + data->setting->state.status = f_string_dynamic_partial_append(data_make->buffer, *range_indexer, &data_make->setting_build.build_indexer); } - if (F_status_is_error(*status)) { - if (F_status_set_fine(*status) != F_interrupt) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_partial_append)); + if (F_status_is_error(data->setting->state.status)) { + if (F_status_set_fine(data->setting->state.status) != F_interrupt) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_partial_append)); } macro_f_fss_set_t_delete_simple(settings); @@ -311,16 +310,20 @@ extern "C" { return; } - *status = fake_make_load_fakefile_setting_define_and_parameter(data_make->data, data_make, &settings); + data->setting->state.status = fake_make_load_fakefile_setting_define_and_parameter(data_make->data, data_make, &settings); macro_f_fss_set_t_delete_simple(settings); } + + data->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_ #ifndef _di_fake_make_load_fakefile_setting_build_ void fake_make_load_fakefile_setting_build(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) { + if (!data_make || !object || !content) return; + if (content->used) { if (fl_string_dynamic_partial_compare_string(fake_common_setting_bool_yes_s.string, data_make->buffer, fake_common_setting_bool_yes_s.used, content->array[0]) == F_equal_to) { data_make->setting_make.load_build = F_true; @@ -345,6 +348,8 @@ extern "C" { #ifndef _di_fake_make_load_fakefile_setting_compiler_ void fake_make_load_fakefile_setting_compiler(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content, f_string_range_t **range_compiler) { + if (!data_make || !object || !content || !range_compiler) return; + if (content->used) { *range_compiler = &content->array[content->used - 1]; @@ -359,15 +364,16 @@ extern "C" { #endif // _di_fake_make_load_fakefile_setting_compiler_ #ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_ - f_status_t fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings) { + void fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings) { - f_status_t status = F_none; + if (!data || !data_make || !settings) return; +; f_string_map_multis_t define = f_string_map_multis_t_initialize; // Load the fakefile "settings" as if they are build "settings". - fake_build_load_setting_process(data, F_false, data->file_data_build_fakefile, 0, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build, &status); + fake_build_load_setting_process(data, F_false, data->file_data_build_fakefile, 0, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build); - if (F_status_is_error_not(status) && settings->objects.used) { + if (F_status_is_error_not(data->setting->state.status) && settings->objects.used) { const f_string_static_t settings_name[] = { fake_make_setting_define_s, fake_make_setting_parameter_s, @@ -378,19 +384,18 @@ extern "C" { &data_make->setting_make.parameter, }; - status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0); + data->setting->state.status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fll_fss_snatch_map_apart)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(fll_fss_snatch_map_apart)); - macro_f_string_map_multis_t_delete_simple(define); + f_string_map_multis_resize(0, &define); - return status; + return; } } if (define.used) { - f_status_t status_validate = F_none; f_string_dynamic_t combined = f_string_dynamic_t_initialize; f_array_length_t i = 0; @@ -398,28 +403,28 @@ extern "C" { for (; i < define.used; ++i) { - status_validate = fake_make_operate_validate_define_name(define.array[i].name); + fake_make_operate_validate_define_name(define.array[i].name); - if (status_validate) { + if (data->setting->state.status) { combined.used = 0; for (j = 0; j < define.array[i].value.used; ++j) { - status = f_string_dynamic_mash(f_string_space_s, define.array[i].value.array[j], &combined); + data->setting->state.status = f_string_dynamic_mash(f_string_space_s, define.array[i].value.array[j], &combined); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_string_dynamic_mash)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_string_dynamic_mash)); break; } } // for - if (F_status_is_error(status)) break; + if (F_status_is_error(data->setting->state.status)) break; - status = f_environment_set(define.array[i].name, combined, F_true); + data->setting->state.status = f_environment_set(define.array[i].name, combined, F_true); - if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(f_environment_set)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data->setting, data->main->error, macro_fake_f(f_environment_set)); break; } @@ -427,7 +432,7 @@ extern "C" { else { fake_make_print_error_define_invalid_character(data_make->setting, data_make->main->error, define.array[i].name); - status = F_status_set_error(F_failure); + data->setting->state.status = F_status_set_error(F_failure); break; } @@ -438,16 +443,14 @@ extern "C" { f_string_map_multis_resize(0, &define); - if (F_status_is_error(status)) return status; + if (F_status_is_error(data->setting->state.status)) return; - return F_none; + data->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_setting_define_and_parameter_ #ifndef _di_fake_make_load_fakefile_setting_environment_ - f_status_t fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_fss_content_t * const content) { - - f_status_t status = F_none; + void fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_fss_content_t * const content) { f_string_dynamic_t name_define = f_string_dynamic_t_initialize; @@ -458,10 +461,10 @@ extern "C" { for (; i < content->used; ++i) { - status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &name_define); + data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &name_define); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_partial_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_partial_append_nulless)); break; } @@ -473,28 +476,28 @@ extern "C" { } // for if (j == data_make->setting_build.environment.used) { - status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->setting_build.environment); + data->setting->state.status = f_string_dynamics_increase(fake_allocation_small_d, &data_make->setting_build.environment); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; } data_make->setting_build.environment.array[j].used = 0; - status = f_string_dynamic_increase_by(name_define.used + 1, &data_make->setting_build.environment.array[j]); + data->setting->state.status = f_string_dynamic_increase_by(name_define.used + 1, &data_make->setting_build.environment.array[j]); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_increase_by)); + 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_increase_by)); break; } - status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); + data->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); - 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)); break; } @@ -506,10 +509,10 @@ extern "C" { data_make->setting_build.environment.array[j].used = 0; - status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); + data->setting->state.status = f_string_dynamic_append_nulless(name_define, &data_make->setting_build.environment.array[j]); - 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)); break; } @@ -524,9 +527,9 @@ extern "C" { f_string_dynamic_resize(0, &name_define); - if (F_status_is_error(status)) return status; + if (F_status_is_error(data->setting->state.status)) return; - return F_none; + data->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_setting_environment_ @@ -574,11 +577,9 @@ extern "C" { #endif // _di_fake_make_load_fakefile_setting_indexer_ #ifndef _di_fake_make_load_fakefile_setting_parameter_ - f_status_t fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) { + void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content) { if (content->used) { - f_status_t status = F_none; - if (fl_string_dynamic_partial_compare_string(fake_make_setting_return_s.string, data_make->buffer, fake_make_setting_return_s.used, content->array[0]) == F_equal_to) { if (content->used > 1) { @@ -587,24 +588,24 @@ extern "C" { for (f_array_length_t i = 1; i < content->used; ++i) { - status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &data_make->setting_make.parameter.array[0].value.array[0]); + data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content->array[i], &data_make->setting_make.parameter.array[0].value.array[0]); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_partial_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_partial_append_nulless)); break; } - status = f_string_dynamic_append_assure(f_string_space_s, &data_make->setting_make.parameter.array[0].value.array[0]); + data->setting->state.status = f_string_dynamic_append_assure(f_string_space_s, &data_make->setting_make.parameter.array[0].value.array[0]); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_append_assure)); + 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_assure)); break; } } // for - if (F_status_is_error(status)) return status; + if (F_status_is_error(data->setting->state.status)) return; } } } @@ -612,7 +613,7 @@ extern "C" { fake_make_print_warning_setting_content_empty(data_make->setting, data_make->main->warning, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_return_s); } - return F_none; + data->setting->state.status = F_none; } #endif // _di_fake_make_load_fakefile_setting_parameter_ diff --git a/level_3/fake/c/main/make/load_fakefile.h b/level_3/fake/c/main/make/load_fakefile.h index 26ee88f..db4088b 100644 --- a/level_3/fake/c/main/make/load_fakefile.h +++ b/level_3/fake/c/main/make/load_fakefile.h @@ -23,22 +23,21 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param process_pipe - * If TRUE, then use the program input pipe. - * If FALSE, then ignore the program input pipe. - * @param status - * The return status. * - * F_none on success. + * This alters data_make.settings.state.status: + * F_none on success. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. * - * Status codes (with error bit) are returned on any problem. + * Errors (with error bit) from: fake_build_load_setting(). + * @param process_pipe + * If TRUE, then use the program input pipe. + * If FALSE, then ignore the program input pipe. * * @see fake_build_load_setting() */ #ifndef _di_fake_make_load_fakefile_ - extern void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe, f_status_t * const status); + extern void fake_make_load_fakefile(fake_make_data_t * const data_make, const bool process_pipe); #endif // _di_fake_make_load_fakefile_ /** @@ -46,6 +45,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This does not alter data_make.setting.state.status. * @param object * The setting object. * @param content @@ -60,6 +61,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This does not alter data_make.setting.state.status. * @param object * The setting object. * @param content @@ -76,24 +79,24 @@ extern "C" { * * @param data * The program data. + * + * This alters data_make.setting.state.status: + * F_none on success. + * + * Errors (with error bit) from: f_environment_set(). + * Errors (with error bit) from: f_string_dynamic_mash_nulless(). + * Errors (with error bit) from: fll_fss_snatch_map_apart(). * @param data_make * All make related setting data, including data from the fakefile and the build settings file. * @param settings * The settings data. * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_environment_set(). - * Errors (with error bit) from: f_string_dynamic_mash_nulless(). - * Errors (with error bit) from: fll_fss_snatch_map_apart(). - * * @see f_environment_set() * @see f_string_dynamic_mash_nulless() * @see fll_fss_snatch_map_apart() */ #ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_ - extern f_status_t fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings); + extern void fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings); #endif // _di_fake_make_load_fakefile_setting_define_and_parameter_ /** @@ -101,22 +104,22 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param content - * The setting content. * - * @return - * F_none on success. + * This alters data_make.setting.state.status: + * F_none on success. * - * Errors (with error bit) from: f_string_dynamic_append(). - * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: f_string_dynamics_increase(). + * Errors (with error bit) from: f_string_dynamic_append(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamics_increase(). + * @param content + * The setting content. * * @see f_string_dynamic_append() * @see f_string_dynamic_partial_append_nulless() * @see f_string_dynamics_increase() */ #ifndef _di_fake_make_load_fakefile_setting_environment_ - extern f_status_t fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_fss_content_t * const content); + extern void fake_make_load_fakefile_setting_environment(fake_make_data_t * const data_make, f_fss_content_t * const content); #endif // _di_fake_make_load_fakefile_setting_environment_ /** @@ -124,6 +127,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This does not alter data_make.setting.state.status. * @param object * The setting object. * @param content @@ -138,6 +143,8 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This does not alter data_make.setting.state.status. * @param object * The setting object. * @param content @@ -157,24 +164,25 @@ 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. + * + * Errors (with error bit) from: f_string_append_assure(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: fake_make_load_fakefile_setting_define_and_parameter(). * @param object * The setting object. * @param content * The setting content. * - * @return - * F_none on success. - * - * Errors (with error bit) from: f_string_append_assure(). - * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). - * * @see f_string_append_assure() * @see f_string_dynamic_partial_append_nulless() * * @see fake_make_load_fakefile_setting_define_and_parameter() */ #ifndef _di_fake_make_load_fakefile_setting_parameter_ - extern f_status_t fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content); + extern void fake_make_load_fakefile_setting_parameter(fake_make_data_t * const data_make, f_fss_object_t * const object, f_fss_content_t * const content); #endif // _di_fake_make_load_fakefile_setting_parameter_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/make/load_parameters.c b/level_3/fake/c/main/make/load_parameters.c index f68bc2c..48789a2 100644 --- a/level_3/fake/c/main/make/load_parameters.c +++ b/level_3/fake/c/main/make/load_parameters.c @@ -10,14 +10,14 @@ extern "C" { if (F_status_is_error(*status)) return; if (data_make->main->context.mode != f_color_mode_none_e) { - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->parameter.color); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.color); if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->parameter_option.color); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.color); } if (F_status_is_error(*status)) { - 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; } @@ -64,7 +64,7 @@ extern "C" { } if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); return; } @@ -74,14 +74,14 @@ extern "C" { } if (data_make->main->error.verbosity != f_console_verbosity_normal_e) { - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->parameter.verbosity); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter.verbosity); if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->parameter_option.verbosity); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->parameter_option.verbosity); } if (F_status_is_error(*status)) { - 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; } @@ -140,7 +140,7 @@ extern "C" { } if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); return; } @@ -189,23 +189,23 @@ extern "C" { for (j = 0; j < source[i].used; ++j) { if (destination[i]->used + 2 > destination[i]->size) { - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, destination[i]); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); if (F_status_is_error(*status)) { - 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; } } - *status = f_string_dynamics_increase(fake_default_allocation_small_d, destination_option[i]); + *status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase(fake_default_allocation_small_d, destination_value[i]); + *status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); } if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); return; } @@ -226,7 +226,7 @@ extern "C" { } 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)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -234,10 +234,10 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, destination[i]); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); if (F_status_is_error(*status)) { - 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; } @@ -249,7 +249,7 @@ extern "C" { } 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)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -338,23 +338,23 @@ extern "C" { if (!(console[i]->result & f_console_result_found_e)) continue; if (destination[i]->used + 2 > destination[i]->size) { - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, destination[i]); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); if (F_status_is_error(*status)) { - 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; } } - *status = f_string_dynamics_increase(fake_default_allocation_small_d, destination_option[i]); + *status = f_string_dynamics_increase(fake_allocation_small_d, destination_option[i]); if (F_status_is_error_not(*status)) { - *status = f_string_dynamics_increase(fake_default_allocation_small_d, destination_value[i]); + *status = f_string_dynamics_increase(fake_allocation_small_d, destination_value[i]); } if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); return; } @@ -375,7 +375,7 @@ extern "C" { } 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)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; } @@ -383,10 +383,10 @@ extern "C" { ++destination[i]->used; ++destination_option[i]->used; - *status = f_string_dynamics_increase_by(fake_default_allocation_small_d, destination[i]); + *status = f_string_dynamics_increase_by(fake_allocation_small_d, destination[i]); if (F_status_is_error(*status)) { - 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; } @@ -398,7 +398,7 @@ extern "C" { } 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)); + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); return; } diff --git a/level_3/fake/c/main/make/operate.c b/level_3/fake/c/main/make/operate.c index 387bf07..843e8a3 100644 --- a/level_3/fake/c/main/make/operate.c +++ b/level_3/fake/c/main/make/operate.c @@ -5,20 +5,22 @@ extern "C" { #endif #ifndef _di_fake_make_operate_ - f_status_t fake_make_operate(fake_data_t * const data) { + void fake_make_operate(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; } } fake_make_print_now_making(data->setting, data->main->message, data->setting->fakefile); - f_status_t status = F_none; - f_array_lengths_t section_stack = f_array_lengths_t_initialize; fake_make_data_t data_make = fake_make_data_t_initialize; @@ -26,50 +28,52 @@ extern "C" { data_make.main = data->main; data_make.setting = data->setting; - status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make.path.stack); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make.path.stack); - if (F_status_is_error(status)) { - fake_print_error(data_make.setting, data_make.main->error, status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_string_dynamics_increase)); - return status; + return; } - status = f_path_current(F_true, &data_make.path.stack.array[0]); + data->setting->state.status = f_path_current(F_true, &data_make.path.stack.array[0]); - if (F_status_is_error(status)) { - fake_print_error(data_make.setting, data_make.main->error, status, macro_fake_f(f_path_current)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_path_current)); fake_make_data_delete(&data_make); - return status; + return; } - status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id); + data->setting->state.status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id); - if (F_status_is_error(status)) { - fake_print_error(data_make.setting, data_make.main->error, status, macro_fake_f(f_directory_open)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make.setting, data_make.main->error, macro_fake_f(f_directory_open)); fake_make_data_delete(&data_make); - return status; + return; } data_make.path.stack.used = 1; - fake_make_load_parameters(&data_make, &status); + fake_make_load_parameters(&data_make); - fake_make_load_fakefile(&data_make, data->main->pipe & fll_program_data_pipe_input_e, &status); + fake_make_load_fakefile(&data_make, data->main->pipe & fll_program_data_pipe_input_e); - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting->state.status)) { fake_make_data_delete(&data_make); - return status; + return; } if (!data_make.buffer.used) { fake_make_data_delete(&data_make); - return F_data_not; + data->setting->state.status = F_data_not; + + return; } if (data_make.setting_make.fail == fake_make_operation_fail_exit_e) { @@ -106,7 +110,7 @@ extern "C" { f_string_range_t range = f_string_range_t_initialize; f_array_length_t index = 0; - status = F_none; + data->setting->state.status = F_none; // Validate the remaining parameters. for (i = 0; i < data->main->parameters.remaining.used; ++i) { @@ -114,7 +118,7 @@ extern "C" { index = data->main->parameters.remaining.array[i]; if (!data->main->parameters.arguments.array[index].used) { - status = F_status_set_error(F_parameter); + data->setting->state.status = F_status_set_error(F_parameter); break; } @@ -127,13 +131,13 @@ extern "C" { } // for if (j == data_make.fakefile.used) { - status = F_status_set_error(F_parameter); + data->setting->state.status = F_status_set_error(F_parameter); break; } } // for - if (F_status_is_error(status)) { + if (F_status_is_error(data->setting->state.status)) { fake_make_print_error_argument_invalid_section(data->setting, data->main->error, data->main->parameters.arguments.array[data->main->parameters.remaining.array[i]]); } else { @@ -149,46 +153,54 @@ extern "C" { if (fl_string_dynamic_partial_compare(data->main->parameters.arguments.array[index], data_make.buffer, range, data_make.fakefile.array[j].name) == F_equal_to) { { - int result = fake_make_operate_section(&data_make, j, §ion_stack, &status); + int result = fake_make_operate_section(&data_make, j, §ion_stack,); - if (status == F_child) { + if (data->setting->state.status == F_child) { data->main->child = result; break; } } - const f_status_t status_path = f_path_change_at(data_make.path.top.id); + const f_status_t status = data->setting->state.status; + + data->setting->state.status = f_path_change_at(data_make.path.top.id); - if (F_status_is_error(status_path)) { - fake_make_print_warning_cannot_change_back(data->setting, data->main->warning, data_make.path.stack.array[0], status_path); + if (F_status_is_error(data->setting->state.status)) { + fake_make_print_warning_cannot_change_back(data->setting, data->main->warning, data_make.path.stack.array[0]); } + data->setting->state.status = status; + break; } - if (F_status_is_error(status)) break; + if (F_status_is_error(data->setting->state.status)) break; } // for - if (status == F_child || F_status_is_error(status)) break; + if (data->setting->state.status == F_child || F_status_is_error(data->setting->state.status)) break; } // for } } else { { - const int result = fake_make_operate_section(&data_make, data_make.id_main, §ion_stack, &status); + const int result = fake_make_operate_section(&data_make, data_make.id_main, §ion_stack); - if (status == F_child) { + if (data->setting->state.status == F_child) { data->main->child = result; } } - if (status != F_child) { - const f_status_t status_path = f_path_change_at(data_make.path.top.id); + if (data->setting->state.status != F_child) { + const f_status_t status = data->setting->state.status; + + data->setting->state.status = f_path_change_at(data_make.path.top.id); - if (F_status_is_error(status_path)) { - fake_make_print_warning_cannot_change_back(data->setting, data->main->warning, data_make.path.stack.array[0], status_path); + if (F_status_is_error(data->setting->state.status)) { + fake_make_print_warning_cannot_change_back(data->setting, data->main->warning, data_make.path.stack.array[0]); } + + data->setting->state.status = status; } } @@ -198,21 +210,24 @@ extern "C" { f_array_lengths_resize(0, §ion_stack); fake_make_data_delete(&data_make); - return status; + if (F_status_is_error_not(data->setting->state.status)) { + data->setting->state.status = F_none; + } } #endif // _di_fake_make_operate_ #ifndef _di_fake_make_operate_expand_ - void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes, f_status_t * const status) { + void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes) { - if (F_status_is_error(*status)) return; + if (!data_make) return; + if (F_status_is_error(data->setting->state.status)) return; if (!content.used) return; // Pre-allocate the known arguments size. - *status = f_string_dynamics_increase_by(content.used, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase_by(content.used, &data_make->cache_arguments); - if (F_status_is_error(*status) || *status == F_string_too_large) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase_by)); + if (F_status_is_error(data->setting->state.status) || data->setting->state.status == F_string_too_large) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); return; } @@ -223,8 +238,6 @@ extern "C" { f_iki_data_t *iki_data = &data_make->cache_iki; - f_state_t state = macro_f_state_t_initialize_1(fake_allocation_large_d, fake_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, (void *) data_make->main, 0); - f_string_range_t range = f_string_range_t_initialize; f_string_map_multis_t *parameter = &data_make->setting_make.parameter; @@ -328,10 +341,14 @@ extern "C" { &data_make->parameter_value.work, }; - *status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.flag = 0; + data->setting->state.handle = 0; + data->setting->state.data = 0; + + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); return; } @@ -350,10 +367,10 @@ extern "C" { if (quotes.array[i]) { ++data_make->cache_arguments.used; - *status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; } @@ -366,11 +383,11 @@ extern "C" { range = content.array[i]; - *status = fl_iki_read(&data_make->buffer, &range, iki_data, state); + data->setting->state.status = fl_iki_read(&data_make->buffer, &range, iki_data, state); - if (F_status_is_error(*status)) { - if (F_status_set_fine(*status) != F_interrupt) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fl_iki_read)); + if (F_status_is_error(data->setting->state.status)) { + if (F_status_set_fine(data->setting->state.status) != F_interrupt) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_iki_read)); } break; @@ -388,10 +405,10 @@ extern "C" { range.start = content.array[i].start; range.stop = iki_data->variable.array[0].start - 1; - *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_partial_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_partial_append_nulless)); break; } @@ -403,31 +420,31 @@ extern "C" { is = 0; - *status = fl_string_dynamic_partial_compare_string(vocabulary_define.string, data_make->buffer, vocabulary_define.used, iki_data->vocabulary.array[j]); + data->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_define.string, data_make->buffer, vocabulary_define.used, iki_data->vocabulary.array[j]); - if (*status == F_equal_to) { + if (data->setting->state.status == F_equal_to) { is = 2; iki_type |= 0x2; } - else if (*status == F_equal_to_not) { - *status = fl_string_dynamic_partial_compare_string(vocabulary_parameter.string, data_make->buffer, vocabulary_parameter.used, iki_data->vocabulary.array[j]); + else if (data->setting->state.status == F_equal_to_not) { + data->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_parameter.string, data_make->buffer, vocabulary_parameter.used, iki_data->vocabulary.array[j]); - if (*status == F_equal_to) { + if (data->setting->state.status == F_equal_to) { is = 1; iki_type |= 0x1; } - else if (*status == F_equal_to_not) { - *status = fl_string_dynamic_partial_compare_string(vocabulary_context.string, data_make->buffer, vocabulary_context.used, iki_data->vocabulary.array[j]); + else if (data->setting->state.status == F_equal_to_not) { + data->setting->state.status = fl_string_dynamic_partial_compare_string(vocabulary_context.string, data_make->buffer, vocabulary_context.used, iki_data->vocabulary.array[j]); - if (*status == F_equal_to) { + if (data->setting->state.status == F_equal_to) { is = 3; iki_type |= 0x4; } } } - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fl_string_dynamic_partial_compare)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_string_dynamic_partial_compare)); break; } @@ -439,19 +456,19 @@ extern "C" { if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_return_s.string, data_make->buffer, fake_make_parameter_variable_return_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->setting_make.parameter.array[0].value.array[0].used) { - *status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append_nulless(data_make->setting_make.parameter.array[0].value.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*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)); break; } } else { - *status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append(f_string_ascii_0_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + 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)); break; } @@ -462,27 +479,27 @@ extern "C" { else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_top_s.string, data_make->buffer, fake_make_parameter_variable_top_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - *status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[0].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_increase_by)); + 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_increase_by)); break; } - *status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[0], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + 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)); break; } // For safe path handling, always append the trailing slash. - *status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append_assure)); + 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_assure)); break; } @@ -493,27 +510,27 @@ extern "C" { else if (fl_string_dynamic_partial_compare_string(fake_make_parameter_variable_current_s.string, data_make->buffer, fake_make_parameter_variable_current_s.used, iki_data->content.array[j]) == F_equal_to) { if (data_make->path.stack.used) { - *status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_increase_by(data_make->path.stack.array[data_make->path.stack.used - 1].used + f_path_separator_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_increase_by)); + 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_increase_by)); break; } - *status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append(data_make->path.stack.array[data_make->path.stack.used - 1], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + 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)); break; } // For safe path handling, always append the trailing slash. - *status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append_assure)); + 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_assure)); break; } @@ -544,10 +561,10 @@ extern "C" { } // for } // for - *status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_increase_by)); + 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_increase_by)); break; } @@ -557,19 +574,19 @@ extern "C" { if (!reserved_value[k]->array[l].used) continue; if (separate) { - *status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + 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)); break; } } - *status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*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)); break; } @@ -589,10 +606,10 @@ extern "C" { if (separate) { ++data_make->cache_arguments.used; - *status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; } @@ -600,10 +617,10 @@ extern "C" { data_make->cache_arguments.array[data_make->cache_arguments.used].used = 0; } - *status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append_nulless(reserved_value[k]->array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*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)); break; } @@ -615,10 +632,10 @@ extern "C" { break; } // for - if (F_status_is_error(*status)) break; + if (F_status_is_error(data->setting->state.status)) break; } - if (unmatched && F_status_is_error_not(*status)) { + if (unmatched && F_status_is_error_not(data->setting->state.status)) { for (k = 0; k < parameter->used; ++k) { // Check against IKI variable list. @@ -642,10 +659,10 @@ extern "C" { } // for } // for - *status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_increase_by(l + f_string_space_s.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_increase_by)); + 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_increase_by)); break; } @@ -657,10 +674,10 @@ extern "C" { if (separate) { if (quotes.array[i]) { - *status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_append)); + 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)); break; } @@ -670,10 +687,10 @@ extern "C" { else { ++data_make->cache_arguments.used; - *status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; } @@ -682,10 +699,10 @@ extern "C" { } } - *status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - 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)); break; } @@ -693,47 +710,47 @@ extern "C" { separate = F_true; } // for - if (F_status_is_error(*status)) break; + if (F_status_is_error(data->setting->state.status)) break; } break; } // for } - if (F_status_is_error(*status)) break; + if (F_status_is_error(data->setting->state.status)) break; if (unmatched) { - *status = fake_make_operate_expand_build(data_make, quotes.array[i], iki_data->content.array[j]); + fake_make_operate_expand_build(data_make, quotes.array[i], iki_data->content.array[j]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fake_make_operate_expand_build)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_build)); break; } - if (*status == F_true) { + if (data->setting->state.status == F_true) { iki_type |= 0x8; } } } else if (is == 2) { - *status = fake_make_operate_expand_environment(data_make, quotes.array[i], iki_data->content.array[j]); + fake_make_operate_expand_environment(data_make, quotes.array[i], iki_data->content.array[j]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fake_make_operate_expand_environment)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_environment)); break; } - if (*status == F_true) { + if (data->setting->state.status == F_true) { iki_type |= 0x8; } } else if (is == 3) { - *status = fake_make_operate_expand_context(data_make, quotes.array[i], iki_data->content.array[j]); + fake_make_operate_expand_context(data_make, quotes.array[i], iki_data->content.array[j]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(fake_make_operate_expand_context)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_expand_context)); break; } @@ -747,10 +764,10 @@ extern "C" { range.start = iki_data->variable.array[j].stop + 1; range.stop = iki_data->variable.array[j + 1].start - 1; - *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_partial_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_partial_append_nulless)); break; } @@ -758,17 +775,17 @@ extern "C" { } } // for - if (F_status_is_error(*status)) break; + if (F_status_is_error(data->setting->state.status)) break; // Copy everything after the last IKI variable to the end of the content. if (iki_data->variable.used && content.array[i].stop > iki_data->variable.array[iki_data->variable.used - 1].stop) { range.start = iki_data->variable.array[iki_data->variable.used - 1].stop + 1; range.stop = content.array[i].stop; - *status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, range, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_partial_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_partial_append_nulless)); break; } @@ -777,10 +794,10 @@ extern "C" { if (!(content.array[i].start == iki_data->variable.array[0].start && content.array[i].stop == iki_data->variable.array[0].stop && !quotes.array[i]) || (iki_type & 0xb) && !quotes.array[i] || i && content.used > 1 && i + 1 == content.used) { ++data_make->cache_arguments.used; - *status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; } @@ -789,20 +806,20 @@ extern "C" { } } else { - *status = f_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data->setting->state.status = f_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamic_partial_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_partial_append_nulless)); break; } ++data_make->cache_arguments.used; - *status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); - if (F_status_is_error(*status)) { - fake_print_error(data_make->setting, data_make->main->error, *status, macro_fake_f(f_string_dynamics_increase)); + if (F_status_is_error(data->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase)); break; } @@ -814,9 +831,8 @@ extern "C" { #endif // _di_fake_make_operate_expand_ #ifndef _di_fake_make_operate_expand_build_ - f_status_t fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { + void fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { - f_status_t status = F_none; bool unmatched = F_true; uint8_t i = 0; @@ -837,12 +853,12 @@ extern "C" { for (; i < 3; ++i) { - status = fl_string_dynamic_partial_compare_string(uint8_name[i].string, data_make->buffer, uint8_name[i].used, range_name); + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(uint8_name[i].string, data_make->buffer, uint8_name[i].used, range_name); - if (status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { unmatched = F_false; - status = f_conversion_number_unsigned_to_string(uint8_value[i], f_conversion_data_base_10_c, &data_make->cache_1); + data_make->setting->state.status = f_conversion_number_unsigned_to_string(uint8_value[i], f_conversion_data_base_10_c, &data_make->cache_1); break; } @@ -872,16 +888,16 @@ extern "C" { for (i = 0; i < 7; ++i) { - status = fl_string_dynamic_partial_compare_string(bool_name[i].string, data_make->buffer, bool_name[i].used, range_name); + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(bool_name[i].string, data_make->buffer, bool_name[i].used, range_name); - if (status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { unmatched = F_false; if (bool_value[i]) { - status = f_string_dynamic_append(fake_common_setting_bool_yes_s, &data_make->cache_1); + data_make->setting->state.status = f_string_dynamic_append(fake_common_setting_bool_yes_s, &data_make->cache_1); } else { - status = f_string_dynamic_append(fake_common_setting_bool_no_s, &data_make->cache_1); + data_make->setting->state.status = f_string_dynamic_append(fake_common_setting_bool_no_s, &data_make->cache_1); } break; @@ -932,12 +948,12 @@ extern "C" { for (i = 0; i < 17; ++i) { - status = fl_string_dynamic_partial_compare_string(dynamic_name[i].string, data_make->buffer, dynamic_name[i].used, range_name); + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(dynamic_name[i].string, data_make->buffer, dynamic_name[i].used, range_name); - if (status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { unmatched = F_false; - status = f_string_dynamic_append_nulless(dynamic_value[i], &data_make->cache_1); + data_make->setting->state.status = f_string_dynamic_append_nulless(dynamic_value[i], &data_make->cache_1); break; } @@ -1066,15 +1082,15 @@ extern "C" { for (i = 0; i < 36; ++i) { - status = fl_string_dynamic_partial_compare_string(dynamics_name[i].string, data_make->buffer, dynamics_name[i].used, range_name); + data_make->setting->state.status = fl_string_dynamic_partial_compare_string(dynamics_name[i].string, data_make->buffer, dynamics_name[i].used, range_name); - if (status == F_equal_to) { + if (data_make->setting->state.status == F_equal_to) { unmatched = F_false; for (j = 0; j < dynamics_value[i].used; ++j) { - status = f_string_dynamic_mash(f_string_space_s, dynamics_value[i].array[j], &data_make->cache_1); - if (F_status_is_error(status)) break; + data_make->setting->state.status = f_string_dynamic_mash(f_string_space_s, dynamics_value[i].array[j], &data_make->cache_1); + if (F_status_is_error(data_make->setting->state.status)) break; } // for if (dynamics_flag[i]) { @@ -1086,28 +1102,39 @@ extern "C" { } // for } - if (F_status_is_error(status)) return status; - if (unmatched) return F_false; + if (F_status_is_error(data_make->setting->state.status)) return; + + if (unmatched) { + data_make->setting->state.status = F_false; + + return; + } - status = f_string_dynamic_append_nulless(data_make->cache_1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->cache_1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error_not(status) && !quote) { + if (F_status_is_error_not(data_make->setting->state.status) && !quote) { ++data_make->cache_arguments.used; - status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data_make->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); } - if (F_status_is_error(status)) return status; - if (data_make->cache_1.used) return F_true; + if (F_status_is_error(data->setting->state.status)) return; + + if (data_make->cache_1.used) { + data_make->setting->state.status = F_true; - return F_data_not; + return; + } + + data_make->setting->state.status = F_data_not; } #endif // _di_fake_make_operate_expand_build_ #ifndef _di_fake_make_operate_expand_context_ - f_status_t fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { + void fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { + + if (!data_make) return; - f_status_t status = F_none; const f_string_static_t *context = 0; const f_string_static_t context_name[] = { @@ -1144,17 +1171,19 @@ extern "C" { } // for if (context) { - status = f_string_dynamic_append_nulless(*context, &data_make->cache_arguments.array[data_make->cache_arguments.used]); - if (F_status_is_error(status)) return status; + data->setting->state.status = f_string_dynamic_append_nulless(*context, &data_make->cache_arguments.array[data_make->cache_arguments.used]); + if (F_status_is_error(data->setting->state.status)) return; } - return F_true; + data->setting->state.status = F_true; } #endif // _di_fake_make_operate_expand_context_ #ifndef _di_fake_make_operate_expand_environment_ void fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name) { + if (!data_make) return; + data->setting->state.status = F_none; data_make->cache_1.used = 0; @@ -1178,7 +1207,7 @@ extern "C" { return; } - data->setting->state.status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); if (F_status_is_error_not(data->setting->state.status)) { data->setting->state.status = f_string_dynamic_increase_by(data_make->cache_2.used + 1, &data_make->cache_arguments.array[data_make->cache_arguments.used]); @@ -1193,7 +1222,7 @@ extern "C" { if (!quote) { ++data_make->cache_arguments.used; - data->setting->state.status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make->cache_arguments); + data->setting->state.status = f_string_dynamics_increase(data_make->setting->state.step_small, &data_make->cache_arguments); if (F_status_is_error(data_make->setting->state.status)) return; } @@ -1216,9 +1245,9 @@ extern "C" { } // Add the operation id to the operation stack. - data->setting->state.status = f_array_lengths_increase(fake_default_allocation_small_d, section_stack); + data->setting->state.status = f_array_lengths_increase(data_make->setting->state.step_small, section_stack); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { fake_print_error(data_make->setting, data_make->error, macro_fake_f(f_array_lengths_increase)); return 0; @@ -1371,7 +1400,7 @@ extern "C" { fake_make_operate_validate(data_make, section->name, &state_process, section_stack); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { if (state_process.block || state_process.operation == fake_make_operation_type_if_e || state_process.operation == fake_make_operation_type_and_e || state_process.operation == fake_make_operation_type_or_e) { state_process.success_block = F_false; @@ -1392,7 +1421,7 @@ extern "C" { if (F_status_set_fine(data->setting->state.status) == F_interrupt) break; - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data->setting->state.status)) { state_process.success = F_false; // Break acts identical to fail when at the top of the stack. diff --git a/level_3/fake/c/main/make/operate.h b/level_3/fake/c/main/make/operate.h index 4621277..29f9a03 100644 --- a/level_3/fake/c/main/make/operate.h +++ b/level_3/fake/c/main/make/operate.h @@ -25,16 +25,16 @@ extern "C" { * @param data * The program data. * - * @return - * F_none on success. - * F_data_not on success but fakefile is empty. + * This alters data.setting.state.status: + * F_none on success. + * F_data_not on success but fakefile is empty. * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. * - * Status codes (with error bit) are returned on any problem. + * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_ - extern f_status_t fake_make_operate(fake_data_t * const data); + extern void fake_make_operate(fake_data_t * const data); #endif // _di_fake_make_operate_ /** @@ -44,19 +44,23 @@ 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_data_not on success but fakefile is empty. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Status codes (with error bit) are returned on any problem. * @param section_name * The section name. * @param content * The content array. * @param quotes * The array of quotes associated with the content. - * @param status - * The return status. - * - * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_ - extern void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes, f_status_t * const status); + extern void fake_make_operate_expand(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_fss_content_t content, const f_uint8s_t quotes); #endif // _di_fake_make_operate_expand_ /** @@ -66,19 +70,19 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data.setting.state.status: + * F_true on success and match expanded. + * F_false on no matches to expand. + * + * Status codes (with error bit) are returned on any problem. * @param quote * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make->buffer. - * - * @return - * F_true on success and match expanded. - * F_false on no matches to expand. - * - * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_context_ - extern f_status_t fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); + extern void fake_make_operate_expand_context(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); #endif // _di_fake_make_operate_expand_context_ /** @@ -86,28 +90,28 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data.setting.state.status: + * F_data_not on success, but nothing is added (data length to append is 0). + * F_true on success and match expanded. + * F_false on no matches to expand. + * + * Errors (with error bit) from: f_string_dynamic_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). + * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_string_dynamics_increase(). * @param quote * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make->buffer. * - * @return - * F_data_not on success, but nothing is added (data length to append is 0). - * F_true on success and match expanded. - * F_false on no matches to expand. - * - * Errors (with error bit) from: f_string_dynamic_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_partial_append_nulless(). - * Errors (with error bit) from: f_string_dynamic_increase_by(). - * Errors (with error bit) from: f_string_dynamics_increase(). - * * @see f_string_dynamic_append_nulless() * @see f_string_dynamic_partial_append_nulless() * @see f_string_dynamic_increase_by() * @see f_string_dynamics_increase() */ #ifndef _di_fake_make_operate_expand_environment_ - extern f_status_t fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); + extern void fake_make_operate_expand_environment(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); #endif // _di_fake_make_operate_expand_environment_ /** @@ -115,20 +119,20 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters data.setting.state.status: + * F_data_not on success, but nothing is added (data length to append is 0). + * F_true on success and match expanded. + * F_false on no matches to expand. + * + * Status codes (with error bit) are returned on any problem. * @param quote * The quote associated with the content. * @param range_name * The range representing the variable content name string within the data_make->buffer. - * - * @return - * F_data_not on success, but nothing is added (data length to append is 0). - * F_true on success and match expanded. - * F_false on no matches to expand. - * - * Status codes (with error bit) are returned on any problem. */ #ifndef _di_fake_make_operate_expand_build_ - extern f_status_t fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); + extern void fake_make_operate_expand_build(fake_make_data_t * const data_make, const uint8_t quote, const f_string_range_t range_name); #endif // _di_fake_make_operate_expand_build_ /** diff --git a/level_3/fake/c/main/make/operate_process.c b/level_3/fake/c/main/make/operate_process.c index f7ba893..809f6ea 100644 --- a/level_3/fake/c/main/make/operate_process.c +++ b/level_3/fake/c/main/make/operate_process.c @@ -115,12 +115,18 @@ extern "C" { #endif // _di_fake_make_operate_process_ #ifndef _di_fake_make_operate_process_buffer_escape_ - f_status_t fake_make_operate_process_buffer_escape(fake_make_data_t * const data_make, const f_string_static_t source, f_string_dynamic_t * const destination) { + void fake_make_operate_process_buffer_escape(fake_make_data_t * const data_make, const f_string_static_t source, f_string_dynamic_t * const destination) { - if (!source.used) return F_data_not; + if (!data_make || !destination) return; - f_status_t status = f_string_dynamic_increase_by(source.used, destination); - if (F_status_is_error(status)) return status; + if (!source.used) { + data_make->setting->status = F_data_not; + + return; + } + + data_make->setting->status = f_string_dynamic_increase_by(source.used, destination); + if (F_status_is_error(data_make->setting->status)) return; for (f_array_length_t i = 0; i < source.used; ++i) { @@ -132,8 +138,8 @@ extern "C" { // A slash by itself at the end of the string is invalid. if (++i >= source.used) break; - status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); - if (F_status_is_error(status)) return status; + data_make->setting->status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + if (F_status_is_error(data_make->setting->status)) return; if (source.string[i] == f_string_ascii_slash_backward_s.string[0]) { destination->string[destination->used++] = f_string_ascii_slash_backward_s.string[0]; @@ -203,22 +209,18 @@ extern "C" { if (buffer.used > 2) { uint32_t codepoint = 0; - status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint); - - if (F_status_is_error(status)) { - status = F_status_set_fine(status); - - if (!(status == F_failure || status == F_utf_not || status == F_complete_not_utf || status == F_utf_fragment || status == F_valid_not)) { - status = F_status_set_error(status); + data_make->setting->status = f_utf_unicode_string_to(buffer.string, buffer.used, &codepoint); + if (F_status_is_error(data_make->setting->status)) { + if (!(data_make->setting->status == F_failure || data_make->setting->status == F_utf_not || data_make->setting->status == F_complete_not_utf || data_make->setting->status == F_utf_fragment || data_make->setting->status == F_valid_not)) { break; } } else { // Reserve 4-bytes (the max size of a Unicode UTF-8 sequence). - status = f_string_dynamic_increase_by(4, destination); - if (F_status_is_error(status)) return status; + data_make->setting->status = f_string_dynamic_increase_by(4, destination); + if (F_status_is_error(data_make->setting->status)) return; if (!codepoint) { destination->string[destination->used++] = f_string_null_s.string[0]; @@ -227,10 +229,10 @@ extern "C" { { f_string_t address = destination->string + destination->used; - status = f_utf_unicode_from(codepoint, 4, &address); + data_make->setting->status = f_utf_unicode_from(codepoint, 4, &address); } - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->status)) { destination->string[destination->used] = 0; } else { @@ -260,31 +262,37 @@ extern "C" { } } else { - status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); - if (F_status_is_error(status)) return status; + data_make->setting->status = f_string_dynamic_increase_by(F_memory_default_allocation_small_d, destination); + if (F_status_is_error(data_make->setting->status)) return; destination->string[destination->used++] = source.string[i]; } } // for - if (F_status_is_error(status)) return status; + if (F_status_is_error(data_make->setting->status)) return; - return F_none; + data_make->setting->status = F_none; } #endif // _di_fake_make_operate_process_buffer_escape_ #ifndef _di_fake_make_operate_process_execute_ - f_status_t fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) { + void fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) { - if (!program.used && !arguments.used) return F_data_not; + if (!data_make) return; + + if (!program.used && !arguments.used) { + data_make->setting->status = F_data_not; + + return; + } if (fll_program_standard_signal_received(data_make->main)) { fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received); - return F_status_set_error(F_interrupt); - } + data_make->setting->status = F_status_set_error(F_interrupt); - f_status_t status = F_none; + return; + } // Reset the environment. for (f_array_length_t i = 0; i < data_make->environment.used; ++i) { @@ -296,21 +304,21 @@ extern "C" { data_make->environment.used = 0; if (data_make->setting_build.flag & data_build_setting_flag_has_environment_e) { - status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment); + data_make->setting->status = fl_environment_load_names(data_make->setting_build.environment, &data_make->environment); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fl_environment_load_names)); + if (F_status_is_error(data_make->setting->status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fl_environment_load_names)); - return status; + return; } } else { - status = f_environment_get_all(&data_make->environment); + data_make->setting->status = f_environment_get_all(&data_make->environment); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_environment_get_all)); + if (F_status_is_error(data_make->setting->status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_get_all)); - return status; + return; } } @@ -325,26 +333,30 @@ extern "C" { int return_code = 0; - status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); + data_make->setting->status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code); if (fll_program_standard_signal_received(data_make->main)) { fll_program_print_signal_received(data_make->main->warning, data_make->data->setting->line_first, data_make->main->signal_received); - return F_status_set_error(F_interrupt); + data_make->setting->status = F_status_set_error(F_interrupt); + + return; } - if (F_status_is_error(status)) { - if (F_status_set_fine(status) == F_interrupt) return status; + if (F_status_is_error(data_make->setting->status)) { + if (F_status_set_fine(data_make->setting->status) == F_interrupt) return; - if (F_status_set_fine(status) == F_file_found_not) { + if (F_status_set_fine(data_make->setting->status) == F_file_found_not) { fake_make_print_error_program_not_found(data_make->setting, data_make->main->error, program); } - else if (F_status_set_fine(status) != F_failure) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(fll_execute_program)); + else if (F_status_set_fine(data_make->setting->status) != F_failure) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fll_execute_program)); } } - return fake_make_operate_process_return(data_make, return_code); + fake_make_operate_process_return(data_make, return_code); + + return; } #endif // _di_fake_make_operate_process_execute_ @@ -360,7 +372,7 @@ extern "C" { result = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), f_conversion_data_base_10_c, &number); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_conversion_number_signed_to_string)); f_string_dynamic_resize(0, &number); @@ -406,7 +418,15 @@ extern "C" { #endif // _di_fake_make_operate_process_return_ #ifndef _di_fake_make_operate_process_run_ - f_status_t fake_make_operate_process_run(fake_make_data_t * const data_make, const bool as_shell) { + void fake_make_operate_process_run(fake_make_data_t * const data_make, const bool as_shell) { + + if (!data_make) return; + + if (!data_make->cache_arguments.used) { + data_make->setting->status = F_data_not; + + return; + } f_string_statics_t args = f_string_statics_t_initialize; @@ -415,11 +435,8 @@ extern "C" { args.used = data_make->cache_arguments.used - 1; args.size = 0; } - else if (!data_make->cache_arguments.used) { - return F_data_not; - } - return fake_make_operate_process_execute(data_make, data_make->cache_arguments.used ? data_make->cache_arguments.array[0] : f_string_empty_s, args, as_shell); + fake_make_operate_process_execute(data_make, data_make->cache_arguments.used ? data_make->cache_arguments.array[0] : f_string_empty_s, args, as_shell); } #endif // _di_fake_make_operate_process_run_ diff --git a/level_3/fake/c/main/make/operate_process.h b/level_3/fake/c/main/make/operate_process.h index 26aff10..43f389e 100644 --- a/level_3/fake/c/main/make/operate_process.h +++ b/level_3/fake/c/main/make/operate_process.h @@ -131,26 +131,26 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters date_make.setting.state.status: + * F_none on success. + * F_data_not if source.used is 0. + * + * Errors (with error bit) from: f_string_dynamic_increase_by(). + * Errors (with error bit) from: f_utf_unicode_from(). + * Errors (with error bit) from: f_utf_unicode_string_to(). * @param source * The source string to process and esacpe. * @param destination * The processed and escaped string. * This is appended to. * - * @return - * F_none on success. - * F_data_not if source.used is 0. - * - * Errors (with error bit) from: f_string_dynamic_increase_by(). - * Errors (with error bit) from: f_utf_unicode_from(). - * Errors (with error bit) from: f_utf_unicode_string_to(). - * * @see f_string_dynamic_increase_by() * @see f_utf_unicode_from() * @see f_utf_unicode_string_to() */ #ifndef _di_fake_make_operate_process_buffer_escape_ - extern f_status_t fake_make_operate_process_buffer_escape(fake_make_data_t * const data_make, const f_string_static_t source, f_string_dynamic_t * const destination); + extern void fake_make_operate_process_buffer_escape(fake_make_data_t * const data_make, const f_string_static_t source, f_string_dynamic_t * const destination); #endif // _di_fake_make_operate_process_buffer_escape_ /** @@ -158,6 +158,18 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters date_make.setting.state.status: + * F_none on success. + * F_data_not if both program.used is 0 and arguments.used is 0. + * + * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. + * + * Errors (with error bit) from: f_environment_get_all(). + * Errors (with error bit) from: fl_environment_load_names(). + * Errors (with error bit) from: fll_execute_program(). + * + * Status codes (with error bit) are returned on any problem. * @param program * The program to be executed. * @param arguments @@ -166,16 +178,12 @@ extern "C" { * When TRUE, this is a shell operation. * When FALSE, this is a run operation. * - * @return - * F_none on success. - * F_data_not if both program.used is 0 and arguments.used is 0. - * - * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. - * - * Status codes (with error bit) are returned on any problem. + * @see f_environment_get_all() + * @see fl_environment_load_names() + * @see fll_execute_program() */ #ifndef _di_fake_make_operate_process_execute_ - extern f_status_t fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell); + extern void fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell); #endif // _di_fake_make_operate_process_execute_ /** @@ -185,25 +193,25 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. - * @param return_code - * The return code to process. * - * @return - * F_none on success. - * F_failure on identifying the return code as an error code and fail mode is not set to fake_make_operation_fail_exit_e. + * This alters date_make.setting.state.status: + * F_none on success. + * F_failure on identifying the return code as an error code and fail mode is not set to fake_make_operation_fail_exit_e. * - * F_failure (with error bit) on identifying the return code as an error code and fail mode is set to fake_make_operation_fail_exit_e. + * F_failure (with error bit) on identifying the return code as an error code and fail mode is set to fake_make_operation_fail_exit_e. * - * Errors (with error bit) from: f_conversion_number_signed_to_string(). - * Errors (with error bit) from: f_string_append(). - * Errors (with error bit) from: f_string_dynamic_append(). + * Errors (with error bit) from: f_conversion_number_signed_to_string(). + * Errors (with error bit) from: f_string_append(). + * Errors (with error bit) from: f_string_dynamic_append(). + * @param return_code + * The return code to process. * * @see f_conversion_number_signed_to_string() * @see f_string_append() * @see f_string_dynamic_append() */ #ifndef _di_fake_make_operate_process_return_ - extern f_status_t fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code); + extern void fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code); #endif // _di_fake_make_operate_process_return_ /** @@ -211,19 +219,21 @@ extern "C" { * * @param data_make * All make related setting data, including data from the fakefile and the build settings file. + * + * This alters date_make.setting.state.status: + * F_data_not if arguments.used is 0. + * + * Success results from: fake_make_operate_process_execute(). + * + * Errors (with error bit) from: fake_make_operate_process_execute(). * @param as_shell * When TRUE, this is a shell operation. * When FALSE, this is a run operation. * - * @return - * F_data_not if arguments.used is 0. - * - * Success results from: fake_make_operate_process_execute(). - * - * Errors (with error bit) from: fake_make_operate_process_execute(). + * @see fake_make_operate_process_execute() */ #ifndef _di_fake_make_operate_process_run_ - extern f_status_t fake_make_operate_process_run(fake_make_data_t * const data_make, const bool as_shell); + extern void fake_make_operate_process_run(fake_make_data_t * const data_make, const bool as_shell); #endif // _di_fake_make_operate_process_run_ #ifdef __cplusplus 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 49333d1..17ce9b0 100644 --- a/level_3/fake/c/main/make/operate_process_type.c +++ b/level_3/fake/c/main/make/operate_process_type.c @@ -9,16 +9,16 @@ extern "C" { if (!data_make) return; - data.setting.state.status = F_none; + data_make->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) { - data.setting.state.status = F_signal_abort; + data_make->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) { - data.setting.state.status = F_status_set_error(F_signal_abort); + data_make->setting->state.status = F_status_set_error(F_signal_abort); } else { - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; return; } @@ -33,9 +33,9 @@ extern "C" { if (!data_make) return; fake_build_operate(data_make->data, data_make->cache_arguments.used ? &data_make->cache_arguments : 0, F_false); - if (F_status_set_fine(data->setting->state.status) == F_interrupt) return; + if (F_status_set_fine(data_make->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); + data_make->setting->state.status = fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_build_ @@ -44,10 +44,10 @@ extern "C" { if (!data_make) return; - data->setting->state.status = fake_clean_operate(data_make->data); - if (F_status_set_fine(data->setting->state.status) == F_interrupt) return; + data_make->setting->state.status = fake_clean_operate(data_make->data); + if (F_status_set_fine(data_make->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); + data_make->setting->state.status = fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_clean_ @@ -58,14 +58,14 @@ extern "C" { 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(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute)); } - else if (data->setting->state.status == F_child) { + else if (data_make->setting->state.status == F_child) { return; } - data->setting->state.status = fake_make_operate_process_return(data_make, result); + fake_make_operate_process_return(data_make, result); return 0; } @@ -76,7 +76,7 @@ extern "C" { if (!data_make) return; - data->setting->state.status = F_none; + data_make->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); @@ -197,31 +197,18 @@ extern "C" { if (!data_make) return; - f_status_t status = F_none; - const f_array_length_t total = data_make->cache_arguments.used - 1; f_string_static_t destination = f_string_static_t_initialize; 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; - recurse.verbose = fake_print_verbose_clone; - } - + recurse.verbose = fake_print_verbose_clone; recurse.flag = f_file_stat_flag_group_e | f_file_stat_flag_owner_e; } else { - macro_f_mode_t_set_default_umask(mode, data_make->main->umask); - - if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { - recurse.output = data_make->main->message.to; - recurse.verbose = fake_print_verbose_copy; - } + recurse.verbose = fake_print_verbose_copy; + macro_f_mode_t_set_default_umask(recurse.state.mode, data_make->main->umask); } bool existing = F_true; @@ -234,17 +221,17 @@ extern "C" { // In this case, the destination could be a file, so confirm this. if (data_make->cache_arguments.used == 2 + i) { - data->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_path_e); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - if (data->setting->state.status == F_false || data->setting->state.status == F_file_found_not || data->setting->state.status == F_data_not) { + if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not || data_make->setting->state.status == F_data_not) { existing = F_false; } } @@ -256,12 +243,12 @@ extern "C" { if (existing) { data_make->cache_path.used = 0; - data->setting->state.status = f_file_name_base(data_make->cache_arguments.array[i], &data_make->cache_path); + data_make->setting->state.status = f_file_name_base(data_make->cache_arguments.array[i], &data_make->cache_path); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_name_base), data_make->cache_arguments.array[i], f_file_operation_process_s, fll_error_file_type_path_e); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -293,48 +280,50 @@ extern "C" { } } - status = f_directory_is(data_make->cache_arguments.array[i]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[i]); - if (status == F_true) { + if (data_make->setting->state.status == F_true) { if (clone) { - status = fl_directory_clone(data_make->cache_arguments.array[i], destination, recurse); + recurse.flag |= f_directory_recurse_flag_clone_e; } else { - status = fl_directory_copy(data_make->cache_arguments.array[i], destination, mode, recurse); + recurse.flag -= recurse.flag & f_directory_recurse_flag_clone_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); + fl_directory_copy(data_make->cache_arguments.array[i], destination, mode, &recurse); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fl_directory_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } - else if (status == F_false) { + else if (data_make->setting->state.status == F_false) { if (clone) { - status = f_file_clone(data_make->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); + data_make->setting->state.status = f_file_clone(data_make->cache_arguments.array[i], destination, recurse.size_block, recurse.flag); } else { - status = f_file_copy(data_make->cache_arguments.array[i], destination, mode, recurse.size_block, recurse.flag); + data_make->setting->state.status = f_file_copy(data_make->cache_arguments.array[i], destination, mode, recurse.size_block, recurse.flag); } - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, clone ? macro_fake_f(f_file_clone) : macro_fake_f(f_file_copy), data_make->cache_arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e); f_directory_recurse_delete(&recurse); - data->setting->state.status = F_status_set_error(F_failure); + data_make->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)) { + else if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e); f_directory_recurse_delete(&recurse); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -342,7 +331,7 @@ extern "C" { f_directory_recurse_delete(&recurse); - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_copy_ @@ -351,22 +340,20 @@ extern "C" { if (!data_make) return; - data->setting->state.status = F_none; - if (data_make->cache_arguments.used > 1) { - data->setting->state.status = f_environment_set(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1], F_true); + data_make->setting->state.status = f_environment_set(data_make->cache_arguments.array[0], data_make->cache_arguments.array[1], F_true); } else { - data->setting->state.status = f_environment_set(data_make->cache_arguments.array[0], f_string_empty_s, F_true); + data_make->setting->state.status = f_environment_set(data_make->cache_arguments.array[0], f_string_empty_s, F_true); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_environment_set)); } else { fake_make_print_verbose_operate_define(data_make->setting, data_make->main->message, data_make->cache_arguments.array[0]); - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_operate_process_type_define_ @@ -379,65 +366,65 @@ extern "C" { const int recursion_max = all ? F_directory_max_descriptors_d : 0; struct stat file_stat; - data->setting->state.status = F_none; + data_make->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)); - data->setting->state.status = f_file_stat(data_make->cache_arguments.array[i], F_false, &file_stat); + data_make->setting->state.status = f_file_stat(data_make->cache_arguments.array[i], F_false, &file_stat); - if (F_status_is_error(setting->state.status)) { - if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->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]); - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } else { 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); - data->setting->state.status = F_status_set_error(F_failure); + data_make->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) { - data->setting->state.status = f_directory_remove_custom(data_make->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely); + data_make->setting->state.status = f_directory_remove_custom(data_make->cache_arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely); } else { - data->setting->state.status = f_directory_remove(data_make->cache_arguments.array[i], recursion_max, F_false); + data_make->setting->state.status = f_directory_remove(data_make->cache_arguments.array[i], recursion_max, F_false); } - if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { + if (F_status_set_fine(data_make->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]); - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } } else { - data->setting->state.status = f_file_remove(data_make->cache_arguments.array[i]); + data_make->setting->state.status = f_file_remove(data_make->cache_arguments.array[i]); - if (F_status_set_fine(data->setting->state.status) == F_file_found_not) { + if (F_status_set_fine(data_make->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]); } - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -446,7 +433,7 @@ extern "C" { fake_make_print_verbose_operate_delete(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i]); } // for - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_deletes_ @@ -455,13 +442,13 @@ extern "C" { if (!data_make) return; - data->setting->state.status = F_none; + data_make->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) { - data->setting->state.status = F_signal_quit; + data_make->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) { - data->setting->state.status = F_status_set_error(F_signal_quit); + data_make->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; @@ -474,7 +461,7 @@ extern "C" { data_make->error.set = &data_make->main->context.set; } else { - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; return; } @@ -527,40 +514,40 @@ extern "C" { bool dereference = F_true; f_array_length_t i = 0; - data->setting->state.status = F_none; + data_make->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; } - data->setting->state.status = fake_make_get_id(data_make, data_make->cache_arguments.array[i++], (void *) &id); + fake_make_get_id(data_make, F_false, data_make->cache_arguments.array[i++], (void *) &id); - if (F_status_is_error(setting->state.status)) { - data->setting->state.status = F_status_set_error(F_failure); + if (F_status_is_error(data_make->setting->state.status)) { + data_make->setting->state.status = F_status_set_error(F_failure); } for (; i < data_make->cache_arguments.used; ++i) { - data->setting->state.status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->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) { - data->setting->state.status = fll_file_role_change_all(data_make->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); + data_make->setting->state.status = fll_file_role_change_all(data_make->cache_arguments.array[i], -1, id, dereference, fake_max_recursion_depth_d); } else { - data->setting->state.status = f_file_role_change(data_make->cache_arguments.array[i], -1, id, dereference); + data_make->setting->state.status = f_file_role_change(data_make->cache_arguments.array[i], -1, id, dereference); } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->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); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -568,7 +555,7 @@ extern "C" { 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 - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_groups_ @@ -611,7 +598,7 @@ extern "C" { f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; if (i == data_make->cache_arguments.used) { if (if_not) { @@ -621,7 +608,7 @@ extern "C" { state_process->condition_result = fake_condition_result_false_e; } - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; return; } @@ -635,27 +622,27 @@ extern "C" { for (; i < data_make->cache_arguments.used; ++i) { - data->setting->state.status = f_file_exists(data_make->cache_arguments.array[i], dereference); + data_make->setting->state.status = f_file_exists(data_make->cache_arguments.array[i], dereference); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_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); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } if (if_not) { - if (data->setting->state.status == F_true) { + if (data_make->setting->state.status == F_true) { state_process->condition_result = fake_condition_result_false_e; break; } } else { - if (data->setting->state.status != F_true) { + if (data_make->setting->state.status != F_true) { state_process->condition_result = fake_condition_result_false_e; break; @@ -663,7 +650,7 @@ extern "C" { } } // for - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_exist_ @@ -681,7 +668,7 @@ extern "C" { f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data->setting->state.status = F_none; + data_make->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; @@ -696,7 +683,7 @@ extern "C" { state_process->condition_result = fake_condition_result_false_e; } - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; return; } @@ -739,14 +726,14 @@ extern "C" { for (; i < data_make->cache_arguments.used; ++i, mode_file = 0) { - data->setting->state.status = f_file_mode_read(data_make->cache_arguments.array[i], dereference, &mode_file); + data_make->setting->state.status = f_file_mode_read(data_make->cache_arguments.array[i], dereference, &mode_file); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_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); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -789,7 +776,7 @@ extern "C" { } } // for - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_is_ @@ -807,7 +794,7 @@ extern "C" { f_array_length_t i = 1; - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; state_process->condition_result = fake_condition_result_true_e; range.start = 0; @@ -822,14 +809,14 @@ extern "C" { } if (range.start > range.stop) { - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - 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); + data_make->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(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 (F_status_is_error_not(data_make->setting->state.status)) { + for (i = 2; i < data_make->cache_arguments.used; ++i, data_make->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; @@ -846,17 +833,17 @@ extern "C" { } if (range.start > range.stop) { - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - 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); + data_make->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 { - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } - if (F_status_is_error(data->setting->state.status)) break; + if (F_status_is_error(data_make->setting->state.status)) break; if (state_process->condition == fake_make_operation_if_type_if_greater_e) { @@ -921,7 +908,7 @@ extern "C" { } // for } - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->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)) { @@ -931,10 +918,10 @@ extern "C" { fake_make_print_error_unsupported_number(data_make->setting, data_make->main->error, data_make->cache_arguments.array[i]); } - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_operate_process_type_if_greater_if_lesser_ @@ -948,21 +935,21 @@ extern "C" { f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data->setting->state.status = F_none; + data_make->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; } - data->setting->state.status = fake_make_get_id(data_make, data_make->cache_arguments.array[i++], (void *) &id); + fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++], (void *) &id); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_e; fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -971,14 +958,14 @@ extern "C" { for (uid_t id_file = 0; i < data_make->cache_arguments.used; ++i, id_file = 0) { - data->setting->state.status = f_file_group_read(data_make->cache_arguments.array[i], dereference, &id_file); + data_make->setting->state.status = f_file_group_read(data_make->cache_arguments.array[i], dereference, &id_file); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_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); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -999,7 +986,7 @@ extern "C" { } } // for - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_group_ @@ -1019,26 +1006,26 @@ extern "C" { { uint8_t mode_replace = 0; - 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); + fake_make_get_id_mode(data_make, data_make->cache_arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_e; fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - data.setting.state.status = f_file_mode_to_mode(mode_rule, &mode_match); + data_make->setting->state.status = f_file_mode_to_mode(mode_rule, &mode_match); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_e; fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_to_mode)); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1050,14 +1037,14 @@ extern "C" { for (f_array_length_t i = if_not ? 4 : 3; i < data_make->cache_arguments.used; ++i, mode_file = 0) { - data.setting.state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); + data_make->setting->state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_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); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1096,7 +1083,7 @@ extern "C" { } } // for - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_mode_ @@ -1109,21 +1096,21 @@ extern "C" { f_array_length_t i = if_not ? 2 : 1; bool dereference = F_true; - data->setting->state.status = F_none; + data_make->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; } - data->setting->state.status = fake_make_get_id(data_make->data, data_make->error, data_make->cache_arguments.array[i++], (void *) &id); + fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++], (void *) &id); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_e; fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1132,14 +1119,14 @@ extern "C" { for (uid_t id_file = 0; i < data_make->cache_arguments.used; ++i, id_file = 0) { - data->setting->state.status = f_file_owner_read(data_make->cache_arguments.array[i], dereference, &id_file); + data_make->setting->state.status = f_file_owner_read(data_make->cache_arguments.array[i], dereference, &id_file); - if (F_status_is_error(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { state_process->condition_result = fake_condition_result_error_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); - data->setting->state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1160,7 +1147,7 @@ extern "C" { } } // for - data->setting->state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_if_owner_ @@ -1206,17 +1193,17 @@ extern "C" { }; const bool reserved_parameter[] = { - data_make->data->setting->build.used, + data_make->setting->build.used, F_true, - data_make->data->setting->data.used, - data_make->data->setting->defines.used, - data_make->data->setting->fakefile.used, - data_make->data->setting->modes.used, - data_make->data->setting->process.used, - data_make->data->setting->settings.used, - data_make->data->setting->sources.used, + data_make->setting->data.used, + data_make->setting->defines.used, + data_make->setting->fakefile.used, + data_make->setting->modes.used, + data_make->setting->process.used, + data_make->setting->settings.used, + data_make->setting->sources.used, F_true, - data_make->data->setting->work.used, + data_make->setting->work.used, data_make->main->parameters.array[fake_parameter_build_e].result & f_console_result_value_e, (data_make->main->parameters.array[fake_parameter_light_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_dark_e].result & f_console_result_found_e) || (data_make->main->parameters.array[fake_parameter_no_color_e].result & f_console_result_found_e), data_make->main->parameters.array[fake_parameter_data_e].result & f_console_result_value_e, @@ -1305,13 +1292,13 @@ extern "C" { 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(setting->state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_execute)); } - if (data->setting->state.status == F_child) return result; + if (data_make->setting->state.status == F_child) return result; - data->setting->state.status = fake_make_operate_process_return(data_make, result); + fake_make_operate_process_return(data_make, result); return 0; } @@ -1322,8 +1309,6 @@ extern "C" { if (!data_make) return; - f_status_t status = F_none; - // 0x1 = force, 0x2 = strict. uint8_t flag = 0; @@ -1347,36 +1332,42 @@ extern "C" { if ((flag & 0x1) && f_file_exists(data_make->cache_arguments.array[data_make->cache_arguments.used - 1], F_false) == F_true) { if (f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]) == F_true) { - status = f_directory_remove(data_make->cache_arguments.array[data_make->cache_arguments.used - 1], F_directory_max_descriptors_d, F_false); + data_make->setting->state.status = f_directory_remove(data_make->cache_arguments.array[data_make->cache_arguments.used - 1], F_directory_max_descriptors_d, F_false); - 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[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_directory_e); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_remove), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_directory_e); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } else { - status = f_file_remove(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + data_make->setting->state.status = f_file_remove(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_remove), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_file_e); - 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[data_make->cache_arguments.used - 1], f_file_operation_delete_s, fll_error_file_type_file_e); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } } } - status = f_file_link(data_make->cache_arguments.array[0], data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + data_make->setting->state.status = f_file_link(data_make->cache_arguments.array[0], data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_link), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_link_s, fll_error_file_type_file_e); - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_link), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_link_s, fll_error_file_type_file_e); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } fake_make_print_verbose_operate_symbolic_link(data_make->setting, data_make->main->message, data_make->cache_arguments.array[data_make->cache_arguments.used - 1], data_make->cache_arguments.array[0]); - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_link_ @@ -1385,17 +1376,17 @@ extern "C" { if (!data_make) return; - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; f_file_mode_t mode_rule = 0; uint8_t replace = 0; - data.setting.state.status = fake_make_get_id_mode(data_make->data, data_make->error, data_make->cache_arguments.array[0], &mode_rule, &replace); + fake_make_get_id_mode(data_make, data_make->cache_arguments.array[0], &mode_rule, &replace); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id_mode)); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1405,37 +1396,37 @@ extern "C" { for (f_array_length_t i = 1; i < data_make->cache_arguments.used; ++i, mode = 0) { - data.setting.state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); + data_make->setting->state.status = f_file_mode_read(data_make->cache_arguments.array[i], F_true, &mode_file); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_read), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - data.setting.state.status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode); + data_make->setting->state.status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_mode_determine), data_make->cache_arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } if (all) { - data.setting.state.status = fll_file_mode_set_all(data_make->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); + data_make->setting->state.status = fll_file_mode_set_all(data_make->cache_arguments.array[i], F_true, mode, fake_max_recursion_depth_d); } else { - data.setting.state.status = f_file_mode_set(data_make->cache_arguments.array[i], mode); + data_make->setting->state.status = f_file_mode_set(data_make->cache_arguments.array[i], mode); } - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->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); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1443,7 +1434,7 @@ extern "C" { fake_make_print_verbose_operate_set_mode(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i], mode); } // for - data.setting.state.status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_modes_ @@ -1452,16 +1443,12 @@ extern "C" { if (!data_make) return; - f_status_t status = F_none; - const f_array_length_t total = data_make->cache_arguments.used -1; f_directory_recurse_t recurse = f_directory_recurse_t_initialize; - f_string_static_t destination = f_string_static_t_initialize; if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { - recurse.output = data_make->main->message.to; recurse.verbose = fake_print_verbose_move; } @@ -1469,15 +1456,17 @@ extern "C" { // In this case, the destination could be a file, so confirm this. if (data_make->cache_arguments.used == 2) { - status = f_directory_is(data_make->cache_arguments.array[1]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e); - 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_directory_e); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } - if (status == F_false || status == F_file_found_not) { + if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) { existing = F_false; } } @@ -1489,12 +1478,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_make->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_make->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); + + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } destination.used += data_make->cache_path.used + 1; @@ -1523,23 +1514,25 @@ extern "C" { } } - status = fll_file_move(data_make->cache_arguments.array[i], destination, recurse); + fll_file_move(data_make->cache_arguments.array[i], destination, &recurse); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fll_file_move), data_make->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e); - if (F_status_is_error(status)) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(fll_file_move), data_make->cache_arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } } // for - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_move_ #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) { + int fake_make_operate_process_type_operate(fake_make_data_t * const data_make, f_array_lengths_t * const section_stack) { - if (!data_make) return; + if (!data_make) return 0; f_array_length_t id_section = 0; @@ -1552,14 +1545,14 @@ extern "C" { if (id_section == data_make->fakefile.used) return 0; - const int result = fake_make_operate_section(data_make, id_section, section_stack, status); + const int result = fake_make_operate_section(data_make, id_section, section_stack); // Ensure that a break only happens within its active state_process->operation stack. - if (*status == F_signal_abort) { - *status = F_none; + if (data_make->setting->state.status == F_signal_abort) { + data_make->setting->state.status = F_none; } - else if (F_status_set_fine(*status) == F_signal_abort) { - *status = F_status_set_error(F_failure); + else if (F_status_set_fine(data_make->setting->state.status) == F_signal_abort) { + data_make->setting->state.status = F_status_set_error(F_failure); } return result; @@ -1567,7 +1560,7 @@ extern "C" { #endif // _di_fake_make_operate_process_type_operate_ #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) { + void fake_make_operate_process_type_owners(fake_make_data_t * const data_make, const bool all) { if (!data_make) return; @@ -1580,51 +1573,53 @@ extern "C" { dereference = F_false; } - f_status_t status = fake_make_get_id(data_make->data, data_make->error, data_make->cache_arguments.array[i++], (void *) &id); + fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[i++], (void *) &id); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_get_id)); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } for (; i < data_make->cache_arguments.used; ++i) { - status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->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], id, -1, dereference, fake_max_recursion_depth_d); + data_make->setting->state.status = fll_file_role_change_all(data_make->cache_arguments.array[i], id, -1, dereference, fake_max_recursion_depth_d); } else { - status = f_file_role_change(data_make->cache_arguments.array[i], id, -1, dereference); + data_make->setting->state.status = f_file_role_change(data_make->cache_arguments.array[i], id, -1, 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_owner_s, fll_error_file_type_file_e); + if (F_status_is_error(data_make->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_owner_s, fll_error_file_type_file_e); + + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } fake_make_print_verbose_operate_set_role(data_make->setting, data_make->main->message, all ? 0x3 : 0x2, data_make->cache_arguments.array[i], (f_number_unsigned_t) id); } // for - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_owners_ #ifndef _di_fake_make_operate_process_type_parameter_ - f_status_t fake_make_operate_process_type_parameter(fake_make_data_t * const data_make) { + void 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; f_array_length_t i = 0; @@ -1640,40 +1635,46 @@ extern "C" { if (found) { for (f_array_length_t j = 0; j < data_make->setting_make.parameter.array[i].value.size; ++j) { - status = f_string_dynamic_resize(0, &data_make->setting_make.parameter.array[i].value.array[j]); + data_make->setting->state.status = f_string_dynamic_resize(0, &data_make->setting_make.parameter.array[i].value.array[j]); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamic_resize)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_resize)); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } // for if (data_make->setting_make.parameter.array[i].value.size) { - status = f_string_dynamics_resize(0, &data_make->setting_make.parameter.array[i].value); + data_make->setting->state.status = f_string_dynamics_resize(0, &data_make->setting_make.parameter.array[i].value); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamics_resize)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_resize)); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } } else { - status = f_string_map_multis_resize(fake_default_allocation_small_d, &data_make->setting_make.parameter); + data_make->setting->state.status = f_string_map_multis_resize(fake_allocation_small_d, &data_make->setting_make.parameter); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_map_multis_resize)); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_map_multis_resize)); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } - status = f_string_dynamic_append_nulless(data_make->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name); + data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->cache_arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - 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)); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } i = data_make->setting_make.parameter.used++; @@ -1682,34 +1683,36 @@ extern "C" { data_make->setting_make.parameter.array[i].value.used = 0; if (data_make->cache_arguments.used > 1) { - status = f_string_dynamics_resize(data_make->cache_arguments.used - 1, &data_make->setting_make.parameter.array[i].value); + data_make->setting->state.status = f_string_dynamics_resize(data_make->cache_arguments.used - 1, &data_make->setting_make.parameter.array[i].value); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_string_dynamics_resize)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_resize)); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } for (f_array_length_t j = 0; j < data_make->setting_make.parameter.array[i].value.size; ++j) { - status = f_string_dynamic_append_nulless(data_make->cache_arguments.array[j + 1], &data_make->setting_make.parameter.array[i].value.array[j]); + data_make->setting->state.status = f_string_dynamic_append_nulless(data_make->cache_arguments.array[j + 1], &data_make->setting_make.parameter.array[i].value.array[j]); - 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_make->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_make->setting->state.status = F_status_set_error(F_failure); } ++data_make->setting_make.parameter.array[i].value.used; } // for } - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_parameter_ #ifndef _di_fake_make_operate_process_type_pop_ - f_status_t fake_make_operate_process_type_pop(fake_make_data_t * const data_make) { + void fake_make_operate_process_type_pop(fake_make_data_t * const data_make) { if (!data_make) return; @@ -1719,12 +1722,12 @@ extern "C" { --data_make->path.stack.used; - data.setting.state.status = f_path_change(*argument); + data_make->setting->state.status = f_path_change(*argument); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, macro_fake_f(f_path_change), *argument); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1733,12 +1736,12 @@ extern "C" { fake_make_path_relative(data_make, *argument); // The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function. - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_path_relative)); fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, *argument); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1746,17 +1749,15 @@ extern "C" { fake_make_print_verbose_operate_set_path(data_make->setting, data_make->main->message, data_make->cache_path); } - data.setting.state.status = F_none; + data_make->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) { + void 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; { @@ -1770,33 +1771,39 @@ extern "C" { total += data_make->cache_arguments.array[i].used; } // for - status = f_string_dynamic_increase_by(total, &data_make->cache_1); + data_make->setting->state.status = f_string_dynamic_increase_by(total, &data_make->cache_1); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_open)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open)); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } for (i = 0; i < data_make->cache_arguments.used; ++i) { if (i) { - status = f_string_dynamic_append(f_string_space_s, &data_make->cache_1); + data_make->setting->state.status = f_string_dynamic_append(f_string_space_s, &data_make->cache_1); - 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(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } - status = fake_make_operate_process_buffer_escape(data_make, data_make->cache_arguments.array[i], &data_make->cache_1); + fake_make_operate_process_buffer_escape(data_make, data_make->cache_arguments.array[i], &data_make->cache_1); + + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open)); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_open)); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } } // for } @@ -1808,19 +1815,19 @@ extern "C" { f_file_stream_unlock(data_make->main->message.to); - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_print_ #ifndef _di_fake_make_operate_process_type_skeleton_ - f_status_t fake_make_operate_process_type_skeleton(fake_make_data_t * const data_make) { + void 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; + fake_skeleton_operate(data_make->data); + if (F_status_set_fine(data_make->setting->state.status) == F_interrupt) return; - data->setting->state.status = fake_make_operate_process_return(data_make, F_status_is_error(status) ? 1 : 0); + fake_make_operate_process_return(data_make, F_status_is_error(data_make->setting->state.status) ? 1 : 0); } #endif // _di_fake_make_operate_process_type_skeleton_ @@ -1829,40 +1836,40 @@ extern "C" { if (!data_make) return; - data.setting.state.status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]); + fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->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); + if (F_status_set_fine(data_make->setting->state.status) == F_false) { + data_make->setting->state.status = F_status_set_error(F_failure); } - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - data.setting.state.status = f_path_change(data_make->cache_arguments.array[0]); + data_make->setting->state.status = f_path_change(data_make->cache_arguments.array[0]); - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->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 { - data.setting.state.status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->path.stack); + data_make->setting->state.status = f_string_dynamics_increase_by(fake_allocation_small_d, &data_make->path.stack); - 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); + if (F_status_is_error(data_make->setting->state.status)) { + if (F_status_set_fine(data_make->setting->state.status) == F_array_too_large) { + fake_print_error_operation_path_stack_max(data_make->setting, data_make->error, macro_fake_f(f_string_dynamics_increase_by), fake_common_file_path_stack_s); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamics_increase_by)); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1870,21 +1877,21 @@ extern "C" { // Copy the entire real path, including the trailing NULL. ++data_make->cache_path.used; - data.setting.state.status = f_string_dynamic_append_nulless(data_make->cache_path, &data_make->path.stack.array[data_make->path.stack.used]); + data_make->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(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_nulless)); - data.setting.state.status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } if (data_make->main->error.verbosity >= f_console_verbosity_verbose_e) { - data.setting.state.status = fake_make_path_relative(data_make, data_make->path.stack.array[data_make->path.stack.used]); + fake_make_path_relative(data_make, data_make->path.stack.array[data_make->path.stack.used]); // The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function. - if (F_status_is_error(data.setting.state.status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(fake_make_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]); @@ -1897,22 +1904,24 @@ extern "C" { ++data_make->path.stack.used; } - data.setting.state.status = F_none; + data_make->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) { + void 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); + data_make->setting->state.status = f_path_change_at(data_make->path.top.id); + + if (F_status_is_error(data_make->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]); - 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]); + data_make->setting->state.status = F_status_set_error(F_failure); - return F_status_set_error(F_failure); + return; } } @@ -1925,16 +1934,15 @@ extern "C" { data_make->path.stack.used = 1; - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_top_ #ifndef _di_fake_make_operate_process_type_touch_ - f_status_t fake_make_operate_process_type_touch(fake_make_data_t * const data_make) { + void 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; macro_f_mode_t_set_default_umask(mode, data_make->main->umask); @@ -1942,126 +1950,132 @@ extern "C" { for (f_array_length_t i = 1; i < data_make->cache_arguments.used; ++i) { if (fl_string_dynamic_compare(fake_make_operation_argument_file_s, data_make->cache_arguments.array[0]) == F_equal_to) { - status = f_file_touch(data_make->cache_arguments.array[i], mode.regular, F_false); + data_make->setting->state.status = f_file_touch(data_make->cache_arguments.array[i], mode.regular, F_false); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (F_status_is_error_not(fll_path_canonical(data_make->cache_arguments.array[i], &data_make->cache_path))) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_file_e); } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e); } - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } else if (fl_string_dynamic_compare(fake_make_operation_argument_directory_s, data_make->cache_arguments.array[0]) == F_equal_to) { - status = f_directory_touch(data_make->cache_arguments.array[i], mode.directory); + data_make->setting->state.status = f_directory_touch(data_make->cache_arguments.array[i], mode.directory); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (F_status_is_error_not(fll_path_canonical(data_make->cache_arguments.array[i], &data_make->cache_path))) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_directory_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_directory_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_touch), data_make->cache_path, f_file_operation_touch_s, fll_error_file_type_directory_e); } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_directory_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_touch), data_make->cache_arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e); } - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } fake_make_print_verbose_operate_touch(data_make->setting, data_make->main->message, data_make->cache_arguments.array[i]); } // for - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_process_type_touch_ #ifndef _di_fake_make_operate_process_type_write_ - f_status_t fake_make_operate_process_type_write(fake_make_data_t * const data_make) { + void 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); + data_make->setting->state.status = f_file_exists(data_make->cache_arguments.array[0], F_true); - if (data_make->cache_arguments.used == 1 || status == F_false) { - status = f_file_stream_open(data_make->cache_arguments.array[0], f_file_open_mode_truncate_s, &file); + if (data_make->cache_arguments.used == 1 || data_make->setting->state.status == F_false) { + data_make->setting->state.status = f_file_stream_open(data_make->cache_arguments.array[0], f_file_open_mode_truncate_s, &file); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (F_status_is_error_not(fll_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e); } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); } - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } // Keep the stream open if there is a string to write to it. if (data_make->cache_arguments.used > 1) { - status = F_false; + data_make->setting->state.status = F_false; } else { - status = F_none; + data_make->setting->state.status = F_none; f_file_stream_flush(file); f_file_stream_close(&file); } } - if (F_status_is_error_not(status) && data_make->cache_arguments.used > 1) { - if (status != F_false) { - status = f_file_stream_open(data_make->cache_arguments.array[0], f_file_open_mode_append_s, &file); + if (F_status_is_error_not(data_make->setting->state.status) && data_make->cache_arguments.used > 1) { + if (data_make->setting->state.status != F_false) { + data_make->setting->state.status = f_file_stream_open(data_make->cache_arguments.array[0], f_file_open_mode_append_s, &file); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (F_status_is_error_not(fll_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_path, f_file_operation_open_s, fll_error_file_type_file_e); } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_open), data_make->cache_arguments.array[0], f_file_operation_open_s, fll_error_file_type_file_e); } } } - if (F_status_is_error_not(status)) { + if (F_status_is_error_not(data_make->setting->state.status)) { for (f_array_length_t i = 1; i < data_make->cache_arguments.used; ++i) { data_make->cache_1.used = 0; - status = fake_make_operate_process_buffer_escape(data_make, data_make->cache_arguments.array[i], &data_make->cache_1); + fake_make_operate_process_buffer_escape(data_make, data_make->cache_arguments.array[i], &data_make->cache_1); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (F_status_is_error_not(fll_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e); } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(fake_make_operate_process_buffer_escape), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); } break; } - status = f_file_stream_write(file, data_make->cache_1, 0); + data_make->setting->state.status = f_file_stream_write(file, data_make->cache_1, 0); - if (F_status_is_error(status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (F_status_is_error_not(fll_path_canonical(data_make->cache_arguments.array[0], &data_make->cache_path))) { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_write), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_write), data_make->cache_path, f_file_operation_write_s, fll_error_file_type_file_e); } else { - fake_print_error_file(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_write), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_write), data_make->cache_arguments.array[0], f_file_operation_write_s, fll_error_file_type_file_e); } break; } if (i + 1 < data_make->cache_arguments.used) { - status = f_file_stream_write(file, f_string_ascii_space_s, 0); + data_make->setting->state.status = f_file_stream_write(file, f_string_ascii_space_s, 0); - if (F_status_is_error(status)) { - fake_print_error(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_stream_write)); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_file_stream_write)); break; } @@ -2073,9 +2087,7 @@ extern "C" { f_file_stream_close(&file); } - if (F_status_is_error(status)) return F_status_set_error(F_failure); - - return F_none; + data_make->setting->state.status = F_status_is_error(data_make->setting->state.status) ? F_status_set_error(F_failure) : F_none; } #endif // _di_fake_make_operate_process_type_write_ diff --git a/level_3/fake/c/main/make/operate_process_type.h b/level_3/fake/c/main/make/operate_process_type.h index 9a52427..7febe00 100644 --- a/level_3/fake/c/main/make/operate_process_type.h +++ b/level_3/fake/c/main/make/operate_process_type.h @@ -99,16 +99,25 @@ extern "C" { * * 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: () + * Errors (with error bit) from: fake_make_operate_process_type_if_define() + * Errors (with error bit) from: fake_make_operate_process_type_if_exist() + * Errors (with error bit) from: fake_make_operate_process_type_if_greater_if_lesser() + * Errors (with error bit) from: fake_make_operate_process_type_if_group() + * Errors (with error bit) from: fake_make_operate_process_type_if_is() + * Errors (with error bit) from: fake_make_operate_process_type_if_mode() + * Errors (with error bit) from: fake_make_operate_process_type_if_owner() + * Errors (with error bit) from: fake_make_operate_process_type_if_parameter() * @param state_process * The operation and if-condition states. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. + * @see fake_make_operate_process_type_if_define() + * @see fake_make_operate_process_type_if_exist() + * @see fake_make_operate_process_type_if_greater_if_lesser() + * @see fake_make_operate_process_type_if_group() + * @see fake_make_operate_process_type_if_is() + * @see fake_make_operate_process_type_if_mode() + * @see fake_make_operate_process_type_if_owner() + * @see fake_make_operate_process_type_if_parameter() */ #ifndef _di_fake_make_operate_process_type_condition_ extern void fake_make_operate_process_type_condition(fake_make_data_t * const data_make, fake_state_process_t * const state_process); @@ -127,7 +136,11 @@ extern "C" { * * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. * - * Errors (with error bit) from: () + * Errors (with error bit) from: f_directory_is() + * Errors (with error bit) from: f_file_clone() + * Errors (with error bit) from: f_file_copy() + * Errors (with error bit) from: f_file_name_base() + * Errors (with error bit) from: fl_directory_copy() * @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. @@ -136,7 +149,6 @@ extern "C" { * @see f_file_clone() * @see f_file_copy() * @see f_file_name_base() - * @see fl_directory_clone() * @see fl_directory_copy() */ #ifndef _di_fake_make_operate_process_type_copy_ @@ -152,14 +164,9 @@ extern "C" { * 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(). + * Success from: f_environment_set(). * - * Errors (with error bit) from: f_environment_set(). + * Errors (with error bit) from: f_environment_set() * * @see f_environment_set() */ @@ -180,7 +187,10 @@ extern "C" { * * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal. * - * Errors (with error bit) from: () + * Errors (with error bit) from: f_file_remove() + * Errors (with error bit) from: f_file_stat() + * Errors (with error bit) from: f_directory_remove() + * Errors (with error bit) from: f_directory_remove_custom() * @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. @@ -201,13 +211,11 @@ extern "C" { * 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_none on unknown exit type (only success and failure are known). + * F_signal_quit to designate exit 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: () + * F_signal_quit (with error bit) to designate exit on failure. * * @return * F_none on unknown exit type (only success and failure are known). @@ -226,14 +234,7 @@ 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: () + * This does not alter data_make.setting.state.status. */ #ifndef _di_fake_make_operate_process_type_fail_ extern void fake_make_operate_process_type_fail(fake_make_data_t * const data_make); @@ -250,18 +251,14 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_role_change() + * Errors (with error bit) from: fll_file_role_change_all() + * Errors (with error bit) from: fake_make_assure_inside_project() + * Errors (with error bit) from: fake_make_get_id() * @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_role_change() * @see fll_file_role_change_all() * @@ -282,10 +279,6 @@ extern "C" { * 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. @@ -307,20 +300,13 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_exists() * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. * @param state_process * The operation process state. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_file_exists() */ #ifndef _di_fake_make_operate_process_type_if_exist_ @@ -338,17 +324,10 @@ extern "C" { * * 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: () + * Errors (with error bit) from: fl_conversion_dynamic_partial_to_unsigned_detect() * @param state_process * The operation process state. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see fl_conversion_dynamic_partial_to_unsigned_detect() */ #ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_ @@ -366,20 +345,14 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_group_read() + * Errors (with error bit) from: fake_make_get_id() * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. * @param state_process * The operation process state. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_file_group_read() * * @see fake_make_get_id() @@ -399,20 +372,13 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_mode_read() * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. * @param state_process * The operation process state. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_file_mode_read() */ #ifndef _di_fake_make_operate_process_type_if_is_ @@ -430,20 +396,15 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_mode_read() + * Errors (with error bit) from: f_file_mode_to_mode() + * Errors (with error bit) from: fake_make_get_id_mode() * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. * @param state_process * The operation process state. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_file_mode_read() * @see f_file_mode_to_mode() * @@ -464,20 +425,14 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_owner_read() + * Errors (with error bit) from: fake_make_get_id() * @param if_not * When TRUE, perform the if not is. * When FALSE, perform the if is. * @param state_process * The operation process state. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * * @see f_file_owner_read() * * @see fake_make_get_id() @@ -496,10 +451,6 @@ extern "C" { * 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. @@ -521,15 +472,10 @@ extern "C" { * * 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. - * - * Success from: fake_make_operate_process_return(). + * Success from: fake_make_operate_process_return(). * - * Errors (with error bit) from: fake_make_operate_process_return(). + * Errors (with error bit) from: fake_execute() + * Errors (with error bit) from: fake_make_operate_process_return() * * @return * The return code of the index operation. @@ -538,7 +484,7 @@ extern "C" { * @see fake_make_operate_process_return() */ #ifndef _di_fake_make_operate_process_type_index_ - extern int fake_make_operate_process_type_index(fake_make_data_t * const data_make, f_status_t * const status); + extern int fake_make_operate_process_type_index(fake_make_data_t * const data_make); #endif // _di_fake_make_operate_process_type_index_ /** @@ -552,14 +498,7 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_file_link() * * @see f_file_link() */ @@ -578,18 +517,15 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_mode_determine() + * Errors (with error bit) from: f_file_mode_read() + * Errors (with error bit) from: f_file_mode_set() + * Errors (with error bit) from: fll_file_mode_set_all() + * Errors (with error bit) from: fake_make_get_id_mode() * @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_mode_determine() * @see f_file_mode_read() * @see f_file_mode_set() @@ -612,14 +548,9 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_directory_is() + * Errors (with error bit) from: f_file_name_base() + * Errors (with error bit) from: fll_file_move() * * @see f_directory_is() * @see f_file_name_base() @@ -640,17 +571,9 @@ extern "C" { * * 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: () + * Errors (with error bit) from: fake_make_operate_section() * @param section_stack * The current operation stack. - * @param status - * The status code. - * - * F_none on success. - * - * F_failure (with error bit) on any error. * * @return * The return code of the section operation. @@ -658,7 +581,7 @@ extern "C" { * @see fake_make_operate_section() */ #ifndef _di_fake_make_operate_process_type_operate_ - extern 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); + extern int fake_make_operate_process_type_operate(fake_make_data_t * const data_make, f_array_lengths_t * const section_stack); #endif // _di_fake_make_operate_process_type_operate_ /** @@ -672,18 +595,14 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_file_role_change() + * Errors (with error bit) from: fll_file_role_change_all() + * Errors (with error bit) from: fake_make_assure_inside_project() + * Errors (with error bit) from: fake_make_get_id() * @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_role_change() * @see fll_file_role_change_all() * @@ -705,14 +624,9 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: f_string_dynamics_resize() + * Errors (with error bit) from: f_string_map_multis_resize() * * @see f_string_dynamic_resize() * @see f_string_dynamics_resize() @@ -738,12 +652,9 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_path_change() + * Errors (with error bit) from: f_string_dynamic_resize() + * Errors (with error bit) from: fake_make_path_relative() * * @see f_path_change() * @see f_string_dynamic_resize() @@ -766,20 +677,16 @@ extern "C" { * * 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: () + * Errors (with error bit) from: f_string_dynamic_append() + * Errors (with error bit) from: f_string_dynamic_increase_by() + * Errors (with error bit) from: fake_make_operate_process_buffer_escape() * @param arguments * The arguments for print operation. * - * @return - * F_none on success. - * - * F_failure (with error bit) on any error. - * - * @see fake_make_operate_process_buffer_escape() * @see f_string_dynamic_append() * @see f_string_dynamic_increase_by() + * + * @see fake_make_operate_process_buffer_escape() */ #ifndef _di_fake_make_operate_process_type_print_ extern void fake_make_operate_process_type_print(fake_make_data_t * const data_make); @@ -798,14 +705,8 @@ extern "C" { * * 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. - * - * Success from: fake_make_operate_process_return(). - * - * Errors (with error bit) from: fake_make_operate_process_return(). + * Errors (with error bit) from: fake_make_operate_process_return() + * Errors (with error bit) from: fake_skeleton_operate() * * @see fake_make_operate_process_return() * @see fake_skeleton_operate() @@ -825,8 +726,6 @@ extern "C" { * * 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() @@ -857,12 +756,8 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_path_change_at() + * Errors (with error bit) from: f_string_dynamic_resize() * * @see f_path_change_at() * @see f_string_dynamic_resize() @@ -884,12 +779,8 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_directory_touch() + * Errors (with error bit) from: f_file_touch() * * @see f_directory_touch() * @see f_file_touch() @@ -912,12 +803,9 @@ extern "C" { * * 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. - * - * F_failure (with error bit) on any error. + * Errors (with error bit) from: f_file_exists() + * Errors (with error bit) from: f_file_stream_open() + * Errors (with error bit) from: f_file_stream_write() * * @see f_file_exists() * @see f_file_stream_open() diff --git a/level_3/fake/c/main/make/operate_validate.c b/level_3/fake/c/main/make/operate_validate.c index 9b14420..0c8c442 100644 --- a/level_3/fake/c/main/make/operate_validate.c +++ b/level_3/fake/c/main/make/operate_validate.c @@ -8,15 +8,15 @@ extern "C" { void fake_make_operate_validate(fake_make_data_t * const data_make, const f_string_range_t section_name, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack) { if (!data_make) return; - if (F_status_is_error(data_make->setting->status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; if (!section_stack) { - data_make->setting->status = F_status_set_error(F_parameter); + data_make->setting->state.status = F_status_set_error(F_parameter); return; } - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; if (state_process->operation == fake_make_operation_type_break_e) { fake_make_operate_validate_type_break(data_make); 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 721dab4..9fb82b9 100644 --- a/level_3/fake/c/main/make/operate_validate_type.c +++ b/level_3/fake/c/main/make/operate_validate_type.c @@ -12,7 +12,9 @@ extern "C" { if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } if (data_make->cache_arguments.used) { @@ -20,12 +22,14 @@ extern "C" { if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, data_make->cache_arguments.array[0]) == F_equal_to_not) { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_break_s, data_make->cache_arguments.array[0]); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } } - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_validate_type_break_ @@ -46,28 +50,34 @@ extern "C" { memcpy(path_file_string, data_make->data->path_data_build.string, sizeof(f_char_t) * data_make->data->path_data_build.used); memcpy(path_file_string + data_make->data->path_data_build.used, data_make->cache_arguments.array[0].string, sizeof(f_char_t) * data_make->cache_arguments.array[0].used); - const f_status_t status = f_file_is(path_file, F_file_type_regular_d, F_false); + data_make->setting->state.status = f_file_is(path_file, F_file_type_regular_d, F_false); - if (status == F_file_found_not || F_status_is_error(status)) { - fake_print_error_file_simple(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_is), path_file, f_file_operation_find_s, fll_error_file_type_file_e); + if (data_make->setting->state.status == F_file_found_not || F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), path_file, f_file_operation_find_s, fll_error_file_type_file_e); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } - if (!status) { + if (!data_make->setting->state.status) { fake_make_print_error_file_type(data_make->setting, data_make->main->message, f_file_type_name_regular_s, path_file); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } else { fake_make_print_error_file_name_empty(data_make->setting, data_make->main->error); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } } - return F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_validate_type_build_ @@ -79,10 +89,11 @@ extern "C" { if (data_make->cache_arguments.used) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + } + else { + data_make->setting->state.status = F_none; } - - return F_none; } #endif // _di_fake_make_operate_validate_type_clean_top_skeleton_ @@ -93,23 +104,22 @@ extern "C" { if (data_make->cache_arguments.used > 1) { f_status_t status = F_none; - f_status_t status_file = F_none; for (f_array_length_t i = 0; i < data_make->cache_arguments.used; ++i) { - status_file = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(status_file)) { - fake_print_error_operation_path_outside(data_make->setting, data_make->error, F_status_set_fine(status_file), 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_make->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]); - status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } // for for (f_array_length_t i = 0; i < data_make->cache_arguments.used - 1; ++i) { if (f_file_exists(data_make->cache_arguments.array[i], F_true) != F_true) { - fake_print_error_file_simple(data_make->setting, data_make->main->error, status, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); + fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } @@ -118,16 +128,16 @@ extern "C" { if (data_make->cache_arguments.used > 2) { // The last file must be a directory. - status_file = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); - if (status_file == F_false || status_file == F_file_found_not) { + if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); status = F_status_set_error(F_failure); } - 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[data_make->cache_arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e); status = F_status_set_error(F_failure); } @@ -135,12 +145,12 @@ extern "C" { else { // When the first file is a directory, then the second, if it exists, must also be a directory. - status_file = f_directory_is(data_make->cache_arguments.array[0]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[0]); - if (status_file == F_true) { - status_file = f_directory_is(data_make->cache_arguments.array[1]); + if (data_make->setting->state.status == F_true) { + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]); - if (status_file == F_false) { + if (data_make->setting->state.status == F_false) { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "second", data_make->cache_arguments.array[1]); status = F_status_set_error(F_failure); @@ -148,12 +158,14 @@ extern "C" { } } - return status; + data_make->setting->state.status = status; + + return; } fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } #endif // _di_fake_make_operate_validate_type_clone_ @@ -165,16 +177,16 @@ extern "C" { if (!data_make->cache_arguments.used) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } - - if (data_make->setting_build.build_compiler.used) { + else if (data_make->setting_build.build_compiler.used) { fake_make_print_error_compiler_not_specified(data_make->setting, data_make->main->error, fake_make_operation_compile_s); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + } + else { + data_make->setting->state.status = F_none; } - - return F_none; } #endif // _di_fake_make_operate_validate_type_compile_ @@ -187,7 +199,7 @@ extern "C" { if (state_process->operation_previous == fake_make_operation_type_if_e) { fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -196,7 +208,7 @@ extern "C" { if (!(state_process->operation_previous == fake_make_operation_type_if_e || state_process->operation_previous == fake_make_operation_type_and_e || state_process->operation_previous == fake_make_operation_type_or_e)) { fake_make_print_error_after_condition_may_only(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -347,7 +359,9 @@ extern "C" { if (i == 23) { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, if_and_or, data_make->cache_arguments.array[k]); - return F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); + + return; } state_process->condition_result = fake_condition_result_true_e; @@ -359,7 +373,7 @@ extern "C" { if (data_make->cache_arguments.used < 1 + k) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -376,7 +390,7 @@ extern "C" { if (j == 7) { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, if_and_or, data_make->cache_arguments.array[k]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -392,10 +406,10 @@ extern "C" { if (data_make->cache_arguments.used > if_type_minimum[i]) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } return; @@ -405,17 +419,17 @@ extern "C" { if (data_make->cache_arguments.used < 2 + k) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } return; } if (state_process->condition == fake_make_operation_if_type_if_exist_e || state_process->condition == fake_make_operation_if_type_if_not_exist_e) { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; return; } @@ -440,7 +454,7 @@ extern "C" { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, message_s, data_make->cache_arguments.array[k]); } - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -449,8 +463,10 @@ extern "C" { f_file_mode_t mode_rule = 0; uint8_t replace = 0; - if (F_status_is_error(fake_make_get_id_mode(data_make->data, data_make->error, data_make->cache_arguments.array[++k], &mode_rule, &replace))) { - data_make->setting->status = F_status_set_error(F_failure); + fake_make_get_id_mode(data_make, data_make->cache_arguments.array[++k], &mode_rule, &replace); + + if (F_status_is_error(data_make->setting->state.status)) { + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -460,8 +476,10 @@ 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(data_make, data_make->cache_arguments.array[k++], (void *) &id))) { - data_make->setting->status = F_status_set_error(F_failure); + fake_make_get_id(data_make, F_false, data_make->cache_arguments.array[k++], (void *) &id); + + if (F_status_is_error(data_make->setting->state.status)) { + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -513,7 +531,7 @@ extern "C" { } // for if (type_file & 0x80) { - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -521,8 +539,10 @@ 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(data_make->data, data_make->error, data_make->cache_arguments.array[k++], (void *) &id))) { - data_make->setting->status = F_status_set_error(F_failure); + fake_make_get_id(data_make, F_true, data_make->cache_arguments.array[k++], (void *) &id); + + if (F_status_is_error(data_make->setting->state.status)) { + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -535,9 +555,9 @@ extern "C" { for (; i < data_make->cache_arguments.used; ++i) { - data_make->setting->status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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]); status = F_status_set_error(F_failure); @@ -545,13 +565,13 @@ extern "C" { else if (state_process->condition != fake_make_operation_if_type_if_exist_e && state_process->condition != fake_make_operation_if_type_if_is_e) { // The existence tests do not need to happen here for *_if_exists and *_if_is as those two types will handle performing them during the process stage. - data_make->setting->status = f_file_exists(data_make->cache_arguments.array[i], dereference); + data_make->setting->state.status = f_file_exists(data_make->cache_arguments.array[i], dereference); - if (data_make->setting->status == F_false) { - data_make->setting->status = F_status_set_error(F_file_found_not); + if (data_make->setting->state.status == F_false) { + data_make->setting->state.status = F_status_set_error(F_file_found_not); } - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_exists), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); @@ -559,10 +579,10 @@ extern "C" { } } // for - data_make->setting->status = status; + data_make->setting->state.status = status; } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } return; @@ -572,7 +592,7 @@ extern "C" { if (data_make->cache_arguments.used < 2 + k) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -581,7 +601,7 @@ extern "C" { f_string_range_t range = f_string_range_t_initialize; f_number_unsigned_t number = 0; - for (i = k; i < data_make->cache_arguments.used; ++i, data_make->setting->status = F_none) { + for (i = k; i < data_make->cache_arguments.used; ++i, data_make->setting->state.status = F_none) { if (data_make->cache_arguments.array[i].used) { range.start = 0; @@ -595,17 +615,17 @@ extern "C" { } if (range.start > range.stop) { - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->cache_arguments.array[i], range, &number); + data_make->setting->state.status = fl_conversion_dynamic_partial_to_unsigned_detect(fl_conversion_data_base_10_c, data_make->cache_arguments.array[i], range, &number); } } else { - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { status = F_status_set_error(F_failure); if (number > F_number_t_size_unsigned_d) { @@ -617,10 +637,10 @@ extern "C" { } } // for - data_make->setting->status = status; + data_make->setting->state.status = status; } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } return; @@ -629,7 +649,7 @@ extern "C" { else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_condition_ @@ -647,7 +667,7 @@ extern "C" { fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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]); status = F_status_set_error(F_failure); @@ -666,16 +686,16 @@ extern "C" { if (data_make->cache_arguments.used > 2) { // The last file must be a directory. - status_file = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); - if (status_file == F_false || status_file == F_file_found_not) { + if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); status = F_status_set_error(F_failure); } - 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[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); + if (F_status_is_error(data_make->setting->state.status)) { + fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); status = F_status_set_error(F_failure); } @@ -683,12 +703,12 @@ extern "C" { else { // When the first file is a directory, then the second, if it exists, must also be a directory. - status_file = f_directory_is(data_make->cache_arguments.array[0]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[0]); - if (status_file == F_true) { - status_file = f_directory_is(data_make->cache_arguments.array[1]); + if (data_make->setting->state.status == F_true) { + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]); - if (status_file == F_false) { + if (data_make->setting->state.status == F_false) { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "second", data_make->cache_arguments.array[1]); status = F_status_set_error(F_failure); @@ -696,12 +716,12 @@ extern "C" { } } - data_make->setting->status = status; + data_make->setting->state.status = status; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_copy_ @@ -714,13 +734,13 @@ extern "C" { if (data_make->cache_arguments.used) { fake_make_operate_validate_define_name(data_make->cache_arguments.array[0]); - if (data_make->setting->status == F_true) { - data_make->setting->status = F_none; + if (data_make->setting->state.status == F_true) { + data_make->setting->state.status = F_none; return; } - if (data_make->setting->status == F_none) { + if (data_make->setting->state.status == F_none) { fake_make_print_error_define_name_empty(data_make->setting, data_make->main->error); } else { @@ -731,7 +751,7 @@ extern "C" { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); } - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } #endif // _di_fake_make_operate_validate_type_define_ @@ -747,19 +767,19 @@ extern "C" { fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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]); status = F_status_set_error(F_failure); } } // for - data_make->setting->status = status; + data_make->setting->state.status = status; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_delete_ @@ -772,7 +792,7 @@ extern "C" { if (state_process->operation_previous == fake_make_operation_type_else_e) { fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -780,7 +800,7 @@ extern "C" { if (state_process->operation_previous == fake_make_operation_type_if_e || state_process->operation_previous == fake_make_operation_type_and_e || state_process->operation_previous == fake_make_operation_type_or_e) { fake_make_print_error_after_condition_must_not(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -788,7 +808,7 @@ extern "C" { if (!state_process->block) { fake_make_print_error_after_condition_no_preceding(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -796,12 +816,12 @@ extern "C" { if (data_make->cache_arguments.used) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_validate_type_else_ @@ -813,7 +833,7 @@ extern "C" { if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -823,14 +843,14 @@ extern "C" { if (fl_string_dynamic_compare(fake_make_operation_argument_failure_s, data_make->cache_arguments.array[0]) == F_equal_to_not) { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_exit_s, data_make->cache_arguments.array[0]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } } } - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } #endif // _di_fake_make_operate_validate_type_exit_ @@ -845,19 +865,19 @@ extern "C" { if (fl_string_dynamic_compare(fake_make_operation_argument_ignore_s, data_make->cache_arguments.array[0]) == F_equal_to_not) { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, fake_make_operation_fail_s, data_make->cache_arguments.array[0]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } } } - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_fail_ @@ -870,15 +890,15 @@ extern "C" { if (!data_make->cache_arguments.used) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else if (!data_make->setting_build.build_indexer.used) { fake_make_print_error_indexer_not_specified(data_make->setting, data_make->main->error, fake_make_operation_index_s); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_index_ @@ -891,7 +911,7 @@ extern "C" { if (data_make->cache_arguments.used > 4) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -932,7 +952,7 @@ extern "C" { fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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[data_make->cache_arguments.used - 1]); status = F_status_set_error(F_failure); @@ -949,13 +969,13 @@ extern "C" { if (f_path_is_absolute(data_make->cache_arguments.array[data_make->cache_arguments.used - 2]) == F_true) { fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[data_make->cache_arguments.used - 2]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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_arguments.array[data_make->cache_arguments.used - 2]); status = F_status_set_error(F_failure); } - if ((flag & 0x2) && F_status_is_error_not(data_make->setting->status)) { + if ((flag & 0x2) && F_status_is_error_not(data_make->setting->state.status)) { if (f_file_exists(data_make->cache_arguments.array[data_make->cache_arguments.used - 2], F_false) != F_true) { fake_print_error_operation_link_target_exists_not(data_make->setting, data_make->error, data_make->cache_arguments.array[data_make->cache_arguments.used - 2]); @@ -976,33 +996,33 @@ extern "C" { data_make->cache_path.used = 0; - data_make->setting->status = f_file_name_directory(full, &data_make->cache_path); + data_make->setting->state.status = f_file_name_directory(full, &data_make->cache_path); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_name_directory), full, f_file_operation_analyze_s, fll_error_file_type_path_e); status = F_status_set_error(F_failure); } - if (F_status_is_error_not(data_make->setting->status)) { - data_make->setting->status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_path); + if (F_status_is_error_not(data_make->setting->state.status)) { + data_make->setting->state.status = f_string_dynamic_append_assure(f_path_separator_s, &data_make->cache_path); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append_assure)); status = F_status_set_error(F_failure); } else { - data_make->setting->status = f_string_dynamic_append(data_make->cache_arguments.array[data_make->cache_arguments.used - 2], &data_make->cache_path); + data_make->setting->state.status = f_string_dynamic_append(data_make->cache_arguments.array[data_make->cache_arguments.used - 2], &data_make->cache_path); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error(data_make->setting, data_make->main->error, macro_fake_f(f_string_dynamic_append)); status = F_status_set_error(F_failure); } } - if (F_status_is_error_not(data_make->setting->status)) { + if (F_status_is_error_not(data_make->setting->state.status)) { // The cache_path is used by fake_make_assure_inside_project(), so copy the contents into another buffer. f_char_t target_string[data_make->cache_path.used + 1]; @@ -1013,13 +1033,13 @@ extern "C" { fake_make_assure_inside_project(data_make, target); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_operation_path_outside(data_make->setting, data_make->error, macro_fake_f(fake_make_assure_inside_project), target); status = F_status_set_error(F_failure); } - if ((flag & 0x2) && F_status_is_error_not(data_make->setting->status)) { + if ((flag & 0x2) && F_status_is_error_not(data_make->setting->state.status)) { if (f_file_exists(target, F_false) != F_true) { fake_print_error_operation_link_target_exists_not(data_make->setting, data_make->error, target); @@ -1032,16 +1052,16 @@ extern "C" { else { fake_make_print_error_target_file_name_empty(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } - data_make->setting->status = status; + data_make->setting->state.status = status; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_link_ @@ -1057,9 +1077,9 @@ extern "C" { for (f_array_length_t i = 0; i < data_make->cache_arguments.used; ++i) { - data_make->setting->status = fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); + fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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]); status = F_status_set_error(F_failure); @@ -1077,28 +1097,28 @@ extern "C" { } // for } - data_make->setting->status = status; + data_make->setting->state.status = status; - if (F_status_is_error(data_make->setting->status)) return; + if (F_status_is_error(data_make->setting->state.status)) return; } if (data_make->cache_arguments.used > 2) { // The last file must be a directory. - data_make->setting->status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); - if (data_make->setting->status == F_false || data_make->setting->status == F_file_found_not) { + if (data_make->setting->state.status == F_false || data_make->setting->state.status == F_file_found_not) { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "last", data_make->cache_arguments.array[data_make->cache_arguments.used - 1]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_directory_is), data_make->cache_arguments.array[data_make->cache_arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1106,27 +1126,27 @@ extern "C" { else { // When the first file is a directory, then the second, if it exists, must also be a directory. - data_make->setting->status = f_directory_is(data_make->cache_arguments.array[0]); + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[0]); - if (data_make->setting->status == F_true) { - data_make->setting->status = f_directory_is(data_make->cache_arguments.array[1]); + if (data_make->setting->state.status == F_true) { + data_make->setting->state.status = f_directory_is(data_make->cache_arguments.array[1]); - if (data_make->setting->status == F_false) { + if (data_make->setting->state.status == F_false) { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, "second", data_make->cache_arguments.array[1]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); - break; + return; } } } - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_move_ @@ -1139,7 +1159,7 @@ extern "C" { if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1157,7 +1177,7 @@ extern "C" { if (id_section == data_make->fakefile.used) { fake_make_print_error_operation_section_not_found(data_make->setting, data_make->main->error, data_make->cache_arguments.array[0]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1167,18 +1187,18 @@ extern "C" { if (section_stack->array[i] == id_section) { fake_make_print_error_operation_recursion(data_make->setting, data_make->main->error, data_make->buffer, data_make->fakefile.array[id_section].name); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } } // for - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_operate_ @@ -1236,12 +1256,12 @@ extern "C" { } } // for - data_make->setting->status = status; + data_make->setting->state.status = status; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_parameter_ @@ -1265,15 +1285,15 @@ extern "C" { for (; i < data_make->cache_arguments.used; ++i) { - data_make->setting->status = f_file_is(data_make->cache_arguments.array[i], F_file_type_regular_d, F_false); + data_make->setting->state.status = f_file_is(data_make->cache_arguments.array[i], F_file_type_regular_d, F_false); - if (data_make->setting->status == F_file_found_not) { + if (data_make->setting->state.status == F_file_found_not) { fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e); status = F_status_set_error(F_failure); } - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->main->error.to.stream) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[i], f_file_operation_find_s, fll_error_file_type_directory_e); } @@ -1282,13 +1302,13 @@ extern "C" { } } // for - data_make->setting->status = status; + data_make->setting->state.status = status; } } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_permission_ @@ -1301,7 +1321,7 @@ extern "C" { if (data_make->cache_arguments.used) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } @@ -1309,10 +1329,10 @@ extern "C" { if (data_make->path.stack.used == 1) { fake_make_print_error_pop_last_path(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_pop_ @@ -1325,10 +1345,10 @@ extern "C" { if (!data_make->cache_arguments.used) { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } } #endif // _di_fake_make_operate_validate_type_run_ @@ -1341,52 +1361,52 @@ extern "C" { if (data_make->cache_arguments.used > 1) { fake_print_error_too_many_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } if (data_make->cache_arguments.used) { if (data_make->cache_arguments.array[0].used) { - data_make->setting->status = f_file_is(data_make->cache_arguments.array[0], F_file_type_directory_d, F_false); + data_make->setting->state.status = f_file_is(data_make->cache_arguments.array[0], F_file_type_directory_d, F_false); - if (data_make->setting->status == F_file_found_not) { + if (data_make->setting->state.status == F_file_found_not) { fake_print_error_file_simple(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->cache_arguments.array[0], f_file_operation_find_s, fll_error_file_type_file_e); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->setting->state.status)) { if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->main->error.to.stream) { fake_print_error_file(data_make->setting, data_make->main->error, macro_fake_f(f_file_is), data_make->data->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e); } - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } - if (data_make->setting->status) { - data_make->setting->status = F_none; + if (data_make->setting->state.status) { + data_make->setting->state.status = F_none; } else { fake_make_print_error_content_not_directory(data_make->setting, data_make->main->error, 0, data_make->cache_arguments.array[0]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } else { fake_make_print_error_file_name_empty(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_to_ @@ -1401,7 +1421,7 @@ extern "C" { if (fl_string_dynamic_compare(fake_make_operation_argument_directory_s, data_make->cache_arguments.array[0]) == F_equal_to_not) { fake_make_print_error_unsupported_type(data_make->setting, data_make->main->error, f_file_type_name_file_s, data_make->cache_arguments.array[0]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } @@ -1411,50 +1431,50 @@ extern "C" { fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[i]); - if (F_status_is_error(setting->status)) { + if (F_status_is_error(data_make->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]); status = F_status_set_error(F_failure); } } // for - data_make->setting->status = status; + data_make->setting->state.status = status; } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_touch_ #ifndef _di_fake_make_operate_validate_type_write_ - f_status_t fake_make_operate_validate_type_write(fake_make_data_t * const data_make) { + void fake_make_operate_validate_type_write(fake_make_data_t * const data_make) { if (data_make->cache_arguments.used) { if (!data_make->cache_arguments.array[0].used) { fake_print_error_argument_empty(data_make->setting, data_make->error, 1); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); return; } fake_make_assure_inside_project(data_make, data_make->cache_arguments.array[0]); - if (F_status_is_error(data_make->setting->status)) { + if (F_status_is_error(data_make->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]); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } else { - data_make->setting->status = F_none; + data_make->setting->state.status = F_none; } } else { fake_print_error_requires_more_arguments(data_make->setting, data_make->main->error); - data_make->setting->status = F_status_set_error(F_failure); + data_make->setting->state.status = F_status_set_error(F_failure); } } #endif // _di_fake_make_operate_validate_type_write_ diff --git a/level_3/fake/c/main/print/verbose.c b/level_3/fake/c/main/print/verbose.c index b5e2706..8f3f830 100644 --- a/level_3/fake/c/main/print/verbose.c +++ b/level_3/fake/c/main/print/verbose.c @@ -5,29 +5,57 @@ extern "C" { #endif #ifndef _di_fake_print_verbose_clone_ - f_status_t fake_print_verbose_clone(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { + void fake_print_verbose_clone(const f_string_static_t source, const f_string_static_t destination, void * const void_recurse) { - if (!setting) return F_status_set_error(F_output_not); - if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!void_recurse) return; - fake_print_wrapped_variables(setting, print, "Cloned ", source, " to ", destination, 0); + f_directory_recurse_t * const recurse = (f_directory_recurse_t * const) void_recurse; - return F_none; + if (!recurse->state.custom) { + recurse->state.status = F_output_not; + + return; + } + + fake_data_t * const data = (fake_data_t * const) recurse->state.custom; + + if (data->main->message.verbosity < f_console_verbosity_verbose_e) { + recurse->state.status = F_output_not; + + return; + } + + fake_print_wrapped_variables(data->setting, data->main->message, "Cloned ", source, " to ", destination, 0); } #endif // _di_fake_print_verbose_clone_ #ifndef _di_fake_print_verbose_copy_ - f_status_t fake_print_verbose_copy(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { + void fake_print_verbose_copy(const f_string_static_t source, const f_string_static_t destination, void * const void_recurse) { - if (!setting) return F_status_set_error(F_output_not); - if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!void_recurse) return; + + f_directory_recurse_t * const recurse = (f_directory_recurse_t * const) void_recurse; + + if (!recurse->state.custom) { + recurse->state.status = F_output_not; - fll_print_format("Copied '%Q' to '%Q'.%r", output, source, destination, f_string_eol_s); + return; + } + + fake_data_t * const data = (fake_data_t * const) recurse->state.custom; + + if (data->main->message.verbosity < f_console_verbosity_verbose_e) { + recurse->state.status = F_output_not; + + return; + } + + fake_print_wrapped_variables(data->setting, data->main->message, "Copied ", source, " to ", destination, 0); } #endif // _di_fake_print_verbose_copy_ #ifndef _di_fake_print_verbose_create_directory_ - f_status_t fake_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { + void fake_print_verbose_create_directory(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t path) { if (!setting) return F_status_set_error(F_output_not); if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; @@ -103,12 +131,27 @@ extern "C" { #endif // _di_fake_print_verbose_file_pre_populated_ #ifndef _di_fake_print_verbose_move_ - f_status_t fake_print_verbose_move(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination) { + void fake_print_verbose_move(const f_string_static_t source, const f_string_static_t destination, void * const void_recurse) { - if (!setting) return F_status_set_error(F_output_not); - if (print.verbosity < f_console_verbosity_verbose_e) return F_output_not; + if (!void_recurse) return; + + f_directory_recurse_t * const recurse = (f_directory_recurse_t * const) void_recurse; + + if (!recurse->state.custom) { + recurse->state.status = F_output_not; + + return; + } + + fake_data_t * const data = (fake_data_t * const) recurse->state.custom; + + if (data->main->message.verbosity < f_console_verbosity_verbose_e) { + recurse->state.status = F_output_not; + + return; + } - fll_print_format("Moved '%Q' to '%Q'.%r", output, source, destination, f_string_eol_s); + fake_print_wrapped_variables(data->setting, data->main->message, "Moved ", source, " to ", destination, 0); } #endif // _di_fake_print_verbose_move_ diff --git a/level_3/fake/c/main/print/verbose.h b/level_3/fake/c/main/print/verbose.h index 7334fac..0d73336 100644 --- a/level_3/fake/c/main/print/verbose.h +++ b/level_3/fake/c/main/print/verbose.h @@ -19,53 +19,47 @@ extern "C" { /** * Helper function for performing a verbose print for a file clone operation. * - * @param setting - * The main program settings. + * This is intended to be passed as a callback to f_directory_recurse_t.verbose. + * The f_directory_recurse_t.state.custom must be the fake_data_t. * - * This does not alter setting.state.status. - * @param print - * Designates the how and where to print. * @param source * The source string. * @param destination * The destination string. + * @param recurse + * The recurse.state.custom must be a structure of type fake_data_t. * - * @return - * F_none on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. + * This alters recurse.state.status: + * F_none on success. + * F_output_not on success, but no printing is performed. * - * @see fake_print_wrapped_variables() + * @see fll_print_format() */ #ifndef _di_fake_print_verbose_clone_ - extern f_status_t fake_print_verbose_clone(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination); + extern void fake_print_verbose_clone(const f_string_static_t source, const f_string_static_t destination, void * const recurse); #endif // _di_fake_print_verbose_clone_ /** * Helper function for performing a verbose print for a file copy operation. * - * @param setting - * The main program settings. + * This is intended to be passed as a callback to f_directory_recurse_t.verbose. + * The f_directory_recurse_t.state.custom must be the fake_data_t. * - * This does not alter setting.state.status. - * @param print - * Designates the how and where to print. * @param source * The source string. * @param destination * The destination string. + * @param recurse + * The recurse.state.custom must be a structure of type fake_data_t. * - * @return - * F_none on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. + * This alters recurse.state.status: + * F_none on success. + * F_output_not on success, but no printing is performed. * * @see fll_print_format() */ #ifndef _di_fake_print_verbose_copy_ - extern f_status_t fake_print_verbose_copy(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination); + extern void fake_print_verbose_copy(const f_string_static_t source, const f_string_static_t destination, void * const recurse); #endif // _di_fake_print_verbose_copy_ /** @@ -239,27 +233,24 @@ extern "C" { /** * Print a verbose message for when a file is moved. * - * @param setting - * The main program settings. + * This is intended to be passed as a callback to f_directory_recurse_t.verbose. + * The f_directory_recurse_t.state.custom must be the fake_data_t. * - * This does not alter setting.state.status. - * @param print - * Designates the how and where to print. * @param source * The source string. * @param destination * The destination string. + * @param recurse + * The recurse.state.custom must be a structure of type fake_data_t. * - * @return - * F_none on success. - * F_output_not on success, but no printing is performed. - * - * F_output_not (with error bit) if setting is NULL. + * This alters recurse.state.status: + * F_none on success. + * F_output_not on success, but no printing is performed. * * @see fll_print_format() */ #ifndef _di_fake_print_verbose_move_ - extern f_status_t fake_print_verbose_move(fake_setting_t * const setting, const fl_print_t print, const f_string_static_t source, const f_string_static_t destination); + extern void fake_print_verbose_move(const f_string_static_t source, const f_string_static_t destination, void * const recurse); #endif // _di_fake_print_verbose_move_ #ifdef __cplusplus diff --git a/level_3/fake/c/main/skeleton.c b/level_3/fake/c/main/skeleton.c index adfb177..1938a5c 100644 --- a/level_3/fake/c/main/skeleton.c +++ b/level_3/fake/c/main/skeleton.c @@ -80,7 +80,7 @@ extern "C" { status = fake_skeleton_operate_directory_create(data, path[i]); if (F_status_is_error(status)) { - fake_print_error(data->setting, data->main->error, status, macro_fake_f(fake_skeleton_operate_directory_create)); + fake_print_error(data->setting, data->main->error, macro_fake_f(fake_skeleton_operate_directory_create)); return status; } -- 1.8.3.1