Move parameter initialization and deallocation for FLL program data into main.c.
const f_string_static_t fake_other_operation_skeleton_s = macro_f_string_static_t_initialize(FAKE_other_operation_skeleton_s, 0, FAKE_other_operation_skeleton_s_length);
#endif // _di_fake_parameters_
-#ifndef _di_fake_main_delete_
- f_status_t fake_main_delete(fake_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_string_dynamics_resize(0, &main->define);
- f_string_dynamic_resize(0, &main->fakefile);
- f_string_dynamics_resize(0, &main->mode);
- f_string_dynamic_resize(0, &main->process);
- f_string_dynamic_resize(0, &main->settings);
-
- f_string_dynamic_resize(0, &main->path_build);
- f_string_dynamic_resize(0, &main->path_build_documents);
- f_string_dynamic_resize(0, &main->path_build_includes);
- f_string_dynamic_resize(0, &main->path_build_libraries);
- f_string_dynamic_resize(0, &main->path_build_libraries_script);
- f_string_dynamic_resize(0, &main->path_build_libraries_shared);
- f_string_dynamic_resize(0, &main->path_build_libraries_static);
- f_string_dynamic_resize(0, &main->path_build_objects);
- f_string_dynamic_resize(0, &main->path_build_objects_script);
- f_string_dynamic_resize(0, &main->path_build_objects_shared);
- f_string_dynamic_resize(0, &main->path_build_objects_static);
- f_string_dynamic_resize(0, &main->path_build_programs);
- f_string_dynamic_resize(0, &main->path_build_programs_script);
- f_string_dynamic_resize(0, &main->path_build_programs_shared);
- f_string_dynamic_resize(0, &main->path_build_programs_static);
- f_string_dynamic_resize(0, &main->path_build_settings);
- f_string_dynamic_resize(0, &main->path_build_stage);
- f_string_dynamic_resize(0, &main->path_work);
-
- f_string_dynamic_resize(0, &main->path_data);
- f_string_dynamic_resize(0, &main->path_data_build);
-
- f_string_dynamic_resize(0, &main->path_data_settings);
-
- f_string_dynamic_resize(0, &main->path_documents);
-
- f_string_dynamic_resize(0, &main->path_licenses);
-
- f_string_dynamic_resize(0, &main->path_sources);
-
- f_string_dynamic_resize(0, &main->path_work);
- f_string_dynamic_resize(0, &main->path_work_includes);
- f_string_dynamic_resize(0, &main->path_work_libraries);
- f_string_dynamic_resize(0, &main->path_work_libraries_script);
- f_string_dynamic_resize(0, &main->path_work_libraries_shared);
- f_string_dynamic_resize(0, &main->path_work_libraries_static);
- f_string_dynamic_resize(0, &main->path_work_programs);
- f_string_dynamic_resize(0, &main->path_work_programs_script);
- f_string_dynamic_resize(0, &main->path_work_programs_shared);
- f_string_dynamic_resize(0, &main->path_work_programs_static);
-
- f_string_dynamic_resize(0, &main->file_data_build_defines);
- f_string_dynamic_resize(0, &main->file_data_build_dependencies);
- f_string_dynamic_resize(0, &main->file_data_build_process_post_s);
- f_string_dynamic_resize(0, &main->file_data_build_process_pre_s);
- f_string_dynamic_resize(0, &main->file_data_build_fakefile);
- f_string_dynamic_resize(0, &main->file_data_build_settings);
-
- f_string_dynamic_resize(0, &main->file_documents_readme);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fake_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#define fake_total_parameters_d 28
#endif // _di_fake_parameters_
-/**
- * The main program data.
- *
- * parameters: The state of pre-defined parameters passed to the program.
- * process_pipe: Designate whether or not to process the input pipe.
- * output: The output file for general printing.
- * error: The output file for error printing.
- * warning: The output file for warning printing.
- * signal: The process signal management structure.
- * context: The color context.
- *
- * @todo
- */
-#ifndef _di_fake_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- bool process_pipe;
-
- fl_print_t output;
- fl_print_t error;
- fl_print_t warning;
-
- f_signal_t signal;
-
- uint8_t operation;
- uint16_t signal_check;
-
- mode_t umask;
- int child;
-
- f_string_dynamic_t fakefile;
- f_string_dynamic_t process;
- f_string_dynamic_t settings;
-
- f_string_dynamic_t path_build;
- f_string_dynamic_t path_build_documents;
- f_string_dynamic_t path_build_includes;
- f_string_dynamic_t path_build_libraries;
- f_string_dynamic_t path_build_libraries_script;
- f_string_dynamic_t path_build_libraries_shared;
- f_string_dynamic_t path_build_libraries_static;
- f_string_dynamic_t path_build_objects;
- f_string_dynamic_t path_build_objects_script;
- f_string_dynamic_t path_build_objects_shared;
- f_string_dynamic_t path_build_objects_static;
- f_string_dynamic_t path_build_programs;
- f_string_dynamic_t path_build_programs_script;
- f_string_dynamic_t path_build_programs_shared;
- f_string_dynamic_t path_build_programs_static;
- f_string_dynamic_t path_build_settings;
- f_string_dynamic_t path_build_stage;
-
- f_string_dynamic_t path_data;
- f_string_dynamic_t path_data_build;
- f_string_dynamic_t path_data_settings;
-
- f_string_dynamic_t path_documents;
-
- f_string_dynamic_t path_licenses;
-
- f_string_dynamic_t path_sources;
-
- f_string_dynamic_t path_work;
- f_string_dynamic_t path_work_includes;
- f_string_dynamic_t path_work_libraries;
- f_string_dynamic_t path_work_libraries_script;
- f_string_dynamic_t path_work_libraries_shared;
- f_string_dynamic_t path_work_libraries_static;
- f_string_dynamic_t path_work_programs;
- f_string_dynamic_t path_work_programs_script;
- f_string_dynamic_t path_work_programs_shared;
- f_string_dynamic_t path_work_programs_static;
-
- f_string_dynamic_t file_data_build_defines;
- f_string_dynamic_t file_data_build_dependencies;
- f_string_dynamic_t file_data_build_fakefile;
- f_string_dynamic_t file_data_build_process_post_s;
- f_string_dynamic_t file_data_build_process_pre_s;
- f_string_dynamic_t file_data_build_settings;
-
- f_string_dynamic_t file_documents_readme;
-
- f_string_dynamics_t define;
- f_string_dynamics_t mode;
-
- f_color_context_t context;
- } fake_main_t;
-
- #define fake_main_t_initialize \
- { \
- f_console_parameters_t_initialize, \
- F_false, \
- fl_print_t_initialize, \
- macro_fl_print_t_initialize_error(), \
- macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
- 0, \
- 0, \
- 0, \
- 0, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_string_dynamics_t_initialize, \
- f_string_dynamics_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fake_main_t_
-
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fake_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fake_main()
- */
-#ifndef _di_fake_main_delete_
- extern f_status_t fake_main_delete(fake_main_t * const main);
-#endif // _di_fake_main_delete_
#ifdef __cplusplus
} // extern "C"
#endif // _di_fake_print_help_
#ifndef _di_fake_main_
- f_status_t fake_main(fake_main_t * const main, const f_console_arguments_t *arguments) {
+ f_status_t fake_main(fll_program_data_t * const main, const f_console_arguments_t *arguments) {
f_status_t status = F_none;
- f_console_parameter_t parameters[] = fake_console_parameter_t_initialize;
- main->parameters.array = parameters;
- main->parameters.used = fake_total_parameters_d;
-
// Load all parameters and identify priority of color parameters.
{
f_console_parameter_id_t ids[3] = { fake_parameter_no_color_e, fake_parameter_light_e, fake_parameter_dark_e };
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true);
- fake_main_delete(main);
return status;
}
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
- fake_main_delete(main);
return status;
}
status = F_none;
+ fake_data_t data = fake_data_t_initialize;
+ data.main = main;
+ data.argv = main->parameters.arguments.array;
+
f_array_length_t operations_length = main->parameters.array[fake_parameter_operation_build_e].locations.used;
operations_length += main->parameters.array[fake_parameter_operation_clean_e].locations.used;
if (main->parameters.array[fake_parameter_help_e].result == f_console_result_found_e) {
fake_print_help(main->output.to, main->context);
- fake_main_delete(main);
+ fake_data_delete(&data);
return F_none;
}
if (main->parameters.array[fake_parameter_version_e].result == f_console_result_found_e) {
fll_program_print_version(main->output.to, fake_program_version_s);
- fake_main_delete(main);
+ fake_data_delete(&data);
return F_none;
}
if (operations_length) {
bool validate_parameter_directories = F_true;
- status = fake_process_console_parameters(main);
+ status = fake_process_console_parameters(&data);
if (F_status_is_error_not(status)) {
- status = fake_path_generate(main);
+ status = fake_path_generate(&data);
}
if (F_status_is_error(status)) {
- fake_main_delete(main);
+ fake_data_delete(&data);
return F_status_set_error(status);
}
for (uint8_t i = 0; i < operations_length; ++i) {
- main->operation = operations[i];
+ data.operation = operations[i];
- if (main->operation == fake_operation_build_e) {
+ if (data.operation == fake_operation_build_e) {
operations_name = fake_other_operation_build_s;
}
- else if (main->operation == fake_operation_clean_e) {
+ else if (data.operation == fake_operation_clean_e) {
operations_name = fake_other_operation_clean_s;
}
- else if (main->operation == fake_operation_make_e) {
+ else if (data.operation == fake_operation_make_e) {
operations_name = fake_other_operation_make_s;
}
- else if (main->operation == fake_operation_skeleton_e) {
+ else if (data.operation == fake_operation_skeleton_e) {
operations_name = fake_other_operation_skeleton_s;
}
- if (main->operation == fake_operation_build_e) {
+ if (data.operation == fake_operation_build_e) {
if (validate_parameter_directories) {
- status = fake_validate_parameter_directories(main);
+ status = fake_validate_parameter_directories(&data);
validate_parameter_directories = F_false;
}
if (F_status_is_error_not(status)) {
- status = fake_build_operate(main, f_string_empty_s);
+ status = fake_build_operate(&data, f_string_empty_s);
}
}
- else if (main->operation == fake_operation_clean_e) {
+ else if (data.operation == fake_operation_clean_e) {
if (validate_parameter_directories) {
validate_parameter_directories = F_false;
}
if (F_status_is_error_not(status)) {
- status = fake_clean_operate(main);
+ status = fake_clean_operate(&data);
}
}
- else if (main->operation == fake_operation_make_e) {
+ else if (data.operation == fake_operation_make_e) {
if (validate_parameter_directories) {
- status = fake_validate_parameter_directories(main);
+ status = fake_validate_parameter_directories(&data);
validate_parameter_directories = F_false;
}
if (F_status_is_error_not(status)) {
- status = fake_make_operate(main);
-
- if (status == F_child) {
- break;
- }
+ status = fake_make_operate(&data);
+ if (status == F_child) break;
}
}
- else if (main->operation == fake_operation_skeleton_e) {
- status = fake_skeleton_operate(main);
+ else if (data.operation == fake_operation_skeleton_e) {
+ status = fake_skeleton_operate(&data);
}
- if (status == F_child) {
- break;
- }
+ if (status == F_child) break;
- if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d) && fake_signal_received(main)) {
+ if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d) && fake_signal_received(&data)) {
status = F_status_set_error(F_interrupt);
break;
status = F_status_set_error(F_parameter);
}
- fake_main_delete(main);
+ fake_data_delete(&data);
return status;
}
/**
* Execute main program.
*
- * Be sure to call fake_main_delete() after executing this.
- *
* If main.signal is non-zero, then this blocks and handles the following signals:
* - F_signal_abort
* - F_signal_broken_pipe
* F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
*
* Status codes (with error bit) are returned on any problem.
- *
- * @see fake_main_delete()
*/
#ifndef _di_fake_main_
- extern f_status_t fake_main(fake_main_t * const main, const f_console_arguments_t *arguments);
+ extern f_status_t fake_main(fll_program_data_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fake_main_
/**
* Deallocate main.
*
- * Be sure to call this after executing fake_main().
- *
* @param main
* The main program data.
*
* @see fake_main()
*/
#ifndef _di_fake_main_delete_
- extern f_status_t fake_main_delete(fake_main_t * const main);
+ extern f_status_t fake_main_delete(fll_program_data_t * const main);
#endif // _di_fake_main_delete_
#ifdef __cplusplus
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
- fake_main_t data = fake_main_t_initialize;
+ fll_program_data_t data = fll_program_data_t_initialize;
+
+ f_console_parameter_t parameters[] = fake_console_parameter_t_initialize;
+ data.parameters.array = parameters;
+ data.parameters.used = fake_total_parameters_d;
fll_program_standard_setup(&data.signal);
const f_status_t status = fake_main(&data, &arguments);
+ fll_program_data_delete(&data);
+
fll_program_standard_setdown(&data.signal);
if (status == F_child) {
#endif
#ifndef _di_fake_build_library_script_
- int fake_build_library_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
return 0;
}
#endif // _di_fake_build_library_script_
#ifndef _di_fake_build_library_shared_
- int fake_build_library_shared(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_shared.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling shared library.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling shared library.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- *status = fake_build_objects_add(main, data_build, &main->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments);
+ *status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_shared, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
f_string_dynamics_resize(0, &arguments);
return 0;
}
- *status = fake_build_sources_add(main, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments);
+ *status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_library, &data_build->setting.build_sources_library_shared, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_sources_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_sources_add", F_true);
f_string_dynamics_resize(0, &arguments);
f_string_static_t parameter_file_path = f_string_static_t_initialize;
f_string_static_t parameter_linker = f_string_static_t_initialize;
- parameter_file_path.used = main->path_build_libraries_shared.used;
+ parameter_file_path.used = data->path_build_libraries_shared.used;
parameter_linker.used = fake_build_parameter_library_shared_prefix_s.used;
if (data_build->setting.version_file == fake_build_version_type_major_e) {
parameter_file_path_string[parameter_file_path.used] = 0;
parameter_linker_string[parameter_linker.used] = 0;
- memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, sizeof(f_char_t) * main->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used);
memcpy(parameter_linker_string, fake_build_parameter_library_shared_prefix_s.string, sizeof(f_char_t) * fake_build_parameter_library_shared_prefix_s.used);
if (data_build->setting.version_file == fake_build_version_type_major_e) {
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major_string, sizeof(f_char_t) * parameter_file_name_major.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_major_string, sizeof(f_char_t) * parameter_file_name_major.used);
}
else if (data_build->setting.version_file == fake_build_version_type_minor_e) {
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_minor_string, sizeof(f_char_t) * parameter_file_name_minor.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_minor_string, sizeof(f_char_t) * parameter_file_name_minor.used);
}
else if (data_build->setting.version_file == fake_build_version_type_micro_e) {
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_micro_string, sizeof(f_char_t) * parameter_file_name_micro.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_micro_string, sizeof(f_char_t) * parameter_file_name_micro.used);
}
else if (data_build->setting.version_file == fake_build_version_type_nano_e) {
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_nano_string, sizeof(f_char_t) * parameter_file_name_nano.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_nano_string, sizeof(f_char_t) * parameter_file_name_nano.used);
}
if (data_build->setting.version_target == fake_build_version_type_major_e) {
if (F_status_is_error(*status)) break;
} // for
- fake_build_arguments_standard_add(main, data_build, F_true, fake_build_type_library_e, &arguments, status);
+ fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_library_e, &arguments, status);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_string_dynamics_resize(0, &arguments);
}
{
- const int result = fake_execute(main, data_build->environment, data_build->setting.build_compiler, arguments, status);
+ const int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status);
f_string_dynamics_resize(0, &arguments);
if (parameter_file_name_major.used) {
f_string_static_t parameter_file_path = f_string_static_t_initialize;
- parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name.used;
+ parameter_file_path.used = data->path_build_libraries_shared.used + parameter_file_name.used;
f_char_t parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
- memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, sizeof(f_char_t) * main->path_build_libraries_shared.used);
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name.string, sizeof(f_char_t) * parameter_file_name.used);
+ memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name.string, sizeof(f_char_t) * parameter_file_name.used);
*status = f_file_link(parameter_file_name_major, parameter_file_path);
- if (F_status_is_error_not(*status) && main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_major, f_string_eol_s);
+ if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->output.to.stream, parameter_file_path, parameter_file_name_major, f_string_eol_s);
}
else if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_major, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
f_string_static_t parameter_file_path = f_string_static_t_initialize;
{
- parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_major.used;
+ parameter_file_path.used = data->path_build_libraries_shared.used + parameter_file_name_major.used;
f_char_t parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
- memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, sizeof(f_char_t) * main->path_build_libraries_shared.used);
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major.string, sizeof(f_char_t) * parameter_file_name_major.used);
+ memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_major.string, sizeof(f_char_t) * parameter_file_name_major.used);
*status = f_file_link(parameter_file_name_minor, parameter_file_path);
- if (F_status_is_error_not(*status) && main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
+ if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
}
else if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
if (data_build->setting.version_file != fake_build_version_type_minor_e && parameter_file_name_minor.used) {
{
- parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_minor.used;
+ parameter_file_path.used = data->path_build_libraries_shared.used + parameter_file_name_minor.used;
f_char_t parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
- memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, sizeof(f_char_t) * main->path_build_libraries_shared.used);
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_minor.string, sizeof(f_char_t) * parameter_file_name_minor.used);
+ memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_minor.string, sizeof(f_char_t) * parameter_file_name_minor.used);
*status = f_file_link(parameter_file_name_micro, parameter_file_path);
- if (F_status_is_error_not(*status) && main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
+ if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
}
else if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
}
if (data_build->setting.version_file != fake_build_version_type_micro_e && parameter_file_name_micro.used) {
- parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_micro.used;
+ parameter_file_path.used = data->path_build_libraries_shared.used + parameter_file_name_micro.used;
f_char_t parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
- memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, sizeof(f_char_t) * main->path_build_libraries_shared.used);
- memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_micro.string, sizeof(f_char_t) * parameter_file_name_micro.used);
+ memcpy(parameter_file_path_string, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + data->path_build_libraries_shared.used, parameter_file_name_micro.string, sizeof(f_char_t) * parameter_file_name_micro.used);
*status = f_file_link(parameter_file_name_nano, parameter_file_path);
- if (F_status_is_error_not(*status) && main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_nano, f_string_eol_s);
+ if (F_status_is_error_not(*status) && data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Linked file '%Q' to '%Q'.%r", data->main->output.to.stream, parameter_file_path, parameter_file_name_nano, f_string_eol_s);
}
else if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_nano, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
}
}
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
return 0;
}
#endif // _di_fake_build_library_shared_
#ifndef _di_fake_build_library_static_
- int fake_build_library_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_library.used && !data_build->setting.build_sources_library_static.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling static library.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling static library.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamic_t file_name = f_string_dynamic_t_initialize;
if (F_status_is_error_not(*status)) {
f_string_static_t destination = f_string_static_t_initialize;
- destination.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used;
+ destination.used = data->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used;
destination.used += data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used;
f_char_t destination_string[destination.used + 1];
destination_string[destination.used] = 0;
destination.used = 0;
- memcpy(destination_string, main->path_build_libraries_static.string, sizeof(f_char_t) * main->path_build_libraries_static.used);
- destination.used += main->path_build_libraries_static.used;
+ memcpy(destination_string, data->path_build_libraries_static.string, sizeof(f_char_t) * data->path_build_libraries_static.used);
+ destination.used += data->path_build_libraries_static.used;
memcpy(destination_string + destination.used, fake_build_parameter_library_name_prefix_s.string, sizeof(f_char_t) * fake_build_parameter_library_name_prefix_s.used);
destination.used += fake_build_parameter_library_name_prefix_s.used;
source_path.used = 0;
- *status = fake_build_get_file_name_without_extension(main, sources[i]->array[j], &file_name);
+ *status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
break;
}
*status = f_file_name_directory(sources[i]->array[j], &source_path);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
break;
}
if (source_path.used) {
- *status = f_string_dynamic_prepend(main->path_build_objects, &source_path);
+ *status = f_string_dynamic_prepend(data->path_build_objects, &source_path);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_prepend", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_prepend", F_true);
break;
}
*status = f_string_dynamic_append_assure(f_path_separator_s, &source_path);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
break;
}
source.used = source_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
else {
- source.used = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
+ source.used = data->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
f_char_t source_string[source.used + 1];
memcpy(source_string + source_path.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
}
else {
- memcpy(source_string, main->path_build_objects.string, sizeof(f_char_t) * main->path_build_objects.used);
- memcpy(source_string + main->path_build_objects.used, file_name.string, sizeof(f_char_t) * file_name.used);
- memcpy(source_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
+ memcpy(source_string, data->path_build_objects.string, sizeof(f_char_t) * data->path_build_objects.used);
+ memcpy(source_string + data->path_build_objects.used, file_name.string, sizeof(f_char_t) * file_name.used);
+ memcpy(source_string + data->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
}
*status = fll_execute_arguments_add(source, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
break;
}
} // for
}
- int result = main->child;
+ int result = data->main->child;
if (F_status_is_error_not(*status)) {
- result = fake_execute(main, data_build->environment, data_build->setting.build_indexer, arguments, status);
+ result = fake_execute(data, data_build->environment, data_build->setting.build_indexer, arguments, status);
}
f_string_dynamic_resize(0, &file_name);
f_string_dynamics_resize(0, &arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
return result;
*
* One potential use of this function could be to construct a script from pieces, effectively building an "library".
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_library_script_
- extern int fake_build_library_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_library_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_library_script_
/**
* Build the shared libraries.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_library_shared_
- extern int fake_build_library_shared(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_library_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_library_shared_
/**
* Build the static libraries.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_library_static_
- extern int fake_build_library_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_library_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_library_static_
#ifdef __cplusplus
#endif
#ifndef _di_fake_build_load_environment_
- void fake_build_load_environment(fake_main_t * const main, fake_build_data_t * const data_build, f_string_maps_t * const environment, f_status_t * const status) {
+ void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment, f_status_t * const status) {
if (F_status_is_error(*status)) return;
*status = fl_environment_load_name(variables[i], environment);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fl_environment_load_name", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fl_environment_load_name", F_true);
return;
}
if (environment->used + data_build->setting.environment.used > environment->size) {
if (environment->used + data_build->setting.environment.used > f_environment_max_length) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe values for the setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, fake_build_setting_name_environment_s, main->error.notable);
- fl_print_format("%[' of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, fake_build_setting_name_environment_s, main->error.notable);
- fl_print_format("%[' is too large.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe values for the setting '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%]", data->main->error.to.stream, data->main->error.notable, fake_build_setting_name_environment_s, data->main->error.notable);
+ fl_print_format("%[' of setting file '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%]", data->main->error.to.stream, data->main->error.notable, fake_build_setting_name_environment_s, data->main->error.notable);
+ fl_print_format("%[' is too large.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
}
*status = F_status_set_error(F_array_too_large);
*status = fl_environment_load_names(data_build->setting.environment, environment);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fl_environment_load_names", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fl_environment_load_names", F_true);
}
}
#endif // _di_fake_build_load_environment_
#ifndef _di_fake_build_load_setting_
- void fake_build_load_setting(fake_main_t * const main, const f_string_static_t setting_file, fake_build_setting_t * const setting, f_status_t * const status) {
+ void fake_build_load_setting(fake_data_t * const data, const f_string_static_t setting_file, fake_build_setting_t * const setting, f_status_t * const status) {
if (F_status_is_error(*status)) return;
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
return;
}
f_string_static_t path_file = f_string_static_t_initialize;
- path_file.used = main->path_data_build.used + setting_file.used;
+ path_file.used = data->path_data_build.used + setting_file.used;
f_char_t path_file_string[path_file.used + 1];
path_file.string = path_file_string;
f_fss_contents_t contents = f_fss_contents_t_initialize;
if (setting_file.used) {
- memcpy(path_file_string, main->path_data_build.string, sizeof(f_char_t) * main->path_data_build.used);
- memcpy(path_file_string + main->path_data_build.used, setting_file.string, sizeof(f_char_t) * setting_file.used);
+ memcpy(path_file_string, data->path_data_build.string, sizeof(f_char_t) * data->path_data_build.used);
+ memcpy(path_file_string + data->path_data_build.used, setting_file.string, sizeof(f_char_t) * setting_file.used);
- *status = fake_file_buffer(main, path_file, &buffer);
+ *status = fake_file_buffer(data, path_file, &buffer);
}
else {
- *status = fake_file_buffer(main, main->file_data_build_settings, &buffer);
+ *status = fake_file_buffer(data, data->file_data_build_settings, &buffer);
}
if (F_status_is_error_not(*status)) {
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
{
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data, 0);
*status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0);
}
if (F_status_is_error(*status)) {
- fake_print_error_fss(main, F_status_set_fine(*status), "fll_fss_extended_read", main->file_data_build_settings, range, F_true);
+ fake_print_error_fss(data, F_status_set_fine(*status), "fll_fss_extended_read", data->file_data_build_settings, range, F_true);
}
else {
*status = fl_fss_apply_delimit(delimits, &buffer);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fl_fss_apply_delimit", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fl_fss_apply_delimit", F_true);
}
else {
- fake_build_load_setting_process(main, F_true, setting_file.used ? path_file : main->file_data_build_settings, buffer, objects, contents, setting, status);
+ fake_build_load_setting_process(data, F_true, setting_file.used ? path_file : data->file_data_build_settings, buffer, objects, contents, setting, status);
}
}
for (uint8_t i = 0; i < 1; ++i) {
if (!settings[i]->used) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe setting '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, names[i], main->error.notable);
- fl_print_format("%[' is required but is not specified in the settings file '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, setting_file.used ? path_file : main->file_data_build_settings, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe setting '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, names[i], data->main->error.notable);
+ fl_print_format("%[' is required but is not specified in the settings file '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, setting_file.used ? path_file : data->file_data_build_settings, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
failed = F_true;
}
}
}
- fake_build_load_setting_override(main, setting, status);
+ fake_build_load_setting_override(data, setting, status);
}
#endif // _di_fake_build_load_setting_
#ifndef _di_fake_build_load_setting_process_
- void fake_build_load_setting_process(fake_main_t * const main, const bool checks, const f_string_static_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting, f_status_t * const status) {
+ void fake_build_load_setting_process(fake_data_t * const data, const bool checks, const f_string_static_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting, f_status_t * const status) {
if (F_status_is_error(*status) && buffer.used) return;
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
return;
f_array_length_t j = 0;
// If any mode is specified, the entire defaults is replaced.
- if (main->mode.used) {
- modes = &main->mode;
+ if (data->mode.used) {
+ modes = &data->mode;
}
for (; i < modes->used; ++i) {
} // for
if (found == F_false) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe specified mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, modes->array[i], main->error.notable);
- fl_print_format("%[' is not a valid mode, according to '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe specified mode '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, modes->array[i], data->main->error.notable);
+ fl_print_format("%[' is not a valid mode, according to '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path_file, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
error_printed = F_true;
if (F_status_is_error(*status)) {
if (*status == F_status_set_error(F_string_too_large)) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- funlockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ funlockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QA setting in the file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
- fl_print_format("%[' is too long.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QA setting in the file '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path_file, data->main->error.notable);
+ fl_print_format("%[' is too long.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
else if (!error_printed) {
- fll_error_print(main->error, F_status_set_fine(*status), function, F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), function, F_true);
}
}
else {
*status = f_string_dynamic_append(settings_single_string_default[i], settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
break;
}
else {
*settings_single_bool[i] = F_true;
- if (main->warning.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->warning.to.stream);
-
- fl_print_format("%r%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' may be either '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_yes_s, main->warning.notable);
- fl_print_format("%[' or '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_no_s, main->warning.notable);
- fl_print_format("%[', defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_common_setting_bool_yes_s, main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
-
- funlockfile(main->warning.to.stream);
+ if (data->main->warning.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->warning.to.stream);
+
+ fl_print_format("%r%[%QThe setting '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, settings_single_name[i], data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' may be either '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_common_setting_bool_yes_s, data->main->warning.notable);
+ fl_print_format("%[' or '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_common_setting_bool_no_s, data->main->warning.notable);
+ fl_print_format("%[', defaulting to '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_common_setting_bool_yes_s, data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
+
+ funlockfile(data->main->warning.to.stream);
}
}
}
else {
*settings_single_language[i] = fake_build_language_type_c_e;
- if (main->warning.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->warning.to.stream);
-
- fl_print_format("%r%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' may only be one of '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_language_bash_s, main->warning.notable);
- fl_print_format("%[', '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_language_c_s, main->warning.notable);
- fl_print_format("%[', or '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_language_cpp_s, main->warning.notable);
- fl_print_format("%[', defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_language_c_s, main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
-
- funlockfile(main->warning.to.stream);
+ if (data->main->warning.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->warning.to.stream);
+
+ fl_print_format("%r%[%QThe setting '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, settings_single_name[i], data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' may only be one of '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_language_bash_s, data->main->warning.notable);
+ fl_print_format("%[', '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_language_c_s, data->main->warning.notable);
+ fl_print_format("%[', or '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_language_cpp_s, data->main->warning.notable);
+ fl_print_format("%[', defaulting to '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_language_c_s, data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
+
+ funlockfile(data->main->warning.to.stream);
}
}
}
else {
*settings_single_version[i] = settings_single_version_default[i];
- if (main->warning.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->warning.to.stream);
-
- fl_print_format("%r%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, settings_single_name[i], main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' may only be one of '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_version_major_s, main->warning.notable);
- fl_print_format("%[', '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_version_minor_s, main->warning.notable);
- fl_print_format("%[', '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_version_micro_s, main->warning.notable);
- fl_print_format("%[', or '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_version_nano_s, main->warning.notable);
- fl_print_format("%[', defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, settings_single_version_default_name[i], main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
-
- funlockfile(main->warning.to.stream);
+ if (data->main->warning.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->warning.to.stream);
+
+ fl_print_format("%r%[%QThe setting '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, settings_single_name[i], data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' may only be one of '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_version_major_s, data->main->warning.notable);
+ fl_print_format("%[', '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_version_minor_s, data->main->warning.notable);
+ fl_print_format("%[', '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_version_micro_s, data->main->warning.notable);
+ fl_print_format("%[', or '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_version_nano_s, data->main->warning.notable);
+ fl_print_format("%[', defaulting to '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, settings_single_version_default_name[i], data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
+
+ funlockfile(data->main->warning.to.stream);
}
}
}
*status = f_path_directory_cleanup(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_path_directory_cleanup", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_path_directory_cleanup", F_true);
break;
}
*status = f_string_dynamic_increase_by(settings_single_source[i]->array[settings_single_source[i]->used - 1].used + 1, settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_increase_by", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_increase_by", F_true);
break;
}
*status = f_string_dynamic_append_nulless(settings_single_source[i]->array[settings_single_source[i]->used - 1], settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
if (checks && !setting->version_file) {
setting->version_file = fake_build_version_type_micro_e;
- if (main->warning.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->warning.to.stream);
+ if (data->main->warning.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_setting_name_version_file_s, main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' is required, defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_version_micro_s, main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe setting '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_setting_name_version_file_s, data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' is required, defaulting to '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_version_micro_s, data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
}
if (checks && !setting->version_target) {
setting->version_target = fake_build_version_type_major_e;
- if (main->warning.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->warning.to.stream);
+ if (data->main->warning.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QThe setting '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_setting_name_version_target_s, main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' is required, defaulting to '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, fake_build_version_major_s, main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe setting '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_setting_name_version_target_s, data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' is required, defaulting to '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, fake_build_version_major_s, data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
}
}
#endif // _di_fake_build_load_setting_process_
#ifndef _di_fake_build_load_setting_override_
- void fake_build_load_setting_override(fake_main_t * const main, fake_build_setting_t * const setting, f_status_t * const status) {
+ void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting, f_status_t * const status) {
if (F_status_is_error(*status)) return;
- if (main->parameters.array[fake_parameter_path_sources_e].result == f_console_result_additional_e && main->path_sources.used) {
- *status = f_string_dynamic_append_assure(f_path_separator_s, &main->path_sources);
+ if (data->main->parameters.array[fake_parameter_path_sources_e].result == f_console_result_additional_e && data->path_sources.used) {
+ *status = f_string_dynamic_append_assure(f_path_separator_s, &data->path_sources);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
return;
}
}
- if (main->parameters.array[fake_parameter_shared_disabled_e].result == f_console_result_found_e) {
- if (main->parameters.array[fake_parameter_shared_enabled_e].result == f_console_result_found_e) {
- if (main->parameters.array[fake_parameter_shared_enabled_e].location > main->parameters.array[fake_parameter_shared_disabled_e].location) {
+ if (data->main->parameters.array[fake_parameter_shared_disabled_e].result == f_console_result_found_e) {
+ if (data->main->parameters.array[fake_parameter_shared_enabled_e].result == f_console_result_found_e) {
+ if (data->main->parameters.array[fake_parameter_shared_enabled_e].location > data->main->parameters.array[fake_parameter_shared_disabled_e].location) {
setting->build_shared = F_true;
setting->search_shared = F_true;
}
setting->search_shared = F_false;
}
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_disabled_s, main->error.notable);
- fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_enabled_s, main->error.notable);
- fl_print_format("%[' contradict, defaulting to '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe parameters '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_disabled_s, data->main->error.notable);
+ fl_print_format("%[' and '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_shared_enabled_s, data->main->error.notable);
+ fl_print_format("%[' contradict, defaulting to '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, setting->build_shared ? fake_long_shared_enabled_s : fake_long_shared_disabled_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
else {
setting->search_shared = F_false;
}
}
- else if (main->parameters.array[fake_parameter_shared_enabled_e].result == f_console_result_found_e) {
+ else if (data->main->parameters.array[fake_parameter_shared_enabled_e].result == f_console_result_found_e) {
setting->build_shared = F_true;
setting->search_shared = F_true;
}
- if (main->parameters.array[fake_parameter_static_disabled_e].result == f_console_result_found_e) {
- if (main->parameters.array[fake_parameter_static_enabled_e].result == f_console_result_found_e) {
- if (main->parameters.array[fake_parameter_static_enabled_e].location > main->parameters.array[fake_parameter_static_disabled_e].location) {
+ if (data->main->parameters.array[fake_parameter_static_disabled_e].result == f_console_result_found_e) {
+ if (data->main->parameters.array[fake_parameter_static_enabled_e].result == f_console_result_found_e) {
+ if (data->main->parameters.array[fake_parameter_static_enabled_e].location > data->main->parameters.array[fake_parameter_static_disabled_e].location) {
setting->build_static = F_true;
setting->search_static = F_true;
}
setting->search_static = F_false;
}
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe parameters '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_static_disabled_s, main->error.notable);
- fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_static_enabled_s, main->error.notable);
- fl_print_format("%[' contradict, defaulting to '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe parameters '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_static_disabled_s, data->main->error.notable);
+ fl_print_format("%[' and '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_static_enabled_s, data->main->error.notable);
+ fl_print_format("%[' contradict, defaulting to '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, setting->build_static ? fake_long_static_enabled_s : fake_long_static_disabled_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
else {
setting->search_static = F_false;
}
}
- else if (main->parameters.array[fake_parameter_static_enabled_e].result == f_console_result_found_e) {
+ else if (data->main->parameters.array[fake_parameter_static_enabled_e].result == f_console_result_found_e) {
setting->build_static = F_true;
setting->search_static = F_true;
}
if (setting->build_language == fake_build_language_type_c_e || setting->build_language == fake_build_language_type_cpp_e) {
if (setting->build_shared == F_false && setting->build_static == F_false) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
-
- fl_print_format("%r%[%QThe build settings '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, fake_build_setting_name_build_shared_s, main->error.notable);
- fl_print_format("%[' and '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, fake_build_setting_name_build_static_s, main->error.notable);
- fl_print_format("%[' cannot both be false when using the language '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%r%]", main->error.to.stream, main->error.notable, setting->build_language == fake_build_language_type_c_e ? fake_build_language_c_s : fake_build_language_cpp_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
-
- funlockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
+
+ fl_print_format("%r%[%QThe build settings '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%]", data->main->error.to.stream, data->main->error.notable, fake_build_setting_name_build_shared_s, data->main->error.notable);
+ fl_print_format("%[' and '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%]", data->main->error.to.stream, data->main->error.notable, fake_build_setting_name_build_static_s, data->main->error.notable);
+ fl_print_format("%[' cannot both be false when using the language '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%r%]", data->main->error.to.stream, data->main->error.notable, setting->build_language == fake_build_language_type_c_e ? fake_build_language_c_s : fake_build_language_cpp_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
+
+ funlockfile(data->main->error.to.stream);
}
*status = F_status_set_error(F_failure);
#endif // _di_fake_build_load_setting_override_
#ifndef _di_fake_build_load_stage_
- void fake_build_load_stage(fake_main_t * const main, const f_string_static_t settings_file, fake_build_stage_t * const stage, f_status_t * const status) {
+ void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage, f_status_t * const status) {
if (F_status_is_error(*status)) return;
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
return;
*status = f_file_name_base(settings_file, &settings_file_base);
}
else {
- *status = f_file_name_base(main->file_data_build_settings, &settings_file_base);
+ *status = f_file_name_base(data->file_data_build_settings, &settings_file_base);
}
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
return;
}
for (uint8_t i = 0; i < fake_build_stage_total_d; ++i) {
- *status = f_string_dynamic_append_nulless(main->path_build_stage, values[i]);
+ *status = f_string_dynamic_append_nulless(data->path_build_stage, values[i]);
- if (F_status_is_error_not(*status) && main->process.used) {
- *status = f_string_dynamic_append_nulless(main->process, values[i]);
+ if (F_status_is_error_not(*status) && data->process.used) {
+ *status = f_string_dynamic_append_nulless(data->process, values[i]);
*status = f_string_dynamic_append_nulless(fake_build_stage_separate_s, values[i]);
}
}
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
/**
* Find the build setting file, load it, validate it, and process it.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param setting_file
* The name of the settings file to use.
* If setting_file.used is 0, then the default or program parameter supplied file is used.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_load_setting_
- extern void fake_build_load_setting(fake_main_t * const main, const f_string_static_t setting_file, fake_build_setting_t * const setting, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern void fake_build_load_setting(fake_data_t * const data, const f_string_static_t setting_file, fake_build_setting_t * const setting, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_load_setting_
/**
* Override build settings based on command line arguments.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path_file
* The path to the buffer.
* @param buffer
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_load_setting_override_
- extern void fake_build_load_setting_override(fake_main_t * const main, fake_build_setting_t * const setting, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern void fake_build_load_setting_override(fake_data_t * const data, fake_build_setting_t * const setting, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_load_setting_override_
/**
* Load and process the setting buffer.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param checks
* If TRUE, perform certain "required" sanity checks.
* If FALSE, do not perform certain "required" sanity checks (intended for a fakefile rather than a build settings file).
* @see fll_fss_snatch_apart()
*/
#ifndef _di_fake_build_load_setting_process_
- extern void fake_build_load_setting_process(fake_main_t * const main, const bool checks, const f_string_static_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern void fake_build_load_setting_process(fake_data_t * const data, const bool checks, const f_string_static_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t * const setting, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_load_setting_process_
/**
* Load the environment used when executing commands.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param environment
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_load_environment_
- extern void fake_build_load_environment(fake_main_t * const main, fake_build_data_t * const data_build, f_string_maps_t * const environment, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern void fake_build_load_environment(fake_data_t * const data, fake_build_data_t * const data_build, f_string_maps_t * const environment, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_load_environment_
/**
* Load the stage file paths.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param settings_file
* The path to the settings file.
* @param stage
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_load_stage_
- extern void fake_build_load_stage(fake_main_t * const main, const f_string_static_t settings_file, fake_build_stage_t * const stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern void fake_build_load_stage(fake_data_t * const data, const f_string_static_t settings_file, fake_build_stage_t * const stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_load_stage_
#ifdef __cplusplus
#endif
#ifndef _di_fake_build_object_script_
- int fake_build_object_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
return 0;
}
#endif // _di_fake_build_object_script_
#ifndef _di_fake_build_object_shared_
- int fake_build_object_shared(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_shared.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling shared object.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling shared object.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- *status = fake_build_sources_object_add(main, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments);
+ *status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_shared, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_sources_object_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_sources_object_add", F_true);
f_string_dynamics_resize(0, &arguments);
{
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
- parameter_file_name_path.used = main->path_build_objects_shared.used + data_build->setting.build_name.used + fake_build_parameter_object_name_suffix_s.used;
+ parameter_file_name_path.used = data->path_build_objects_shared.used + data_build->setting.build_name.used + fake_build_parameter_object_name_suffix_s.used;
f_char_t parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
- memcpy(parameter_file_name_path_string, main->path_build_objects_shared.string, sizeof(f_char_t) * main->path_build_objects_shared.used);
- memcpy(parameter_file_name_path_string + main->path_build_objects_shared.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
- memcpy(parameter_file_name_path_string + main->path_build_objects_static.used + data_build->setting.build_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
+ memcpy(parameter_file_name_path_string, data->path_build_objects_shared.string, sizeof(f_char_t) * data->path_build_objects_shared.used);
+ memcpy(parameter_file_name_path_string + data->path_build_objects_shared.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
+ memcpy(parameter_file_name_path_string + data->path_build_objects_static.used + data_build->setting.build_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
const f_string_static_t values[] = {
fake_build_parameter_object_compile_s,
} // for
}
- fake_build_arguments_standard_add(main, data_build, F_true, fake_build_type_object_e, &arguments, status);
+ fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_object_e, &arguments, status);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_arguments_standard_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_arguments_standard_add", F_true);
macro_f_string_dynamics_t_delete_simple(arguments);
return 0;
}
- int result = fake_execute(main, data_build->environment, data_build->setting.build_compiler, arguments, status);
+ int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status);
macro_f_string_dynamics_t_delete_simple(arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
return result;
#endif // _di_fake_build_object_shared_
#ifndef _di_fake_build_object_static_
- int fake_build_object_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_object.used && !data_build->setting.build_sources_object_static.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling static object.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling static object.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- *status = fake_build_sources_object_add(main, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments);
+ *status = fake_build_sources_object_add(data, data_build, &data_build->setting.build_sources_object, &data_build->setting.build_sources_object_static, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_sources_object_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_sources_object_add", F_true);
f_string_dynamics_resize(0, &arguments);
{
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
- parameter_file_name_path.used = main->path_build_objects_static.used + data_build->setting.build_name.used + fake_build_parameter_object_name_suffix_s.used;
+ parameter_file_name_path.used = data->path_build_objects_static.used + data_build->setting.build_name.used + fake_build_parameter_object_name_suffix_s.used;
f_char_t parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
- memcpy(parameter_file_name_path_string, main->path_build_objects_static.string, sizeof(f_char_t) * main->path_build_objects_static.used);
- memcpy(parameter_file_name_path_string + main->path_build_objects_static.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
- memcpy(parameter_file_name_path_string + main->path_build_objects_static.used + data_build->setting.build_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
+ memcpy(parameter_file_name_path_string, data->path_build_objects_static.string, sizeof(f_char_t) * data->path_build_objects_static.used);
+ memcpy(parameter_file_name_path_string + data->path_build_objects_static.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
+ memcpy(parameter_file_name_path_string + data->path_build_objects_static.used + data_build->setting.build_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
const f_string_static_t values[] = {
fake_build_parameter_object_compile_s,
} // for
}
- fake_build_arguments_standard_add(main, data_build, F_false, fake_build_type_object_e, &arguments, status);
+ fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_object_e, &arguments, status);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_arguments_standard_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_arguments_standard_add", F_true);
macro_f_string_dynamics_t_delete_simple(arguments);
return 0;
}
- int result = fake_execute(main, data_build->environment, data_build->setting.build_compiler, arguments, status);
+ int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status);
macro_f_string_dynamics_t_delete_simple(arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
return result;
*
* One potential use of this function could be to construct a script from pieces, effectively building an "object".
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_object_script_
- extern int fake_build_object_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_object_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_object_script_
/**
* Object files can be compiled differently between shared and static such that a shared object might be compiled with -fPIC and a static object might not be.
* This represents an object being compiled with the intent to be used in a shared library or program.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_object_shared_
- extern int fake_build_object_shared(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_object_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_object_shared_
/**
* Object files can be compiled differently between shared and static such that a shared object might be compiled with -fPIC and a static object might not be.
* This represents an object being compiled with the intent to be used in a static library or program.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_object_static_
- extern int fake_build_object_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_object_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_object_static_
#ifdef __cplusplus
#endif
#ifndef _di_fake_build_objects_static_
- int fake_build_objects_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_library.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling objects for static library.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling objects for static library.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- *status = fake_build_objects_add(main, data_build, &main->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static, &arguments);
+ *status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_library, &data_build->setting.build_objects_library_static, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
f_string_dynamics_resize(0, &arguments);
f_string_static_t destination = f_string_static_t_initialize;
f_string_static_t source = f_string_static_t_initialize;
- int result = main->child;
+ int result = data->main->child;
const f_string_dynamics_t *sources[2] = {
&data_build->setting.build_sources_library,
file_name.used = 0;
destination_path.used = 0;
- fake_build_path_source_length(main, data_build, &data_build->setting.path_sources, &source);
+ fake_build_path_source_length(data, data_build, &data_build->setting.path_sources, &source);
f_char_t source_string[source.used + sources[i]->array[j].used + 1];
source.string = source_string;
- fake_build_path_source_string(main, data_build, &data_build->setting.path_sources, &source);
+ fake_build_path_source_string(data, data_build, &data_build->setting.path_sources, &source);
memcpy(source_string + source.used, sources[i]->array[j].string, sizeof(f_char_t) * sources[i]->array[j].used);
source.used += sources[i]->array[j].used;
source.string[source.used] = 0;
- *status = fake_build_get_file_name_without_extension(main, sources[i]->array[j], &file_name);
+ *status = fake_build_get_file_name_without_extension(data, sources[i]->array[j], &file_name);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
break;
}
*status = f_file_name_directory(sources[i]->array[j], &destination_path);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
break;
}
if (destination_path.used) {
- *status = f_string_dynamic_prepend(main->path_build_objects, &destination_path);
+ *status = f_string_dynamic_prepend(data->path_build_objects, &destination_path);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_prepend", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_prepend", F_true);
break;
}
*status = f_string_dynamic_append_assure(f_path_separator_s, &destination_path);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
break;
}
*status = f_directory_exists(destination_path);
if (*status == F_false) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination_path, main->error.notable);
- fl_print_format("%[' exists but is not a directory.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, destination_path, data->main->error.notable);
+ fl_print_format("%[' exists but is not a directory.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
*status = F_status_set_error(F_failure);
if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found_not) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination_path, main->error.notable);
- fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, destination_path, data->main->error.notable);
+ fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
else {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_create", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_directory_create", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
}
break;
}
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Directory '%Q' created.%r", main->output.to.stream, destination_path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Directory '%Q' created.%r", data->main->output.to.stream, destination_path, f_string_eol_s);
}
}
if (F_status_is_error(*status)) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_exists", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_directory_exists", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
break;
}
destination.used = destination_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
else {
- destination.used = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
+ destination.used = data->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
f_char_t destination_string[destination.used + 1];
memcpy(destination_string + destination_path.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
}
else {
- memcpy(destination_string, main->path_build_objects.string, sizeof(f_char_t) * main->path_build_objects.used);
- memcpy(destination_string + main->path_build_objects.used, file_name.string, sizeof(f_char_t) * file_name.used);
- memcpy(destination_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
+ memcpy(destination_string, data->path_build_objects.string, sizeof(f_char_t) * data->path_build_objects.used);
+ memcpy(destination_string + data->path_build_objects.used, file_name.string, sizeof(f_char_t) * file_name.used);
+ memcpy(destination_string + data->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, sizeof(f_char_t) * fake_build_parameter_object_name_suffix_s.used);
}
const f_string_static_t values[] = {
if (F_status_is_error(*status)) break;
} // for
- fake_build_arguments_standard_add(main, data_build, F_false, fake_build_type_library_e, &arguments, status);
+ fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_library_e, &arguments, status);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
break;
}
- result = fake_execute(main, data_build->environment, data_build->setting.build_compiler, arguments, status);
+ result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status);
macro_f_string_dynamics_t_delete_simple(arguments);
f_string_dynamics_resize(0, &arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
return result;
* This is neither the "build_sources_object" nor the "build_sources_object_static" property.
* Instead, this converts the "build_sources_library" and the "build_sources_library_static" into a static object file so that the indexer program (such as GNU ar) can combine these into a static file.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_objects_static_
- extern int fake_build_objects_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_objects_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_objects_static_
#ifdef __cplusplus
#endif
#ifndef _di_fake_build_program_script_
- int fake_build_program_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
return 0;
}
#endif // _di_fake_build_program_script_
#ifndef _di_fake_build_program_shared_
- int fake_build_program_shared(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_shared.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling shared program.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling shared program.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- *status = fake_build_objects_add(main, data_build, &main->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments);
+ *status = fake_build_objects_add(data, data_build, &data->path_build_objects_shared, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_shared, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
f_string_dynamics_resize(0, &arguments);
return 0;
}
- *status = fake_build_sources_add(main, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments);
+ *status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_shared, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_sources_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_sources_add", F_true);
f_string_dynamics_resize(0, &arguments);
if (F_status_is_error_not(*status)) {
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
- parameter_file_name_path.used = main->path_build_programs_shared.used + data_build->setting.build_name.used;
+ parameter_file_name_path.used = data->path_build_programs_shared.used + data_build->setting.build_name.used;
f_char_t parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
- memcpy(parameter_file_name_path_string, main->path_build_programs_shared.string, sizeof(f_char_t) * main->path_build_programs_shared.used);
- memcpy(parameter_file_name_path_string + main->path_build_programs_shared.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
+ memcpy(parameter_file_name_path_string, data->path_build_programs_shared.string, sizeof(f_char_t) * data->path_build_programs_shared.used);
+ memcpy(parameter_file_name_path_string + data->path_build_programs_shared.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
const f_string_static_t values[] = {
fake_build_parameter_library_output_s,
*status = fll_execute_arguments_add(link_project_library, &arguments);
}
- fake_build_arguments_standard_add(main, data_build, F_true, fake_build_type_program_e, &arguments, status);
+ fake_build_arguments_standard_add(data, data_build, F_true, fake_build_type_program_e, &arguments, status);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
macro_f_string_dynamics_t_delete_simple(arguments);
return 0;
}
- int result = fake_execute(main, data_build->environment, data_build->setting.build_compiler, arguments, status);
+ int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status);
macro_f_string_dynamics_t_delete_simple(arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
return result;
#endif // _di_fake_build_program_shared_
#ifndef _di_fake_build_program_static_
- int fake_build_program_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!data_build->setting.build_sources_program.used && !data_build->setting.build_sources_program_static.used) return 0;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Compiling static program.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Compiling static program.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- *status = fake_build_objects_add(main, data_build, &main->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments);
+ *status = fake_build_objects_add(data, data_build, &data->path_build_objects_static, &data_build->setting.build_objects_program, &data_build->setting.build_objects_program_static, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_objects_add", F_true);
f_string_dynamics_resize(0, &arguments);
return 0;
}
- *status = fake_build_sources_add(main, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments);
+ *status = fake_build_sources_add(data, data_build, &data_build->setting.build_sources_program, &data_build->setting.build_sources_program_static, &arguments);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fake_build_sources_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fake_build_sources_add", F_true);
f_string_dynamics_resize(0, &arguments);
if (F_status_is_error_not(*status)) {
f_string_static_t source_library = f_string_static_t_initialize;
- source_library.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used;
+ source_library.used = data->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used;
f_char_t source_library_string[source_library.used + 1];
source_library.string = source_library_string;
// Only include the library if there are sources that would result in it being built.
if (data_build->setting.build_sources_library.used) {
- memcpy(source_library_string, main->path_build_libraries_static.string, sizeof(f_char_t) * main->path_build_libraries_static.used);
- source_library.used += main->path_build_libraries_static.used;
+ memcpy(source_library_string, data->path_build_libraries_static.string, sizeof(f_char_t) * data->path_build_libraries_static.used);
+ source_library.used += data->path_build_libraries_static.used;
memcpy(source_library_string + source_library.used, fake_build_parameter_library_name_prefix_s.string, sizeof(f_char_t) * fake_build_parameter_library_name_prefix_s.used);
source_library.used += fake_build_parameter_library_name_prefix_s.used;
}
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
- parameter_file_name_path.used = main->path_build_programs_static.used + data_build->setting.build_name.used;
+ parameter_file_name_path.used = data->path_build_programs_static.used + data_build->setting.build_name.used;
f_char_t parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
- memcpy(parameter_file_name_path_string, main->path_build_programs_static.string, sizeof(f_char_t) * main->path_build_programs_static.used);
- memcpy(parameter_file_name_path_string + main->path_build_programs_static.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
+ memcpy(parameter_file_name_path_string, data->path_build_programs_static.string, sizeof(f_char_t) * data->path_build_programs_static.used);
+ memcpy(parameter_file_name_path_string + data->path_build_programs_static.used, data_build->setting.build_name.string, sizeof(f_char_t) * data_build->setting.build_name.used);
const f_string_static_t values[] = {
source_library,
} // for
}
- fake_build_arguments_standard_add(main, data_build, F_false, fake_build_type_program_e, &arguments, status);
+ fake_build_arguments_standard_add(data, data_build, F_false, fake_build_type_program_e, &arguments, status);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
macro_f_string_dynamics_t_delete_simple(arguments);
return 0;
}
- int result = fake_execute(main, data_build->environment, data_build->setting.build_compiler, arguments, status);
+ int result = fake_execute(data, data_build->environment, data_build->setting.build_compiler, arguments, status);
macro_f_string_dynamics_t_delete_simple(arguments);
if (F_status_is_error_not(*status) && *status != F_child) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
return result;
* A script is often referred to as a program, but in this context "script" and "program" are not the same.
* One potential use of this function could be to construct a script from pieces, effectively building a "program".
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_program_script_
- extern int fake_build_program_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_program_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_program_script_
/**
* Build the shared programs.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_program_shared_
- extern int fake_build_program_shared(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_program_shared(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_program_shared_
/**
* Build the static programs.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_program_static_
- extern int fake_build_program_static(fake_main_t * const main, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_build_program_static(fake_data_t * const data, fake_build_data_t * const data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_program_static_
#ifdef __cplusplus
#endif
#ifndef _di_fake_build_skeleton_
- void fake_build_skeleton(fake_main_t * const main, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
+ void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status) {
if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return;
f_string_static_t path_headers = f_string_static_t_initialize;
- path_headers.used = main->path_build_includes.used + data_build->setting.path_headers.used;
+ path_headers.used = data->path_build_includes.used + data_build->setting.path_headers.used;
f_char_t path_headers_string[path_headers.used + 1];
path_headers.string = path_headers_string;
if (data_build->setting.path_headers.used) {
- memcpy(path_headers_string, main->path_build_includes.string, sizeof(f_char_t) * main->path_build_includes.used);
- memcpy(path_headers_string + main->path_build_includes.used, data_build->setting.path_headers.string, sizeof(f_char_t) * data_build->setting.path_headers.used);
+ memcpy(path_headers_string, data->path_build_includes.string, sizeof(f_char_t) * data->path_build_includes.used);
+ memcpy(path_headers_string + data->path_build_includes.used, data_build->setting.path_headers.string, sizeof(f_char_t) * data_build->setting.path_headers.used);
}
else {
path_headers.used = 0;
path_headers_string[path_headers.used] = 0;
const f_string_static_t *directorys[] = {
- &main->path_build,
- &main->path_build_documents,
- &main->path_build_includes,
- &main->path_build_libraries,
- &main->path_build_libraries_script,
- &main->path_build_libraries_shared,
- &main->path_build_libraries_static,
- &main->path_build_objects,
- &main->path_build_objects_script,
- &main->path_build_objects_shared,
- &main->path_build_objects_static,
- &main->path_build_programs,
- &main->path_build_programs_script,
- &main->path_build_programs_shared,
- &main->path_build_programs_static,
- &main->path_build_settings,
- &main->path_build_stage,
+ &data->path_build,
+ &data->path_build_documents,
+ &data->path_build_includes,
+ &data->path_build_libraries,
+ &data->path_build_libraries_script,
+ &data->path_build_libraries_shared,
+ &data->path_build_libraries_static,
+ &data->path_build_objects,
+ &data->path_build_objects_script,
+ &data->path_build_objects_shared,
+ &data->path_build_objects_static,
+ &data->path_build_programs,
+ &data->path_build_programs_script,
+ &data->path_build_programs_shared,
+ &data->path_build_programs_static,
+ &data->path_build_settings,
+ &data->path_build_stage,
&path_headers,
};
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Creating base build directories.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Creating base build directories.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
bool created = F_false;
continue;
}
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_create", F_true, *directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_directory_create", F_true, *directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e);
return;
}
- if (created && main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Created directory '%Q'.%r", main->output.to.stream, *directorys[i], f_string_eol_s);
+ if (created && data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Created directory '%Q'.%r", data->main->output.to.stream, *directorys[i], f_string_eol_s);
}
} // for
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
#endif // _di_fake_build_skeleton_
/**
* Create all of the base directories inside the build directory.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param mode
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_skeleton_
- extern void fake_build_skeleton(fake_main_t * const main, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern void fake_build_skeleton(fake_data_t * const data, fake_build_data_t * const data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_skeleton_
#ifdef __cplusplus
#endif // _di_fake_build_strings_
#ifndef _di_fake_build_arguments_standard_add_
- void fake_build_arguments_standard_add(fake_main_t * const main, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments, f_status_t *status) {
+ void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments, f_status_t *status) {
if (F_status_is_error(*status)) return;
{
- f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s.used + main->path_build_libraries_shared.used;
+ f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s.used + data->path_build_libraries_shared.used;
f_char_t build_libraries[build_libraries_length + 1];
memcpy(build_libraries, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used);
if (is_shared) {
- memcpy(build_libraries + fake_build_parameter_library_link_path_s.used, main->path_build_libraries_shared.string, sizeof(f_char_t) * main->path_build_libraries_shared.used);
+ memcpy(build_libraries + fake_build_parameter_library_link_path_s.used, data->path_build_libraries_shared.string, sizeof(f_char_t) * data->path_build_libraries_shared.used);
}
else {
- memcpy(build_libraries + fake_build_parameter_library_link_path_s.used, main->path_build_libraries_static.string, sizeof(f_char_t) * main->path_build_libraries_static.used);
+ memcpy(build_libraries + fake_build_parameter_library_link_path_s.used, data->path_build_libraries_static.string, sizeof(f_char_t) * data->path_build_libraries_static.used);
}
build_libraries[build_libraries_length] = 0;
- f_array_length_t build_includes_length = fake_build_parameter_library_include_s.used + main->path_build_includes.used;
+ f_array_length_t build_includes_length = fake_build_parameter_library_include_s.used + data->path_build_includes.used;
f_char_t build_includes[build_includes_length + 1];
memcpy(build_includes, fake_build_parameter_library_include_s.string, sizeof(f_char_t) * fake_build_parameter_library_include_s.used);
- memcpy(build_includes + fake_build_parameter_library_include_s.used, main->path_build_includes.string, sizeof(f_char_t) * main->path_build_includes.used);
+ memcpy(build_includes + fake_build_parameter_library_include_s.used, data->path_build_includes.string, sizeof(f_char_t) * data->path_build_includes.used);
const f_string_static_t values[] = {
macro_f_string_static_t_initialize(build_libraries, 0, build_libraries_length),
} // for
}
- if (main->path_work.used && F_status_is_error_not(*status)) {
+ if (data->path_work.used && F_status_is_error_not(*status)) {
f_string_static_t buffer = f_string_static_t_initialize;
if (F_status_is_error_not(*status)) {
- buffer.used = fake_build_parameter_library_include_s.used + main->path_work_includes.used;
+ buffer.used = fake_build_parameter_library_include_s.used + data->path_work_includes.used;
f_char_t buffer_string[buffer.used + 1];
buffer.string = buffer_string;
buffer_string[buffer.used] = 0;
memcpy(buffer_string, fake_build_parameter_library_include_s.string, sizeof(f_char_t) * fake_build_parameter_library_include_s.used);
- memcpy(buffer_string + fake_build_parameter_library_include_s.used, main->path_work_includes.string, sizeof(f_char_t) * main->path_work_includes.used);
+ memcpy(buffer_string + fake_build_parameter_library_include_s.used, data->path_work_includes.string, sizeof(f_char_t) * data->path_work_includes.used);
*status = fll_execute_arguments_add(buffer, arguments);
}
if (data_build->setting.search_shared && (is_shared || !data_build->setting.search_exclusive) && F_status_is_error_not(*status)) {
- buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_shared.used;
+ buffer.used = fake_build_parameter_library_link_path_s.used + data->path_work_libraries_shared.used;
f_char_t buffer_string[buffer.used + 1];
buffer.string = buffer_string;
buffer_string[buffer.used] = 0;
memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used);
- memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_shared.string, sizeof(f_char_t) * main->path_work_libraries_shared.used);
+ memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, data->path_work_libraries_shared.string, sizeof(f_char_t) * data->path_work_libraries_shared.used);
*status = fll_execute_arguments_add(buffer, arguments);
}
if (data_build->setting.search_static && (!is_shared || !data_build->setting.search_exclusive) && F_status_is_error_not(*status)) {
- buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_static.used;
+ buffer.used = fake_build_parameter_library_link_path_s.used + data->path_work_libraries_static.used;
f_char_t buffer_string[buffer.used + 1];
buffer.string = buffer_string;
buffer_string[buffer.used] = 0;
memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, sizeof(f_char_t) * fake_build_parameter_library_link_path_s.used);
- memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_static.string, sizeof(f_char_t) * main->path_work_libraries_static.used);
+ memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, data->path_work_libraries_static.string, sizeof(f_char_t) * data->path_work_libraries_static.used);
*status = fll_execute_arguments_add(buffer, arguments);
}
}
}
- for (i = 0; i < main->define.used && F_status_is_error_not(*status); ++i) {
+ for (i = 0; i < data->define.used && F_status_is_error_not(*status); ++i) {
- if (!main->define.array[i].used) continue;
+ if (!data->define.array[i].used) continue;
- *status = fll_execute_arguments_add(main->define.array[i], arguments);
+ *status = fll_execute_arguments_add(data->define.array[i], arguments);
} // for
}
#endif // _di_fake_build_arguments_standard_add_
#ifndef _di_fake_build_copy_
- void fake_build_copy(fake_main_t * const main, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status) {
+ void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status) {
if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return;
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
return;
f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize;
f_string_static_t buffer = f_string_static_t_initialize;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Copying %Q.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, label, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Copying %Q.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, label, data->main->context.set.important, f_string_eol_s);
}
*status = f_string_dynamic_resize(source.used, &path_source);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), " f_string_dynamic_resize", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), " f_string_dynamic_resize", F_true);
f_string_dynamic_resize(0, &path_source);
fl_directory_recurse_t recurse = fl_directory_recurse_t_initialize;
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- recurse.output.stream = main->output.to.stream;
- recurse.output.id = main->output.to.id;
- recurse.output.flag = main->output.to.flag;
- recurse.output.size_read = main->output.to.size_read;
- recurse.output.size_write = main->output.to.size_write;
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ recurse.output.stream = data->main->output.to.stream;
+ recurse.output.id = data->main->output.to.id;
+ recurse.output.flag = data->main->output.to.flag;
+ recurse.output.size_read = data->main->output.to.size_read;
+ recurse.output.size_write = data->main->output.to.size_write;
recurse.verbose = fake_verbose_print_copy;
}
for (f_array_length_t i = 0; i < files.used; ++i) {
- if (!(i % fake_signal_check_short_d) && fake_signal_received(main)) {
+ if (!(i % fake_signal_check_short_d) && fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
break;
*status = f_string_dynamic_append_nulless(files.array[i], &path_source);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
*status = f_string_dynamic_append_nulless(destination, &destination_directory);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
*status = f_file_name_base(path_source, &destination_directory);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
break;
}
*status = fl_directory_copy(path_source, destination_directory, mode, recurse);
if (F_status_is_error(*status)) {
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
for (f_array_length_t j = 0; j < failures.used; ++j) {
- fake_print_error_build_operation_file(main, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
+ fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
} // for
if (F_status_set_fine(*status) != F_failure) {
- fll_error_print(main->error, F_status_set_fine(*status), "fl_directory_copy", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fl_directory_copy", F_true);
}
break;
}
- else if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fake_print_error_build_operation_file(main, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
+ else if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy", fake_common_file_directory_copy_s, f_file_operation_to_s, path_source, destination_directory, F_true);
}
break;
*status = f_string_dynamic_append_nulless(destination, &destination_file);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
*status = f_string_dynamic_append_nulless(destination, &destination_directory);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
break;
}
*status = f_file_name_directory(buffer, &destination_directory);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
break;
}
*status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d);
if (F_status_is_error(*status)) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "fl_directory_create", F_true, destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "fl_directory_create", F_true, destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e);
break;
}
*status = f_string_append(path_source.string + perserve_offset, path_source.used - perserve_offset, &destination_file);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_append", F_true);
break;
}
*status = f_file_name_base(path_source, &destination_file);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
break;
}
*status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, F_false);
if (F_status_is_error(*status)) {
- fake_print_error_build_operation_file(main, F_status_set_fine(*status), "f_file_copy", f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true);
+ fake_print_error_build_operation_file(data, F_status_set_fine(*status), "f_file_copy", f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true);
break;
}
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Copied file '%Q' to '%Q'.%r", main->output.to.stream, path_source, destination_file, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Copied file '%Q' to '%Q'.%r", data->main->output.to.stream, path_source, destination_file, f_string_eol_s);
}
}
else if (F_status_is_error(*status)) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_is", F_true, path_source, f_file_operation_create_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_directory_is", F_true, path_source, f_file_operation_create_s, fll_error_file_type_file_e);
break;
}
f_string_dynamic_resize(0, &destination_directory);
if (F_status_is_error_not(*status)) {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
}
#endif // _di_fake_build_copy_
#ifndef _di_fake_build_execute_process_script_
- int fake_build_execute_process_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) {
+ int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return data->main->child;
if (!process_script.used) return 0;
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
*status = fll_execute_arguments_add(fake_other_operation_build_s, &arguments);
// Ensure console color mode is passed to the scripts so that they can also react to color mode.
- if (F_status_is_error_not(*status) && main->context.mode != F_color_mode_none_d) {
+ if (F_status_is_error_not(*status) && data->main->context.mode != F_color_mode_none_d) {
f_string_static_t argument = f_string_static_t_initialize;
argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_dark_s.used;
memcpy(argument_string, f_console_symbol_short_disable_s.string, sizeof(f_char_t) * f_console_symbol_short_disable_s.used);
- if (main->context.mode == F_color_mode_dark_d) {
+ if (data->main->context.mode == F_color_mode_dark_d) {
memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_dark_s.string, sizeof(f_char_t) * f_console_standard_short_dark_s.used);
}
- else if (main->context.mode == F_color_mode_light_d) {
+ else if (data->main->context.mode == F_color_mode_light_d) {
memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_light_s.string, sizeof(f_char_t) * f_console_standard_short_light_s.used);
}
- else if (main->context.mode == F_color_mode_no_color_d) {
+ else if (data->main->context.mode == F_color_mode_no_color_d) {
memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_no_color_s.string, sizeof(f_char_t) * f_console_standard_short_no_color_s.used);
}
}
// Ensure verbosity level is passed to the scripts so that they can also react to requested verbosity.
- if (F_status_is_error_not(*status) && main->error.verbosity != f_console_verbosity_normal_e) {
+ if (F_status_is_error_not(*status) && data->main->error.verbosity != f_console_verbosity_normal_e) {
f_string_static_t argument = f_string_static_t_initialize;
argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_quiet_s.used;
memcpy(argument_string, f_console_symbol_short_disable_s.string, sizeof(f_char_t) * f_console_symbol_short_disable_s.used);
- if (main->context.mode == f_console_verbosity_quiet_e) {
+ if (data->main->context.mode == f_console_verbosity_quiet_e) {
memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_quiet_s.string, sizeof(f_char_t) * f_console_standard_short_quiet_s.used);
}
- else if (main->context.mode == f_console_verbosity_verbose_e) {
+ else if (data->main->context.mode == f_console_verbosity_verbose_e) {
memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_verbose_s.string, sizeof(f_char_t) * f_console_standard_short_verbose_s.used);
}
- else if (main->context.mode == f_console_verbosity_debug_e) {
+ else if (data->main->context.mode == f_console_verbosity_debug_e) {
memcpy(argument_string + f_console_symbol_short_disable_s.used, f_console_standard_short_debug_s.string, sizeof(f_char_t) * f_console_standard_short_debug_s.used);
}
}
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_string_dynamics_resize(0, &arguments);
{
f_string_dynamic_t defines = f_string_dynamic_t_initialize;
- if (main->define.used) {
- for (f_array_length_t i = 0; i < main->define.used; ++i) {
+ if (data->define.used) {
+ for (f_array_length_t i = 0; i < data->define.used; ++i) {
- *status = f_string_dynamic_mash(f_string_space_s, main->define.array[i], &defines);
+ *status = f_string_dynamic_mash(f_string_space_s, data->define.array[i], &defines);
if (F_status_is_error(*status)) break;
} // for
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_mash", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_mash", F_true);
f_string_dynamic_resize(0, &defines);
f_string_dynamics_resize(0, &arguments);
const f_string_static_t parameters_value[] = {
defines,
- main->process,
- main->settings,
- main->path_build,
- main->path_data,
- main->path_sources,
- main->path_work,
+ data->process,
+ data->settings,
+ data->path_build,
+ data->path_data,
+ data->path_sources,
+ data->path_work,
};
*status = fll_execute_arguments_add_parameter_set(parameters_prefix, parameters_name, parameters_value, 7, &arguments);
f_string_dynamic_resize(0, &defines);
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true);
f_string_dynamics_resize(0, &arguments);
f_string_dynamic_t path = f_string_dynamic_t_initialize;
if (process_script.string[0] != '/') {
- *status = f_string_dynamic_append_nulless(main->path_data_build, &path);
+ *status = f_string_dynamic_append_nulless(data->path_data_build, &path);
}
if (F_status_is_error_not(*status)) {
}
if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
f_string_dynamic_resize(0, &path);
f_string_dynamics_resize(0, &arguments);
f_string_dynamics_resize(0, &arguments);
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
}
else if (*status != F_child) {
if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_failure) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to execute script: '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to execute script: '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
else {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_program", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_program", F_true);
}
}
else {
- fake_build_touch(main, file_stage, status);
+ fake_build_touch(data, file_stage, status);
}
}
#endif // _di_fake_build_execute_process_script_
#ifndef _di_fake_build_get_file_name_without_extension_
- f_status_t fake_build_get_file_name_without_extension(fake_main_t * const main, const f_string_static_t path, f_string_dynamic_t *name) {
+ f_status_t fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name) {
name->used = 0;
f_status_t status = f_file_name_base(path, name);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_file_name_base", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_file_name_base", F_true);
return status;
}
#endif // _di_fake_build_get_file_name_without_extension_
#ifndef _di_fake_build_objects_add_
- f_status_t fake_build_objects_add(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) {
+ f_status_t fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) {
f_status_t status = F_none;
f_array_length_t i = 0;
#endif // _di_fake_build_objects_add_
#ifndef _di_fake_build_operate_
- f_status_t fake_build_operate(fake_main_t * const main, const f_string_static_t setting_file) {
+ f_status_t fake_build_operate(fake_data_t * const data, const f_string_static_t setting_file) {
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
return F_status_set_error(F_interrupt);
}
fake_build_data_t data_build = fake_build_data_t_initialize;
fake_build_stage_t stage = fake_build_stage_t_initialize;
- macro_f_mode_t_set_default_umask(mode, main->umask);
+ macro_f_mode_t_set_default_umask(mode, data->main->umask);
- fake_build_load_setting(main, setting_file, &data_build.setting, &status);
+ fake_build_load_setting(data, setting_file, &data_build.setting, &status);
if (F_status_is_fine(status)) {
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->output.to.stream);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->output.to.stream);
- fl_print_format("%r%[Building%] ", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important);
- fl_print_format("%[%Q%]", main->output.to.stream, main->context.set.notable, data_build.setting.build_name, main->context.set.notable);
- fl_print_format("%[.%]%r", main->output.to.stream, main->context.set.important, main->context.set.important, f_string_eol_s);
+ fl_print_format("%r%[Building%] ", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important);
+ fl_print_format("%[%Q%]", data->main->output.to.stream, data->main->context.set.notable, data_build.setting.build_name, data->main->context.set.notable);
+ fl_print_format("%[.%]%r", data->main->output.to.stream, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
- funlockfile(main->output.to.stream);
+ funlockfile(data->main->output.to.stream);
}
}
- fake_build_load_stage(main, setting_file, &stage, &status);
+ fake_build_load_stage(data, setting_file, &stage, &status);
- fake_build_load_environment(main, &data_build, &data_build.environment, &status);
+ fake_build_load_environment(data, &data_build, &data_build.environment, &status);
- fake_build_skeleton(main, &data_build, mode.directory, stage.file_skeleton, &status);
+ fake_build_skeleton(data, &data_build, mode.directory, stage.file_skeleton, &status);
- main->child = fake_build_execute_process_script(main, &data_build, data_build.setting.process_pre, stage.file_process_pre, &status);
+ data->main->child = fake_build_execute_process_script(data, &data_build, data_build.setting.process_pre, stage.file_process_pre, &status);
- fake_build_copy(main, mode, fake_build_setting_files_s, main->path_data_settings, main->path_build_settings, data_build.setting.build_sources_setting, stage.file_sources_settings, 0, &status);
+ fake_build_copy(data, mode, fake_build_setting_files_s, data->path_data_settings, data->path_build_settings, data_build.setting.build_sources_setting, stage.file_sources_settings, 0, &status);
if (data_build.setting.build_language == fake_build_language_type_bash_e) {
- fake_build_object_script(main, &data_build, mode, stage.file_object_script, &status);
+ fake_build_object_script(data, &data_build, mode, stage.file_object_script, &status);
- fake_build_library_script(main, &data_build, mode, stage.file_library_script, &status);
+ fake_build_library_script(data, &data_build, mode, stage.file_library_script, &status);
- fake_build_program_script(main, &data_build, mode, stage.file_program_script, &status);
+ fake_build_program_script(data, &data_build, mode, stage.file_program_script, &status);
if (data_build.setting.build_script) {
f_string_static_t source = f_string_static_t_initialize;
- fake_build_path_source_length(main, &data_build, &data_build.setting.path_sources, &source);
+ fake_build_path_source_length(data, &data_build, &data_build.setting.path_sources, &source);
f_char_t source_string[source.used + fake_path_part_script_s.used + 1];
source.string = source_string;
- fake_build_path_source_string(main, &data_build, &data_build.setting.path_sources, &source);
+ fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &source);
memcpy(source_string + source.used, fake_path_part_script_s.string, sizeof(f_char_t) * fake_path_part_script_s.used);
source.used += fake_path_part_script_s.used;
source.string[source.used] = 0;
- fake_build_copy(main, mode, fake_build_scripts_s, source, main->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
+ fake_build_copy(data, mode, fake_build_scripts_s, source, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
}
}
else {
if (data_build.setting.build_sources_headers.used) {
f_string_static_t source = f_string_static_t_initialize;
- fake_build_path_source_length(main, &data_build, &data_build.setting.path_sources, &source);
+ fake_build_path_source_length(data, &data_build, &data_build.setting.path_sources, &source);
f_char_t source_string[source.used + 1];
source.string = source_string;
- fake_build_path_source_string(main, &data_build, &data_build.setting.path_sources, &source);
+ fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &source);
f_string_static_t path_headers = f_string_static_t_initialize;
- path_headers.used = main->path_build_includes.used + data_build.setting.path_headers.used;
+ path_headers.used = data->path_build_includes.used + data_build.setting.path_headers.used;
f_char_t path_headers_string[path_headers.used + 1];
path_headers.string = path_headers_string;
- memcpy(path_headers_string, main->path_build_includes.string, sizeof(f_char_t) * main->path_build_includes.used);
+ memcpy(path_headers_string, data->path_build_includes.string, sizeof(f_char_t) * data->path_build_includes.used);
if (data_build.setting.path_headers.used) {
- memcpy(path_headers_string + main->path_build_includes.used, data_build.setting.path_headers.string, sizeof(f_char_t) * data_build.setting.path_headers.used);
+ memcpy(path_headers_string + data->path_build_includes.used, data_build.setting.path_headers.string, sizeof(f_char_t) * data_build.setting.path_headers.used);
}
path_headers_string[path_headers.used] = 0;
- fake_build_copy(main, mode, fake_build_header_files_s, source, path_headers, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status);
+ fake_build_copy(data, mode, fake_build_header_files_s, source, path_headers, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status);
if (data_build.setting.build_shared) {
- fake_build_copy(main, mode, fake_build_header_files_shared_s, source, path_headers, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status);
+ fake_build_copy(data, mode, fake_build_header_files_shared_s, source, path_headers, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status);
}
if (data_build.setting.build_static) {
- fake_build_copy(main, mode, fake_build_header_files_static_s, source, path_headers, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status);
+ fake_build_copy(data, mode, fake_build_header_files_static_s, source, path_headers, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.preserve_path_headers ? source.used : 0, &status);
}
}
if (data_build.setting.build_shared) {
- main->child = fake_build_object_shared(main, &data_build, mode, stage.file_object_shared, &status);
+ data->main->child = fake_build_object_shared(data, &data_build, mode, stage.file_object_shared, &status);
- main->child = fake_build_library_shared(main, &data_build, mode, stage.file_library_shared, &status);
+ data->main->child = fake_build_library_shared(data, &data_build, mode, stage.file_library_shared, &status);
- main->child = fake_build_program_shared(main, &data_build, mode, stage.file_program_shared, &status);
+ data->main->child = fake_build_program_shared(data, &data_build, mode, stage.file_program_shared, &status);
}
if (data_build.setting.build_static) {
- main->child = fake_build_object_static(main, &data_build, mode, stage.file_object_static, &status);
+ data->main->child = fake_build_object_static(data, &data_build, mode, stage.file_object_static, &status);
- main->child = fake_build_objects_static(main, &data_build, mode, stage.file_objects_static, &status);
+ data->main->child = fake_build_objects_static(data, &data_build, mode, stage.file_objects_static, &status);
- main->child = fake_build_library_static(main, &data_build, mode, stage.file_library_static, &status);
+ data->main->child = fake_build_library_static(data, &data_build, mode, stage.file_library_static, &status);
- main->child = fake_build_program_static(main, &data_build, mode, stage.file_program_static, &status);
+ data->main->child = fake_build_program_static(data, &data_build, mode, stage.file_program_static, &status);
}
if (data_build.setting.build_script) {
f_string_static_t source = f_string_static_t_initialize;
- fake_build_path_source_length(main, &data_build, &data_build.setting.path_sources, &source);
+ fake_build_path_source_length(data, &data_build, &data_build.setting.path_sources, &source);
f_char_t source_string[source.used + fake_path_part_script_s.used + 1];
source.string = source_string;
- fake_build_path_source_string(main, &data_build, &data_build.setting.path_sources, &source);
+ fake_build_path_source_string(data, &data_build, &data_build.setting.path_sources, &source);
memcpy(source_string + source.used, fake_path_part_script_s.string, sizeof(f_char_t) * fake_path_part_script_s.used);
source.used += fake_path_part_script_s.used;
source.string[source.used] = 0;
- fake_build_copy(main, mode, fake_build_scripts_s, source, main->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
+ fake_build_copy(data, mode, fake_build_scripts_s, source, data->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
}
}
- fake_build_execute_process_script(main, &data_build, data_build.setting.process_post, stage.file_process_post, &status);
+ fake_build_execute_process_script(data, &data_build, data_build.setting.process_post, stage.file_process_post, &status);
macro_fake_build_main_delete_simple(data_build);
macro_fake_build_stage_t_delete_simple(stage);
#endif // _di_fake_build_operate_
#ifndef _di_fake_build_path_source_length_
- void fake_build_path_source_length(fake_main_t * const main, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) {
+ void fake_build_path_source_length(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) {
- source->used = main->path_sources.used;
+ source->used = data->path_sources.used;
if (setting_path_source->used) {
source->used += setting_path_source->used;
#endif // _di_fake_build_path_source_length_
#ifndef _di_fake_build_path_source_string_
- void fake_build_path_source_string(fake_main_t * const main, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) {
+ void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) {
source->used = 0;
- memcpy(source->string, main->path_sources.string, sizeof(f_char_t) * main->path_sources.used);
- source->used += main->path_sources.used;
+ memcpy(source->string, data->path_sources.string, sizeof(f_char_t) * data->path_sources.used);
+ source->used += data->path_sources.used;
memcpy(source->string + source->used, setting_path_source->string, sizeof(f_char_t) * setting_path_source->used);
source->used += setting_path_source->used;
#endif // _di_fake_build_path_source_string_
#ifndef _di_fake_build_sources_add_
- f_status_t fake_build_sources_add(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) {
+ f_status_t fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) {
f_status_t status = F_none;
f_array_length_t i = 0;
if (!sources[i]->array[j].used) continue;
- fake_build_path_source_length(main, data_build, &data_build->setting.path_sources, &source);
+ fake_build_path_source_length(data, data_build, &data_build->setting.path_sources, &source);
f_char_t source_string[source.used + sources[i]->array[j].used + 1];
source.string = source_string;
- fake_build_path_source_string(main, data_build, &data_build->setting.path_sources, &source);
+ fake_build_path_source_string(data, data_build, &data_build->setting.path_sources, &source);
memcpy(source_string + source.used, sources[i]->array[j].string, sizeof(f_char_t) * sources[i]->array[j].used);
source.used += sources[i]->array[j].used;
#endif // _di_fake_build_sources_add_
#ifndef _di_fake_build_sources_object_add_
- f_status_t fake_build_sources_object_add(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) {
+ f_status_t fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) {
if (!generic->used && !specific->used) return F_none;
f_string_static_t source = f_string_static_t_initialize;
- fake_build_path_source_length(main, data_build, &data_build->setting.path_sources_object, &source);
+ fake_build_path_source_length(data, data_build, &data_build->setting.path_sources_object, &source);
if (specific->used) {
source.used += specific->used;
f_char_t source_string[source.used + 1];
source.string = source_string;
- fake_build_path_source_string(main, data_build, &data_build->setting.path_sources_object, &source);
+ fake_build_path_source_string(data, data_build, &data_build->setting.path_sources_object, &source);
if (specific->used) {
memcpy(source_string + source.used, specific->string, sizeof(f_char_t) * specific->used);
#endif // _di_fake_build_sources_object_add_
#ifndef _di_fake_build_touch_
- void fake_build_touch(fake_main_t * const main, const f_string_dynamic_t file, f_status_t *status) {
+ void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file, f_status_t *status) {
if (F_status_is_error(*status)) return;
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
return;
f_mode_t mode = f_mode_t_initialize;
- macro_f_mode_t_set_default_umask(mode, main->umask);
+ macro_f_mode_t_set_default_umask(mode, data->main->umask);
*status = f_file_touch(file, mode.regular, F_false);
if (F_status_is_error(*status)) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_touch", F_true, file, f_file_operation_touch_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(*status), "f_file_touch", F_true, file, f_file_operation_touch_s, fll_error_file_type_file_e);
}
}
#endif // _di_fake_build_touch_
/**
* Add the standard arguments for building a library/program.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param is_shared
* @see fll_execute_arguments_add()
*/
#ifndef _di_fake_build_arguments_standard_add_
- extern void fake_build_arguments_standard_add(fake_main_t * const main, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments, f_status_t *status) F_attribute_visibility_internal_d;
+ extern void fake_build_arguments_standard_add(fake_data_t * const data, fake_build_data_t * const data_build, const bool is_shared, const uint8_t type, f_string_dynamics_t *arguments, f_status_t *status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_arguments_standard_add_
/**
* Copy over the main setting files.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param mode
* The modes for each file type.
* @param label
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_copy_
- extern void fake_build_copy(fake_main_t * const main, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status) F_attribute_visibility_internal_d;
+ extern void fake_build_copy(fake_data_t * const data, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t perserve_offset, f_status_t *status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_copy_
/**
* Execute the Pre-Process or Post-pocess build script.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param process_script
* This generally is only needed when F_child is returned, where this holds the return status of the child process.
*/
#ifndef _di_fake_build_execute_process_script_
- extern int fake_build_execute_process_script(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) F_attribute_visibility_internal_d;
+ extern int fake_build_execute_process_script(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_execute_process_script_
/**
* Get the file name without the extension and without the path parts.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path
* The file path to get the file name from.
* @param name
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_get_file_name_without_extension_
- extern f_status_t fake_build_get_file_name_without_extension(fake_main_t * const main, const f_string_static_t path, f_string_dynamic_t *name);
+ extern f_status_t fake_build_get_file_name_without_extension(fake_data_t * const data, const f_string_static_t path, f_string_dynamic_t *name);
#endif // _di_fake_build_get_file_name_without_extension_
/**
* Add the pre-compiled objects to the execute arguments array (such as "build_objects_library").
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param path
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_objects_add_
- extern f_status_t fake_build_objects_add(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d;
+ extern f_status_t fake_build_objects_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *path, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d;
#endif // _di_fake_build_objects_add_
/**
* Execute the build operation.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param setting_file
* The name of the settings file to use.
* If setting_file.used is 0, then the default or program parameter supplied file is used.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_operate_
- extern f_status_t fake_build_operate(fake_main_t * const main, const f_string_static_t setting_file) F_attribute_visibility_internal_d;
+ extern f_status_t fake_build_operate(fake_data_t * const data, const f_string_static_t setting_file) F_attribute_visibility_internal_d;
#endif // _di_fake_build_operate_
/**
* Calculate the length of the sources path so that it can be used to manually construct a static string.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param setting_path_source
* The path_sources.size is ignored.
*/
#ifndef _di_fake_build_path_source_length_
- extern void fake_build_path_source_length(fake_main_t * const main, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) F_attribute_visibility_internal_d;
+ extern void fake_build_path_source_length(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) F_attribute_visibility_internal_d;
#endif // _di_fake_build_path_source_length_
/**
* Construct a static string array of the sources path.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param setting_path_source
* The path_sources.size is ignored.
*/
#ifndef _di_fake_build_path_source_string_
- extern void fake_build_path_source_string(fake_main_t * const main, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) F_attribute_visibility_internal_d;
+ extern void fake_build_path_source_string(fake_data_t * const data, fake_build_data_t * const data_build, f_string_static_t * const setting_path_source, f_string_static_t * const source) F_attribute_visibility_internal_d;
#endif // _di_fake_build_path_source_string_
/**
* Add the sources to the execute arguments array.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param generic
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_sources_add_
- extern f_status_t fake_build_sources_add(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d;
+ extern f_status_t fake_build_sources_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_statics_t *generic, const f_string_statics_t *specific, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d;
#endif // _di_fake_build_sources_add_
/**
* Add the sources object to the execute arguments array.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_build
* The build data.
* @param generic
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_sources_object_add_
- extern f_status_t fake_build_sources_object_add(fake_main_t * const main, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d;
+ extern f_status_t fake_build_sources_object_add(fake_data_t * const data, fake_build_data_t * const data_build, const f_string_static_t *generic, const f_string_static_t *specific, f_string_dynamics_t *arguments) F_attribute_visibility_internal_d;
#endif // _di_fake_build_sources_object_add_
/**
* Touch the given build stage file, but only if there are no current errors in status.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param file
* The file path to touch.
* @param status
* @see f_file_touch()
*/
#ifndef _di_fake_build_touch_
- extern void fake_build_touch(fake_main_t * const main, const f_string_dynamic_t file, f_status_t *status) F_attribute_visibility_internal_d;
+ extern void fake_build_touch(fake_data_t * const data, const f_string_dynamic_t file, f_status_t *status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_touch_
#ifdef __cplusplus
#endif
#ifndef _di_fake_clean_operate_
- f_status_t fake_clean_operate(fake_main_t * const main) {
+ f_status_t fake_clean_operate(fake_data_t * const data) {
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->output.to.stream);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->output.to.stream);
- fl_print_format("%r%[Deleting all files within build directory '%]", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important);
- fl_print_format("%[%Q%]", main->output.to.stream, main->context.set.notable, main->path_build, main->context.set.notable);
- fl_print_format("%[.%]%r", main->output.to.stream, main->context.set.important, main->context.set.important, f_string_eol_s);
+ fl_print_format("%r%[Deleting all files within build directory '%]", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important);
+ fl_print_format("%[%Q%]", data->main->output.to.stream, data->main->context.set.notable, data->path_build, data->main->context.set.notable);
+ fl_print_format("%[.%]%r", data->main->output.to.stream, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
- funlockfile(main->output.to.stream);
+ funlockfile(data->main->output.to.stream);
}
f_status_t status = F_none;
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- status = f_directory_remove_custom(main->path_build, F_directory_descriptors_max_d, F_true, fake_clean_remove_recursively_verbosely);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ status = f_directory_remove_custom(data->path_build, F_directory_descriptors_max_d, F_true, fake_clean_remove_recursively_verbosely);
}
else {
- status = f_directory_remove(main->path_build, F_directory_descriptors_max_d, F_true);
+ status = f_directory_remove(data->path_build, F_directory_descriptors_max_d, F_true);
}
if (F_status_set_fine(status) == F_file_found_not || F_status_set_fine(status) == F_directory) {
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("The build directory '%[%Q%]' does not exist.%r", main->warning.to.stream, main->context.set.notable, main->path_build, main->context.set.notable, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("The build directory '%[%Q%]' does not exist.%r", data->main->warning.to.stream, data->main->context.set.notable, data->path_build, data->main->context.set.notable, f_string_eol_s);
}
status = F_none;
}
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_remove", F_true, main->path_build, f_file_operation_delete_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_directory_remove", F_true, data->path_build, f_file_operation_delete_s, fll_error_file_type_directory_e);
return status;
}
/**
* Execute the clean operation.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_clean_operate_
- extern f_status_t fake_clean_operate(fake_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_clean_operate(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_clean_operate_
/**
const f_string_static_t fake_file_data_build_process_pre_s = macro_f_string_static_t_initialize(FAKE_file_data_build_process_pre_s, 0, FAKE_file_data_build_process_pre_s_length);
#endif // _di_fake_file_data_build_strings_
+#ifndef _di_fake_data_delete_
+ f_status_t fake_data_delete(fake_data_t * const data) {
+
+ f_string_dynamics_resize(0, &data->define);
+ f_string_dynamic_resize(0, &data->fakefile);
+ f_string_dynamics_resize(0, &data->mode);
+ f_string_dynamic_resize(0, &data->process);
+ f_string_dynamic_resize(0, &data->settings);
+
+ f_string_dynamic_resize(0, &data->path_build);
+ f_string_dynamic_resize(0, &data->path_build_documents);
+ f_string_dynamic_resize(0, &data->path_build_includes);
+ f_string_dynamic_resize(0, &data->path_build_libraries);
+ f_string_dynamic_resize(0, &data->path_build_libraries_script);
+ f_string_dynamic_resize(0, &data->path_build_libraries_shared);
+ f_string_dynamic_resize(0, &data->path_build_libraries_static);
+ f_string_dynamic_resize(0, &data->path_build_objects);
+ f_string_dynamic_resize(0, &data->path_build_objects_script);
+ f_string_dynamic_resize(0, &data->path_build_objects_shared);
+ f_string_dynamic_resize(0, &data->path_build_objects_static);
+ f_string_dynamic_resize(0, &data->path_build_programs);
+ f_string_dynamic_resize(0, &data->path_build_programs_script);
+ f_string_dynamic_resize(0, &data->path_build_programs_shared);
+ f_string_dynamic_resize(0, &data->path_build_programs_static);
+ f_string_dynamic_resize(0, &data->path_build_settings);
+ f_string_dynamic_resize(0, &data->path_build_stage);
+ f_string_dynamic_resize(0, &data->path_work);
+
+ f_string_dynamic_resize(0, &data->path_data);
+ f_string_dynamic_resize(0, &data->path_data_build);
+
+ f_string_dynamic_resize(0, &data->path_data_settings);
+
+ f_string_dynamic_resize(0, &data->path_documents);
+
+ f_string_dynamic_resize(0, &data->path_licenses);
+
+ f_string_dynamic_resize(0, &data->path_sources);
+
+ f_string_dynamic_resize(0, &data->path_work);
+ f_string_dynamic_resize(0, &data->path_work_includes);
+ f_string_dynamic_resize(0, &data->path_work_libraries);
+ f_string_dynamic_resize(0, &data->path_work_libraries_script);
+ f_string_dynamic_resize(0, &data->path_work_libraries_shared);
+ f_string_dynamic_resize(0, &data->path_work_libraries_static);
+ f_string_dynamic_resize(0, &data->path_work_programs);
+ f_string_dynamic_resize(0, &data->path_work_programs_script);
+ f_string_dynamic_resize(0, &data->path_work_programs_shared);
+ f_string_dynamic_resize(0, &data->path_work_programs_static);
+
+ f_string_dynamic_resize(0, &data->file_data_build_defines);
+ f_string_dynamic_resize(0, &data->file_data_build_dependencies);
+ f_string_dynamic_resize(0, &data->file_data_build_process_post_s);
+ f_string_dynamic_resize(0, &data->file_data_build_process_pre_s);
+ f_string_dynamic_resize(0, &data->file_data_build_fakefile);
+ f_string_dynamic_resize(0, &data->file_data_build_settings);
+
+ f_string_dynamic_resize(0, &data->file_documents_readme);
+
+ return F_none;
+ }
+#endif // _di_fake_data_delete_
+
#ifndef _di_fake_make_data_delete_
f_status_t fake_make_data_delete(fake_make_data_t * const data) {
#endif // _di_fake_make_data_delete_
#ifndef _di_fake_signal_received_
- f_status_t fake_signal_received(fake_main_t * const main) {
+ f_status_t fake_signal_received(fake_data_t * const data) {
- if (main->signal.id == -1) {
+ if (data->main->signal.id == -1) {
return F_false;
}
memset(&information, 0, sizeof(struct signalfd_siginfo));
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
+ if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
switch (information.ssi_signo) {
case F_signal_abort:
case F_signal_broken_pipe:
case F_signal_interrupt:
case F_signal_quit:
case F_signal_termination:
- fake_print_signal_received(main, information.ssi_signo);
+ fake_print_signal_received(data, information.ssi_signo);
return information.ssi_signo;
}
extern "C" {
#endif
+/**
+ * The program data.
+ *
+ * argv: The argument structure in the progam data parameters for simplifying syntax.
+ * at: The processed at parameter value.
+ *
+ * operation: A code representing the currrent operation.
+ *
+ * fakefile: The fakefile data.
+ * process: The process data.
+ * settings: The settings data.
+ *
+ * path_build The build path.
+ * path_build_documents The build documents path.
+ * path_build_includes The build includes path.
+ * path_build_libraries The build libraries path.
+ * path_build_libraries_script: The build libraries_script path.
+ * path_build_libraries_shared: The build libraries_shared path.
+ * path_build_libraries_static: The build libraries_static path.
+ * path_build_objects: The build objects path.
+ * path_build_objects_script: The build objects_script path.
+ * path_build_objects_shared: The build objects_shared path.
+ * path_build_objects_static: The build objects_static path.
+ * path_build_programs: The build programs path.
+ * path_build_programs_script: The build programs_script path.
+ * path_build_programs_shared: The build programs_shared path.
+ * path_build_programs_static: The build programs_static path.
+ * path_build_settings: The build settings path.
+ * path_build_stage: The build stage path.
+ *
+ * path_data: The data path.
+ * path_data_build: The data_build path.
+ * path_data_build_settings: The data_build_settings path.
+ *
+ * path_documents The documents path.
+ * path_licenses The licenses path.
+ * path_sources The sources path.
+ *
+ * path_work The work path.
+ * path_work_includes The includes work path.
+ * path_work_libraries The libraries work path.
+ * path_work_libraries_script The libraries_script work path.
+ * path_work_libraries_shared The libraries_shared work path.
+ * path_work_libraries_static The libraries_static work path.
+ * path_work_programs The programs work path.
+ * path_work_programs_script The programs_script work path.
+ * path_work_programs_shared The programs_shared work path.
+ * path_work_programs_static The programs_static work path.
+ *
+ * file_data_build_defines The defines build file data.
+ * file_data_build_dependencies The dependencies build file data.
+ * file_data_build_fakefile The fakefile build file data.
+ * file_data_build_process_post_s The process_post_s build file data.
+ * file_data_build_process_pre_s The process_pre_s build file data.
+ * file_data_build_settings The settings build file data.
+ *
+ * file_documents_readme The documents readme file data.
+
+ * define The define data.
+ * mode The mode data.
+ */
+#ifndef _di_fake_data_t_
+ typedef struct {
+ fll_program_data_t *main;
+ f_string_static_t *argv;
+
+ uint8_t operation;
+
+ f_string_dynamic_t fakefile;
+ f_string_dynamic_t process;
+ f_string_dynamic_t settings;
+
+ f_string_dynamic_t path_build;
+ f_string_dynamic_t path_build_documents;
+ f_string_dynamic_t path_build_includes;
+ f_string_dynamic_t path_build_libraries;
+ f_string_dynamic_t path_build_libraries_script;
+ f_string_dynamic_t path_build_libraries_shared;
+ f_string_dynamic_t path_build_libraries_static;
+ f_string_dynamic_t path_build_objects;
+ f_string_dynamic_t path_build_objects_script;
+ f_string_dynamic_t path_build_objects_shared;
+ f_string_dynamic_t path_build_objects_static;
+ f_string_dynamic_t path_build_programs;
+ f_string_dynamic_t path_build_programs_script;
+ f_string_dynamic_t path_build_programs_shared;
+ f_string_dynamic_t path_build_programs_static;
+ f_string_dynamic_t path_build_settings;
+ f_string_dynamic_t path_build_stage;
+
+ f_string_dynamic_t path_data;
+ f_string_dynamic_t path_data_build;
+ f_string_dynamic_t path_data_settings;
+
+ f_string_dynamic_t path_documents;
+
+ f_string_dynamic_t path_licenses;
+
+ f_string_dynamic_t path_sources;
+
+ f_string_dynamic_t path_work;
+ f_string_dynamic_t path_work_includes;
+ f_string_dynamic_t path_work_libraries;
+ f_string_dynamic_t path_work_libraries_script;
+ f_string_dynamic_t path_work_libraries_shared;
+ f_string_dynamic_t path_work_libraries_static;
+ f_string_dynamic_t path_work_programs;
+ f_string_dynamic_t path_work_programs_script;
+ f_string_dynamic_t path_work_programs_shared;
+ f_string_dynamic_t path_work_programs_static;
+
+ f_string_dynamic_t file_data_build_defines;
+ f_string_dynamic_t file_data_build_dependencies;
+ f_string_dynamic_t file_data_build_fakefile;
+ f_string_dynamic_t file_data_build_process_post_s;
+ f_string_dynamic_t file_data_build_process_pre_s;
+ f_string_dynamic_t file_data_build_settings;
+
+ f_string_dynamic_t file_documents_readme;
+
+ f_string_dynamics_t define;
+ f_string_dynamics_t mode;
+ } fake_data_t;
+
+ #define fake_data_t_initialize \
+ { \
+ 0, \
+ 0, \
+ 0, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamics_t_initialize, \
+ f_string_dynamics_t_initialize, \
+ }
+#endif // _di_fake_main_t_
+
#ifndef _di_fake_build_setting_t_
typedef struct {
uint8_t build_language;
f_array_length_t id_main;
- fake_main_t *main;
+ fll_program_data_t *main;
+ fake_data_t *data;
} fake_make_data_t;
#define fake_make_data_t_initialize { \
f_string_dynamic_t_initialize, \
0, \
0, \
+ 0, \
}
#endif // _di_fake_make_data_t_
#endif // _di_fake_file_data_build_strings_
/**
+ * Deallocate data.
+ *
+ * @param data
+ * The program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fake_main()
+ */
+#ifndef _di_fake_data_delete_
+ extern f_status_t fake_data_delete(fake_data_t * const data);
+#endif // _di_fake_data_delete_
+
+/**
* Deallocate make data.
*
* @param data
*
* Only signals that are blocked via main.signal will be received.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* A positive number representing a valid signal on signal received.
* @see f_signal_read()
*/
#ifndef _di_fake_signal_received_
- extern f_status_t fake_signal_received(fake_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_signal_received(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_signal_received_
#ifdef __cplusplus
#endif
#ifndef _di_fake_path_generate_
- f_status_t fake_path_generate(fake_main_t *main) {
+ f_status_t fake_path_generate(fake_data_t * const data) {
f_status_t status = F_none;
uint8_t i = 0;
{
const f_string_dynamic_t *parameters_source[] = {
- &main->path_build,
- &main->path_data,
+ &data->path_build,
+ &data->path_data,
};
const uint8_t parameters_size[] = {
};
f_string_dynamic_t *parameters_value_0[] = {
- &main->path_build_documents,
- &main->path_build_includes,
- &main->path_build_libraries,
- &main->path_build_objects,
- &main->path_build_programs,
- &main->path_build_settings,
- &main->path_build_stage,
+ &data->path_build_documents,
+ &data->path_build_includes,
+ &data->path_build_libraries,
+ &data->path_build_objects,
+ &data->path_build_programs,
+ &data->path_build_settings,
+ &data->path_build_stage,
};
f_string_dynamic_t *parameters_value_1[] = {
- &main->path_data_build,
- &main->path_data_settings,
+ &data->path_data_build,
+ &data->path_data_settings,
};
f_string_dynamic_t **const parameters_value[] = {
parameters_value[i][j]->used = 0;
} // for
- status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_size[i]);
+ status = fake_path_generate_string_dynamic(data, *parameters_source[i], parameters_value[i], parameters_size[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
return status;
}
};
f_string_dynamic_t * const parameters_value[] = {
- &main->path_build_documents,
- &main->path_build_includes,
- &main->path_build_libraries,
- &main->path_build_objects,
- &main->path_build_programs,
- &main->path_build_settings,
- &main->path_build_stage,
- &main->path_data_build,
- &main->path_data_settings,
- &main->path_documents,
- &main->path_licenses,
+ &data->path_build_documents,
+ &data->path_build_includes,
+ &data->path_build_libraries,
+ &data->path_build_objects,
+ &data->path_build_programs,
+ &data->path_build_settings,
+ &data->path_build_stage,
+ &data->path_data_build,
+ &data->path_data_settings,
+ &data->path_documents,
+ &data->path_licenses,
};
for (i = 0; i < 11; ++i) {
status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
{
const f_string_dynamic_t *parameters_source[] = {
- &main->path_build_libraries,
- &main->path_build_objects,
- &main->path_build_programs,
- &main->path_data_build,
- &main->path_documents,
+ &data->path_build_libraries,
+ &data->path_build_objects,
+ &data->path_build_programs,
+ &data->path_data_build,
+ &data->path_documents,
};
const uint8_t parameters_size[] = {
};
f_string_dynamic_t *parameters_value_0[] = {
- &main->path_build_libraries_script,
- &main->path_build_libraries_shared,
- &main->path_build_libraries_static,
+ &data->path_build_libraries_script,
+ &data->path_build_libraries_shared,
+ &data->path_build_libraries_static,
};
f_string_dynamic_t *parameters_value_1[] = {
- &main->path_build_objects_script,
- &main->path_build_objects_shared,
- &main->path_build_objects_static,
+ &data->path_build_objects_script,
+ &data->path_build_objects_shared,
+ &data->path_build_objects_static,
};
f_string_dynamic_t *parameters_value_2[] = {
- &main->path_build_programs_script,
- &main->path_build_programs_shared,
- &main->path_build_programs_static,
+ &data->path_build_programs_script,
+ &data->path_build_programs_shared,
+ &data->path_build_programs_static,
};
f_string_dynamic_t *parameters_value_3[] = {
- &main->file_data_build_defines,
- &main->file_data_build_dependencies,
- &main->file_data_build_fakefile,
- &main->file_data_build_process_post_s,
- &main->file_data_build_process_pre_s,
- &main->file_data_build_settings,
+ &data->file_data_build_defines,
+ &data->file_data_build_dependencies,
+ &data->file_data_build_fakefile,
+ &data->file_data_build_process_post_s,
+ &data->file_data_build_process_pre_s,
+ &data->file_data_build_settings,
};
f_string_dynamic_t *parameters_value_4[] = {
- &main->file_documents_readme,
+ &data->file_documents_readme,
};
f_string_dynamic_t **const parameters_value[] = {
for (i = 0; i < 5; ++i) {
- status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_size[i]);
+ status = fake_path_generate_string_dynamic(data, *parameters_source[i], parameters_value[i], parameters_size[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
return status;
}
}
// When custom fakefile or settings are used and they are paths to a file, remove the default path.
- if (f_path_is(main->fakefile) == F_true) {
- main->file_data_build_fakefile.used = 0;
+ if (f_path_is(data->fakefile) == F_true) {
+ data->file_data_build_fakefile.used = 0;
}
- if (f_path_is(main->settings) == F_true) {
- main->file_data_build_settings.used = 0;
+ if (f_path_is(data->settings) == F_true) {
+ data->file_data_build_settings.used = 0;
}
{
fake_file_dependencies_s,
fake_file_process_post_s,
fake_file_process_pre_s,
- main->fakefile,
- main->settings,
+ data->fakefile,
+ data->settings,
fake_file_readme_s,
};
f_string_dynamic_t * const parameters_value[] = {
- &main->path_build_libraries_script,
- &main->path_build_libraries_shared,
- &main->path_build_libraries_static,
- &main->path_build_objects_script,
- &main->path_build_objects_shared,
- &main->path_build_objects_static,
- &main->path_build_programs_script,
- &main->path_build_programs_shared,
- &main->path_build_programs_static,
- &main->file_data_build_defines,
- &main->file_data_build_dependencies,
- &main->file_data_build_process_post_s,
- &main->file_data_build_process_pre_s,
- &main->file_data_build_fakefile,
- &main->file_data_build_settings,
- &main->file_documents_readme,
+ &data->path_build_libraries_script,
+ &data->path_build_libraries_shared,
+ &data->path_build_libraries_static,
+ &data->path_build_objects_script,
+ &data->path_build_objects_shared,
+ &data->path_build_objects_static,
+ &data->path_build_programs_script,
+ &data->path_build_programs_shared,
+ &data->path_build_programs_static,
+ &data->file_data_build_defines,
+ &data->file_data_build_dependencies,
+ &data->file_data_build_process_post_s,
+ &data->file_data_build_process_pre_s,
+ &data->file_data_build_fakefile,
+ &data->file_data_build_settings,
+ &data->file_documents_readme,
};
for (i = 0; i < 16; ++i) {
status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
} // for
}
- if (main->path_work.used) {
+ if (data->path_work.used) {
{
f_string_dynamic_t * const parameters_value[] = {
- &main->path_work_includes,
- &main->path_work_libraries,
- &main->path_work_programs,
+ &data->path_work_includes,
+ &data->path_work_libraries,
+ &data->path_work_programs,
};
for (i = 0; i < 3; ++i) {
parameters_value[i]->used = 0;
- status = f_string_dynamic_append_nulless(main->path_work, parameters_value[i]);
+ status = f_string_dynamic_append_nulless(data->path_work, parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
};
f_string_dynamic_t * const parameters_value[] = {
- &main->path_work_includes,
- &main->path_work_libraries,
- &main->path_work_programs,
+ &data->path_work_includes,
+ &data->path_work_libraries,
+ &data->path_work_programs,
};
for (i = 0; i < 3; ++i) {
status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
{
const f_string_dynamic_t *parameters_source[] = {
- &main->path_work_libraries,
- &main->path_work_programs,
+ &data->path_work_libraries,
+ &data->path_work_programs,
};
const uint8_t parameters_size[] = {
};
f_string_dynamic_t *parameters_value_0[] = {
- &main->path_work_libraries_script,
- &main->path_work_libraries_shared,
- &main->path_work_libraries_static,
+ &data->path_work_libraries_script,
+ &data->path_work_libraries_shared,
+ &data->path_work_libraries_static,
};
f_string_dynamic_t *parameters_value_1[] = {
- &main->path_work_programs_script,
- &main->path_work_programs_shared,
- &main->path_work_programs_static,
+ &data->path_work_programs_script,
+ &data->path_work_programs_shared,
+ &data->path_work_programs_static,
};
f_string_dynamic_t **const parameters_value[] = {
for (i = 0; i < 2; ++i) {
- status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_size[i]);
+ status = fake_path_generate_string_dynamic(data, *parameters_source[i], parameters_value[i], parameters_size[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
return status;
}
};
f_string_dynamic_t * const parameters_value[] = {
- &main->path_work_libraries_script,
- &main->path_work_libraries_shared,
- &main->path_work_libraries_static,
- &main->path_work_programs_script,
- &main->path_work_programs_shared,
- &main->path_work_programs_static,
+ &data->path_work_libraries_script,
+ &data->path_work_libraries_shared,
+ &data->path_work_libraries_static,
+ &data->path_work_programs_script,
+ &data->path_work_programs_shared,
+ &data->path_work_programs_static,
};
for (i = 0; i < 6; ++i) {
status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
return status;
}
#endif // _di_fake_path_generate_
#ifndef _di_fake_path_generate_string_dynamic_
- f_status_t fake_path_generate_string_dynamic(fake_main_t *main, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t length) {
+ f_status_t fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t length) {
f_status_t status = F_none;
/**
* Generate all appropriate paths based on runtime information.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_path_generate_
- extern f_status_t fake_path_generate(fake_main_t *main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_path_generate(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_path_generate_
/**
*
* The given source is applied to each destination.
*
- * @param main
- * The main program data.
+ * @param daa
+ * The program data.
* @param source
* The string to copy from.
* @param destination
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_path_generate_string_dynamic_
- extern f_status_t fake_path_generate_string_dynamic(fake_main_t *main, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t size) F_attribute_visibility_internal_d;
+ extern f_status_t fake_path_generate_string_dynamic(fake_data_t * const data, const f_string_dynamic_t source, f_string_dynamic_t *destination[], const uint8_t size) F_attribute_visibility_internal_d;
#endif // _di_fake_path_generate_string_dynamic_
#ifdef __cplusplus
#endif
#ifndef _di_fake_execute_
- int fake_execute(fake_main_t * const main, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t * const status) {
+ int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t * const status) {
if (F_status_is_error(*status)) return 1;
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->output.to.stream);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->output.to.stream);
- f_print_dynamic(program, main->output.to.stream);
+ f_print_dynamic(program, data->main->output.to.stream);
for (f_array_length_t i = 0; i < arguments.used; ++i) {
if (!arguments.array[i].used) continue;
- fl_print_format(" %Q", main->output.to.stream, arguments.array[i]);
+ fl_print_format(" %Q", data->main->output.to.stream, arguments.array[i]);
} // for
- f_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
+ f_print_dynamic_raw(f_string_eol_s, data->main->output.to.stream);
- funlockfile(main->output.to.stream);
+ funlockfile(data->main->output.to.stream);
// Flush to stdout before executing command.
- fflush(main->output.to.stream);
+ fflush(data->main->output.to.stream);
}
int return_code = 0;
*status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
*status = F_status_set_error(F_interrupt);
return 0;
return_code = 1;
if (F_status_set_fine(*status) == F_file_found_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to find program '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, program, main->error.notable);
- fl_print_format("%[' for executing.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to find program '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, program, data->main->error.notable);
+ fl_print_format("%[' for executing.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
else {
- fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_program", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(*status), "fll_execute_program", F_true);
}
}
#endif // _di_fake_execute_
#ifndef _di_fake_file_buffer_
- f_status_t fake_file_buffer(fake_main_t * const main, const f_string_static_t path_file, f_string_dynamic_t * const buffer) {
+ f_status_t fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, f_string_dynamic_t * const buffer) {
f_file_t file = f_file_t_initialize;
char *name_function = "f_file_exists";
f_status_t status = F_none;
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
return F_status_set_error(F_interrupt);
}
if (F_status_is_error(status)) {
const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24);
- fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, message, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), name_function, F_true, path_file, message, fll_error_file_type_file_e);
f_string_dynamic_resize(0, buffer);
}
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, f_file_operation_read_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), name_function, F_true, path_file, f_file_operation_read_s, fll_error_file_type_file_e);
f_string_dynamic_resize(0, buffer);
}
#endif // _di_fake_file_buffer_
#ifndef _di_fake_process_console_parameters_
- f_status_t fake_process_console_parameters(fake_main_t * const main) {
+ f_status_t fake_process_console_parameters(fake_data_t * const data) {
f_status_t status = F_none;
- // @todo move as many of the inline error printing code into more general functions where possible to provide more accurate error reporting.
-
{
const uint8_t parameters_id[] = {
fake_parameter_fakefile_e,
};
f_string_dynamic_t * const parameters_value[] = {
- &main->fakefile,
- &main->process,
- &main->settings,
+ &data->fakefile,
+ &data->process,
+ &data->settings,
};
bool parameters_validate_word[] = {
for (uint8_t i = 0; i < 3; ++i) {
- if (main->parameters.array[parameters_id[i]].result == f_console_result_found_e) {
- fake_print_error_parameter_missing_value(main, parameters_name[i]);
+ if (data->main->parameters.array[parameters_id[i]].result == f_console_result_found_e) {
+ fake_print_error_parameter_missing_value(data, parameters_name[i]);
return F_status_set_error(F_parameter);
}
- else if (main->parameters.array[parameters_id[i]].result == f_console_result_additional_e) {
- if (main->parameters.array[parameters_id[i]].locations.used > 1) {
- fake_print_error_parameter_too_many(main, parameters_name[i]);
+ else if (data->main->parameters.array[parameters_id[i]].result == f_console_result_additional_e) {
+ if (data->main->parameters.array[parameters_id[i]].locations.used > 1) {
+ fake_print_error_parameter_too_many(data, parameters_name[i]);
return F_status_set_error(F_parameter);
}
- f_array_length_t index = main->parameters.array[parameters_id[i]].values.array[0];
+ f_array_length_t index = data->main->parameters.array[parameters_id[i]].values.array[0];
- if (main->parameters.arguments.array[index].used) {
+ if (data->main->parameters.arguments.array[index].used) {
if (parameters_validate_word[i]) {
f_array_length_t j = 0;
f_array_length_t width_max = 0;
- for (j = 0; j < main->parameters.arguments.array[index].used; ++j) {
+ for (j = 0; j < data->main->parameters.arguments.array[index].used; ++j) {
- width_max = main->parameters.arguments.array[index].used - j;
+ width_max = data->main->parameters.arguments.array[index].used - j;
- status = f_utf_is_word_dash_plus(main->parameters.arguments.array[index].string + j, width_max, F_false);
+ status = f_utf_is_word_dash_plus(data->main->parameters.arguments.array[index].string + j, width_max, F_false);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return status;
}
if (status == F_false) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, main->error.notable);
- fl_print_format("%[' parameters value '%]", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, main->parameters.arguments.array[index], main->error.notable);
- fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_process_s, data->main->error.notable);
+ fl_print_format("%[' parameters value '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, data->main->parameters.arguments.array[index], data->main->error.notable);
+ fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_status_set_error(F_parameter);
} // for
}
- status = f_string_dynamic_increase_by(main->parameters.arguments.array[index].used + 1, parameters_value[i]);
+ status = f_string_dynamic_increase_by(data->main->parameters.arguments.array[index].used + 1, parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
return status;
}
- status = f_string_dynamic_append(main->parameters.arguments.array[index], parameters_value[i]);
+ status = f_string_dynamic_append(data->main->parameters.arguments.array[index], parameters_value[i]);
if (F_status_is_error(status)) {
if (status == F_status_set_error(F_string_too_large)) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%Q%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
- fl_print_format("%[' is too long.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%Q%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], data->main->error.notable);
+ fl_print_format("%[' is too long.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
else {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_append", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_append", F_true);
}
return status;
}
}
- if (!main->parameters.arguments.array[index].used || status == F_data_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (!data->main->parameters.arguments.array[index].used || status == F_data_not) {
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
- fl_print_format("%[' must not be empty and must not contain only whitespace.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], data->main->error.notable);
+ fl_print_format("%[' must not be empty and must not contain only whitespace.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
}
status = f_string_dynamic_increase_by(parameter_defaults[i].used + 1, parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
return status;
}
status = f_string_dynamic_append(parameter_defaults[i], parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
return status;
}
} // for
}
- if (main->parameters.array[fake_parameter_define_e].result == f_console_result_found_e) {
- fake_print_error_parameter_missing_value(main, fake_long_define_s);
+ if (data->main->parameters.array[fake_parameter_define_e].result == f_console_result_found_e) {
+ fake_print_error_parameter_missing_value(data, fake_long_define_s);
return F_status_set_error(F_parameter);
}
};
f_string_dynamic_t * const parameters_value[] = {
- &main->path_build,
- &main->path_data,
- &main->path_work,
+ &data->path_build,
+ &data->path_data,
+ &data->path_work,
};
for (uint8_t i = 0; i < 3; ++i) {
- if (main->parameters.array[parameters_id[i]].result == f_console_result_found_e) {
- fake_print_error_parameter_missing_value(main, parameters_name[i]);
+ if (data->main->parameters.array[parameters_id[i]].result == f_console_result_found_e) {
+ fake_print_error_parameter_missing_value(data, parameters_name[i]);
return F_status_set_error(F_parameter);
}
- else if (main->parameters.array[parameters_id[i]].result == f_console_result_additional_e) {
- if (main->parameters.array[parameters_id[i]].values.used > 1) {
- fake_print_error_parameter_too_many(main, parameters_name[i]);
+ else if (data->main->parameters.array[parameters_id[i]].result == f_console_result_additional_e) {
+ if (data->main->parameters.array[parameters_id[i]].values.used > 1) {
+ fake_print_error_parameter_too_many(data, parameters_name[i]);
return F_status_set_error(F_parameter);
}
- const f_array_length_t index = main->parameters.array[parameters_id[i]].values.array[main->parameters.array[parameters_id[i]].values.used - 1];
+ const f_array_length_t index = data->main->parameters.array[parameters_id[i]].values.array[data->main->parameters.array[parameters_id[i]].values.used - 1];
parameters_value[i]->used = 0;
- status = f_string_dynamic_increase_by(main->parameters.arguments.array[index].used + 1, parameters_value[i]);
+ status = f_string_dynamic_increase_by(data->main->parameters.arguments.array[index].used + 1, parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
return status;
}
- status = f_path_directory_cleanup(main->parameters.arguments.array[index], parameters_value[i]);
+ status = f_path_directory_cleanup(data->main->parameters.arguments.array[index], parameters_value[i]);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), "f_path_directory_cleanup", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, F_status_set_fine(status), "f_path_directory_cleanup", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to process parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to process parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return status;
status = f_string_dynamic_increase_by(parameter_defaults[i].used + 1, parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_increase_by", F_true);
return status;
}
status = f_string_dynamic_append(parameter_defaults[i], parameters_value[i]);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), " f_string_dynamic_append", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, F_status_set_fine(status), " f_string_dynamic_append", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to load default for the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to load default for the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return status;
} // for
}
- if (main->parameters.array[fake_parameter_define_e].result == f_console_result_additional_e) {
- status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[fake_parameter_define_e].values, &main->define);
+ if (data->main->parameters.array[fake_parameter_define_e].result == f_console_result_additional_e) {
+ status = fll_program_parameter_additional_rip(data->main->parameters.arguments.array, data->main->parameters.array[fake_parameter_define_e].values, &data->define);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_define_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_define_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return status;
}
}
- if (main->parameters.array[fake_parameter_mode_e].result == f_console_result_found_e) {
- fake_print_error_parameter_missing_value(main, fake_long_mode_s);
+ if (data->main->parameters.array[fake_parameter_mode_e].result == f_console_result_found_e) {
+ fake_print_error_parameter_missing_value(data, fake_long_mode_s);
return F_status_set_error(F_parameter);
}
- else if (main->parameters.array[fake_parameter_mode_e].result == f_console_result_additional_e) {
- status = fll_program_parameter_additional_rip(main->parameters.arguments.array, main->parameters.array[fake_parameter_mode_e].values, &main->mode);
+ else if (data->main->parameters.array[fake_parameter_mode_e].result == f_console_result_additional_e) {
+ status = fll_program_parameter_additional_rip(data->main->parameters.arguments.array, data->main->parameters.array[fake_parameter_mode_e].values, &data->mode);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%SFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%SFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return status;
f_array_length_t j = 0;
f_array_length_t width_max = 0;
- for (; i < main->mode.used; ++i) {
+ for (; i < data->mode.used; ++i) {
- for (j = 0; j < main->mode.array[i].used; ++j) {
+ for (j = 0; j < data->mode.array[i].used; ++j) {
- width_max = main->mode.array[i].used - j;
+ width_max = data->mode.array[i].used - j;
- status = f_utf_is_word_dash_plus(main->mode.array[i].string + j, width_max, F_false);
+ status = f_utf_is_word_dash_plus(data->mode.array[i].string + j, width_max, F_false);
if (F_status_is_error(status)) {
- if (fll_error_print(main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_known_not && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to process the parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed to process the parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, data->main->error.notable);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return status;
}
if (status == F_false) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
- fl_print_format("%[' parameters value '%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, main->error.notable);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, main->mode.array[i], main->error.notable);
- fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, data->main->error.notable);
+ fl_print_format("%[' parameters value '%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, fake_long_mode_s, data->main->error.notable);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, data->mode.array[i], data->main->error.notable);
+ fl_print_format("%[' contains non-word, non-dash, and non-plus characters.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_status_set_error(F_parameter);
return F_interrupt_not;
}
- fake_main_t * const main = (fake_main_t *) state_ptr->custom;
+ fake_data_t * const data = (fake_data_t *) state_ptr->custom;
- if (!((++main->signal_check) % fake_signal_check_d)) {
- if (fake_signal_received(main)) {
+ if (!((++data->main->signal_check) % fake_signal_check_d)) {
+ if (fake_signal_received(data)) {
return F_status_set_error(F_interrupt);
}
- main->signal_check = 0;
+ data->main->signal_check = 0;
}
return F_interrupt_not;
return F_interrupt_not;
}
- fake_main_t * const main = (fake_main_t *) state_ptr->custom;
+ fake_data_t * const data = (fake_data_t *) state_ptr->custom;
- if (!((++main->signal_check) % fake_signal_check_d)) {
- if (fake_signal_received(main)) {
+ if (!((++data->main->signal_check) % fake_signal_check_d)) {
+ if (fake_signal_received(data)) {
return F_status_set_error(F_interrupt);
}
- main->signal_check = 0;
+ data->main->signal_check = 0;
}
return F_interrupt_not;
#endif // _di_fake_signal_state_interrupt_iki_
#ifndef _di_fake_validate_directories_
- f_status_t fake_validate_parameter_directories(fake_main_t * const main) {
+ f_status_t fake_validate_parameter_directories(fake_data_t * const data) {
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
return F_status_set_error(F_interrupt);
}
};
const f_string_dynamic_t parameters_value[] = {
- main->path_build,
- main->path_data,
- main->path_work,
+ data->path_build,
+ data->path_data,
+ data->path_work,
};
const bool parameters_required[] = {
if (F_status_is_error(status)) {
if (F_status_set_fine(status) != F_directory_found_not || parameters_required[i]) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stat", F_true, parameters_value[i], f_file_operation_access_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_file_stat", F_true, parameters_value[i], f_file_operation_access_s, fll_error_file_type_directory_e);
return status;
}
}
}
else if (parameters_required[i]) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QNo valid path for the (required) directory parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], main->error.notable);
- fl_print_format("%[' was found.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QNo valid path for the (required) directory parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameters_name[i], data->main->error.notable);
+ fl_print_format("%[' was found.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
return F_status_set_error(F_directory_found_not);
}
*
* Will print the command if in verbose mode.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param environment
* The environment variable data.
* @param program
* F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
*/
#ifndef _di_fake_execute_
- extern int fake_execute(fake_main_t * const main, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t * const status) F_attribute_visibility_internal_d;
+ extern int fake_execute(fake_data_t * const data, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t * const status) F_attribute_visibility_internal_d;
#endif // _di_fake_execute_
/**
* Load the contents of a file into the given buffer, handling all potential errors.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path_file
* The path to the file to load.
* @param buffer
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_file_buffer_
- extern f_status_t fake_file_buffer(fake_main_t * const main, const f_string_static_t path_file, f_string_dynamic_t * const buffer) F_attribute_visibility_internal_d;
+ extern f_status_t fake_file_buffer(fake_data_t * const data, const f_string_static_t path_file, f_string_dynamic_t * const buffer) F_attribute_visibility_internal_d;
#endif // _di_fake_file_buffer_
/**
* Validate console arguments and print any relating error messages.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_process_console_parameters_
- extern f_status_t fake_process_console_parameters(fake_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_process_console_parameters(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_validate_console_parameters_
/**
*
* This should not be called for skeleton as in that case the directories probably do not exist.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_validate_parameter_directories_
- extern f_status_t fake_validate_parameter_directories(fake_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_validate_parameter_directories(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_validate_parameter_directories_
/**
if (F_status_is_error(*status)) return;
- if (fake_signal_received(data_make->main)) {
+ if (fake_signal_received(data_make->data)) {
*status = F_status_set_error(F_interrupt);
return;
data_make->fakefile.used = 0;
- *status = fake_file_buffer(data_make->main, data_make->main->file_data_build_fakefile, &data_make->buffer);
+ *status = fake_file_buffer(data_make->data, data_make->data->file_data_build_fakefile, &data_make->buffer);
if (F_status_is_error(*status)) return;
if (!data_make->buffer.used) {
flockfile(data_make->main->warning.to.stream);
fl_print_format("%r%[%QThe fakefile '%]", data_make->main->warning.to.stream, f_string_eol_s, data_make->main->warning.context, data_make->main->warning.prefix, data_make->main->warning.context);
- fl_print_format("%[%Q%]", data_make->main->warning.to.stream, data_make->main->warning.notable, data_make->main->file_data_build_fakefile, data_make->main->warning.notable);
+ fl_print_format("%[%Q%]", data_make->main->warning.to.stream, data_make->main->warning.notable, data_make->data->file_data_build_fakefile, data_make->main->warning.notable);
fl_print_format("%[' is empty.%]%r", data_make->main->warning.to.stream, data_make->main->warning.context, data_make->main->warning.context, f_string_eol_s);
funlockfile(data_make->main->warning.to.stream);
f_fss_comments_t comments = f_fss_comments_t_initialize;
{
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->main, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->data, 0);
*status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments);
}
if (F_status_is_error(*status)) {
- fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_basic_list_read", data_make->main->file_data_build_fakefile, range, F_true);
+ fake_print_error_fss(data_make->data, F_status_set_fine(*status), "fll_fss_basic_list_read", data_make->data->file_data_build_fakefile, range, F_true);
}
else {
*status = fl_fss_apply_delimit(delimits, &data_make->buffer);
f_fss_set_t settings = f_fss_set_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->main, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->data, 0);
if (list_objects.used > data_make->fakefile.size) {
macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used);
for (f_array_length_t i = 0; i < list_objects.used; ++i) {
- if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->main)) {
+ if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->data)) {
*status = F_status_set_error(F_interrupt);
break;
if (fl_string_dynamic_partial_compare_string(fake_make_section_settings_s.string, data_make->buffer, fake_make_section_settings_s.used, list_objects.array[i]) == F_equal_to) {
if (!missing_settings) {
- fake_print_warning_settings_object_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_common_setting_list_s, fake_make_section_settings_s);
+ fake_print_warning_settings_object_multiple(data_make->data, data_make->data->file_data_build_fakefile, fake_common_setting_list_s, fake_make_section_settings_s);
continue;
}
*status = fll_fss_extended_read(data_make->buffer, state, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0);
if (F_status_is_error(*status)) {
- fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_extended_read", data_make->main->file_data_build_fakefile, content_range, F_true);
+ fake_print_error_fss(data_make->data, F_status_set_fine(*status), "fll_fss_extended_read", data_make->data->file_data_build_fakefile, content_range, F_true);
break;
}
}
else if (fl_string_dynamic_partial_compare_string(fake_make_section_main_s.string, data_make->buffer, fake_make_section_main_s.used, list_objects.array[i]) == F_equal_to) {
if (!missing_main) {
- fake_print_warning_settings_object_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_common_setting_list_s, fake_make_section_main_s);
+ fake_print_warning_settings_object_multiple(data_make->data, data_make->data->file_data_build_fakefile, fake_common_setting_list_s, fake_make_section_main_s);
continue;
}
*status = fll_fss_extended_read(data_make->buffer, state, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0);
if (F_status_is_error(*status)) {
- fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_extended_read", data_make->main->file_data_build_fakefile, content_range, F_true);
+ fake_print_error_fss(data_make->data, F_status_set_fine(*status), "fll_fss_extended_read", data_make->data->file_data_build_fakefile, content_range, F_true);
break;
}
flockfile(data_make->main->error.to.stream);
fl_print_format("%r%[%QThe fakefile '%]", data_make->main->error.to.stream, f_string_eol_s, data_make->main->error.context, data_make->main->error.prefix, data_make->main->error.context);
- fl_print_format("%[%Q%]", data_make->main->error.to.stream, data_make->main->error.notable, data_make->main->file_data_build_fakefile, data_make->main->error.notable);
+ fl_print_format("%[%Q%]", data_make->main->error.to.stream, data_make->main->error.notable, data_make->data->file_data_build_fakefile, data_make->main->error.notable);
fl_print_format("%[' is missing the required '%]", data_make->main->error.to.stream, data_make->main->error.context, data_make->main->error.context);
fl_print_format("%[%r%]", data_make->main->error.to.stream, data_make->main->error.notable, fake_make_section_main_s, data_make->main->error.notable);
fl_print_format("%[' object.%]%r", data_make->main->error.to.stream, data_make->main->error.context, data_make->main->error.context, f_string_eol_s);
}
if (F_status_is_error_not(*status) && data_make->setting_make.load_build) {
- fake_build_load_setting(data_make->main, f_string_empty_s, &data_make->setting_build, status);
+ fake_build_load_setting(data_make->data, f_string_empty_s, &data_make->setting_build, status);
if (F_status_is_error(*status) && *status != F_status_set_error(F_interrupt)) {
fll_error_print(data_make->main->error, F_status_set_fine(*status), "fake_build_load_setting", F_true);
return;
}
- *status = fake_make_load_fakefile_setting_define_and_parameter(data_make->main, data_make, &settings);
+ *status = fake_make_load_fakefile_setting_define_and_parameter(data_make->data, data_make, &settings);
macro_f_fss_set_t_delete_simple(settings);
}
data_make->setting_make.load_build = F_false;
}
else {
- fake_print_warning_settings_content_invalid(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, content->array[0], fake_make_section_settings_s);
+ fake_print_warning_settings_content_invalid(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, content->array[0], fake_make_section_settings_s);
}
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_load_build_s);
+ fake_print_warning_settings_content_multiple(data_make->data, data_make->data->file_data_build_fakefile, fake_make_setting_load_build_s);
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_load_build_s);
+ fake_print_warning_settings_content_empty(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_load_build_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_build_
*range_compiler = &content->array[content->used - 1];
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_compiler_s);
+ fake_print_warning_settings_content_multiple(data_make->data, data_make->data->file_data_build_fakefile, fake_make_setting_compiler_s);
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_compiler_s);
+ fake_print_warning_settings_content_empty(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_compiler_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_compiler_
#ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_
- f_status_t fake_make_load_fakefile_setting_define_and_parameter(fake_main_t * const main, fake_make_data_t * const data_make, f_fss_set_t * const settings) {
+ f_status_t fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings) {
f_status_t status = F_none;
f_string_map_multis_t define = f_string_map_multis_t_initialize;
// Load the fakefile "settings" as if they are build "settings".
- fake_build_load_setting_process(main, F_false, main->file_data_build_fakefile, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build, &status);
+ fake_build_load_setting_process(data, F_false, data->file_data_build_fakefile, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build, &status);
if (F_status_is_error_not(status) && settings->objects.used) {
const f_string_static_t settings_name[] = {
status = fll_fss_snatch_map_apart(data_make->buffer, settings->objects, settings->contents, settings_name, 2, settings_value, 0, 0);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fll_fss_snatch_map_apart", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "fll_fss_snatch_map_apart", F_true);
macro_f_string_map_multis_t_delete_simple(define);
status = f_string_dynamic_mash(f_string_space_s, define.array[i].value.array[j], &combined);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_mash", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamic_mash", F_true);
break;
}
status = f_environment_set(define.array[i].name, combined, F_true);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_environment_set", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_environment_set", F_true);
break;
}
}
else {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QInvalid characters in the define setting name '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, define.array[i].name, main->error.notable);
- fl_print_format("%[', only alpha-numeric ASCII characters and underscore (without a leading digit) are allowed.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QInvalid characters in the define setting name '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, define.array[i].name, data->main->error.notable);
+ fl_print_format("%[', only alpha-numeric ASCII characters and underscore (without a leading digit) are allowed.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
status = F_status_set_error(F_failure);
data_make->setting_make.fail = fake_make_operation_fail_type_ignore_e;
}
else {
- fake_print_warning_settings_content_invalid(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, content->array[content->used - 1], fake_make_section_settings_s);
+ fake_print_warning_settings_content_invalid(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, content->array[content->used - 1], fake_make_section_settings_s);
}
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_fail_s);
+ fake_print_warning_settings_content_multiple(data_make->data, data_make->data->file_data_build_fakefile, fake_make_setting_fail_s);
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_fail_s);
+ fake_print_warning_settings_content_empty(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_fail_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_fail_
*range_indexer = &content->array[content->used - 1];
if (content->used > 1) {
- fake_print_warning_settings_content_multiple(data_make->main, data_make->main->file_data_build_fakefile, fake_make_setting_indexer_s);
+ fake_print_warning_settings_content_multiple(data_make->data, data_make->data->file_data_build_fakefile, fake_make_setting_indexer_s);
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_indexer_s);
+ fake_print_warning_settings_content_empty(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_indexer_s);
}
}
#endif // _di_fake_make_load_fakefile_setting_indexer_
}
}
else {
- fake_print_warning_settings_content_empty(data_make->main, data_make->main->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_return_s);
+ fake_print_warning_settings_content_empty(data_make->data, data_make->data->file_data_build_fakefile, data_make->buffer, *object, fake_make_setting_return_s);
}
return F_none;
/**
* Load the fakefile setting "parameter".
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param data_make
* All make related setting data, including data from the fakefile and the build settings file.
* @param settings
* @see fll_fss_snatch_map_apart()
*/
#ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_
- extern f_status_t fake_make_load_fakefile_setting_define_and_parameter(fake_main_t * const main, fake_make_data_t * const data_make, f_fss_set_t * const settings) F_attribute_visibility_internal_d;
+ extern f_status_t fake_make_load_fakefile_setting_define_and_parameter(fake_data_t * const data, fake_make_data_t * const data_make, f_fss_set_t * const settings) F_attribute_visibility_internal_d;
#endif // _di_fake_make_load_fakefile_setting_define_and_parameter_
/**
};
const f_string_dynamics_t *source[] = {
- &data_make->main->define,
- &data_make->main->mode,
+ &data_make->data->define,
+ &data_make->data->mode,
};
f_string_dynamics_t * const destination[] = {
};
const f_string_dynamic_t *source[] = {
- &data_make->main->fakefile,
- &data_make->main->path_build,
- &data_make->main->path_data,
- &data_make->main->path_sources,
- &data_make->main->path_work,
- &data_make->main->process,
- &data_make->main->settings,
+ &data_make->data->fakefile,
+ &data_make->data->path_build,
+ &data_make->data->path_data,
+ &data_make->data->path_sources,
+ &data_make->data->path_work,
+ &data_make->data->process,
+ &data_make->data->settings,
};
f_string_dynamics_t * const destination[] = {
#endif
#ifndef _di_fake_make_operate_
- f_status_t fake_make_operate(fake_main_t * const main) {
+ f_status_t fake_make_operate(fake_data_t * const data) {
- if (fake_signal_received(main)) {
+ if (fake_signal_received(data)) {
return F_status_set_error(F_interrupt);
}
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Now making.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, main->context.set.important, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[Now making.%]%r", data->main->output.to.stream, f_string_eol_s, data->main->context.set.important, data->main->context.set.important, f_string_eol_s);
}
f_status_t status = F_none;
f_array_lengths_t section_stack = f_array_lengths_t_initialize;
fake_make_data_t data_make = fake_make_data_t_initialize;
- data_make.main = main;
+ data_make.data = data;
+ data_make.main = data->main;
status = f_string_dynamics_increase(fake_default_allocation_small_d, &data_make.path.stack);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_string_dynamics_increase", F_true);
return status;
}
status = f_path_current(F_true, &data_make.path.stack.array[0]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_path_current", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_path_current", F_true);
fake_make_data_delete(&data_make);
status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_directory_open", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "f_directory_open", F_true);
fake_make_data_delete(&data_make);
data_make.path.stack.used = 1;
- macro_f_mode_t_set_default_umask(mode, main->umask);
+ macro_f_mode_t_set_default_umask(mode, data->main->umask);
fake_make_load_parameters(&data_make, &status);
if (data_make.setting_make.fail == fake_make_operation_fail_type_exit_e) {
data_make.error.prefix = fl_print_error_s;
data_make.error.suffix = f_string_empty_s;
- data_make.error.context = main->context.set.error;
- data_make.error.notable = main->context.set.notable;
+ data_make.error.context = data->main->context.set.error;
+ data_make.error.notable = data->main->context.set.notable;
data_make.error.to.stream = F_type_error_d;
data_make.error.to.id = F_type_descriptor_error_d;
- data_make.error.set = &main->context.set;
+ data_make.error.set = &data->main->context.set;
}
else if (data_make.setting_make.fail == fake_make_operation_fail_type_warn_e) {
data_make.error.prefix = fl_print_warning_s;
data_make.error.suffix = f_string_empty_s;
- data_make.error.context = main->context.set.warning;
- data_make.error.notable = main->context.set.notable;
+ data_make.error.context = data->main->context.set.warning;
+ data_make.error.notable = data->main->context.set.notable;
data_make.error.to.stream = F_type_warning_d;
data_make.error.to.id = F_type_descriptor_warning_d;
- data_make.error.set = &main->context.set;
+ data_make.error.set = &data->main->context.set;
}
else {
data_make.error.to.stream = 0;
data_make.error.prefix = f_string_empty_s;
data_make.error.suffix = f_string_empty_s;
data_make.error.to.id = -1;
- data_make.error.set = &main->context.set;
+ data_make.error.set = &data->main->context.set;
}
{
const int result = fake_make_operate_section(&data_make, data_make.id_main, §ion_stack, &status);
if (status == F_child) {
- main->child = result;
+ data->main->child = result;
}
}
if (status != F_child) {
f_status_t status_path = f_path_change_at(data_make.path.top.id);
- if (F_status_is_error(status_path) && main->warning.verbosity >= f_console_verbosity_verbose_e) {
- flockfile(main->warning.to.stream);
+ if (F_status_is_error(status_path) && data->main->warning.verbosity >= f_console_verbosity_verbose_e) {
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QFailed change back to orignal path '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, data_make.path.stack.array[0], main->warning.notable);
- fl_print_format("%[', status code =%] ", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%ui%]", main->warning.to.stream, main->warning.notable, F_status_set_fine(status_path), main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QFailed change back to orignal path '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, data_make.path.stack.array[0], data->main->warning.notable);
+ fl_print_format("%[', status code =%] ", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%ui%]", data->main->warning.to.stream, data->main->warning.notable, F_status_set_fine(status_path), data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
}
f_iki_data_t iki_data = f_iki_data_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_iki, 0, (void *) data_make->main, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_iki, 0, (void *) data_make->data, 0);
f_string_range_t range = f_string_range_t_initialize;
f_string_map_multis_t *parameter = &data_make->setting_make.parameter;
#ifndef _di_fake_make_operate_section_
int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t * const section_stack, f_status_t * const status) {
- if (F_status_is_error(*status) || *status == F_child) return data_make->main->child;
+ if (F_status_is_error(*status) || *status == F_child) return data_make->data->main->child;
if (id_section > data_make->fakefile.used) {
*status = F_status_set_error(F_parameter);
state_process.operation_previous = state_process.operation;
state_process.operation = 0;
- if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->main)) {
+ if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->data)) {
*status = F_status_set_error(F_interrupt);
break;
} // for
if (!state_process.operation) {
- fake_print_message_section_operation_unknown(data_make->main, data_make->error, data_make->buffer, section->name, section->objects.array[i]);
+ fake_print_message_section_operation_unknown(data_make->data, data_make->error, data_make->buffer, section->name, section->objects.array[i]);
*status = F_status_set_error(F_valid_not);
}
else if (state_process.operation == fake_make_operation_type_operate_e) {
if (section_stack->used == fake_make_section_stack_max_d) {
- fake_print_message_section_operation_stack_max(data_make->main, data_make->error, data_make->buffer, section->name, section->objects.array[i], fake_make_section_stack_max_d);
+ fake_print_message_section_operation_stack_max(data_make->data, data_make->error, data_make->buffer, section->name, section->objects.array[i], fake_make_section_stack_max_d);
*status = F_status_set_error(F_recurse);
}
data_make->error.set = &data_make->main->context.set;
}
- fake_print_message_section_operation_failed(data_make->main, data_make->error, data_make->buffer, section->name, section->objects.array[i]);
+ fake_print_message_section_operation_failed(data_make->data, data_make->error, data_make->buffer, section->name, section->objects.array[i]);
// F_signal_abort is used by the break section operation.
if (F_status_set_fine(*status) == F_signal_abort) break;
}
if (i == section->objects.used && F_status_is_error_not(*status) && (state_process.block == fake_state_process_block_if_e || state_process.block == fake_state_process_block_if_skip_e || state_process.block == fake_state_process_block_else_e)) {
- if (data_make->main->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
+ if (data_make->data->main->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
fl_print_format("%r%[%QIncomplete '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
funlockfile(data_make->error.to.stream);
}
- fake_print_message_section_operation_failed(data_make->main, data_make->error, data_make->buffer, section->name, section->objects.array[section->objects.used - 1]);
+ fake_print_message_section_operation_failed(data_make->data, data_make->error, data_make->buffer, section->name, section->objects.array[section->objects.used - 1]);
*status = F_status_set_error(F_failure);
}
* The first section operated on is the 'main' section.
* The 'settings' section is only loaded into settings and is never operated on.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_make_operate_
- extern f_status_t fake_make_operate(fake_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_make_operate(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_make_operate_
/**
#ifndef _di_fake_make_operate_process_
int fake_make_operate_process(fake_make_data_t * const data_make, const f_string_range_t section_name, const f_string_dynamics_t arguments, const bool success, fake_state_process_t * const state_process, f_array_lengths_t * const section_stack, f_status_t * const status) {
- if (*status == F_child) return data_make->main->child;
+ if (*status == F_child) return data_make->data->main->child;
if (state_process->block) {
if (state_process->block == fake_state_process_block_if_e) {
}
if (state_process->operation == fake_make_operation_type_index_e) {
- const f_status_t result = fake_execute(data_make->main, data_make->environment, data_make->setting_build.build_indexer, arguments, status);
+ const f_status_t result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_indexer, arguments, status);
if (F_status_is_error(*status)) {
fll_error_print(data_make->error, F_status_set_fine(*status), "fake_execute", F_true);
}
if (state_process->operation == fake_make_operation_type_build_e) {
- *status = fake_build_operate(data_make->main, arguments.used ? arguments.array[0] : f_string_empty_s);
+ *status = fake_build_operate(data_make->data, arguments.used ? arguments.array[0] : f_string_empty_s);
if (F_status_set_fine(*status) == F_interrupt) {
return 0;
}
if (state_process->operation == fake_make_operation_type_clean_e) {
- *status = fake_clean_operate(data_make->main);
+ *status = fake_clean_operate(data_make->data);
if (F_status_set_fine(*status) == F_interrupt) {
return 0;
}
if (state_process->operation == fake_make_operation_type_compile_e) {
- const int result = fake_execute(data_make->main, data_make->environment, data_make->setting_build.build_compiler, arguments, status);
+ const int result = fake_execute(data_make->data, data_make->environment, data_make->setting_build.build_compiler, arguments, status);
if (F_status_is_error(*status)) {
fll_error_print(data_make->error, F_status_set_fine(*status), "fake_execute", F_true);
}
if (state_process->operation == fake_make_operation_type_skeleton_e) {
- *status = fake_skeleton_operate(data_make->main);
+ *status = fake_skeleton_operate(data_make->data);
if (F_status_set_fine(*status) == F_interrupt) {
return 0;
#ifndef _di_fake_make_operate_process_execute_
f_status_t fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) {
- if (fake_signal_received(data_make->main)) {
+ if (fake_signal_received(data_make->data)) {
return F_status_set_error(F_interrupt);
}
status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
- if (fake_signal_received(data_make->main)) {
+ if (fake_signal_received(data_make->data)) {
return F_status_set_error(F_interrupt);
}
gid_t id = 0;
- status = fake_make_get_id_group(data_make->main, data_make->error, arguments.array[0], &id);
+ status = fake_make_get_id_group(data_make->data, data_make->error, arguments.array[0], &id);
if (F_status_is_error(status)) return 0;
for (f_array_length_t i = 1; i < arguments.used; ++i) {
if (F_status_is_error(status_file)) {
status = status_file;
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
continue;
}
};
const bool reserved_defined[] = {
- data_make->main->path_build.used,
+ data_make->data->path_build.used,
F_true,
- data_make->main->path_data.used,
- data_make->main->define.used,
- data_make->main->fakefile.used,
- data_make->main->mode.used,
- data_make->main->process.used,
- data_make->main->settings.used,
- data_make->main->path_sources.used,
+ data_make->data->path_data.used,
+ data_make->data->define.used,
+ data_make->data->fakefile.used,
+ data_make->data->mode.used,
+ data_make->data->process.used,
+ data_make->data->settings.used,
+ data_make->data->path_sources.used,
F_true,
- data_make->main->path_work.used,
+ data_make->data->path_work.used,
data_make->main->parameters.array[fake_parameter_path_build_e].result == f_console_result_additional_e,
data_make->main->parameters.array[fake_parameter_light_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_dark_e].result == f_console_result_found_e || data_make->main->parameters.array[fake_parameter_no_color_e].result == f_console_result_found_e,
data_make->main->parameters.array[fake_parameter_path_data_e].result == f_console_result_additional_e,
f_status_t status = F_none;
uid_t id = 0;
- status = fake_make_get_id_group(data_make->main, data_make->error, arguments.array[if_not ? 2 : 1], &id);
+ status = fake_make_get_id_group(data_make->data, data_make->error, arguments.array[if_not ? 2 : 1], &id);
if (F_status_is_error(status)) return status;
uid_t id_file = 0;
{
uint8_t mode_replace = 0;
- status = fake_make_get_id_mode(data_make->main, data_make->error, arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace);
+ status = fake_make_get_id_mode(data_make->data, data_make->error, arguments.array[if_not ? 3 : 2], &mode_rule, &mode_replace);
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
f_status_t status = F_none;
uid_t id = 0;
- status = fake_make_get_id_owner(data_make->main, data_make->error, arguments.array[if_not ? 2 : 1], &id);
+ status = fake_make_get_id_owner(data_make->data, data_make->error, arguments.array[if_not ? 2 : 1], &id);
if (F_status_is_error(status)) return status;
uid_t id_file = 0;
f_file_mode_t mode_rule = 0;
uint8_t replace = 0;
- status = fake_make_get_id_mode(data_make->main, data_make->error, arguments.array[0], &mode_rule, &replace);
+ status = fake_make_get_id_mode(data_make->data, data_make->error, arguments.array[0], &mode_rule, &replace);
if (F_status_is_error(status)) return 0;
mode_t mode = 0;
f_status_t status = F_none;
uid_t id = 0;
- status = fake_make_get_id_owner(data_make->main, data_make->error, arguments.array[0], &id);
+ status = fake_make_get_id_owner(data_make->data, data_make->error, arguments.array[0], &id);
if (F_status_is_error(status)) return status;
f_status_t status_file = F_none;
if (F_status_is_error(status_file)) {
status = status_file;
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
continue;
}
status = f_path_change(*argument);
if (F_status_is_error(status)) {
- fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", *argument);
+ fake_print_message_section_operation_path_stack_max(data_make->data, data_make->error, F_status_set_fine(status), "f_path_change", *argument);
return 0;
}
status = fake_make_assure_inside_project(data_make, arguments.array[0]);
if (F_status_is_error(status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[0]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[0]);
if (F_status_set_fine(status) == F_false) {
status = F_status_set_error(F_failure);
status = f_path_change(arguments.array[0]);
if (F_status_is_error(status)) {
- fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0]);
+ fake_print_message_section_operation_path_stack_max(data_make->data, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0]);
}
else {
status = f_string_dynamics_increase_by(fake_default_allocation_small_d, &data_make->path.stack);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_array_too_large) {
- fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", fake_common_file_path_stack_s);
+ fake_print_message_section_operation_path_stack_max(data_make->data, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", fake_common_file_path_stack_s);
return status;
}
status = f_path_change_at(data_make->path.top.id);
if (F_status_is_error(status)) {
- fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0]);
+ fake_print_message_section_operation_path_stack_max(data_make->data, data_make->error, F_status_set_fine(status), "f_path_change", arguments.array[0]);
return status;
}
else if (arguments.used) {
if (arguments.array[0].used) {
f_string_static_t path_file = f_string_static_t_initialize;
- path_file.used = data_make->main->path_data_build.used + arguments.array[0].used;
+ path_file.used = data_make->data->path_data_build.used + arguments.array[0].used;
f_char_t path_file_string[path_file.used + 1];
path_file.string = path_file_string;
path_file_string[path_file.used] = 0;
- memcpy(path_file_string, data_make->main->path_data_build.string, sizeof(f_char_t) * data_make->main->path_data_build.used);
- memcpy(path_file_string + data_make->main->path_data_build.used, arguments.array[0].string, sizeof(f_char_t) * arguments.array[0].used);
+ memcpy(path_file_string, data_make->data->path_data_build.string, sizeof(f_char_t) * data_make->data->path_data_build.used);
+ memcpy(path_file_string + data_make->data->path_data_build.used, arguments.array[0].string, sizeof(f_char_t) * arguments.array[0].used);
f_status_t status_file = f_file_is(path_file, F_file_type_regular_d, F_false);
*status = fake_make_assure_inside_project(data_make, arguments.array[i]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data_make, arguments.array[i]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data_make, arguments.array[i]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
f_file_mode_t mode_rule = 0;
uint8_t replace = 0;
- *status = fake_make_get_id_mode(data_make->main, data_make->error, j == 6 ? arguments.array[2] : arguments.array[3], &mode_rule, &replace);
+ *status = fake_make_get_id_mode(data_make->data, data_make->error, j == 6 ? arguments.array[2] : arguments.array[3], &mode_rule, &replace);
if (F_status_is_error(*status)) return;
i = j == 6 ? 3 : 4;
else if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_not_group_e) {
gid_t id = 0;
- *status = fake_make_get_id_group(data_make->main, data_make->error, j == 6 ? arguments.array[1] : arguments.array[2], &id);
+ *status = fake_make_get_id_group(data_make->data, data_make->error, j == 6 ? arguments.array[1] : arguments.array[2], &id);
if (F_status_is_error(*status)) return;
i = j == 6 ? 2 : 3;
else if (state_process->condition == fake_make_operation_if_type_if_owner_e || state_process->condition == fake_make_operation_if_type_if_not_owner_e) {
uid_t id = 0;
- *status = fake_make_get_id_owner(data_make->main, data_make->error, arguments.array[1], &id);
+ *status = fake_make_get_id_owner(data_make->data, data_make->error, arguments.array[1], &id);
if (F_status_is_error(*status)) return;
i = j == 6 ? 2 : 3;
status_file = fake_make_assure_inside_project(data_make, arguments.array[i]);
if (F_status_is_error(status_file)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(status_file), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(status_file), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
if (F_status_is_error_not(*status)) {
if (F_status_set_fine(status_file) == F_false) {
*status = fake_make_assure_inside_project(data_make, arguments.array[0]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[0]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[0]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data_make, arguments.array[1]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[1]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[1]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data_make, arguments.array[i]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, data_make->main->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, data_make->data->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e);
}
*status = status_file;
*status = fake_make_assure_inside_project(data_make, arguments.array[i]);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data_make->main, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
+ fake_print_message_section_operation_path_outside(data_make->data, data_make->error, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache : arguments.array[i]);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
#endif // _di_fake_make_assure_inside_project_
#ifndef _di_fake_make_get_id_group_
- f_status_t fake_make_get_id_group(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, gid_t *id) {
+ f_status_t fake_make_get_id_group(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, gid_t *id) {
f_number_unsigned_t number = 0;
return F_status_set_error(status);
}
else if (status == F_exist_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe group name '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, buffer, main->error.notable);
- fl_print_format("%[' was not found.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe group name '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, buffer, data->main->error.notable);
+ fl_print_format("%[' was not found.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_status_set_error(F_failure);
return F_status_set_error(status);
}
else if (number > F_type_size_32_unsigned_d) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe number '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, number, main->error.notable);
- fl_print_format("%[' is too large.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe number '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%un%]", data->main->error.to.stream, data->main->error.notable, number, data->main->error.notable);
+ fl_print_format("%[' is too large.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
#endif // _di_fake_make_get_id_group_
#ifndef _di_fake_make_get_id_mode_
- f_status_t fake_make_get_id_mode(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) {
+ f_status_t fake_make_get_id_mode(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) {
if (!buffer.used) {
fll_error_print(print, F_parameter, "fake_make_get_id_mode", F_true);
return F_status_set_error(F_parameter);
}
- const f_status_t status = f_file_mode_from_string(buffer, main->umask, mode, replace);
+ const f_status_t status = f_file_mode_from_string(buffer, data->main->umask, mode, replace);
if (F_status_is_error(status)) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
if (F_status_set_fine(status) == F_syntax) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe mode '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, buffer, main->error.notable);
- fl_print_format("%[' is invalid.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe mode '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, buffer, data->main->error.notable);
+ fl_print_format("%[' is invalid.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
else {
fll_error_print(print, status, "f_file_mode_from_string", F_true);
#endif // _di_fake_make_get_id_mode_
#ifndef _di_fake_make_get_id_owner_
- f_status_t fake_make_get_id_owner(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, uid_t *id) {
+ f_status_t fake_make_get_id_owner(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, uid_t *id) {
f_number_unsigned_t number = 0;
return F_status_set_error(status);
}
else if (status == F_exist_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe user '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, buffer, main->error.notable);
- fl_print_format("%[' was not found.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe user '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, buffer, data->main->error.notable);
+ fl_print_format("%[' was not found.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_status_set_error(F_failure);
return F_status_set_error(status);
}
else if (number > F_type_size_32_unsigned_d) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe number '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, number, main->error.notable);
- fl_print_format("%[' is too large.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe number '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%un%]", data->main->error.to.stream, data->main->error.notable, number, data->main->error.notable);
+ fl_print_format("%[' is too large.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
}
/**
* Get the group id from either a string representing the number or a string representing the name.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* The error/warning print data.
* @param buffer
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_make_get_id_group_
- f_status_t fake_make_get_id_group(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, gid_t *id) F_attribute_visibility_internal_d;
+ f_status_t fake_make_get_id_group(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, gid_t *id) F_attribute_visibility_internal_d;
#endif // _di_fake_make_get_id_group_
/**
* Get the mode id from either a string representing the number or a string representing the mode.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* The error/warning print data.
* @param buffer
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_make_get_id_mode_
- f_status_t fake_make_get_id_mode(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) F_attribute_visibility_internal_d;
+ f_status_t fake_make_get_id_mode(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) F_attribute_visibility_internal_d;
#endif // _di_fake_make_get_id_mode_
/**
* Get the user id from either a string representing the number or a string representing the name.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* The error/warning print data.
* @param buffer
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_make_get_id_owner_
- f_status_t fake_make_get_id_owner(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, uid_t *id) F_attribute_visibility_internal_d;
+ f_status_t fake_make_get_id_owner(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, uid_t *id) F_attribute_visibility_internal_d;
#endif // _di_fake_make_get_id_owner_
/**
#endif
#ifndef _di_fake_print_error_build_operation_file_
- bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const char *function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) {
+ bool fake_print_error_build_operation_file(fake_data_t * const data, const f_status_t status, const char *function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) {
if (status == F_file_found_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to find '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%r%[%QFailed to find '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_parameter) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QInvalid parameter when calling '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%S%]", main->error.to.stream, main->error.notable, function, main->error.notable);
- fl_print_format("%[() to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context);
+ fl_print_format("%r%[%QInvalid parameter when calling '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%S%]", data->main->error.to.stream, data->main->error.notable, function, data->main->error.notable);
+ fl_print_format("%[() to %Q '%]", data->main->error.to.stream, data->main->error.context, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_name) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QInvalid name for '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
+ fl_print_format("%r%[%QInvalid name for '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
if (source.used) {
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, source, data->main->error.notable);
}
if (destination.used) {
- fl_print_format("%[' or '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination, main->error.notable);
+ fl_print_format("%[' or '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, destination, data->main->error.notable);
}
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_memory_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QUnable to allocate memory, while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QUnable to allocate memory, while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_number_overflow) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QOverflow while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QOverflow while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_directory) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QInvalid directory while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QInvalid directory while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_access_denied) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QAccess denied while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QAccess denied while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_loop) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QLoop while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QLoop while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_prohibited) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QProhibited by system while trying to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QProhibited by system while trying to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_directory_found_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QFailed to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%[' due to an invalid directory in the path.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%[' due to an invalid directory in the path.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_failure) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QFailed to %Q '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, operation, main->error.context);
+ fl_print_format("%r%[%QFailed to %Q '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
- if (fll_error_print(main->error, status, function, F_false) == F_known_not && fallback && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, status, function, F_false) == F_known_not && fallback && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[UNKNOWN %Q(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%ui%]", main->error.to.stream, main->error.notable, status, main->error.notable);
- fl_print_format("%[) occurred while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context);
+ fl_print_format("%r%[UNKNOWN %Q(%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%ui%]", data->main->error.to.stream, data->main->error.notable, status, data->main->error.notable);
+ fl_print_format("%[) occurred while trying to %Q '%]", data->main->error.to.stream, data->main->error.context, operation, data->main->error.context);
- fake_print_error_build_operation_file_message(main, operation, source, destination, how);
+ fake_print_error_build_operation_file_message(data, operation, source, destination, how);
- fl_print_format("%['.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_true;
#endif // _di_fake_print_error_build_operation_file_
#ifndef _di_fake_print_error_build_operation_file_message_
- void fake_print_error_build_operation_file_message(fake_main_t * const main, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) {
+ void fake_print_error_build_operation_file_message(fake_data_t * const data, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) {
if (source.used) {
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, source, data->main->error.notable);
}
- fl_print_format("%[while trying to %Q '%]", main->error.to.stream, main->error.context, operation, main->error.context);
+ fl_print_format("%[while trying to %Q '%]", data->main->error.to.stream, data->main->error.context, operation, data->main->error.context);
if (destination.used) {
- fl_print_format("%[' %Q '%]", main->error.to.stream, main->error.context, how, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, destination, main->error.notable);
+ fl_print_format("%[' %Q '%]", data->main->error.to.stream, data->main->error.context, how, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, destination, data->main->error.notable);
}
else if (source.used) {
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, source, main->error.notable);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, source, data->main->error.notable);
}
}
#endif // #ifndef _di_fake_print_error_build_operation_file_message_
#ifndef _di_fake_print_error_fss
- bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const char *function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) {
+ bool fake_print_error_fss(fake_data_t * const data, const f_status_t status, const char *function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) {
if (status == F_file_found_not) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QOccurred on invalid UTF-8 character at stop position (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable);
- fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
- fl_print_format("%[').%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QOccurred on invalid UTF-8 character at stop position (at '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%un%]", data->main->error.to.stream, data->main->error.notable, range.start, data->main->error.notable);
+ fl_print_format("%[ of setting file '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path_file, data->main->error.notable);
+ fl_print_format("%[').%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_complete_not_utf || status == F_complete_not_utf_eos || status == F_complete_not_utf_stop) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QOccurred on invalid UTF-8 character at %s (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", main->error.context);
- fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable);
- fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
- fl_print_format("%[').%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QOccurred on invalid UTF-8 character at %s (at '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, status == F_complete_not_utf_eos ? "end of string" : "stop point of string", data->main->error.context);
+ fl_print_format("%[%un%]", data->main->error.to.stream, data->main->error.notable, range.start, data->main->error.notable);
+ fl_print_format("%[ of setting file '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path_file, data->main->error.notable);
+ fl_print_format("%[').%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
if (status == F_complete_not_utf_stop) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QOccurred on invalid UTF-8 character at stop point of string (at '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, range.start, main->error.notable);
- fl_print_format("%[ of setting file '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path_file, main->error.notable);
- fl_print_format("%[').%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QOccurred on invalid UTF-8 character at stop point of string (at '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%un%]", data->main->error.to.stream, data->main->error.notable, range.start, data->main->error.notable);
+ fl_print_format("%[ of setting file '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path_file, data->main->error.notable);
+ fl_print_format("%[').%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_false;
}
- if (fll_error_print(main->error, status, function, F_false) == F_known_not && fallback && main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (fll_error_print(data->main->error, status, function, F_false) == F_known_not && fallback && data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[UNKNOWN %Q(%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%ui%]", main->error.to.stream, main->error.notable, status, main->error.notable);
- fl_print_format("%[) in function '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, function, main->error.notable);
- fl_print_format("%[().%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[UNKNOWN %Q(%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%ui%]", data->main->error.to.stream, data->main->error.notable, status, data->main->error.notable);
+ fl_print_format("%[) in function '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, function, data->main->error.notable);
+ fl_print_format("%[().%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_true;
#endif // _di_fake_print_error_fss
#ifndef _di_fake_print_error_parameter_missing_value_
- void fake_print_error_parameter_missing_value(fake_main_t * const main, const f_string_static_t parameter) {
+ void fake_print_error_parameter_missing_value(fake_data_t * const data, const f_string_static_t parameter) {
- if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter, main->error.notable);
- fl_print_format("%[' is specified, but no value is given.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameter, data->main->error.notable);
+ fl_print_format("%[' is specified, but no value is given.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
#endif // _di_fake_print_error_parameter_missing_value_
#ifndef _di_fake_print_error_parameter_too_many_
- void fake_print_error_parameter_too_many(fake_main_t * const main, const f_string_static_t parameter) {
+ void fake_print_error_parameter_too_many(fake_data_t * const data, const f_string_static_t parameter) {
- if (main->error.verbosity == f_console_verbosity_quiet_e) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe parameter '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%r%r%]", main->error.to.stream, main->error.notable, f_console_symbol_long_enable_s, parameter, main->error.notable);
- fl_print_format("%[' was specified too many times.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe parameter '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%r%r%]", data->main->error.to.stream, data->main->error.notable, f_console_symbol_long_enable_s, parameter, data->main->error.notable);
+ fl_print_format("%[' was specified too many times.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
#endif // _di_fake_print_error_parameter_too_many_
#endif // _di_fake_print_error_too_many_arguments_
#ifndef _di_fake_print_message_section_operation_failed_
- void fake_print_message_section_operation_failed(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) {
+ void fake_print_message_section_operation_failed(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) {
- if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
f_array_length_t line = 1;
f_fss_count_lines(buffer, operation_name.start, &line);
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, operation_name, main->error.notable);
- fl_print_format("%[' from section '%]", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, section_name, main->error.notable);
- fl_print_format("%[' on line%] ", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%un%]", main->error.to.stream, main->error.notable, line, main->error.notable);
- fl_print_format(" %[failed.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe section operation '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%/Q%]", data->main->error.to.stream, data->main->error.notable, buffer, operation_name, data->main->error.notable);
+ fl_print_format("%[' from section '%]", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%/Q%]", data->main->error.to.stream, data->main->error.notable, buffer, section_name, data->main->error.notable);
+ fl_print_format("%[' on line%] ", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%un%]", data->main->error.to.stream, data->main->error.notable, line, data->main->error.notable);
+ fl_print_format(" %[failed.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
#endif // _di_fake_print_message_section_operation_failed_
#ifndef _di_fake_print_message_section_operation_path_outside_
- void fake_print_message_section_operation_path_outside(fake_main_t * const main, const fl_print_t print, const f_status_t status, const char *function, const f_string_static_t path) {
+ void fake_print_message_section_operation_path_outside(fake_data_t * const data, const fl_print_t print, const f_status_t status, const char *function, const f_string_static_t path) {
- if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
if (F_status_set_fine(status) == F_false) {
- fl_print_format("%r%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
- fl_print_format("%[' is outside the project root.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path, data->main->error.notable);
+ fl_print_format("%[' is outside the project root.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
}
else {
- fll_error_file_print(main->error, F_status_set_fine(status), function, F_true, path, fake_common_file_path_determine_real_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), function, F_true, path, fake_common_file_path_determine_real_s, fll_error_file_type_file_e);
}
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
#endif // _di_fake_print_message_section_operation_path_outside_
#ifndef _di_fake_print_message_section_operation_path_stack_max_
- void fake_print_message_section_operation_path_stack_max(fake_main_t * const main, fl_print_t print, const f_status_t status, const char *function, const f_string_static_t path) {
+ void fake_print_message_section_operation_path_stack_max(fake_data_t * const data, fl_print_t print, const f_status_t status, const char *function, const f_string_static_t path) {
- if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
if (status == F_array_too_large) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QMaximum stack size reached while processing path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
- fl_print_format("%['", main->error.to.stream, main->error.context);
+ fl_print_format("%r%[%QMaximum stack size reached while processing path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path, data->main->error.notable);
+ fl_print_format("%['", data->main->error.to.stream, data->main->error.context);
if (function) {
- fl_print_format(" while calling%] %[%S%]", main->error.to.stream, main->error.context, main->error.notable, function, main->error.notable);
- fl_print_format("%[()", main->error.to.stream, main->error.context);
+ fl_print_format(" while calling%] %[%S%]", data->main->error.to.stream, data->main->error.context, data->main->error.notable, function, data->main->error.notable);
+ fl_print_format("%[()", data->main->error.to.stream, data->main->error.context);
}
- fl_print_format(".%]%r", main->error.to.stream, main->error.context, f_string_eol_s);
+ fl_print_format(".%]%r", data->main->error.to.stream, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
else {
fll_error_file_print(print, status, function, F_true, path, fake_common_file_path_change_to_s, fll_error_file_type_directory_e);
#endif // _di_fake_print_message_section_operation_path_stack_max_
#ifndef _di_fake_print_message_section_operation_stack_max_
- void fake_print_message_section_operation_stack_max(fake_main_t * const main, fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) {
+ void fake_print_message_section_operation_stack_max(fake_data_t * const data, fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) {
- if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
f_array_length_t line = 1;
f_fss_count_lines(buffer, operation_name.start, &line);
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, operation_name, main->error.notable);
- fl_print_format("%[' from section '%]", main->error.to.stream, main->error.context, buffer, main->error.context);
- fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, section_name, main->error.notable);
- fl_print_format("%[' on line%] ", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, line, main->error.notable);
- fl_print_format("%[' cannot be processed because the max stack depth of%] ", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, stack_max, main->error.notable);
- fl_print_format(" %[has been reached.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe section operation '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%/Q%]", data->main->error.to.stream, data->main->error.notable, buffer, operation_name, data->main->error.notable);
+ fl_print_format("%[' from section '%]", data->main->error.to.stream, data->main->error.context, buffer, data->main->error.context);
+ fl_print_format("%[%/Q%]", data->main->error.to.stream, data->main->error.notable, buffer, section_name, data->main->error.notable);
+ fl_print_format("%[' on line%] ", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%ul%]", data->main->error.to.stream, data->main->error.notable, line, data->main->error.notable);
+ fl_print_format("%[' cannot be processed because the max stack depth of%] ", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%ul%]", data->main->error.to.stream, data->main->error.notable, stack_max, data->main->error.notable);
+ fl_print_format(" %[has been reached.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
#endif // _di_fake_print_message_section_operation_stack_max_
#ifndef _di_fake_print_message_section_operation_unknown_
- void fake_print_message_section_operation_unknown(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) {
+ void fake_print_message_section_operation_unknown(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) {
- if (main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
+ if (data->main->error.verbosity == f_console_verbosity_quiet_e || !print.to.stream) return;
f_array_length_t line = 1;
f_fss_count_lines(buffer, operation_name.start, &line);
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe section operation '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, operation_name, main->error.notable);
- fl_print_format("%[' from section '%]", main->error.to.stream, main->error.context, buffer, main->error.context);
- fl_print_format("%[%/Q%]", main->error.to.stream, main->error.notable, buffer, section_name, main->error.notable);
- fl_print_format("%[' on line%] ", main->error.to.stream, main->error.context, main->error.context);
- fl_print_format("%[%ul%]", main->error.to.stream, main->error.notable, line, main->error.notable);
- fl_print_format(" %[is not a known operation name.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe section operation '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%/Q%]", data->main->error.to.stream, data->main->error.notable, buffer, operation_name, data->main->error.notable);
+ fl_print_format("%[' from section '%]", data->main->error.to.stream, data->main->error.context, buffer, data->main->error.context);
+ fl_print_format("%[%/Q%]", data->main->error.to.stream, data->main->error.notable, buffer, section_name, data->main->error.notable);
+ fl_print_format("%[' on line%] ", data->main->error.to.stream, data->main->error.context, data->main->error.context);
+ fl_print_format("%[%ul%]", data->main->error.to.stream, data->main->error.notable, line, data->main->error.notable);
+ fl_print_format(" %[is not a known operation name.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
#endif // _di_fake_print_message_section_operation_unknown_
#ifndef _di_fake_print_signal_received_
- void fake_print_signal_received(fake_main_t * const main, const f_status_t signal) {
+ void fake_print_signal_received(fake_data_t * const data, const f_status_t signal) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
- fflush(main->warning.to.stream);
+ fflush(data->main->warning.to.stream);
- flockfile(main->warning.to.stream);
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
- fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
+ fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
+ fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+ fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
#endif // _di_fake_print_signal_received_
#ifndef _di_fake_print_warning_settings_content_empty_
- void fake_print_warning_settings_content_empty(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_static_t settings_name) {
+ void fake_print_warning_settings_content_empty(fake_data_t * const data, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_static_t settings_name) {
- if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
+ if (data->main->warning.verbosity == f_console_verbosity_quiet_e) return;
- flockfile(main->warning.to.stream);
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' has empty content for the '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, settings_name, main->warning.notable);
- fl_print_format("%[' object '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%/Q%]", main->warning.to.stream, main->warning.notable, buffer, range_object, main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe fakefile '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' has empty content for the '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, settings_name, data->main->warning.notable);
+ fl_print_format("%[' object '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%/Q%]", data->main->warning.to.stream, data->main->warning.notable, buffer, range_object, data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
#endif // _di_fake_print_warning_settings_content_empty_
#ifndef _di_fake_print_warning_settings_content_invalid_
- void fake_print_warning_settings_content_invalid(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_static_t settings_name) {
+ void fake_print_warning_settings_content_invalid(fake_data_t * const data, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_static_t settings_name) {
- if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
+ if (data->main->warning.verbosity == f_console_verbosity_quiet_e) return;
- flockfile(main->warning.to.stream);
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' has invalid content '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%/Q%]", main->warning.to.stream, main->warning.notable, buffer, range_content, main->warning.notable);
- fl_print_format("%[' for the '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, settings_name, main->warning.notable);
- fl_print_format("%[' object '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%/Q%]", main->warning.to.stream, main->warning.notable, buffer, range_object, main->warning.notable);
- fl_print_format("%['.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe fakefile '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' has invalid content '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%/Q%]", data->main->warning.to.stream, data->main->warning.notable, buffer, range_content, data->main->warning.notable);
+ fl_print_format("%[' for the '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, settings_name, data->main->warning.notable);
+ fl_print_format("%[' object '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%/Q%]", data->main->warning.to.stream, data->main->warning.notable, buffer, range_object, data->main->warning.notable);
+ fl_print_format("%['.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
#endif // _di_fake_print_warning_settings_content_invalid_
#ifndef _di_fake_print_warning_settings_content_multiple_
- void fake_print_warning_settings_content_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t name_object) {
+ void fake_print_warning_settings_content_multiple(fake_data_t * const data, const f_string_static_t path_file, const f_string_static_t name_object) {
- if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
+ if (data->main->warning.verbosity == f_console_verbosity_quiet_e) return;
- flockfile(main->warning.to.stream);
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QThe fakefile '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, name_object, main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' may only have a single property, only using the first.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe fakefile '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, name_object, data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' may only have a single property, only using the first.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
#endif // _di_fake_print_warning_settings_content_multiple_
#ifndef _di_fake_print_warning_settings_object_multiple_
- void fake_print_warning_settings_object_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t label, const f_string_static_t name_object) {
+ void fake_print_warning_settings_object_multiple(fake_data_t * const data, const f_string_static_t path_file, const f_string_static_t label, const f_string_static_t name_object) {
- if (main->warning.verbosity == f_console_verbosity_quiet_e) return;
+ if (data->main->warning.verbosity == f_console_verbosity_quiet_e) return;
- flockfile(main->warning.to.stream);
+ flockfile(data->main->warning.to.stream);
- fl_print_format("%r%[%QThe object '%]", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, main->warning.context);
- fl_print_format("%[%r%]", main->warning.to.stream, main->warning.notable, name_object, main->warning.notable);
- fl_print_format("%[' in the file '%]", main->warning.to.stream, main->warning.context, main->warning.context);
- fl_print_format("%[%Q%]", main->warning.to.stream, main->warning.notable, path_file, main->warning.notable);
- fl_print_format("%[' may only be specified once, only using the first.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe object '%]", data->main->warning.to.stream, f_string_eol_s, data->main->warning.context, data->main->warning.prefix, data->main->warning.context);
+ fl_print_format("%[%r%]", data->main->warning.to.stream, data->main->warning.notable, name_object, data->main->warning.notable);
+ fl_print_format("%[' in the file '%]", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context);
+ fl_print_format("%[%Q%]", data->main->warning.to.stream, data->main->warning.notable, path_file, data->main->warning.notable);
+ fl_print_format("%[' may only be specified once, only using the first.%]%r", data->main->warning.to.stream, data->main->warning.context, data->main->warning.context, f_string_eol_s);
- funlockfile(main->warning.to.stream);
+ funlockfile(data->main->warning.to.stream);
}
#endif // _di_fake_print_warning_settings_object_multiple_
/**
* Print build operation file error messages.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param status
* The error status code to report on.
* @param function
* @see fake_print_error_build_operation_file_message();
*/
#ifndef _di_fake_print_error_operation_file_
- extern bool fake_print_error_build_operation_file(fake_main_t * const main, const f_status_t status, const char *function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) F_attribute_visibility_internal_d;
+ extern bool fake_print_error_build_operation_file(fake_data_t * const data, const f_status_t status, const char *function, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how, const bool fallback) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_operation_file_
/**
*
* This prints the "copy source to destination" part of the message.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param operation
* The operation performed.
* @param source
* @see fake_print_error_build_operation_file()
*/
#ifndef _di_fake_print_error_build_operation_file_message_
- extern void fake_print_error_build_operation_file_message(fake_main_t * const main, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) F_attribute_visibility_internal_d;
+ extern void fake_print_error_build_operation_file_message(fake_data_t * const data, const f_string_static_t operation, const f_string_static_t source, const f_string_static_t destination, const f_string_static_t how) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_build_operation_file_message_
/**
* Print FSS error messages.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param status
* The error status code to report on.
* @param function
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_fss_
- extern bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const char *function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) F_attribute_visibility_internal_d;
+ extern bool fake_print_error_fss(fake_data_t * const data, const f_status_t status, const char *function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_fss_
/**
* Print an error message for when the parameter is missing its accompanying value.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param parameter
* The parameter name.
*
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_parameter_missing_value_
- extern void fake_print_error_parameter_missing_value(fake_main_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ extern void fake_print_error_parameter_missing_value(fake_data_t * const data, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_parameter_missing_value_
/**
* Print an error message for when the parameter is specified too many times.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param parameter
* The parameter name.
*
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_parameter_too_many_
- extern void fake_print_error_parameter_too_many(fake_main_t * const main, const f_string_static_t parameter) F_attribute_visibility_internal_d;
+ extern void fake_print_error_parameter_too_many(fake_data_t * const data, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_parameter_too_many_
/**
/**
* Print error messages when processing some fakefile section, for a specific line and operation, and that operation failed.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* Designates how the section error/warning should be printed.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_message_section_operation_failed_
- extern void fake_print_message_section_operation_failed(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) F_attribute_visibility_internal_d;
+ extern void fake_print_message_section_operation_failed(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) F_attribute_visibility_internal_d;
#endif // _di_fake_print_message_section_operation_failed_
/**
* Print error messages when processing some fakefile section, for a specific line and operation, and that operation has a path outside of the project root.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* Designates how the section error/warning should be printed.
* @param status
* @see fll_error_file_print()
*/
#ifndef _di_fake_print_message_section_operation_path_outside_
- extern void fake_print_message_section_operation_path_outside(fake_main_t * const main, const fl_print_t print, const f_status_t status, const char *function, const f_string_static_t path) F_attribute_visibility_internal_d;
+ extern void fake_print_message_section_operation_path_outside(fake_data_t * const data, const fl_print_t print, const f_status_t status, const char *function, const f_string_static_t path) F_attribute_visibility_internal_d;
#endif // _fake_print_message_section_operation_path_outside_
/**
* Print error messages when processing some fakefile section, for a specific line and operation.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param error
* Designates how the section error/warning should be printed.
* @param status
* @see fll_error_file_print()
*/
#ifndef _di_fake_print_message_section_operation_path_stack_max_
- extern void fake_print_message_section_operation_path_stack_max(fake_main_t * const main, fl_print_t error, const f_status_t status, const char *function, const f_string_static_t path) F_attribute_visibility_internal_d;
+ extern void fake_print_message_section_operation_path_stack_max(fake_data_t * const data, fl_print_t error, const f_status_t status, const char *function, const f_string_static_t path) F_attribute_visibility_internal_d;
#endif // _di_fake_print_message_section_operation_path_stack_max_
/**
* Print error messages when processing some fakefile section, for a specific line and operation, and that the max stack depth is reached.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* Designates how the section error/warning should be printed.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_message_section_operation_stack_max_
- extern void fake_print_message_section_operation_stack_max(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) F_attribute_visibility_internal_d;
+ extern void fake_print_message_section_operation_stack_max(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max) F_attribute_visibility_internal_d;
#endif // _di_fake_print_message_section_operation_stack_max_
/**
* Print error messages when processing some fakefile section, for a specific line and operation, and that operation is invalid.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param print
* Designates how the section error/warning should be printed.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_message_section_operation_unknown_
- extern void fake_print_message_section_operation_unknown(fake_main_t * const main, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) F_attribute_visibility_internal_d;
+ extern void fake_print_message_section_operation_unknown(fake_data_t * const data, const fl_print_t print, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name) F_attribute_visibility_internal_d;
#endif // _di_fake_print_message_section_operation_unknown_
/**
* Print a message about a process signal being recieved, such as an interrupt signal.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param signal
* The signal received.
*
* @see fl_print_format()
*/
#ifndef _di_fake_print_signal_received_
- extern void fake_print_signal_received(fake_main_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fake_print_signal_received(fake_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
#endif // _di_fake_print_signal_received_
/**
* Print message when fake settings content is empty.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path_file
* The path to the fakefile.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_content_empty_
- extern void fake_print_warning_settings_content_empty(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_static_t settings_name) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_content_empty(fake_data_t * const data, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_static_t settings_name) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_content_empty_
/**
* Print warning message when fake settings content is invalid.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path_file
* The path to the fakefile.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_content_invalid_
- extern void fake_print_warning_settings_content_invalid(fake_main_t * const main, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_static_t settings_name) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_content_invalid(fake_data_t * const data, const f_string_static_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_static_t settings_name) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_content_invalid_
/**
* Print warning message when settings content has too many values.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path_file
* The path to the fakefile.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_content_multiple_
- extern void fake_print_warning_settings_content_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t name_object) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_content_multiple(fake_data_t * const data, const f_string_static_t path_file, const f_string_static_t name_object) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_content_multiple_
/**
* Print warning message when fakefile has too many objects with the same name.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path_file
* The path to the fakefile.
* @param buffer
* @see fl_print_format()
*/
#ifndef _di_fake_print_warning_settings_object_multiple_
- extern void fake_print_warning_settings_object_multiple(fake_main_t * const main, const f_string_static_t path_file, const f_string_static_t label, const f_string_static_t name_object) F_attribute_visibility_internal_d;
+ extern void fake_print_warning_settings_object_multiple(fake_data_t * const data, const f_string_static_t path_file, const f_string_static_t label, const f_string_static_t name_object) F_attribute_visibility_internal_d;
#endif // _di_fake_print_warning_settings_object_multiple_
#ifdef __cplusplus
#endif
#ifndef _di_fake_skeleton_operate_
- f_status_t fake_skeleton_operate(fake_main_t * const main) {
+ f_status_t fake_skeleton_operate(fake_data_t * const data) {
f_status_t status = F_none;
- if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%rGenerating skeleton structure.%r", main->output.to.stream, f_string_eol_s, f_string_eol_s);
+ if (data->main->output.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%rGenerating skeleton structure.%r", data->main->output.to.stream, f_string_eol_s, f_string_eol_s);
- if (main->output.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_dynamic(f_string_eol_s, main->output.to.stream);
+ if (data->main->output.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_dynamic(f_string_eol_s, data->main->output.to.stream);
}
}
f_string_static_t sources_cpp = f_string_static_t_initialize;
f_string_static_t sources_script = f_string_static_t_initialize;
- fake_skeleton_path_source_length(main, &f_string_empty_s, &sources);
- fake_skeleton_path_source_length(main, &fake_path_part_bash_s, &sources_bash);
- fake_skeleton_path_source_length(main, &fake_path_part_c_s, &sources_c);
- fake_skeleton_path_source_length(main, &fake_path_part_cpp_s, &sources_cpp);
- fake_skeleton_path_source_length(main, &fake_path_part_script_s, &sources_script);
+ fake_skeleton_path_source_length(data, &f_string_empty_s, &sources);
+ fake_skeleton_path_source_length(data, &fake_path_part_bash_s, &sources_bash);
+ fake_skeleton_path_source_length(data, &fake_path_part_c_s, &sources_c);
+ fake_skeleton_path_source_length(data, &fake_path_part_cpp_s, &sources_cpp);
+ fake_skeleton_path_source_length(data, &fake_path_part_script_s, &sources_script);
f_char_t sources_string[sources.used + 1];
f_char_t sources_bash_string[sources_bash.used + 1];
sources_cpp.string = sources_cpp_string;
sources_script.string = sources_script_string;
- fake_skeleton_path_source_string(main, &f_string_empty_s, &sources);
- fake_skeleton_path_source_string(main, &fake_path_part_bash_s, &sources_bash);
- fake_skeleton_path_source_string(main, &fake_path_part_c_s, &sources_c);
- fake_skeleton_path_source_string(main, &fake_path_part_cpp_s, &sources_cpp);
- fake_skeleton_path_source_string(main, &fake_path_part_script_s, &sources_script);
+ fake_skeleton_path_source_string(data, &f_string_empty_s, &sources);
+ fake_skeleton_path_source_string(data, &fake_path_part_bash_s, &sources_bash);
+ fake_skeleton_path_source_string(data, &fake_path_part_c_s, &sources_c);
+ fake_skeleton_path_source_string(data, &fake_path_part_cpp_s, &sources_cpp);
+ fake_skeleton_path_source_string(data, &fake_path_part_script_s, &sources_script);
const f_string_static_t *parameters_value[] = {
- &main->path_build,
- &main->path_data,
- &main->path_data_build,
- &main->path_data_settings,
- &main->path_documents,
- &main->path_licenses,
- &main->path_sources,
+ &data->path_build,
+ &data->path_data,
+ &data->path_data_build,
+ &data->path_data_settings,
+ &data->path_documents,
+ &data->path_licenses,
+ &data->path_sources,
&sources,
&sources_bash,
&sources_c,
&sources_cpp,
&sources_script,
- &main->path_work,
- &main->path_work_includes,
- &main->path_work_libraries,
- &main->path_work_libraries_script,
- &main->path_work_libraries_shared,
- &main->path_work_libraries_static,
- &main->path_work_programs,
- &main->path_work_programs_script,
- &main->path_work_programs_shared,
- &main->path_work_programs_static,
+ &data->path_work,
+ &data->path_work_includes,
+ &data->path_work_libraries,
+ &data->path_work_libraries_script,
+ &data->path_work_libraries_shared,
+ &data->path_work_libraries_static,
+ &data->path_work_programs,
+ &data->path_work_programs_script,
+ &data->path_work_programs_shared,
+ &data->path_work_programs_static,
&fake_path_part_specifications_s,
};
for (uint8_t i = 0; i < 23; ++i) {
- status = fake_skeleton_operate_directory_create(main, *parameters_value[i]);
+ status = fake_skeleton_operate_directory_create(data, *parameters_value[i]);
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "fake_skeleton_operate_directory_create", F_true);
+ fll_error_print(data->main->error, F_status_set_fine(status), "fake_skeleton_operate_directory_create", F_true);
return status;
}
} // for
- if (main->output.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_dynamic(f_string_eol_s, main->output.to.stream);
+ if (data->main->output.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_dynamic(f_string_eol_s, data->main->output.to.stream);
}
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_data_build_defines, F_false, fake_make_skeleton_content_defines_s);
+ status = fake_skeleton_operate_file_create(data, data->file_data_build_defines, F_false, fake_make_skeleton_content_defines_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_data_build_dependencies, F_false, fake_make_skeleton_content_dependencies_s);
+ status = fake_skeleton_operate_file_create(data, data->file_data_build_dependencies, F_false, fake_make_skeleton_content_dependencies_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_data_build_process_post_s, F_true, fake_make_skeleton_content_process_post_s);
+ status = fake_skeleton_operate_file_create(data, data->file_data_build_process_post_s, F_true, fake_make_skeleton_content_process_post_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_data_build_process_pre_s, F_true, fake_make_skeleton_content_process_pre_s);
+ status = fake_skeleton_operate_file_create(data, data->file_data_build_process_pre_s, F_true, fake_make_skeleton_content_process_pre_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_data_build_settings, F_false, fake_make_skeleton_content_settings_s);
+ status = fake_skeleton_operate_file_create(data, data->file_data_build_settings, F_false, fake_make_skeleton_content_settings_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_documents_readme, F_false, f_string_empty_s);
+ status = fake_skeleton_operate_file_create(data, data->file_documents_readme, F_false, f_string_empty_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, main->file_data_build_fakefile, F_false, fake_make_skeleton_content_fakefile_s);
+ status = fake_skeleton_operate_file_create(data, data->file_data_build_fakefile, F_false, fake_make_skeleton_content_fakefile_s);
}
if (F_status_is_error(status)) return status;
#endif // _di_fake_skeleton_operate_
#ifndef _di_fake_skeleton_operate_directory_create_
- f_status_t fake_skeleton_operate_directory_create(fake_main_t * const main, const f_string_static_t path) {
+ f_status_t fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path) {
if (!path.used) return F_none;
f_status_t status = f_directory_exists(path);
if (status == F_true) {
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Directory '%Q' already exists.%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Directory '%Q' already exists.%r", data->main->output.to.stream, path, f_string_eol_s);
}
return F_none;
}
if (status == F_false) {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- flockfile(main->error.to.stream);
+ if (data->main->error.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
- fl_print_format("%[' exists but is not a directory.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path, data->main->error.notable);
+ fl_print_format("%[' exists but is not a directory.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
return F_status_set_warning(F_failure);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe path '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
- fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe path '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path, data->main->error.notable);
+ fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
else {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_create", F_true, path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_directory_create", F_true, path, f_file_operation_create_s, fll_error_file_type_directory_e);
}
return status;
}
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("Directory '%Q' created.%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("Directory '%Q' created.%r", data->main->output.to.stream, path, f_string_eol_s);
}
}
else if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_exists", F_true, path, f_file_operation_create_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_directory_exists", F_true, path, f_file_operation_create_s, fll_error_file_type_directory_e);
return status;
}
#endif // _di_fake_skeleton_operate_directory_create_
#ifndef _di_fake_skeleton_operate_file_create_
- f_status_t fake_skeleton_operate_file_create(fake_main_t * const main, const f_string_static_t path, const bool executable, const f_string_static_t content) {
+ f_status_t fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content) {
f_status_t status = F_none;
status = f_file_is(path, F_file_type_regular_d, F_false);
if (status == F_true) {
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("File '%Q' already exists.%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("File '%Q' already exists.%r", data->main->output.to.stream, path, f_string_eol_s);
}
return F_none;
status = f_file_is(path, F_file_type_link_d, F_false);
if (status == F_true) {
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("File '%Q' already exists (as a symbolic link).%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("File '%Q' already exists (as a symbolic link).%r", data->main->output.to.stream, path, f_string_eol_s);
}
return F_none;
}
if (status == F_false) {
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("File '%Q' already exists but is not a regular file (or symbolic link).%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("File '%Q' already exists but is not a regular file (or symbolic link).%r", data->main->output.to.stream, path, f_string_eol_s);
}
return F_status_set_warning(F_none);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
- flockfile(main->error.to.stream);
+ flockfile(data->main->error.to.stream);
- fl_print_format("%r%[%QThe file '%]", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context);
- fl_print_format("%[%Q%]", main->error.to.stream, main->error.notable, path, main->error.notable);
- fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", main->error.to.stream, main->error.context, main->error.context, f_string_eol_s);
+ fl_print_format("%r%[%QThe file '%]", data->main->error.to.stream, f_string_eol_s, data->main->error.context, data->main->error.prefix, data->main->error.context);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->error.notable, path, data->main->error.notable);
+ fl_print_format("%[' could not be created, a parent directory does not exist.%]%r", data->main->error.to.stream, data->main->error.context, data->main->error.context, f_string_eol_s);
- funlockfile(main->error.to.stream);
+ funlockfile(data->main->error.to.stream);
}
else {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_create", F_true, path, f_file_operation_create_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_file_create", F_true, path, f_file_operation_create_s, fll_error_file_type_file_e);
}
return status;
}
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("File '%Q' created.%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("File '%Q' created.%r", data->main->output.to.stream, path, f_string_eol_s);
}
if (content.used) {
status = f_file_open(path, 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_file_open", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
return status;
}
status = f_file_write(file, content, 0);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_write", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_file_write", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
f_file_stream_close(F_true, &file);
return status;
}
- if (main->error.verbosity >= f_console_verbosity_verbose_e) {
- fll_print_format("File '%Q' pre-populated.%r", main->output.to.stream, path, f_string_eol_s);
+ if (data->main->error.verbosity >= f_console_verbosity_verbose_e) {
+ fll_print_format("File '%Q' pre-populated.%r", data->main->output.to.stream, path, f_string_eol_s);
}
f_file_stream_close(F_true, &file);
}
}
else if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_is", F_true, path, f_file_operation_create_s, fll_error_file_type_file_e);
+ fll_error_file_print(data->main->error, F_status_set_fine(status), "f_file_is", F_true, path, f_file_operation_create_s, fll_error_file_type_file_e);
return status;
}
#endif // _di_fake_skeleton_operate_file_create_
#ifndef _di_fake_skeleton_path_source_length_
- void fake_skeleton_path_source_length(fake_main_t * const main, const f_string_static_t *partial, f_string_static_t * const source) {
+ void fake_skeleton_path_source_length(fake_data_t * const data, const f_string_static_t *partial, f_string_static_t * const source) {
- source->used = main->path_sources.used + fake_default_path_sources_s.used + partial->used;
+ source->used = data->path_sources.used + fake_default_path_sources_s.used + partial->used;
}
#endif // _di_fake_skeleton_path_source_length_
#ifndef _di_fake_skeleton_path_source_string_
- void fake_skeleton_path_source_string(fake_main_t * const main, const f_string_static_t *partial, f_string_static_t * const source) {
+ void fake_skeleton_path_source_string(fake_data_t * const data, const f_string_static_t *partial, f_string_static_t * const source) {
source->used = 0;
- memcpy(source->string, main->path_sources.string, sizeof(f_char_t) * main->path_sources.used);
- source->used += main->path_sources.used;
+ memcpy(source->string, data->path_sources.string, sizeof(f_char_t) * data->path_sources.used);
+ source->used += data->path_sources.used;
memcpy(source->string, fake_default_path_sources_s.string, sizeof(f_char_t) * fake_default_path_sources_s.used);
source->used += fake_default_path_sources_s.used;
/**
* Execute the skeleton operation.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_skeleton_operate_
- extern f_status_t fake_skeleton_operate(fake_main_t * const main) F_attribute_visibility_internal_d;
+ extern f_status_t fake_skeleton_operate(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_skeleton_operate_
/**
* Create a directory if it does not exist, ignore it if it does, and warn if path exists but is not a directory.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path
* The file path for the directory to create.
*
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_skeleton_operate_directory_create_
- extern f_status_t fake_skeleton_operate_directory_create(fake_main_t * const main, const f_string_static_t path) F_attribute_visibility_internal_d;
+ extern f_status_t fake_skeleton_operate_directory_create(fake_data_t * const data, const f_string_static_t path) F_attribute_visibility_internal_d;
#endif // _di_fake_skeleton_operate_directory_create_
/**
* Create a file if it does not exist, ignore it if it does, and warn if path exists but is not a file.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param path
* The file path for the directory to create.
* @param executable
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_skeleton_operate_file_create_
- extern f_status_t fake_skeleton_operate_file_create(fake_main_t * const main, const f_string_static_t path, const bool executable, const f_string_static_t content) F_attribute_visibility_internal_d;
+ extern f_status_t fake_skeleton_operate_file_create(fake_data_t * const data, const f_string_static_t path, const bool executable, const f_string_static_t content) F_attribute_visibility_internal_d;
#endif // _di_fake_skeleton_operate_file_create_
/**
* Calculate the length of the sources path so that it can be used to manually construct a static string.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param partial
* The partial path string, such as "bash".
* @param source
* The path_sources.size is ignored.
*/
#ifndef _di_fake_skeleton_path_source_length_
- extern void fake_skeleton_path_source_length(fake_main_t * const main, const f_string_static_t *partial, f_string_static_t * const source) F_attribute_visibility_internal_d;
+ extern void fake_skeleton_path_source_length(fake_data_t * const data, const f_string_static_t *partial, f_string_static_t * const source) F_attribute_visibility_internal_d;
#endif // _di_fake_skeleton_path_source_length_
/**
* Construct a static string array of the sources path.
*
- * @param main
- * The main program data.
+ * @param data
+ * The program data.
* @param partial
* The partial path string, such as "bash".
* @param source
* The path_sources.size is ignored.
*/
#ifndef _di_fake_skeleton_path_source_string_
- extern void fake_skeleton_path_source_string(fake_main_t * const main, const f_string_static_t *partial, f_string_static_t * const source) F_attribute_visibility_internal_d;
+ extern void fake_skeleton_path_source_string(fake_data_t * const data, const f_string_static_t *partial, f_string_static_t * const source) F_attribute_visibility_internal_d;
#endif // _di_fake_skeleton_path_source_string_
#ifdef __cplusplus