fprintf(f_standard_error, "%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_standard_output, "%cAll operations complete.%c%c", f_string_eol, f_string_eol, f_string_eol);
}
}
}
#define fake_path_part_sources "sources" f_path_separator
#define fake_path_part_static "static" f_path_separator
- #define fake_path_part_bash_length (4 + f_path_separator_length)
- #define fake_path_part_build_length (5 + f_path_separator_length)
- #define fake_path_part_c_length (1 + f_path_separator_length)
- #define fake_path_part_cpp_length (3 + f_path_separator_length)
- #define fake_path_part_data_length (4 + f_path_separator_length)
- #define fake_path_part_documents_length (9 + f_path_separator_length)
- #define fake_path_part_includes_length (8 + f_path_separator_length)
- #define fake_path_part_libraries_length (9 + f_path_separator_length)
- #define fake_path_part_licenses_length (8 + f_path_separator_length)
- #define fake_path_part_objects_length (7 + f_path_separator_length)
- #define fake_path_part_process_length (7 + f_path_separator_length)
- #define fake_path_part_programs_length (8 + f_path_separator_length)
- #define fake_path_part_script_length (6 + f_path_separator_length)
- #define fake_path_part_settings_length (8 + f_path_separator_length)
- #define fake_path_part_shared_length (6 + f_path_separator_length)
- #define fake_path_part_sources_length (7 + f_path_separator_length)
- #define fake_path_part_static_length (6 + f_path_separator_length)
+ #define fake_path_part_bash_length 5
+ #define fake_path_part_build_length 6
+ #define fake_path_part_c_length 2
+ #define fake_path_part_cpp_length 4
+ #define fake_path_part_data_length 5
+ #define fake_path_part_documents_length 10
+ #define fake_path_part_includes_length 9
+ #define fake_path_part_libraries_length 10
+ #define fake_path_part_licenses_length 9
+ #define fake_path_part_objects_length 8
+ #define fake_path_part_process_length 8
+ #define fake_path_part_programs_length 9
+ #define fake_path_part_script_length 7
+ #define fake_path_part_settings_length 9
+ #define fake_path_part_shared_length 7
+ #define fake_path_part_sources_length 8
+ #define fake_path_part_static_length 7
#endif // _di_fake_path_
#ifndef _di_fake_file_
#define fake_default_path_sources "sources" f_path_separator
#define fake_default_path_work ""
- #define fake_default_path_build_length (5 + f_path_separator_length)
- #define fake_default_path_data_length (4 + f_path_separator_length)
- #define fake_default_path_sources_length (7 + f_path_separator_length)
+ #define fake_default_path_build_length 6
+ #define fake_default_path_data_length 5
+ #define fake_default_path_sources_length 8
#define fake_default_path_work_length 0
#define fake_default_defines ""
}
{
+ f_string_dynamics environment_names = f_string_dynamics_initialize;
+ f_string_dynamics environment_values = f_string_dynamics_initialize;
+
+ // @todo add support for allowing specific environment variables
+ const f_string variables_name[] = {
+ f_path_environment,
+ f_path_present_working
+ };
+
+ const f_string_length variables_length[] = {
+ f_path_environment_length,
+ f_path_present_working_length
+ };
+
+ f_string_dynamic variable_name = f_string_dynamic_initialize;
+ f_string_dynamic variable_value = f_string_dynamic_initialize;
+
+ for (uint8_t i = 0; i < 2; i++) {
+ status = f_environment_get(variables_name[i], &variable_value);
+ if (f_status_is_error(status)) {
+ status = f_status_set_fine(status);
+
+ if (status == f_error_reallocation) {
+ fake_print_error(data.context, data.verbosity, status, "f_environment_get", f_true);
+
+ f_macro_string_dynamic_delete_simple(variable_name);
+ f_macro_string_dynamic_delete_simple(variable_value);
+ f_macro_string_dynamic_delete_simple(path);
+ f_macro_string_dynamics_delete_simple(environment_names);
+ f_macro_string_dynamics_delete_simple(environment_values);
+ f_macro_string_dynamics_delete_simple(arguments);
+ return status;
+ }
+ }
+
+ if (environment_names.used + 1 > environment_names.size) {
+ f_macro_string_dynamics_resize(status, environment_names, environment_names.size + f_memory_default_allocation_step);
+
+ if (!f_status_is_error(status)) {
+ f_macro_string_dynamics_resize(status, environment_values, environment_values.size + f_memory_default_allocation_step);
+ }
+
+ if (f_status_is_error(status)) {
+ fake_print_error(data.context, data.verbosity, status, "f_macro_string_dynamics_resize", f_true);
+
+ f_macro_string_dynamic_delete_simple(variable_name);
+ f_macro_string_dynamic_delete_simple(variable_value);
+ f_macro_string_dynamic_delete_simple(path);
+ f_macro_string_dynamics_delete_simple(environment_names);
+ f_macro_string_dynamics_delete_simple(environment_values);
+ f_macro_string_dynamics_delete_simple(arguments);
+ return status;
+ }
+ }
+
+ status = fl_string_append(variables_name[i], variables_length[i], &variable_name);
+
+ if (f_status_is_error(status)) {
+ fake_print_error(data.context, data.verbosity, status, "fl_string_append", f_true);
+
+ f_macro_string_dynamic_delete_simple(variable_name);
+ f_macro_string_dynamic_delete_simple(variable_value);
+ f_macro_string_dynamic_delete_simple(path);
+ f_macro_string_dynamics_delete_simple(environment_names);
+ f_macro_string_dynamics_delete_simple(environment_values);
+ f_macro_string_dynamics_delete_simple(arguments);
+ return status;
+ }
+
+ environment_names.array[environment_names.used].string = variable_name.string;
+ environment_names.array[environment_names.used].used = variable_name.used;
+ environment_names.array[environment_names.used].size = variable_name.size;
+ environment_names.used++;
+
+ environment_values.array[environment_values.used].string = variable_value.string;
+ environment_values.array[environment_values.used].used = variable_value.used;
+ environment_values.array[environment_values.used].size = variable_value.size;
+ environment_values.used++;
+
+ f_macro_string_dynamic_clear(variable_name);
+ f_macro_string_dynamic_clear(variable_value);
+ }
+
int result = 0;
- status = fll_execute_path(path.string, arguments, &result);
+ status = fll_execute_path_environment(path.string, arguments, environment_names, environment_values, &result);
+
+ f_macro_string_dynamics_delete_simple(environment_names);
+ f_macro_string_dynamics_delete_simple(environment_values);
+ f_macro_string_dynamics_delete_simple(arguments);
}
if (f_status_is_error(status)) {
}
}
else {
- fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_execute_path", f_true);
+ fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_execute_path_environment", f_true);
}
}
f_macro_string_dynamic_delete_simple(path);
- f_macro_string_dynamics_delete_simple(arguments);
return status;
}
#ifndef _di_fake_build_operate_
f_return_status fake_build_operate(const fake_data data) {
+ if (data.verbosity != fake_verbosity_quiet) {
+ printf("%c", f_string_eol);
+ fl_color_print_line(f_standard_output, data.context.important, data.context.reset, "Building project.");
+ }
+
f_status status = f_none;
fake_build_settings settings = fake_build_settings_initialize;
#endif // _di_fake_path_generate_
#ifndef _di_fake_path_generate_string_dynamic_
- f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *value[], const uint8_t length) {
+ f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *destination[], const uint8_t length) {
f_status status = f_none;
for (uint8_t i = 0; i < length; i++) {
- status = fl_string_dynamic_append_nulless(source, value[i]);
+ status = fl_string_dynamic_append_nulless(source, destination[i]);
if (f_status_is_error(status)) return status;
} // for
if (status == f_invalid_parameter) {
if (verbosity != fake_verbosity_quiet) {
fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ", function, name);
+ fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
fl_color_print(f_standard_error, context.notable, context.reset, "%s", function);
fl_color_print(f_standard_error, context.error, context.reset, "() for the %s '", file_or_directory);
fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
}
f_string_length location = data->parameters[parameters_id[i]].additional.array[0];
- f_string_length length = strnlen(arguments.argv[location], f_console_max_size);
+ f_string_length length = strnlen(arguments.argv[location], f_console_length_size);
if (length > 0) {
status = fl_string_append(arguments.argv[location], length, parameters_value[i]);
* The program data.
* @param source
* The string to copy from.
- * @param value
+ * @param destination
* An array of pointers to the strings to append onto.
* @param length
* The size of the values.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_path_generate_string_dynamic_
- extern f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *value[], const uint8_t size) f_gcc_attribute_visibility_internal;
+ extern f_return_status fake_path_generate_string_dynamic(fake_data *data, const f_string_dynamic source, f_string_dynamic *destination[], const uint8_t size) f_gcc_attribute_visibility_internal;
#endif // _di_fake_path_generate_string_dynamic_
/**
extern "C" {
#endif
-
#ifdef __cplusplus
} // extern "C"
#endif
build_compiler gcc
build_linker ar
build_libraries -lc
-build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_utf -lfl_string -lfl_file -lfl_fss -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_environment -lf_file -lf_conversion -lf_console -lf_memory
+build_libraries_fll -lfll_program -lfll_fss -lfll_execute -lfl_utf -lfl_string -lfl_file -lfl_fss -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_path -lf_environment -lf_file -lf_conversion -lf_console -lf_memory
build_libraries_fll-level -lfll_2 -lfll_1 -lfll_0
build_libraries_fll-monolithic -lfll
-build_libraries-individual -lfll_program -lfll_fss -lfll_execute -lfl_utf -lfl_string -lfl_file -lfl_fss -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_environment -lf_file -lf_conversion -lf_console -lf_memory
+build_libraries-individual -lfll_program -lfll_fss -lfll_execute -lfl_utf -lfl_string -lfl_file -lfl_fss -lfl_directory -lfl_console -lfl_color -lf_utf -lf_print -lf_path -lf_environment -lf_file -lf_conversion -lf_console -lf_memory
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
build_sources_library fake.c private-fake.c private-clean.c private-build.c private-make.c private-skeleton.c