The "parameter" is already supported under "settings" in a fakefile.
Extend the operations to also support "parameter".
This allows for defining the parameter anywhere within the file and it can be overridden.
There exists several "if" operations that would make sense to have the inverse.
This is now supported via the if "not" operation.
To keep the logic more consistent with the previous design, just extend the existing code to handle "if not" behavior rather than adding new structures.
To achieve this, the pre-processor identifies "not" and then parses that to identify the particular "if" operation that is being negated.
The "if" operation is then change to a new operation type to reflect this.
Anything that already supports an inverse through some means are omitted from this.
This list includes:
- fail (opposite of success).
- success (opposite of fail).
- integer/math comparisons: ==, <>, <, <=, >, >=.
Fix the order of several of the functions that are not alphabetical.
Update the documentation accordingly.
const f_string_t fake_make_operation_operate_s = FAKE_make_operation_operate_s;
const f_string_t fake_make_operation_owner_s = FAKE_make_operation_owner_s;
const f_string_t fake_make_operation_owners_s = FAKE_make_operation_owners_s;
+ const f_string_t fake_make_operation_parameter_s = FAKE_make_operation_parameter_s;
const f_string_t fake_make_operation_pop_s = FAKE_make_operation_pop_s;
const f_string_t fake_make_operation_print_s = FAKE_make_operation_print_s;
const f_string_t fake_make_operation_run_s = FAKE_make_operation_run_s;
const f_string_t fake_make_operation_argument_if_less_s = FAKE_make_operation_argument_if_less_s;
const f_string_t fake_make_operation_argument_if_less_equal_s = FAKE_make_operation_argument_if_less_equal_s;
const f_string_t fake_make_operation_argument_if_mode_s = FAKE_make_operation_argument_if_mode_s;
+ const f_string_t fake_make_operation_argument_if_not_s = FAKE_make_operation_argument_if_not_s;
const f_string_t fake_make_operation_argument_if_owner_s = FAKE_make_operation_argument_if_owner_s;
const f_string_t fake_make_operation_argument_if_success_s = FAKE_make_operation_argument_if_success_s;
#endif // _di_fake_make_operation_
#endif // _di_fake_make_setting_t_
#ifndef _di_fake_make_operation_
- #define FAKE_make_operation_break_s "break"
- #define FAKE_make_operation_build_s "build"
- #define FAKE_make_operation_clean_s "clean"
- #define FAKE_make_operation_clone_s "clone"
- #define FAKE_make_operation_compile_s "compile"
- #define FAKE_make_operation_copy_s "copy"
- #define FAKE_make_operation_define_s "define"
- #define FAKE_make_operation_delete_s "delete"
- #define FAKE_make_operation_deletes_s "deletes"
- #define FAKE_make_operation_else_s "else"
- #define FAKE_make_operation_exit_s "exit"
- #define FAKE_make_operation_fail_s "fail"
- #define FAKE_make_operation_group_s "group"
- #define FAKE_make_operation_groups_s "groups"
- #define FAKE_make_operation_if_s "if"
- #define FAKE_make_operation_index_s "index"
- #define FAKE_make_operation_link_s "link"
- #define FAKE_make_operation_mode_s "mode"
- #define FAKE_make_operation_modes_s "modes"
- #define FAKE_make_operation_move_s "move"
- #define FAKE_make_operation_operate_s "operate"
- #define FAKE_make_operation_owner_s "owner"
- #define FAKE_make_operation_owners_s "owners"
- #define FAKE_make_operation_pop_s "pop"
- #define FAKE_make_operation_print_s "print"
- #define FAKE_make_operation_run_s "run"
- #define FAKE_make_operation_shell_s "shell"
- #define FAKE_make_operation_skeleton_s "skeleton"
- #define FAKE_make_operation_to_s "to"
- #define FAKE_make_operation_top_s "top"
- #define FAKE_make_operation_touch_s "touch"
-
- #define fake_make_operation_break_s_length 5
- #define fake_make_operation_build_s_length 5
- #define fake_make_operation_clean_s_length 5
- #define fake_make_operation_clone_s_length 5
- #define fake_make_operation_compile_s_length 7
- #define fake_make_operation_copy_s_length 4
- #define fake_make_operation_define_s_length 6
- #define fake_make_operation_delete_s_length 6
- #define fake_make_operation_deletes_s_length 7
- #define fake_make_operation_else_s_length 4
- #define fake_make_operation_exit_s_length 4
- #define fake_make_operation_fail_s_length 4
- #define fake_make_operation_group_s_length 5
- #define fake_make_operation_groups_s_length 6
- #define fake_make_operation_if_s_length 2
- #define fake_make_operation_index_s_length 5
- #define fake_make_operation_link_s_length 4
- #define fake_make_operation_mode_s_length 4
- #define fake_make_operation_modes_s_length 5
- #define fake_make_operation_move_s_length 4
- #define fake_make_operation_operate_s_length 7
- #define fake_make_operation_owner_s_length 5
- #define fake_make_operation_owners_s_length 6
- #define fake_make_operation_pop_s_length 3
- #define fake_make_operation_print_s_length 5
- #define fake_make_operation_run_s_length 3
- #define fake_make_operation_shell_s_length 5
- #define fake_make_operation_skeleton_s_length 8
- #define fake_make_operation_to_s_length 2
- #define fake_make_operation_top_s_length 3
- #define fake_make_operation_touch_s_length 5
+ #define FAKE_make_operation_break_s "break"
+ #define FAKE_make_operation_build_s "build"
+ #define FAKE_make_operation_clean_s "clean"
+ #define FAKE_make_operation_clone_s "clone"
+ #define FAKE_make_operation_compile_s "compile"
+ #define FAKE_make_operation_copy_s "copy"
+ #define FAKE_make_operation_define_s "define"
+ #define FAKE_make_operation_delete_s "delete"
+ #define FAKE_make_operation_deletes_s "deletes"
+ #define FAKE_make_operation_else_s "else"
+ #define FAKE_make_operation_exit_s "exit"
+ #define FAKE_make_operation_fail_s "fail"
+ #define FAKE_make_operation_group_s "group"
+ #define FAKE_make_operation_groups_s "groups"
+ #define FAKE_make_operation_if_s "if"
+ #define FAKE_make_operation_index_s "index"
+ #define FAKE_make_operation_link_s "link"
+ #define FAKE_make_operation_mode_s "mode"
+ #define FAKE_make_operation_modes_s "modes"
+ #define FAKE_make_operation_move_s "move"
+ #define FAKE_make_operation_operate_s "operate"
+ #define FAKE_make_operation_owner_s "owner"
+ #define FAKE_make_operation_owners_s "owners"
+ #define FAKE_make_operation_parameter_s "parameter"
+ #define FAKE_make_operation_pop_s "pop"
+ #define FAKE_make_operation_print_s "print"
+ #define FAKE_make_operation_run_s "run"
+ #define FAKE_make_operation_shell_s "shell"
+ #define FAKE_make_operation_skeleton_s "skeleton"
+ #define FAKE_make_operation_to_s "to"
+ #define FAKE_make_operation_top_s "top"
+ #define FAKE_make_operation_touch_s "touch"
+
+ #define fake_make_operation_break_s_length 5
+ #define fake_make_operation_build_s_length 5
+ #define fake_make_operation_clean_s_length 5
+ #define fake_make_operation_clone_s_length 5
+ #define fake_make_operation_compile_s_length 7
+ #define fake_make_operation_copy_s_length 4
+ #define fake_make_operation_define_s_length 6
+ #define fake_make_operation_delete_s_length 6
+ #define fake_make_operation_deletes_s_length 7
+ #define fake_make_operation_else_s_length 4
+ #define fake_make_operation_exit_s_length 4
+ #define fake_make_operation_fail_s_length 4
+ #define fake_make_operation_group_s_length 5
+ #define fake_make_operation_groups_s_length 6
+ #define fake_make_operation_if_s_length 2
+ #define fake_make_operation_index_s_length 5
+ #define fake_make_operation_link_s_length 4
+ #define fake_make_operation_mode_s_length 4
+ #define fake_make_operation_modes_s_length 5
+ #define fake_make_operation_move_s_length 4
+ #define fake_make_operation_operate_s_length 7
+ #define fake_make_operation_owner_s_length 5
+ #define fake_make_operation_owners_s_length 6
+ #define fake_make_operation_parameter_s_length 9
+ #define fake_make_operation_pop_s_length 3
+ #define fake_make_operation_print_s_length 5
+ #define fake_make_operation_run_s_length 3
+ #define fake_make_operation_shell_s_length 5
+ #define fake_make_operation_skeleton_s_length 8
+ #define fake_make_operation_to_s_length 2
+ #define fake_make_operation_top_s_length 3
+ #define fake_make_operation_touch_s_length 5
extern const f_string_t fake_make_operation_break_s;
extern const f_string_t fake_make_operation_build_s;
extern const f_string_t fake_make_operation_operate_s;
extern const f_string_t fake_make_operation_owner_s;
extern const f_string_t fake_make_operation_owners_s;
+ extern const f_string_t fake_make_operation_parameter_s;
extern const f_string_t fake_make_operation_pop_s;
extern const f_string_t fake_make_operation_print_s;
extern const f_string_t fake_make_operation_run_s;
fake_make_operation_type_operate,
fake_make_operation_type_owner,
fake_make_operation_type_owners,
+ fake_make_operation_type_parameter,
fake_make_operation_type_pop,
fake_make_operation_type_print,
fake_make_operation_type_run,
fake_make_operation_type_touch,
};
- #define fake_make_operation_total_d 31
+ #define fake_make_operation_total_d 32
#define FAKE_make_operation_argument_environment_s "environment"
#define FAKE_make_operation_argument_failure_s "failure"
#define FAKE_make_operation_argument_if_less_s "<"
#define FAKE_make_operation_argument_if_less_equal_s "<="
#define FAKE_make_operation_argument_if_mode_s "mode"
+ #define FAKE_make_operation_argument_if_not_s "not"
#define FAKE_make_operation_argument_if_owner_s "owner"
#define FAKE_make_operation_argument_if_success_s "success"
#define fake_make_operation_argument_if_less_s_length 1
#define fake_make_operation_argument_if_less_equal_s_length 2
#define fake_make_operation_argument_if_mode_s_length 4
+ #define fake_make_operation_argument_if_not_s_length 3
#define fake_make_operation_argument_if_owner_s_length 5
#define fake_make_operation_argument_if_success_s_length 7
extern const f_string_t fake_make_operation_argument_if_less_s;
extern const f_string_t fake_make_operation_argument_if_less_equal_s;
extern const f_string_t fake_make_operation_argument_if_mode_s;
+ extern const f_string_t fake_make_operation_argument_if_not_s;
extern const f_string_t fake_make_operation_argument_if_owner_s;
extern const f_string_t fake_make_operation_argument_if_success_s;
fake_make_operation_if_type_if_less,
fake_make_operation_if_type_if_less_equal,
fake_make_operation_if_type_if_mode,
+ fake_make_operation_if_type_if_not,
+ fake_make_operation_if_type_if_not_defined,
+ fake_make_operation_if_type_if_not_exists,
+ fake_make_operation_if_type_if_not_group,
+ fake_make_operation_if_type_if_not_is,
+ fake_make_operation_if_type_if_not_mode,
+ fake_make_operation_if_type_if_not_owner,
fake_make_operation_if_type_if_owner,
fake_make_operation_if_type_if_success,
fake_make_operation_if_type_true,
}
#endif // _di_fake_make_operate_process_type_groups_
-#ifndef _di_fake_make_operate_process_type_if_group_
- f_status_t fake_make_operate_process_type_if_group(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) {
-
- f_status_t status = F_none;
- uid_t id = 0;
+#ifndef _di_fake_make_operate_process_type_if_defined_
+ void fake_make_operate_process_type_if_defined(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) {
- status = fake_make_get_id_group(main, data_make->error, arguments.array[1], &id);
- if (F_status_is_error(status)) return status;
+ const f_string_static_t argument = if_not ? arguments.array[2] : arguments.array[1];
- uid_t id_file = 0;
+ const f_string_t reserved_name[] = {
+ fake_make_parameter_variable_build_s,
+ fake_make_parameter_variable_color_s,
+ fake_make_parameter_variable_data_s,
+ fake_make_parameter_variable_define_s,
+ fake_make_parameter_variable_fakefile_s,
+ fake_make_parameter_variable_mode_s,
+ fake_make_parameter_variable_process_s,
+ fake_make_parameter_variable_settings_s,
+ fake_make_parameter_variable_sources_s,
+ fake_make_parameter_variable_verbosity_s,
+ fake_make_parameter_variable_work_s,
+ fake_make_parameter_variable_option_build_s,
+ fake_make_parameter_variable_option_color_s,
+ fake_make_parameter_variable_option_data_s,
+ fake_make_parameter_variable_option_define_s,
+ fake_make_parameter_variable_option_fakefile_s,
+ fake_make_parameter_variable_option_mode_s,
+ fake_make_parameter_variable_option_process_s,
+ fake_make_parameter_variable_option_settings_s,
+ fake_make_parameter_variable_option_sources_s,
+ fake_make_parameter_variable_option_verbosity_s,
+ fake_make_parameter_variable_option_work_s,
+ fake_make_parameter_variable_value_build_s,
+ fake_make_parameter_variable_value_color_s,
+ fake_make_parameter_variable_value_data_s,
+ fake_make_parameter_variable_value_define_s,
+ fake_make_parameter_variable_value_fakefile_s,
+ fake_make_parameter_variable_value_mode_s,
+ fake_make_parameter_variable_value_process_s,
+ fake_make_parameter_variable_value_settings_s,
+ fake_make_parameter_variable_value_sources_s,
+ fake_make_parameter_variable_value_verbosity_s,
+ fake_make_parameter_variable_value_work_s,
+ };
- *operation_if = fake_make_operation_if_type_true_next;
+ const f_array_length_t reserved_length[] = {
+ fake_make_parameter_variable_build_s_length,
+ fake_make_parameter_variable_color_s_length,
+ fake_make_parameter_variable_data_s_length,
+ fake_make_parameter_variable_define_s_length,
+ fake_make_parameter_variable_fakefile_s_length,
+ fake_make_parameter_variable_mode_s_length,
+ fake_make_parameter_variable_process_s_length,
+ fake_make_parameter_variable_settings_s_length,
+ fake_make_parameter_variable_sources_s_length,
+ fake_make_parameter_variable_verbosity_s_length,
+ fake_make_parameter_variable_work_s_length,
+ fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_value_s_length,
+ };
- for (f_array_length_t i = 2; i < arguments.used; ++i, id_file = 0) {
+ const bool reserved_defined[] = {
+ main->path_build.used,
+ F_true,
+ main->path_data.used,
+ main->define.used,
+ main->fakefile.used,
+ main->mode.used,
+ main->process.used,
+ main->settings.used,
+ main->path_sources.used,
+ F_true,
+ main->path_work.used,
+ main->parameters[fake_parameter_path_build].result == f_console_result_additional,
+ main->parameters[fake_parameter_light].result == f_console_result_found || main->parameters[fake_parameter_dark].result == f_console_result_found || main->parameters[fake_parameter_no_color].result == f_console_result_found,
+ main->parameters[fake_parameter_path_data].result == f_console_result_additional,
+ main->parameters[fake_parameter_define].result == f_console_result_additional,
+ main->parameters[fake_parameter_fakefile].result == f_console_result_additional,
+ main->parameters[fake_parameter_mode].result == f_console_result_additional,
+ main->parameters[fake_parameter_process].result == f_console_result_additional,
+ main->parameters[fake_parameter_settings].result == f_console_result_additional,
+ main->parameters[fake_parameter_path_sources].result == f_console_result_additional,
+ main->parameters[fake_parameter_verbosity_quiet].result == f_console_result_found || main->parameters[fake_parameter_verbosity_normal].result == f_console_result_found || main->parameters[fake_parameter_verbosity_verbose].result == f_console_result_found || main->parameters[fake_parameter_verbosity_debug].result == f_console_result_found,
+ main->parameters[fake_parameter_path_work].result == f_console_result_additional,
+ data_make->parameter_value.build.used,
+ data_make->parameter_value.color.used,
+ data_make->parameter_value.data.used,
+ data_make->parameter_value.define.used,
+ data_make->parameter_value.fakefile.used,
+ data_make->parameter_value.mode.used,
+ data_make->parameter_value.process.used,
+ data_make->parameter_value.settings.used,
+ data_make->parameter_value.sources.used,
+ data_make->parameter_value.verbosity.used,
+ data_make->parameter_value.work.used,
+ };
- status = f_file_group_read(arguments.array[i].string, &id_file);
+ if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment_s, argument, fake_make_operation_argument_environment_s_length) == F_equal_to) {
+ *operation_if = fake_make_operation_if_type_true_next;
- if (F_status_is_error(status)) {
- *operation_if = fake_make_operation_if_type_false_always_next;
+ if (if_not) {
+ for (f_array_length_t i = 3; i < arguments.used; ++i) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_group_read", F_true, arguments.array[i].string, "get group of", fll_error_file_type_file);
+ if (f_environment_exists(arguments.array[i].string) == F_true) {
+ *operation_if = fake_make_operation_if_type_false_next;
- break;
+ break;
+ }
+ } // for
}
+ else {
+ for (f_array_length_t i = 2; i < arguments.used; ++i) {
- if (id != id_file) {
- *operation_if = fake_make_operation_if_type_false_next;
+ if (f_environment_exists(arguments.array[i].string) != F_true) {
+ *operation_if = fake_make_operation_if_type_false_next;
- break;
+ break;
+ }
+ } // for
}
- } // for
- if (F_status_is_error(status)) return status;
+ return;
+ }
- return F_none;
- }
-#endif // _di_fake_make_operate_process_type_if_group_
+ f_array_length_t i = if_not ? 3 : 2;
+ f_array_length_t j = 0;
-#ifndef _di_fake_make_operate_process_type_if_mode_
- f_status_t fake_make_operate_process_type_if_mode(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) {
+ // 0 = unknown, 1 = fail, 2 = pass.
+ uint8_t result = 0;
- f_status_t status = F_none;
- f_file_mode_t mode_rule = 0;
- mode_t mode_match = 0;
- bool is = F_false;
+ *operation_if = fake_make_operation_if_type_true_next;
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_is_s, arguments.array[1], fake_make_operation_argument_is_s_length) == F_equal_to) {
- is = F_true;
- }
+ // Multiple properties may pass and so if any of them fail, then they all fail.
+ for (; i < arguments.used; ++i) {
- {
- uint8_t mode_replace = 0;
+ for (j = 0; j < 33; ++j) {
- status = fake_make_get_id_mode(main, data_make->error, arguments.array[2], &mode_rule, &mode_replace);
+ if (fl_string_dynamic_compare_string(reserved_name[j], arguments.array[i], reserved_length[j]) == F_equal_to) {
+ result = reserved_defined[j] ? 2 : 1;
- if (F_status_is_error(status)) {
- *operation_if = fake_make_operation_if_type_false_always_next;
+ break;
+ }
+ } // for
- return status;
+ if (!result) {
+ for (j = 0; j < data_make->setting_make.parameter.used; ++j) {
+
+ if (fl_string_dynamic_compare(arguments.array[i], data_make->setting_make.parameter.array[j].name) == F_equal_to) {
+ result = 2;
+
+ break;
+ }
+ } // for
}
- status = f_file_mode_to_mode(mode_rule, &mode_match);
+ if (result < 2) {
+ result = 1;
- if (F_status_is_error(status)) {
- *operation_if = fake_make_operation_if_type_false_always_next;
+ break;
+ }
- fll_error_print(data_make->error, F_status_set_fine(status), "f_file_mode_to_mode", F_true);
+ if (i + 1 < arguments.used) {
+ result = 0;
+ }
+ } // for
- return status;
+ if (if_not) {
+ if (result < 2) {
+ *operation_if = fake_make_operation_if_type_true_next;
+ }
+ else {
+ *operation_if = fake_make_operation_if_type_false_next;
}
}
+ else if (result < 2) {
+ *operation_if = fake_make_operation_if_type_false_next;
+ }
+ }
+#endif // _di_fake_make_operate_process_type_if_defined_
- mode_t mode_file = 0;
+#ifndef _di_fake_make_operate_process_type_if_exists_
+ f_status_t fake_make_operate_process_type_if_exists(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) {
+
+ f_status_t status = F_none;
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 3; i < arguments.used; ++i, mode_file = 0) {
+ for (f_array_length_t i = if_not ? 2 : 1; i < arguments.used; ++i) {
- status = f_file_mode_read(arguments.array[i].string, &mode_file);
+ status = f_file_exists(arguments.array[i].string);
if (F_status_is_error(status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "get mode of", fll_error_file_type_file);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_exists", F_true, arguments.array[i].string, "find", fll_error_file_type_file);
break;
}
- if (is) {
- if (mode_match != (mode_file & F_file_mode_all_d)) {
+ if (if_not) {
+ if (status == F_true) {
*operation_if = fake_make_operation_if_type_false_next;
break;
}
}
else {
- if (!(mode_match & mode_file)) {
+ if (status == F_false) {
*operation_if = fake_make_operation_if_type_false_next;
break;
}
} // for
- return F_none;
- }
-#endif // _di_fake_make_operate_process_type_if_mode_
-
-#ifndef _di_fake_make_operate_process_type_if_owner_
- f_status_t fake_make_operate_process_type_if_owner(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) {
-
- f_status_t status = F_none;
- uid_t id = 0;
-
- status = fake_make_get_id_owner(main, data_make->error, arguments.array[1], &id);
- if (F_status_is_error(status)) return status;
-
- uid_t id_file = 0;
-
- *operation_if = fake_make_operation_if_type_true_next;
-
- for (f_array_length_t i = 2; i < arguments.used; ++i, id_file = 0) {
-
- status = f_file_owner_read(arguments.array[i].string, &id_file);
-
- if (F_status_is_error(status)) {
- *operation_if = fake_make_operation_if_type_false_always_next;
-
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_owner_read", F_true, arguments.array[i].string, "get owner of", fll_error_file_type_file);
-
- break;
- }
-
- if (id != id_file) {
- *operation_if = fake_make_operation_if_type_false_next;
-
- break;
- }
- } // for
-
if (F_status_is_error(status)) return status;
return F_none;
}
-#endif // _di_fake_make_operate_process_type_if_owner_
+#endif // _di_fake_make_operate_process_type_if_exists_
#ifndef _di_fake_make_operate_process_type_if_is_
- f_status_t fake_make_operate_process_type_if_is(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) {
+ f_status_t fake_make_operate_process_type_if_is(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) {
f_status_t status = F_none;
// fifo = 0x8 (0000 1000) invalid = 0x80 (1000 0000)
uint8_t type = 0;
- f_array_length_t i = 1;
+ f_array_length_t i = if_not ? 2 : 1;
status = F_none;
type_file = 0x2;
}
else if (macro_f_file_type_is_directory(mode_file)) {
- type_file = 0x4;
- }
- else if (macro_f_file_type_is_fifo(mode_file)) {
- type_file = 0x8;
- }
- else if (macro_f_file_type_is_link(mode_file)) {
- type_file = 0x10;
- }
- else if (macro_f_file_type_is_regular(mode_file)) {
- type_file = 0x20;
- }
- else if (macro_f_file_type_is_socket(mode_file)) {
- type_file = 0x40;
- }
-
- if (!(type & type_file)) {
- *operation_if = fake_make_operation_if_type_false_next;
-
- break;
- }
- } // for
-
- if (F_status_is_error(status)) return status;
-
- return F_none;
- }
-#endif // _di_fake_make_operate_process_type_if_is_
-
-#ifndef _di_fake_make_operate_process_type_if_defined_
- void fake_make_operate_process_type_if_defined(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) {
-
- const f_string_t reserved_name[] = {
- fake_make_parameter_variable_build_s,
- fake_make_parameter_variable_color_s,
- fake_make_parameter_variable_data_s,
- fake_make_parameter_variable_define_s,
- fake_make_parameter_variable_fakefile_s,
- fake_make_parameter_variable_mode_s,
- fake_make_parameter_variable_process_s,
- fake_make_parameter_variable_settings_s,
- fake_make_parameter_variable_sources_s,
- fake_make_parameter_variable_verbosity_s,
- fake_make_parameter_variable_work_s,
- fake_make_parameter_variable_option_build_s,
- fake_make_parameter_variable_option_color_s,
- fake_make_parameter_variable_option_data_s,
- fake_make_parameter_variable_option_define_s,
- fake_make_parameter_variable_option_fakefile_s,
- fake_make_parameter_variable_option_mode_s,
- fake_make_parameter_variable_option_process_s,
- fake_make_parameter_variable_option_settings_s,
- fake_make_parameter_variable_option_sources_s,
- fake_make_parameter_variable_option_verbosity_s,
- fake_make_parameter_variable_option_work_s,
- fake_make_parameter_variable_value_build_s,
- fake_make_parameter_variable_value_color_s,
- fake_make_parameter_variable_value_data_s,
- fake_make_parameter_variable_value_define_s,
- fake_make_parameter_variable_value_fakefile_s,
- fake_make_parameter_variable_value_mode_s,
- fake_make_parameter_variable_value_process_s,
- fake_make_parameter_variable_value_settings_s,
- fake_make_parameter_variable_value_sources_s,
- fake_make_parameter_variable_value_verbosity_s,
- fake_make_parameter_variable_value_work_s,
- };
-
- const f_array_length_t reserved_length[] = {
- fake_make_parameter_variable_build_s_length,
- fake_make_parameter_variable_color_s_length,
- fake_make_parameter_variable_data_s_length,
- fake_make_parameter_variable_define_s_length,
- fake_make_parameter_variable_fakefile_s_length,
- fake_make_parameter_variable_mode_s_length,
- fake_make_parameter_variable_process_s_length,
- fake_make_parameter_variable_settings_s_length,
- fake_make_parameter_variable_sources_s_length,
- fake_make_parameter_variable_verbosity_s_length,
- fake_make_parameter_variable_work_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_option_s_length,
- fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_value_s_length,
- fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_value_s_length,
- };
-
- const bool reserved_defined[] = {
- main->path_build.used,
- F_true,
- main->path_data.used,
- main->define.used,
- main->fakefile.used,
- main->mode.used,
- main->process.used,
- main->settings.used,
- main->path_sources.used,
- F_true,
- main->path_work.used,
- main->parameters[fake_parameter_path_build].result == f_console_result_additional,
- main->parameters[fake_parameter_light].result == f_console_result_found || main->parameters[fake_parameter_dark].result == f_console_result_found || main->parameters[fake_parameter_no_color].result == f_console_result_found,
- main->parameters[fake_parameter_path_data].result == f_console_result_additional,
- main->parameters[fake_parameter_define].result == f_console_result_additional,
- main->parameters[fake_parameter_fakefile].result == f_console_result_additional,
- main->parameters[fake_parameter_mode].result == f_console_result_additional,
- main->parameters[fake_parameter_process].result == f_console_result_additional,
- main->parameters[fake_parameter_settings].result == f_console_result_additional,
- main->parameters[fake_parameter_path_sources].result == f_console_result_additional,
- main->parameters[fake_parameter_verbosity_quiet].result == f_console_result_found || main->parameters[fake_parameter_verbosity_normal].result == f_console_result_found || main->parameters[fake_parameter_verbosity_verbose].result == f_console_result_found || main->parameters[fake_parameter_verbosity_debug].result == f_console_result_found,
- main->parameters[fake_parameter_path_work].result == f_console_result_additional,
- data_make->parameter_value.build.used,
- data_make->parameter_value.color.used,
- data_make->parameter_value.data.used,
- data_make->parameter_value.define.used,
- data_make->parameter_value.fakefile.used,
- data_make->parameter_value.mode.used,
- data_make->parameter_value.process.used,
- data_make->parameter_value.settings.used,
- data_make->parameter_value.sources.used,
- data_make->parameter_value.verbosity.used,
- data_make->parameter_value.work.used,
- };
-
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment_s, arguments.array[1], fake_make_operation_argument_environment_s_length) == F_equal_to) {
- *operation_if = fake_make_operation_if_type_true_next;
-
- for (f_array_length_t i = 2; i < arguments.used; ++i) {
-
- if (f_environment_exists(arguments.array[i].string) != F_true) {
- *operation_if = fake_make_operation_if_type_false_next;
-
- break;
- }
- } // for
- }
- else if (fl_string_dynamic_compare_string(fake_make_operation_argument_parameter_s, arguments.array[1], fake_make_operation_argument_parameter_s_length) == F_equal_to) {
-
- f_array_length_t i = 2;
- f_array_length_t j = 0;
-
- // 0 = unknown, 1 = fail, 2 = pass.
- uint8_t result = 0;
-
- *operation_if = fake_make_operation_if_type_true_next;
-
- // Multiple properties may pass and so if any of them fail, then they all fail.
- for (; i < arguments.used; ++i) {
-
- for (j = 0; j < 33; ++j) {
-
- if (fl_string_dynamic_compare_string(reserved_name[j], arguments.array[i], reserved_length[j]) == F_equal_to) {
- result = reserved_defined[j] ? 2 : 1;
-
- break;
- }
- } // for
-
- if (!result) {
- for (j = 0; j < data_make->setting_make.parameter.used; ++j) {
+ type_file = 0x4;
+ }
+ else if (macro_f_file_type_is_fifo(mode_file)) {
+ type_file = 0x8;
+ }
+ else if (macro_f_file_type_is_link(mode_file)) {
+ type_file = 0x10;
+ }
+ else if (macro_f_file_type_is_regular(mode_file)) {
+ type_file = 0x20;
+ }
+ else if (macro_f_file_type_is_socket(mode_file)) {
+ type_file = 0x40;
+ }
- if (fl_string_dynamic_compare(arguments.array[i], data_make->setting_make.parameter.array[j].name) == F_equal_to) {
- result = 2;
+ if (if_not) {
+ if (type & type_file) {
+ *operation_if = fake_make_operation_if_type_false_next;
- break;
- }
- } // for
+ break;
}
-
- if (result < 2) {
- result = 1;
+ }
+ else {
+ if (!(type & type_file)) {
+ *operation_if = fake_make_operation_if_type_false_next;
break;
}
+ }
+ } // for
- if (i + 1 < arguments.used) {
- result = 0;
- }
- } // for
+ if (F_status_is_error(status)) return status;
- if (result < 2) {
- *operation_if = fake_make_operation_if_type_false_next;
- }
- }
+ return F_none;
}
-#endif // _di_fake_make_operate_process_type_if_defined_
+#endif // _di_fake_make_operate_process_type_if_is_
#ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_
f_status_t fake_make_operate_process_type_if_greater_if_lesser(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) {
}
#endif // _di_fake_make_operate_process_type_if_greater_if_lesser_
+#ifndef _di_fake_make_operate_process_type_if_group_
+ f_status_t fake_make_operate_process_type_if_group(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) {
+
+ f_status_t status = F_none;
+ uid_t id = 0;
+
+ status = fake_make_get_id_group(main, data_make->error, arguments.array[if_not ? 2 : 1], &id);
+ if (F_status_is_error(status)) return status;
+
+ uid_t id_file = 0;
+
+ *operation_if = fake_make_operation_if_type_true_next;
+
+ for (f_array_length_t i = if_not ? 3 : 2; i < arguments.used; ++i, id_file = 0) {
+
+ status = f_file_group_read(arguments.array[i].string, &id_file);
+
+ if (F_status_is_error(status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_group_read", F_true, arguments.array[i].string, "get group of", fll_error_file_type_file);
+
+ break;
+ }
+
+ if (if_not) {
+ if (id == id_file) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ else {
+ if (id != id_file) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ } // for
+
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_fake_make_operate_process_type_if_group_
+
+#ifndef _di_fake_make_operate_process_type_if_mode_
+ f_status_t fake_make_operate_process_type_if_mode(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) {
+
+ f_status_t status = F_none;
+ f_file_mode_t mode_rule = 0;
+ mode_t mode_match = 0;
+ bool is = F_false;
+
+ if (fl_string_dynamic_compare_string(fake_make_operation_argument_is_s, arguments.array[if_not ? 2 : 1], fake_make_operation_argument_is_s_length) == F_equal_to) {
+ is = F_true;
+ }
+
+ {
+ uint8_t mode_replace = 0;
+
+ status = fake_make_get_id_mode(main, data_make->error, arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace);
+
+ if (F_status_is_error(status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ return status;
+ }
+
+ status = f_file_mode_to_mode(mode_rule, &mode_match);
+
+ if (F_status_is_error(status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_file_mode_to_mode", F_true);
+
+ return status;
+ }
+ }
+
+ mode_t mode_file = 0;
+
+ *operation_if = fake_make_operation_if_type_true_next;
+
+ for (f_array_length_t i = if_not ? 4 : 3; i < arguments.used; ++i, mode_file = 0) {
+
+ status = f_file_mode_read(arguments.array[i].string, &mode_file);
+
+ if (F_status_is_error(status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "get mode of", fll_error_file_type_file);
+
+ break;
+ }
+
+ if (if_not) {
+ if (is) {
+ if (mode_match == (mode_file & F_file_mode_all_d)) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ else {
+ if (mode_match & mode_file) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ }
+ else {
+ if (is) {
+ if (mode_match != (mode_file & F_file_mode_all_d)) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ else {
+ if (!(mode_match & mode_file)) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ }
+ } // for
+
+ return F_none;
+ }
+#endif // _di_fake_make_operate_process_type_if_mode_
+
+#ifndef _di_fake_make_operate_process_type_if_owner_
+ f_status_t fake_make_operate_process_type_if_owner(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) {
+
+ f_status_t status = F_none;
+ uid_t id = 0;
+
+ status = fake_make_get_id_owner(main, data_make->error, arguments.array[if_not ? 2 : 1], &id);
+ if (F_status_is_error(status)) return status;
+
+ uid_t id_file = 0;
+
+ *operation_if = fake_make_operation_if_type_true_next;
+
+ for (f_array_length_t i = if_not ? 3 : 2; i < arguments.used; ++i, id_file = 0) {
+
+ status = f_file_owner_read(arguments.array[i].string, &id_file);
+
+ if (F_status_is_error(status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_owner_read", F_true, arguments.array[i].string, "get owner of", fll_error_file_type_file);
+
+ break;
+ }
+
+ if (if_not) {
+ if (id == id_file) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ else {
+ if (id != id_file) {
+ *operation_if = fake_make_operation_if_type_false_next;
+
+ break;
+ }
+ }
+ } // for
+
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+#endif // _di_fake_make_operate_process_type_if_owner_
+
#ifndef _di_fake_make_operate_process_type_modes_
f_status_t fake_make_operate_process_type_modes(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool all) {
}
#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_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments) {
+
+ f_status_t status = F_none;
+
+ bool found = F_false;
+ f_array_length_t i = 0;
+
+ for (; i < data_make->setting_make.parameter.used; ++i) {
+
+ if (fl_string_dynamic_compare(arguments.array[0], data_make->setting_make.parameter.array[i].name) == F_equal_to) {
+ found = F_true;
+
+ break;
+ }
+ } // for
+
+ 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]);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true);
+
+ return status;
+ }
+ } // 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);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamics_resize", F_true);
+
+ return status;
+ }
+ }
+ }
+ else {
+ status = f_string_map_multis_resize(F_memory_default_allocation_small_d, &data_make->setting_make.parameter);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_map_multis_resize", F_true);
+
+ return status;
+ }
+
+ status = f_string_dynamic_append(arguments.array[0], &data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+
+ return status;
+ }
+
+ status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
+
+ return status;
+ }
+
+ i = data_make->setting_make.parameter.used++;
+ }
+
+ data_make->setting_make.parameter.array[i].value.used = 0;
+
+ if (arguments.used > 1) {
+ status = f_string_dynamics_resize(arguments.used - 1, &data_make->setting_make.parameter.array[i].value);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamics_resize", F_true);
+
+ return status;
+ }
+
+ for (f_array_length_t j = 0; j < data_make->setting_make.parameter.array[i].value.size; ++j) {
+
+ status = f_string_dynamic_append(arguments.array[j + 1], &data_make->setting_make.parameter.array[i].value.array[j]);
+
+ if (F_status_is_error(status)) {
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+
+ return status;
+ }
+
+ ++data_make->setting_make.parameter.array[i].value.used;
+ } // for
+ }
+
+ return 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_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments) {
#endif // _di_fake_make_operate_process_type_groups_
/**
- * Perform the if group operation process.
+ * Perform the if defined operation process.
*
* @param main
* The main program data.
* All make related setting data, including data from the fakefile and optionally build settings file.
* @param arguments
* The arguments for the run or shell operation.
+ * @param if_not
+ * When TRUE, perform the if not is.
+ * When FALSE, perform the if is.
* @param operation_if
* The if-condition status for the current operation.
+ */
+#ifndef _di_fake_make_operate_process_type_if_defined_
+ extern void fake_make_operate_process_type_if_defined(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_if_defined_
+
+/**
+ * Perform the if exists operation process.
+ *
+ * @param main
+ * The main program data.
+ * @param data_make
+ * All make related setting data, including data from the fakefile and optionally build settings file.
+ * @param if_not
+ * When TRUE, perform the if not is.
+ * When FALSE, perform the if is.
+ * @param arguments
+ * The arguments for the run or shell operation.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_file_group_read().
- *
- * Errors (with error bit) from: fake_make_get_id_group().
+ * Errors (with error bit) from: f_file_exists().
*
- * @see f_file_group_read()
- *
- * @see fake_make_get_id_group()
+ * @see f_file_exists()
*/
-#ifndef _di_fake_make_operate_process_type_if_group_
- extern f_status_t fake_make_operate_process_type_if_group(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
-#endif // _di_fake_make_operate_process_type_if_group_
+#ifndef _di_fake_make_operate_process_type_if_exists_
+ extern f_status_t fake_make_operate_process_type_if_exists(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_if_exists_
/**
- * Perform the if operation process.
+ * Perform the if >, >=, <, and <= operation processes.
*
* @param main
* The main program data.
* @return
* F_none on success.
*
- * 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().
- *
- * @see f_file_mode_read()
- * @see f_file_mode_to_mode()
+ * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
*
- * @see fake_make_get_id_mode()
+ * @see fl_conversion_string_to_number_unsigned()
*/
-#ifndef _di_fake_make_operate_process_type_if_mode_
- extern f_status_t fake_make_operate_process_type_if_mode(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
-#endif // _di_fake_make_operate_process_type_if_mode_
+#ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_
+ extern f_status_t fake_make_operate_process_type_if_greater_if_lesser(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_if_greater_if_lesser_
/**
- * Perform the if owner operation process.
+ * Perform the if group operation process.
*
* @param main
* The main program data.
* All make related setting data, including data from the fakefile and optionally build settings file.
* @param arguments
* The arguments for the run or shell operation.
+ * @param if_not
+ * When TRUE, perform the if not is.
+ * When FALSE, perform the if is.
* @param operation_if
* The if-condition status for the current operation.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_file_owner_read().
+ * Errors (with error bit) from: f_file_group_read().
*
- * Errors (with error bit) from: fake_make_get_id_owner().
+ * Errors (with error bit) from: fake_make_get_id_group().
*
- * @see f_file_owner_read()
+ * @see f_file_group_read()
*
- * @see fake_make_get_id_owner()
+ * @see fake_make_get_id_group()
*/
-#ifndef _di_fake_make_operate_process_type_if_owner_
- extern f_status_t fake_make_operate_process_type_if_owner(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
-#endif // _di_fake_make_operate_process_type_if_owner_
+#ifndef _di_fake_make_operate_process_type_if_group_
+ extern f_status_t fake_make_operate_process_type_if_group(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_if_group_
/**
* Perform the if is operation process.
* All make related setting data, including data from the fakefile and optionally build settings file.
* @param arguments
* The arguments for the run or shell operation.
+ * @param if_not
+ * When TRUE, perform the if not is.
+ * When FALSE, perform the if is.
* @param operation_if
* The if-condition status for the current operation.
*
* @see f_file_mode_read()
*/
#ifndef _di_fake_make_operate_process_type_if_is_
- extern f_status_t fake_make_operate_process_type_if_is(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
+ extern f_status_t fake_make_operate_process_type_if_is(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) F_attribute_visibility_internal_d;
#endif // _di_fake_make_operate_process_type_if_is_
/**
- * Perform the if defined operation process.
+ * Perform the if operation process.
*
* @param main
* The main program data.
* All make related setting data, including data from the fakefile and optionally build settings file.
* @param arguments
* The arguments for the run or shell operation.
+ * @param if_not
+ * When TRUE, perform the if not is.
+ * When FALSE, perform the if is.
* @param operation_if
* The if-condition status for the current operation.
+ *
+ * @return
+ * F_none on success.
+ *
+ * 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().
+ *
+ * @see f_file_mode_read()
+ * @see f_file_mode_to_mode()
+ *
+ * @see fake_make_get_id_mode()
*/
-#ifndef _di_fake_make_operate_process_type_if_defined_
- extern void fake_make_operate_process_type_if_defined(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
-#endif // _di_fake_make_operate_process_type_if_defined_
+#ifndef _di_fake_make_operate_process_type_if_mode_
+ extern f_status_t fake_make_operate_process_type_if_mode(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_if_mode_
/**
- * Perform the if >, >=, <, and <= operation processes.
+ * Perform the if owner operation process.
*
* @param main
* The main program data.
* All make related setting data, including data from the fakefile and optionally build settings file.
* @param arguments
* The arguments for the run or shell operation.
+ * @param if_not
+ * When TRUE, perform the if not is.
+ * When FALSE, perform the if is.
* @param operation_if
* The if-condition status for the current operation.
*
* @return
* F_none on success.
*
- * Errors (with error bit) from: fl_conversion_string_to_number_unsigned().
+ * Errors (with error bit) from: f_file_owner_read().
*
- * @see fl_conversion_string_to_number_unsigned()
+ * Errors (with error bit) from: fake_make_get_id_owner().
+ *
+ * @see f_file_owner_read()
+ *
+ * @see fake_make_get_id_owner()
*/
-#ifndef _di_fake_make_operate_process_type_if_greater_if_lesser_
- extern f_status_t fake_make_operate_process_type_if_greater_if_lesser(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, uint8_t *operation_if) F_attribute_visibility_internal_d;
-#endif // _di_fake_make_operate_process_type_if_greater_if_lesser_
+#ifndef _di_fake_make_operate_process_type_if_owner_
+ extern f_status_t fake_make_operate_process_type_if_owner(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, uint8_t *operation_if) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_if_owner_
/**
* Perform the mode operation process.
#endif // _di_fake_make_operate_process_type_owners_
/**
+ * Perform the parameter operation process.
+ *
+ * @param main
+ * The main program data.
+ * @param data_make
+ * All make related setting data, including data from the fakefile and optionally build settings file.
+ * @param arguments
+ * The arguments for the run or shell operation.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Errors (with error bit) from: f_string_dynamic_resize().
+ * Errors (with error bit) from: f_string_dynamic_terminate_after().
+ * 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_dynamic_terminate_after()
+ * @see f_string_dynamics_resize()
+ * @see f_string_map_multis_resize()
+ */
+#ifndef _di_fake_make_operate_process_type_parameter_
+ extern f_status_t fake_make_operate_process_type_parameter(fake_main_t * const main, fake_make_data_t * const data_make, const f_string_dynamics_t arguments) F_attribute_visibility_internal_d;
+#endif // _di_fake_make_operate_process_type_parameter_
+
+/**
* Perform the pop operation process.
*
* Only call this function if the data_make.path.stack.used is greater than 1.
fake_make_operation_operate_s,
fake_make_operation_owner_s,
fake_make_operation_owners_s,
+ fake_make_operation_parameter_s,
fake_make_operation_pop_s,
fake_make_operation_print_s,
fake_make_operation_run_s,
fake_make_operation_operate_s_length,
fake_make_operation_owner_s_length,
fake_make_operation_owners_s_length,
+ fake_make_operation_parameter_s_length,
fake_make_operation_pop_s_length,
fake_make_operation_print_s_length,
fake_make_operation_run_s_length,
fake_make_operation_type_operate,
fake_make_operation_type_owner,
fake_make_operation_type_owners,
+ fake_make_operation_type_parameter,
fake_make_operation_type_pop,
fake_make_operation_type_print,
fake_make_operation_type_run,
case fake_make_operation_if_type_if_less:
case fake_make_operation_if_type_if_less_equal:
case fake_make_operation_if_type_if_mode:
+ case fake_make_operation_if_type_if_not:
+ case fake_make_operation_if_type_if_not_defined:
+ case fake_make_operation_if_type_if_not_exists:
+ case fake_make_operation_if_type_if_not_group:
+ case fake_make_operation_if_type_if_not_is:
+ case fake_make_operation_if_type_if_not_mode:
+ case fake_make_operation_if_type_if_not_owner:
case fake_make_operation_if_type_if_owner:
case fake_make_operation_if_type_if_success:
operation_if = 0;
bool existing = F_true;
- // in this case, the destination could be a file, so confirm this.
+ // In this case, the destination could be a file, so confirm this.
if (arguments.used == 2) {
status_file = f_directory_is(arguments.array[1].string);
return 0;
}
- if (*operation_if == fake_make_operation_if_type_if_failure) {
- if (success) {
- *operation_if = fake_make_operation_if_type_false_next;
- }
- else {
- *operation_if = fake_make_operation_if_type_true_next;
- }
+ if (*operation_if == fake_make_operation_if_type_if_defined) {
+ fake_make_operate_process_type_if_defined(main, data_make, arguments, F_false, operation_if);
return 0;
}
- if (*operation_if == fake_make_operation_if_type_if_group) {
- *status = fake_make_operate_process_type_if_group(main, data_make, arguments, operation_if);
+ if (*operation_if == fake_make_operation_if_type_if_exists) {
+ *status = fake_make_operate_process_type_if_exists(main, data_make, arguments, F_false, operation_if);
return 0;
}
- if (*operation_if == fake_make_operation_if_type_if_mode) {
- *status = fake_make_operate_process_type_if_mode(main, data_make, arguments, operation_if);
+ if (*operation_if == fake_make_operation_if_type_if_failure) {
+ if (success) {
+ *operation_if = fake_make_operation_if_type_false_next;
+ }
+ else {
+ *operation_if = fake_make_operation_if_type_true_next;
+ }
return 0;
}
- if (*operation_if == fake_make_operation_if_type_if_owner) {
- *status = fake_make_operate_process_type_if_owner(main, data_make, arguments, operation_if);
+ if (*operation_if == fake_make_operation_if_type_if_group) {
+ *status = fake_make_operate_process_type_if_group(main, data_make, arguments, F_false, operation_if);
return 0;
}
if (*operation_if == fake_make_operation_if_type_if_is) {
- *status = fake_make_operate_process_type_if_is(main, data_make, arguments, operation_if);
+ *status = fake_make_operate_process_type_if_is(main, data_make, arguments, F_false, operation_if);
return 0;
}
- if (*operation_if == fake_make_operation_if_type_if_exists) {
- *operation_if = fake_make_operation_if_type_true_next;
-
- for (f_array_length_t i = 1; i < arguments.used; ++i) {
-
- *status = f_file_exists(arguments.array[i].string);
-
- if (F_status_is_error(*status)) {
- *operation_if = fake_make_operation_if_type_false_always_next;
-
- fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_exists", F_true, arguments.array[i].string, "find", fll_error_file_type_file);
-
- break;
- }
-
- if (*status == F_false) {
- *operation_if = fake_make_operation_if_type_false_next;
-
- break;
- }
- } // for
+ if (*operation_if == fake_make_operation_if_type_if_mode) {
+ *status = fake_make_operate_process_type_if_mode(main, data_make, arguments, F_false, operation_if);
return 0;
}
- if (*operation_if == fake_make_operation_if_type_if_defined) {
- fake_make_operate_process_type_if_defined(main, data_make, arguments, operation_if);
+ if (*operation_if == fake_make_operation_if_type_if_not_defined) {
+ fake_make_operate_process_type_if_defined(main, data_make, arguments, F_true, operation_if);
return 0;
}
return 0;
}
+ if (*operation_if == fake_make_operation_if_type_if_not_exists) {
+ *status = fake_make_operate_process_type_if_exists(main, data_make, arguments, F_true, operation_if);
+
+ return 0;
+ }
+
+ if (*operation_if == fake_make_operation_if_type_if_not_group) {
+ *status = fake_make_operate_process_type_if_group(main, data_make, arguments, F_true, operation_if);
+
+ return 0;
+ }
+
+ if (*operation_if == fake_make_operation_if_type_if_not_is) {
+ *status = fake_make_operate_process_type_if_is(main, data_make, arguments, F_true, operation_if);
+
+ return 0;
+ }
+
+ if (*operation_if == fake_make_operation_if_type_if_not_mode) {
+ *status = fake_make_operate_process_type_if_mode(main, data_make, arguments, F_true, operation_if);
+
+ return 0;
+ }
+
+ if (*operation_if == fake_make_operation_if_type_if_not_owner) {
+ *status = fake_make_operate_process_type_if_owner(main, data_make, arguments, F_true, operation_if);
+
+ return 0;
+ }
+
+ if (*operation_if == fake_make_operation_if_type_if_owner) {
+ *status = fake_make_operate_process_type_if_owner(main, data_make, arguments, F_false, operation_if);
+
+ return 0;
+ }
+
return 0;
}
return 0;
}
+ if (operation == fake_make_operation_type_parameter) {
+ *status = fake_make_operate_process_type_parameter(main, data_make, arguments);
+
+ return 0;
+ }
+
if (operation == fake_make_operation_type_pop) {
*status = fake_make_operate_process_type_pop(main, data_make, arguments);
return;
}
- if (operation == fake_make_operation_type_delete || operation == fake_make_operation_type_deletes) {
- if (arguments.used) {
- for (f_array_length_t i = 0; i < arguments.used; ++i) {
-
- *status = fake_make_assure_inside_project(main, data_make, arguments.array[i]);
-
- if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string);
-
- if (F_status_set_fine(*status) == F_false) {
- *status = F_status_set_error(F_failure);
- }
- }
- } // for
- }
- else {
- if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
- fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
- }
-
- *status = F_status_set_error(F_failure);
- }
-
- return;
- }
-
if (operation == fake_make_operation_type_define) {
if (arguments.used) {
*status = fake_make_operate_validate_define_name(arguments.array[0]);
return;
}
+ if (operation == fake_make_operation_type_delete || operation == fake_make_operation_type_deletes) {
+ if (arguments.used) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
+
+ *status = fake_make_assure_inside_project(main, data_make, arguments.array[i]);
+
+ if (F_status_is_error(*status)) {
+ fake_print_message_section_operation_path_outside(main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string);
+
+ if (F_status_set_fine(*status) == F_false) {
+ *status = F_status_set_error(F_failure);
+ }
+ }
+ } // for
+ }
+ else {
+ if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
+ }
+
+ *status = F_status_set_error(F_failure);
+ }
+
+ return;
+ }
+
if (operation == fake_make_operation_type_else) {
if (*operation_if == fake_make_operation_if_type_else_true || *operation_if == fake_make_operation_if_type_else_false) {
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
fake_make_operation_argument_if_less_s,
fake_make_operation_argument_if_less_equal_s,
fake_make_operation_argument_if_mode_s,
+ fake_make_operation_argument_if_not_s,
+ fake_make_operation_argument_if_defined_s, // if not defined, represented by just "defined".
+ fake_make_operation_argument_if_exists_s, // if not exists, represented by just "exists".
+ fake_make_operation_argument_if_group_s, // if not group, represented by just "group".
+ fake_make_operation_argument_if_is_s, // if not is, represented by just "is".
+ fake_make_operation_argument_if_mode_s, // if not mode, represented by just "mode".
+ fake_make_operation_argument_if_owner_s, // if not owner, represented by just "owner".
fake_make_operation_argument_if_owner_s,
fake_make_operation_argument_if_success_s,
};
fake_make_operation_argument_if_less_s_length,
fake_make_operation_argument_if_less_equal_s_length,
fake_make_operation_argument_if_mode_s_length,
+ fake_make_operation_argument_if_not_s_length,
+ fake_make_operation_argument_if_defined_s_length, // if not defined, represented by just "defined".
+ fake_make_operation_argument_if_exists_s_length, // if not exists, represented by just "exists".
+ fake_make_operation_argument_if_group_s_length, // if not group, represented by just "group".
+ fake_make_operation_argument_if_is_s_length, // if not is, represented by just "is".
+ fake_make_operation_argument_if_mode_s_length, // if not mode, represented by just "mode".
+ fake_make_operation_argument_if_owner_s_length, // if not owner, represented by just "owner".
fake_make_operation_argument_if_owner_s_length,
fake_make_operation_argument_if_success_s_length,
};
fake_make_operation_if_type_if_less,
fake_make_operation_if_type_if_less_equal,
fake_make_operation_if_type_if_mode,
+ fake_make_operation_if_type_if_not,
+ fake_make_operation_if_type_if_not_defined,
+ fake_make_operation_if_type_if_not_exists,
+ fake_make_operation_if_type_if_not_group,
+ fake_make_operation_if_type_if_not_is,
+ fake_make_operation_if_type_if_not_mode,
+ fake_make_operation_if_type_if_not_owner,
fake_make_operation_if_type_if_owner,
fake_make_operation_if_type_if_success,
};
const uint8_t if_type_minimum[] = {
- 2,
- 2,
- 2,
- 2,
- 1,
- 2,
- 2,
- 3,
- 3,
- 2,
- 2,
- 4,
- 3,
- 1,
+ 3, // If defined.
+ 2, // If equal (==).
+ 2, // If equal not (<>).
+ 2, // If exists.
+ 1, // If failure.
+ 2, // If greater (>).
+ 2, // If greater equal (>=).
+ 3, // If group.
+ 3, // If is.
+ 2, // If less (<).
+ 2, // If less equal (<=).
+ 4, // If mode.
+ 3, // If not.
+ 5, // If not defined.
+ 3, // If not exists.
+ 4, // If not group.
+ 4, // If not is.
+ 5, // If not mode.
+ 4, // If not owner.
+ 3, // If owner.
+ 1, // If success.
+ };
+
+ const f_string_t if_not_type_strings[] = {
+ fake_make_operation_argument_if_defined_s,
+ fake_make_operation_argument_if_exists_s,
+ fake_make_operation_argument_if_group_s,
+ fake_make_operation_argument_if_is_s,
+ fake_make_operation_argument_if_mode_s,
+ fake_make_operation_argument_if_owner_s,
+ };
+
+ const f_array_length_t if_not_type_lengths[] = {
+ fake_make_operation_argument_if_defined_s_length,
+ fake_make_operation_argument_if_exists_s_length,
+ fake_make_operation_argument_if_group_s_length,
+ fake_make_operation_argument_if_is_s_length,
+ fake_make_operation_argument_if_mode_s_length,
+ fake_make_operation_argument_if_owner_s_length,
+ };
+
+ const uint8_t if_not_type_codes[] = {
+ fake_make_operation_if_type_if_not_defined,
+ fake_make_operation_if_type_if_not_exists,
+ fake_make_operation_if_type_if_not_group,
+ fake_make_operation_if_type_if_not_is,
+ fake_make_operation_if_type_if_not_mode,
+ fake_make_operation_if_type_if_not_owner,
+ };
+
+ const uint8_t if_not_type_minimum[] = {
+ 4, // If not defined.
+ 3, // If not exists.
+ 4, // If not group.
+ 4, // If not is.
+ 5, // If not mode.
+ 4, // If not owner.
};
f_array_length_t i = 0;
+ f_array_length_t j = 0;
+
+ for (; i < 21; ++i) {
- for (; i < 14; ++i) {
+ // Skip the "if not XXX" types as they are determined later on.
+ if (i > 12 && i < 19) continue;
if (fl_string_dynamic_compare_string(if_type_strings[i], arguments.array[0], if_type_lengths[i]) == F_equal_to) {
*operation_if = if_type_codes[i];
+
break;
}
} // for
- if (i == 14) {
+ if (i == 21) {
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
return;
}
- if (arguments.used >= if_type_minimum[i]) {
+ // Identify and convert to the appropriate if not condition.
+ if (*operation_if == fake_make_operation_if_type_if_not) {
+ if (arguments.used < 2) {
+ if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
+ }
+
+ *status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ return;
+ }
+
+ for (; j < 6; ++j) {
+
+ if (fl_string_dynamic_compare_string(if_not_type_strings[j], arguments.array[1], if_not_type_lengths[j]) == F_equal_to) {
+ *operation_if = if_not_type_codes[j];
+
+ break;
+ }
+ } // for
+
+ if (j == 6) {
+ if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ flockfile(data_make->error.to.stream);
+
+ fl_print_format("%c%[%SUnsupported if not type '%]", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[0], data_make->error.notable);
+ fl_print_format("%['.%]%c", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s[0]);
+
+ funlockfile(data_make->error.to.stream);
+ }
+
+ *status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ return;
+ }
+ }
+ else {
+ j = 6;
+ }
+
+ if (j == 6 && arguments.used >= if_type_minimum[i] || arguments.used >= if_not_type_minimum[j]) {
if (*operation_if == fake_make_operation_if_type_if_success || *operation_if == fake_make_operation_if_type_if_failure) {
if (arguments.used > if_type_minimum[i]) {
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
return;
}
- if (*operation_if == fake_make_operation_if_type_if_mode || *operation_if == fake_make_operation_if_type_if_owner || *operation_if == fake_make_operation_if_type_if_group || *operation_if == fake_make_operation_if_type_if_is || *operation_if == fake_make_operation_if_type_if_exists) {
- if (*operation_if == fake_make_operation_if_type_if_mode) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_is_s, arguments.array[1], fake_make_operation_argument_is_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_has_s, arguments.array[1], fake_make_operation_argument_has_s_length) == F_equal_to_not) {
+ if (*operation_if == fake_make_operation_if_type_if_defined || *operation_if == fake_make_operation_if_type_if_not_defined) {
+ if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment_s, j == 6 ? arguments.array[1] : arguments.array[2], fake_make_operation_argument_environment_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare_string(fake_make_operation_argument_parameter_s, j == 6 ? arguments.array[1] : arguments.array[2], fake_make_operation_argument_parameter_s_length) == F_equal_to_not) {
+ if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ flockfile(data_make->error.to.stream);
+
+ fl_print_format("%c%[%SUnsupported define type '%]", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, j == 6 ? arguments.array[1] : arguments.array[2], data_make->error.notable);
+ fl_print_format("%['.%]%c", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s[0]);
+
+ funlockfile(data_make->error.to.stream);
+ }
+
+ *status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
+ }
+ }
+
+ return;
+ }
+ else if (*operation_if == fake_make_operation_if_type_if_equal || *operation_if == fake_make_operation_if_type_if_equal_not) {
+ if (arguments.used < 3) {
+ if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
+ }
+
+ *status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
+ }
+
+ return;
+ }
+ else if (*operation_if == fake_make_operation_if_type_if_exists || *operation_if == fake_make_operation_if_type_if_not_exists) {
+ return;
+ }
+ else if (*operation_if == fake_make_operation_if_type_if_group || *operation_if == fake_make_operation_if_type_if_is || *operation_if == fake_make_operation_if_type_if_mode || *operation_if > fake_make_operation_if_type_if_not_exists && *operation_if < fake_make_operation_if_type_if_success) {
+
+ if (*operation_if == fake_make_operation_if_type_if_mode || *operation_if == fake_make_operation_if_type_if_not_mode) {
+ if (fl_string_dynamic_compare_string(fake_make_operation_argument_is_s, j == 6 ? arguments.array[1] : arguments.array[2], fake_make_operation_argument_is_s_length) == F_equal_to_not) {
+ if (fl_string_dynamic_compare_string(fake_make_operation_argument_has_s, j == 6 ? arguments.array[1] : arguments.array[2], fake_make_operation_argument_has_s_length) == F_equal_to_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%c%[%SUnsupported mode type '%]", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
+ fl_print_format("%c%[%SUnsupported %smode type '%]", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, j == 6 ? "" : "not ", data_make->error.context);
+ fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, j == 6 ? arguments.array[1] : arguments.array[2], data_make->error.notable);
fl_print_format("%['.%]%c", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s[0]);
funlockfile(data_make->error.to.stream);
}
*status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
return;
}
}
f_file_mode_t mode_rule = 0;
uint8_t replace = 0;
- *status = fake_make_get_id_mode(main, data_make->error, arguments.array[2], &mode_rule, &replace);
- if (F_status_is_error(*status)) return;
-
- i = 3;
- }
+ *status = fake_make_get_id_mode(main, data_make->error, j == 6 ? arguments.array[2] : arguments.array[3], &mode_rule, &replace);
- if (*operation_if == fake_make_operation_if_type_if_owner) {
- uid_t id = 0;
+ if (F_status_is_error(*status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
- *status = fake_make_get_id_owner(main, data_make->error, arguments.array[1], &id);
- if (F_status_is_error(*status)) return;
+ return;
+ }
- i = 2;
+ i = j == 6 ? 3 : 4;
}
-
- if (*operation_if == fake_make_operation_if_type_if_group) {
+ else if (*operation_if == fake_make_operation_if_type_if_group || *operation_if == fake_make_operation_if_type_if_not_group) {
gid_t id = 0;
- *status = fake_make_get_id_group(main, data_make->error, arguments.array[1], &id);
- if (F_status_is_error(*status)) return;
+ *status = fake_make_get_id_group(main, data_make->error, j == 6 ? arguments.array[1] : arguments.array[2], &id);
- i = 2;
- }
+ if (F_status_is_error(*status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
- if (*operation_if == fake_make_operation_if_type_if_is) {
+ return;
+ }
+
+ i = j == 6 ? 2 : 3;
+ }
+ else if (*operation_if == fake_make_operation_if_type_if_is || *operation_if == fake_make_operation_if_type_if_not_is) {
// block = 0x1 (0000 0001) link = 0x10 (0001 0000)
// character = 0x2 (0000 0010) regular = 0x20 (0010 0000)
// fifo = 0x8 (0000 1000) invalid = 0x80 (1000 0000)
uint8_t type_file = 0;
- for (i = 1; i < arguments.used; ++i) {
+ for (i = j == 6 ? 1 : 2; i < arguments.used; ++i) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_if_is_for_s, arguments.array[i], fake_make_operation_argument_if_is_for_s_length) == F_equal_to) {
++i;
+
break;
}
return;
}
}
+ else if (*operation_if == fake_make_operation_if_type_if_owner || *operation_if == fake_make_operation_if_type_if_not_owner) {
+ uid_t id = 0;
+
+ *status = fake_make_get_id_owner(main, data_make->error, j == 6 ? arguments.array[1] : arguments.array[2], &id);
+
+ if (F_status_is_error(*status)) {
+ *operation_if = fake_make_operation_if_type_false_always_next;
+
+ return;
+ }
- if (*operation_if == fake_make_operation_if_type_if_exists) {
- i = 1;
+ i = j == 6 ? 2 : 3;
}
if (i < arguments.used) {
if (F_status_is_error_not(*status)) {
if (F_status_set_fine(status_file) == F_false) {
*status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
}
else {
*status = status_file;
return;
}
}
-
- if (*operation_if == fake_make_operation_if_type_if_defined) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment_s, arguments.array[1], fake_make_operation_argument_environment_s_length) == F_equal_to_not) {
- if (fl_string_dynamic_compare_string(fake_make_operation_argument_parameter_s, arguments.array[1], fake_make_operation_argument_parameter_s_length) == F_equal_to_not) {
- if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
- flockfile(data_make->error.to.stream);
-
- fl_print_format("%c%[%SUnsupported define type '%]", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
- fl_print_format("%['.%]%c", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s[0]);
-
- funlockfile(data_make->error.to.stream);
- }
-
- *status = F_status_set_error(F_failure);
- }
- }
-
- return;
- }
-
- if (*operation_if == fake_make_operation_if_type_if_equal || *operation_if == fake_make_operation_if_type_if_equal_not) {
+ else if (*operation_if == fake_make_operation_if_type_if_greater || *operation_if == fake_make_operation_if_type_if_greater_equal || *operation_if == fake_make_operation_if_type_if_less || *operation_if == fake_make_operation_if_type_if_less_equal) {
if (arguments.used < 3) {
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
}
*status = F_status_set_error(F_failure);
- }
-
- return;
- }
-
- if (*operation_if == fake_make_operation_if_type_if_greater || *operation_if == fake_make_operation_if_type_if_greater_equal || *operation_if == fake_make_operation_if_type_if_less || *operation_if == fake_make_operation_if_type_if_less_equal) {
- if (arguments.used < 3) {
- if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
- fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
- }
+ *operation_if = fake_make_operation_if_type_false_always_next;
- *status = F_status_set_error(F_failure);
return;
}
if (F_status_is_error(status_number)) {
*status = F_status_set_error(F_failure);
+ *operation_if = fake_make_operation_if_type_false_always_next;
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
return;
}
+ if (operation == fake_make_operation_type_parameter) {
+ if (arguments.used) {
+ const f_string_t reserved_name[] = {
+ fake_make_parameter_variable_build_s,
+ fake_make_parameter_variable_color_s,
+ fake_make_parameter_variable_data_s,
+ fake_make_parameter_variable_define_s,
+ fake_make_parameter_variable_fakefile_s,
+ fake_make_parameter_variable_mode_s,
+ fake_make_parameter_variable_process_s,
+ fake_make_parameter_variable_settings_s,
+ fake_make_parameter_variable_sources_s,
+ fake_make_parameter_variable_verbosity_s,
+ fake_make_parameter_variable_work_s,
+ fake_make_parameter_variable_option_build_s,
+ fake_make_parameter_variable_option_color_s,
+ fake_make_parameter_variable_option_data_s,
+ fake_make_parameter_variable_option_define_s,
+ fake_make_parameter_variable_option_fakefile_s,
+ fake_make_parameter_variable_option_mode_s,
+ fake_make_parameter_variable_option_process_s,
+ fake_make_parameter_variable_option_settings_s,
+ fake_make_parameter_variable_option_sources_s,
+ fake_make_parameter_variable_option_verbosity_s,
+ fake_make_parameter_variable_option_work_s,
+ fake_make_parameter_variable_value_build_s,
+ fake_make_parameter_variable_value_color_s,
+ fake_make_parameter_variable_value_data_s,
+ fake_make_parameter_variable_value_define_s,
+ fake_make_parameter_variable_value_fakefile_s,
+ fake_make_parameter_variable_value_mode_s,
+ fake_make_parameter_variable_value_process_s,
+ fake_make_parameter_variable_value_settings_s,
+ fake_make_parameter_variable_value_sources_s,
+ fake_make_parameter_variable_value_verbosity_s,
+ fake_make_parameter_variable_value_work_s,
+ };
+
+ const f_array_length_t reserved_length[] = {
+ fake_make_parameter_variable_build_s_length,
+ fake_make_parameter_variable_color_s_length,
+ fake_make_parameter_variable_data_s_length,
+ fake_make_parameter_variable_define_s_length,
+ fake_make_parameter_variable_fakefile_s_length,
+ fake_make_parameter_variable_mode_s_length,
+ fake_make_parameter_variable_process_s_length,
+ fake_make_parameter_variable_settings_s_length,
+ fake_make_parameter_variable_sources_s_length,
+ fake_make_parameter_variable_verbosity_s_length,
+ fake_make_parameter_variable_work_s_length,
+ fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_option_s_length,
+ fake_make_parameter_variable_build_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_color_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_data_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_define_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_fakefile_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_mode_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_process_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_settings_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_sources_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_verbosity_s_length + fake_make_parameter_iki_value_s_length,
+ fake_make_parameter_variable_work_s_length + fake_make_parameter_iki_value_s_length,
+ };
+
+ for (f_array_length_t i = 0; i < 33; ++i) {
+
+ if (fl_string_dynamic_compare_string(reserved_name[i], arguments.array[0], reserved_length[i]) == F_equal_to) {
+ fll_print_format("%c%[%SCannot assign a value to the parameter name '%s' because it is a reserved parameter name.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
+
+ *status = F_status_set_error(F_failure);
+
+ return;
+ }
+ } // for
+ }
+ else {
+ if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fll_print_format("%c%[%SRequires more arguments.%]%c", data_make->error.to.stream, f_string_eol_s[0], data_make->error.context, data_make->error.prefix, data_make->error.context, f_string_eol_s[0]);
+ }
+
+ *status = F_status_set_error(F_failure);
+ }
+
+ return;
+ }
+
if (operation == fake_make_operation_type_to) {
if (arguments.used > 1) {
if (data_make->error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
environment
- parameter verbose +v
- parameter verbose_fll +V
-
main:
build
The Content represents a set of conditions to perform.
+ For all conditions that rely on numbers, only whole numbers are (currently) supported.
+
conditions\:
- == "left" "right"\:
+ - == "left" "right"\:
Compare all parameters to be equal.
Requires 2 or more after the "==".
For example, "if == 'a' 'b' 'c' 'd'" would test: 'a' == 'b' && 'b' == 'c' && 'c' == 'd'.
This performs only string-based comparisons.
- > "left string" "right string"\:
+ - > "left string" "right string"\:
Compare "left" to "right" for greater than.
Requires 2 or more after the ">".
For example, "if > 0 1 2 3" would test: 0 > 1 && 1 > 2 && 2 > 3.
This performs only number-based comparisons.
- < "left string" "right string"\:
+ - < "left string" "right string"\:
Compare "left" to "right" for less than.
Requires 2 or more after the ">".
For example, "if < 0 1 2 3" would test: 0 < 1 && 1 < 2 && 2 < 3.
This performs only number-based comparisons.
- >= "left string" "right string"\:
+ - >= "left string" "right string"\:
Compare "left" to "right" for greater than or equal to.
Requires 2 or more after the ">=".
For example, "if >= 0 1 2 3" would test: 0 >= 1 && 1 >= 2 && 2 >= 3.
This performs only number-based comparisons.
- <= "left string" "right string"\:
+ - <= "left string" "right string"\:
Compare "left" to "right" for less than or equal to.
Requires 2 or more after the ">=".
For example, "if <= 0 1 2 3" would test: 0 <= 1 && 1 <= 2 && 2 <= 3.
This performs only number-based comparisons.
- <> "left" "right"\:
+ - <> "left" "right"\:
Compare all parameters to be not equal.
Requires 2 or more after the "==".
For example, "if <> 'a' 'b' 'c'" would test: 'a' <> 'b' && 'b' <> 'c' && 'a' <> 'c'.
This performs only string-based comparisons.
- exists "file path"\:
- Test if file exists.
- For example, "if exists "a.txt" "b.txt" would test if both the file a.txt and b.txt exist.
-
- is block character directory fifo link regular socket for "file path"\:
- Test if one or more files exist and if each file is any of the given types followed by "for" to designate where the the file paths begin.
- For example, "if is regular directory for "a.txt" "b.txt" would test if both the file a.txt and b.txt exist and are either of type "regular" or type "directory".
-
- fail\:
- Test if the previous section operation failed.
-
- succeed\:
- Test if the previous section operation succeeded.
-
- mode is/has "some mode" "some file"\:
- Test if one or more files has the exact mode ("is") or has at least the given modes ("has").
- For example, "if mode is u+r a.txt b.txt" would test if both file a.txt and b.txt only have owner set to read.
- For example, "if mode has u+r a.txt b.txt" would test if both file a.txt and b.txt has owner set to read, and all other modes can be anything.
-
- owner "some mode" "some file"\:
- Test if one or more files has the given owner.
- For example, "if owner me a.txt b.txt" would test if both file a.txt and b.txt have an owner named "me".
-
- group "some mode" "some file"\:
- For example, "if owner we a.txt b.txt" would test if both file a.txt and b.txt have a group named "we".
-
- defined parameter/environment "some define name"\:
+ - defined parameter/environment "some define name"\:
Test if one or more names are defined as a "parameter" or an "environment" variable.
For example, "if defined parameter verbose silent" would test if both the "verbose" and the "silent" variables are defined via the "parameter" setting.
For example, "if defined environment PWD SHELL" would test if both the "PWD" and the "SHELL" variables are defined via the "environment" variables.
- verbosity: Associated with +q/++quiet, +N/++normal, +V/++verbose, and +D/++debug parameters.
- work: Associated with -w/--work parameter.
+ - exists "file path"\:
+ Test if file exists.
+ For example, "if exists "a.txt" "b.txt" would test if both the file a.txt and b.txt exist.
+
+ - fail\:
+ Test if the previous section operation failed.
+
+ - group "some mode" "some file"\:
+ For example, "if group friends a.txt b.txt" would test if both file a.txt and b.txt have a group named "we".
+
+ - is block character directory fifo link regular socket for "file path"\:
+ Test if one or more files exist and if each file is any of the given types followed by "for" to designate where the the file paths begin.
+ For example, "if is regular directory for "a.txt" "b.txt" would test if both the file a.txt and b.txt exist and are either of type "regular" or type "directory".
+
+ - mode is/has "some mode" "some file"\:
+ Test if one or more files has the exact mode ("is") or has at least the given modes ("has").
+ For example, "if mode is u+r a.txt b.txt" would test if both file a.txt and b.txt only have owner set to read.
+ For example, "if mode has u+r a.txt b.txt" would test if both file a.txt and b.txt has owner set to read, and all other modes can be anything.
+
+ - not\:
+ Perform the test expecting a false result rather than a true result.
+ This is to be immediately followed by a valid if condition as well as all appropriate valid content associated with that if condition.
+
+ Only the following if conditions are supported\:
+ - defined.
+ - exists.
+ - group.
+ - is.
+ - mode.
+ - owner.
+
+ Examples\:
+ - "if not defined parameter work"
+ - "if not exists documentation.txt"
+
+ - owner "some mode" "some file"\:
+ Test if one or more files has the given owner.
+ For example, "if owner me a.txt b.txt" would test if both file a.txt and b.txt have an owner named "me".
+
+ - succeed\:
+ Test if the previous section operation succeeded.
+
- index\:
Execute the linker program, such as "ar".
- owners\:
Identical to owner operation, except this will recursively apply the mode to all files within the given file, if that file is a directory file path.
+ - parameter\:
+ This represents an variable defined within the scope of the fakefile.
+ This is not exported as an environment variable and is therefore not visible to any executed programs or scripts.
+ This replaces the value of any existing parameter variable with this name.
+ The reserved parameter variable names (see IKI vocabulary context section below) may not be changed by this.
+
- pop\:
Pop a directory path of the path stack, thereby changing to the previous directory on the stack.
This is a change directory command similar to a back button in a browser.
The Settings Objects are\:
- compiler: Only one Content, which must only be a valid filename.
- - define: First Content represents variable name (case-sensitive), remaining Content represents varaiable value for IKI substitution.
+ - define: First Content represents variable name (case-sensitive), remaining Content represents the value.
- environment: Zero or more Content representing valid environment variable names (alpha-numeric with underscore, but cannot begin with a number).
- fail: Only one Content, which must be either "exit", "warn" or "ignore" (quotes not required) (case-sensitive).
- indexer: Only one Content, which must only be a valid filename.
- indexer_arguments: Zero or more arguments supported by the indexer specified in "build_indexer".
- load_build: Only one Content, which must be either "yes" or "no" (quotes not required) (case-sensitive).
- - parameter: First Content represents variable name (case-sensitive), remaining Content represents varaiable value for IKI substitution.
+ - parameter: First Content represents variable name (case-sensitive), remaining Content represents the value.
The build settings may also be specified in the Settings Section.
- clone: Two or more Content representing paths to files.
- compile: One or more Content as parameters to compiler.
- copy: Two or more Content representing paths to files.
- - define: Two or more Content.
+ - define: First Content represents variable name (case-sensitive), remaining Content represents the value.
- delete: One or more Content representing paths to files.
- deletes: One or more Content representing paths to files.
- else: Zero Content.
- operate: One Content. First Content is the name of a valid Section Object, except for the reserved Section Objects.
- owner: Two or more Content. First Content is group name or number, remaining Content are paths to files.
- owners: Two or more Content. First Content is group name or number, remaining Content are paths to files.
+ - parameter: First Content represents variable name (case-sensitive), remaining Content represents the value.
- pop: Zero Content.
- print: Zero or more Content.
- run: One or more Content. First Content is the name of the program (or script) and all remaining Content are passed as arguments to the named program (or script).
- group: First Content is the name of a group. Second or more Content are paths to files.
- is: First Content is a list of "block", "character", "directory", "fifo", "link", "regular" , or "socket" followed by "for" and then the Remaining Content that are paths to files.
- mode: First Content is either "is" or "has". Second Content is a valid file mode. Third or more Content are paths to files.
+ - not: First Content is one of "defined", "exists", "group", "is", "mode", or "owner" and all remaining Content are based on the First Content's "if" Section Operation Content rules.
- owner: First Content is the name of an owner. Second or more Content are paths to files.
- success: has no other Content.