Minor syntax and style cleanups.
#ifndef _di_controller_main_
f_status_t controller_main(const f_console_arguments_t arguments, controller_main_t *main) {
+
f_status_t status = F_none;
{
#ifndef _di_controller_main_delete_
f_status_t controller_main_delete(controller_main_t *main) {
- for (f_array_length_t i = 0; i < controller_total_parameters; i++) {
+ for (f_array_length_t i = 0; i < controller_total_parameters; ++i) {
macro_f_array_lengths_t_delete_simple(main->parameters[i].locations);
macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub);
macro_f_array_lengths_t_delete_simple(main->parameters[i].values);
f_thread_unlock(&process->lock);
if (count < controller_thread_wait_timeout_3_before) {
- count++;
+ ++count;
}
} while (status == F_time && controller_thread_is_enabled_process(process, global.thread));
#ifndef _di_controller_file_pid_create_
f_status_t controller_file_pid_create(const pid_t pid, const f_string_static_t path) {
+
f_status_t status = F_none;
// the file exists, do not attempt to overwrite.
if (processs.array[i] && processs.array[i]->action == action && fl_string_dynamic_compare(alias, processs.array[i]->rule.alias) == F_equal_to) {
if (at) *at = i;
+
return F_true;
}
} // for
#ifndef _di_controller_get_id_user_
f_status_t controller_get_id_user(const f_string_static_t buffer, const f_string_range_t range, controller_cache_t *cache, uid_t *id) {
+
f_number_unsigned_t number = 0;
f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, range, &number);
#ifndef _di_controller_get_id_group_
f_status_t controller_get_id_group(const f_string_static_t buffer, const f_string_range_t range, controller_cache_t *cache, gid_t *id) {
+
f_number_unsigned_t number = 0;
f_status_t status = fl_conversion_string_to_number_unsigned(buffer.string, range, &number);
#ifndef _di_controller_perform_ready_
f_status_t controller_perform_ready(const bool is_entry, controller_global_t global, controller_cache_t *cache) {
+
f_status_t status = F_none;
// only create pid file when not in validate mode.
#ifndef _di_controller_preprocess_entry_
f_status_t controller_preprocess_entry(const bool is_entry, controller_global_t global, controller_cache_t *cache) {
+
f_status_t status = F_none;
f_status_t status2 = F_none;
}
}
else {
- global->setting->rules.used++;
+ ++global->setting->rules.used;
}
f_thread_unlock(&global->thread->lock.rule);
cache->object_actions.used = cache->object_actions.size;
while (cache->object_actions.used) {
- cache->object_actions.used--;
- cache->object_actions.array[cache->object_actions.used].start = 1;
+
+ cache->object_actions.array[--cache->object_actions.used].start = 1;
cache->object_actions.array[cache->object_actions.used].stop = 0;
} // while
cache->content_actions.used = cache->content_actions.size;
while (cache->content_actions.used) {
- cache->content_actions.used--;
- cache->content_actions.array[cache->content_actions.used].used = 0;
+ cache->content_actions.array[--cache->content_actions.used].used = 0;
} // while
{
break;
}
- action->parameters.used++;
+ ++action->parameters.used;
} // for
if (F_status_is_error_not(action->status)) {
}
}
- actions->used++;
+ ++actions->used;
} // for
if (F_status_is_error(status_action)) {
}
else {
actions->array[actions->used].parameters.used = 1;
- actions->used++;
+ ++actions->used;
}
}
actions->array[actions->used].status = F_known_not;
for (f_array_length_t i = 0; i < cache->content_action.used; ++i) {
+
status = f_string_dynamic_partial_mash_nulless(f_string_space_s, f_string_space_length, cache->buffer_item, cache->content_action.array[i], &actions->array[actions->used].parameters.array[0]);
if (F_status_is_error(status)) break;
} // for
actions->array[actions->used].status = status;
}
- actions->used++;
+ ++actions->used;
}
}
}
status = controller_rule_item_read(is_normal, global, cache, &rule->items.array[rule->items.used]);
if (F_status_is_error(status)) break;
- rule->items.used++;
+ ++rule->items.used;
}
else {
for_item = F_false;
controller_rule_item_error_print(global.main->error, cache->action, for_item, global.thread);
rule->status[0] = controller_status_simplify_error(F_status_set_fine(status));
+
return rule->status[0];
}
continue;
}
- setting_maps->used++;
+ ++setting_maps->used;
continue;
}
break;
}
- rule->control_group.groups.used++;
+ ++rule->control_group.groups.used;
} // for
}
continue;
}
- setting_values->used++;
+ ++setting_values->used;
} // for
continue;
f_array_length_t j = 0;
for (; j < process->path_pids.used; ++j) {
- if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j].string) == F_true) break;
+
+ if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j].string) == F_true) {
+ break;
+ }
} // for
if (j < process->path_pids.used) {
// A forked child process should deallocate memory on exit.
// It seems that this function doesn't return to the calling thread for a forked child process, even with the "return 0;" below.
// Deallocate as much as possible.
-
controller_main_t *main = (controller_main_t *) process->main_data;
controller_setting_t *setting = (controller_setting_t *) process->main_setting;
controller_thread_t *thread = (controller_thread_t *) process->main_thread;
process = global->thread->processs.array[i];
// do not cancel exit processes, when not performing "execute" during exit.
- if (process->type == controller_process_type_exit && global->thread->enabled != controller_thread_enabled_exit_execute) continue;
+ if (process->type == controller_process_type_exit && global->thread->enabled != controller_thread_enabled_exit_execute) {
+ continue;
+ }
for (j = 0; j < process->childs.used; ++j) {
#ifndef _di_controller_thread_process_exit_
void controller_thread_process_exit(controller_global_t *global) {
- if (global->thread->enabled != controller_thread_enabled_exit) return;
+ if (global->thread->enabled != controller_thread_enabled_exit) {
+ return;
+ }
if (global->setting->ready == controller_setting_ready_done) {
// A forked child process should deallocate memory on exit.
// It seems that this function doesn't return to the calling thread for a forked child process, even with the "return 0;" below.
// Deallocate as much as possible.
-
controller_thread_delete_simple(entry->global->thread);
controller_setting_delete_simple(entry->global->setting);
controller_main_delete(entry->global->main);
#ifndef _di_fake_main_
f_status_t fake_main(const f_console_arguments_t arguments, fake_main_t *main) {
+
f_status_t status = F_none;
{
f_array_length_t j = 0;
f_array_length_t k = 0;
- for (; i < main->parameters[fake_parameter_operation_build].locations.used; i++, locations_length++) {
+ for (; i < main->parameters[fake_parameter_operation_build].locations.used; ++i, ++locations_length) {
operations[locations_length] = fake_operation_build;
locations[locations_length] = main->parameters[fake_parameter_operation_build].locations.array[i];
} // for
- for (i = 0; i < main->parameters[fake_parameter_operation_clean].locations.used; i++) {
+ for (i = 0; i < main->parameters[fake_parameter_operation_clean].locations.used; ++i) {
- for (j = 0; j < locations_length; j++) {
+ for (j = 0; j < locations_length; ++j) {
if (main->parameters[fake_parameter_operation_clean].locations.array[i] < locations[j]) {
- for (k = locations_length; k > j; k--) {
+ for (k = locations_length; k > j; --k) {
locations[k] = locations[k - 1];
operations[k] = operations[k - 1];
} // for
locations[j] = main->parameters[fake_parameter_operation_clean].locations.array[i];
operations[j] = fake_operation_clean;
- locations_length++;
+ ++locations_length;
} // for
- for (i = 0; i < main->parameters[fake_parameter_operation_make].locations.used; i++) {
+ for (i = 0; i < main->parameters[fake_parameter_operation_make].locations.used; ++i) {
- for (j = 0; j < locations_length; j++) {
+ for (j = 0; j < locations_length; ++j) {
if (main->parameters[fake_parameter_operation_make].locations.array[i] < locations[j]) {
- for (k = locations_length; k > j; k--) {
+ for (k = locations_length; k > j; --k) {
locations[k] = locations[k - 1];
operations[k] = operations[k - 1];
} // for
locations[j] = main->parameters[fake_parameter_operation_make].locations.array[i];
operations[j] = fake_operation_make;
- locations_length++;
+ ++locations_length;
} // for
- for (i = 0; i < main->parameters[fake_parameter_operation_skeleton].locations.used; i++) {
+ for (i = 0; i < main->parameters[fake_parameter_operation_skeleton].locations.used; ++i) {
- for (j = 0; j < locations_length; j++) {
+ for (j = 0; j < locations_length; ++j) {
if (main->parameters[fake_parameter_operation_skeleton].locations.array[i] < locations[j]) {
- for (k = locations_length; k > j; k--) {
+ for (k = locations_length; k > j; --k) {
+
locations[k] = locations[k - 1];
operations[k] = operations[k - 1];
} // for
locations[j] = main->parameters[fake_parameter_operation_skeleton].locations.array[i];
operations[j] = fake_operation_skeleton;
- locations_length++;
+ ++locations_length;
} // for
}
if (F_status_is_error(status)) {
fake_main_delete(main);
+
return F_status_set_error(status);
}
- for (uint8_t i = 0; i < operations_length; i++) {
+ for (uint8_t i = 0; i < operations_length; ++i) {
+
main->operation = operations[i];
if (main->operation == fake_operation_build) {
#ifndef _di_fake_build_arguments_standard_add_
void fake_build_arguments_standard_add(const fake_main_t main, const fake_build_data_t data_build, const bool is_shared, const bool is_library, 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_length + main.path_build_libraries_shared.used;
build_includes_length,
};
- for (uint8_t i = 0; i < 2; i++) {
+ for (uint8_t i = 0; i < 2; ++i) {
+
*status = fll_execute_arguments_add(values[i], lengths[i], arguments);
if (F_status_is_error(*status)) break;
} // for
}
if (F_status_is_error_not(*status)) {
- for (f_array_length_t i = 0; i < data_build.setting.build_libraries.used; i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.build_libraries.used; ++i) {
*status = fll_execute_arguments_add(data_build.setting.build_libraries.array[i].string, data_build.setting.build_libraries.array[i].used, arguments);
if (F_status_is_error(*status)) break;
} // for
}
- for (f_array_length_t i = 0; i < data_build.setting.flags_all.used && F_status_is_error_not(*status); i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.flags_all.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(data_build.setting.flags_all.array[i].string, data_build.setting.flags_all.array[i].used, arguments);
if (F_status_is_error(*status)) break;
} // for
- for (f_array_length_t i = 0; i < data_build.setting.flags_shared.used && F_status_is_error_not(*status); i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.flags_shared.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(data_build.setting.flags_shared.array[i].string, data_build.setting.flags_shared.array[i].used, arguments);
if (F_status_is_error(*status)) break;
} // for
if (is_library) {
- for (f_array_length_t j = 0; j < data_build.setting.flags_library.used && F_status_is_error_not(*status); j++) {
+ for (f_array_length_t j = 0; j < data_build.setting.flags_library.used && F_status_is_error_not(*status); ++j) {
*status = fll_execute_arguments_add(data_build.setting.flags_library.array[j].string, data_build.setting.flags_library.array[j].used, arguments);
if (F_status_is_error(*status)) break;
} // for
}
else {
- for (f_array_length_t i = 0; i < data_build.setting.flags_program.used && F_status_is_error_not(*status); i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.flags_program.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(data_build.setting.flags_program.array[i].string, data_build.setting.flags_program.array[i].used, arguments);
if (F_status_is_error(*status)) break;
f_array_length_t length = 0;
f_array_length_t i = 0;
- for (; i < main.define.used && F_status_is_error_not(*status); i++) {
+ for (; i < main.define.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(main.define.array[i].string, main.define.array[i].used, arguments);
if (F_status_is_error(*status)) break;
f_array_length_t length = 0;
f_array_length_t i = 0;
- for (; i < data_build.setting.defines_all.used && F_status_is_error_not(*status); i++) {
+ for (; i < data_build.setting.defines_all.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(data_build.setting.defines_all.array[i].string, data_build.setting.defines_all.array[i].used, arguments);
if (F_status_is_error(*status)) break;
} // for
if (is_shared) {
- for (i = 0; i < data_build.setting.defines_shared.used && F_status_is_error_not(*status); i++) {
+ for (i = 0; i < data_build.setting.defines_shared.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(data_build.setting.defines_shared.array[i].string, data_build.setting.defines_shared.array[i].used, arguments);
if (F_status_is_error(*status)) break;
} // for
}
else {
- for (i = 0; i < data_build.setting.defines_static.used && F_status_is_error_not(*status); i++) {
+ for (i = 0; i < data_build.setting.defines_static.used && F_status_is_error_not(*status); ++i) {
*status = fll_execute_arguments_add(data_build.setting.defines_static.array[i].string, data_build.setting.defines_static.array[i].used, arguments);
if (F_status_is_error(*status)) break;
#ifndef _di_fake_build_copy_
void fake_build_copy(const fake_main_t main, const f_mode_t mode, const f_string_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 preserve, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return;
}
recurse.failures = &failures;
- for (f_array_length_t i = 0; i < files.used; i++) {
+ for (f_array_length_t i = 0; i < files.used; ++i) {
+
if (!files.array[i].used) continue;
path_source.used = source.used;
if (F_status_is_error(*status)) {
if (main.error.verbosity == f_console_verbosity_verbose) {
- for (f_array_length_t j = 0; j < failures.used; j++) {
+ 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", "copy directory", "to", path_source.string, destination_directory.string, F_true);
} // for
#ifndef _di_fake_build_skeleton_
void fake_build_skeleton(const fake_main_t main, const fake_build_data_t data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return;
if (fake_signal_received(main)) {
fprintf(main.output.stream, "%c", f_string_eol_s[0]);
}
- for (uint8_t i = 0; i < 15; i++) {
+ for (uint8_t i = 0; i < 15; ++i) {
if (!directorys[i]->used) continue;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return;
}
#ifndef _di_fake_build_execute_process_script_
int fake_build_execute_process_script(const fake_main_t main, const fake_build_data_t 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.string) == F_true || *status == F_child) return main.child;
if (!process_script.used) return 0;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return 0;
}
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++) {
+ for (f_array_length_t i = 0; i < main.define.used; ++i) {
*status = f_string_dynamic_mash(f_string_space_s, 1, main.define.array[i], &defines);
#ifndef _di_fake_build_get_file_name_without_extension_
f_status_t fake_build_get_file_name_without_extension(const fake_main_t main, const f_string_static_t path, f_string_dynamic_t *name) {
+
name->used = 0;
if (!path.used) return F_none;
if (F_status_is_error(status)) {
fll_error_print(main.error, F_status_set_fine(status), "f_file_name_base", F_true);
+
return status;
}
f_array_length_t i = name->used;
- for (; i > 0; i--) {
+ for (; i > 0; --i) {
+
if (name->string[i] == f_path_extension_separator[0]) {
name->used = i;
break;
if (F_status_is_error(status)) {
fll_error_print(main.error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
+
return status;
}
#ifndef _di_fake_build_library_shared_
int fake_build_library_shared(const fake_main_t main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child;
if (!data_build.setting.build_sources_library.used) return 0;
f_array_length_t source_length = 0;
- for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; ++i) {
source_length = path_sources->used + data_build.setting.build_sources_library.array[i].used;
parameter_file_path_length,
};
- for (uint8_t i = 0; i < 4; i++) {
+ for (uint8_t i = 0; i < 4; ++i) {
+
*status = fll_execute_arguments_add(values[i], lengths[i], &arguments);
if (F_status_is_error(*status)) break;
} // for
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return 0;
}
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, "link", fll_error_file_type_file);
+
return 0;
}
fll_error_file_print(main.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, "link", fll_error_file_type_file);
+
return 0;
}
}
#ifndef _di_fake_build_library_static_
int fake_build_library_static(const fake_main_t main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child;
if (!data_build.setting.build_sources_library.used) return 0;
if (F_status_is_error_not(*status)) {
f_array_length_t source_length = 0;
- for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; ++i) {
+
source_path.used = 0;
*status = fake_build_get_file_name_without_extension(main, data_build.setting.build_sources_library.array[i], &file_name);
#ifndef _di_fake_build_load_environment_
void fake_build_load_environment(const fake_main_t main, const fake_build_data_t data_build, f_string_maps_t *environment, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
// reset the environment.
f_path_present_working_length
};
- for (uint8_t i = 0; i < 2; i++) {
+ for (uint8_t i = 0; i < 2; ++i) {
*status = fl_environment_load_name(variables_name[i], variables_length[i], environment);
#ifndef _di_fake_build_load_setting_
void fake_build_load_setting(const fake_main_t main, const f_string_static_t setting_file, fake_build_setting_t *setting, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
if (fake_signal_received(main)) {
fake_build_setting_name_project_name,
};
- for (uint8_t i = 0; i < 1; i++) {
+ for (uint8_t i = 0; i < 1; ++i) {
if (!settings[i]->used) {
fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
if (failed) {
*status = F_status_set_error(F_failure);
+
return;
}
}
#ifndef _di_fake_build_load_setting_process_
void fake_build_load_setting_process(const fake_main_t main, const f_string_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 *setting, f_status_t *status) {
+
if (F_status_is_error(*status) && buffer.used) return;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return;
}
modes = &main.mode;
}
- for (; i < modes->used; i++) {
+ for (; i < modes->used; ++i) {
+
found = F_false;
- for (j = 0; j < setting->modes.used; j++) {
+ for (j = 0; j < setting->modes.used; ++j) {
if (fl_string_dynamic_compare_trim(modes->array[i], setting->modes.array[j]) == F_equal_to) {
found = F_true;
memset(&settings_mode_names, 0, sizeof(f_string_t) * fake_build_setting_total);
memset(&setting_mode_lengths, 0, sizeof(f_array_length_t) * fake_build_setting_total);
- for (j = 0; j < fake_build_setting_total; j++) {
+ for (j = 0; j < fake_build_setting_total; ++j) {
setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used;
}
}
- for (j = 0; j < fake_build_setting_total; j++) {
+ for (j = 0; j < fake_build_setting_total; ++j) {
macro_f_string_dynamic_t_delete_simple(settings_mode_name_dynamic[j]);
} // for
f_string_dynamic_t temporary[total_build_libraries];
for (i = 0; i < total_build_libraries; ++i) {
+
temporary[i].string = setting->build_libraries.array[i].string;
temporary[i].used = setting->build_libraries.array[i].used;
temporary[i].size = setting->build_libraries.array[i].size;
} // for
for (i = 0, j = total_build_libraries; j < setting->build_libraries.used; ++i, ++j) {
+
setting->build_libraries.array[i].string = setting->build_libraries.array[j].string;
setting->build_libraries.array[i].used = setting->build_libraries.array[j].used;
setting->build_libraries.array[i].size = setting->build_libraries.array[j].size;
} // for
for (i = setting->build_libraries.used - total_build_libraries, j = 0; j < total_build_libraries; ++i, ++j) {
+
setting->build_libraries.array[i].string = temporary[j].string;
setting->build_libraries.array[i].used = temporary[j].used;
setting->build_libraries.array[i].size = temporary[j].size;
5,
};
- for (f_array_length_t i = 0; i < 27; i++) {
+ for (f_array_length_t i = 0; i < 27; ++i) {
+
if (!settings_single_source[i]->used) continue;
if (settings_single_source[i]->used > 1) {
}
}
else {
+
// replace any potential existing value.
settings_single_destination[i]->used = 0;
#ifndef _di_fake_build_load_setting_defaults_
void fake_build_load_setting_defaults(const fake_main_t main, fake_build_setting_t *setting, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return;
}
&setting->version_micro,
};
- for (uint8_t i = 0; i < 3; i++) {
+ for (uint8_t i = 0; i < 3; ++i) {
+
if (destinations[i]->used) continue;
*status = f_string_append_assure(sources[i], lengths[i], destinations[i]);
#ifndef _di_fake_build_load_stage_
void fake_build_load_stage(const fake_main_t main, const f_string_static_t settings_file, fake_build_stage_t *stage, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
if (fake_signal_received(main)) {
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_file_name_base", F_true);
+
return;
}
- for (uint8_t i = 0; i < fake_build_stage_total; i++) {
+ for (uint8_t i = 0; i < fake_build_stage_total; ++i) {
*status = f_string_dynamic_append_nulless(main.path_build_stage, values[i]);
#ifndef _di_fake_build_objects_static_
int fake_build_objects_static(const fake_main_t main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child;
if (!data_build.setting.build_sources_library.used) return 0;
path_sources = &data_build.setting.path_sources;
}
- for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; ++i) {
+
file_name.used = 0;
destination_path.used = 0;
destination_length,
};
- for (uint8_t j = 0; j < 5; j++) {
+ for (uint8_t j = 0; j < 5; ++j) {
*status = fll_execute_arguments_add(values[j], lengths[j], &arguments);
if (F_status_is_error(*status)) break;
#ifndef _di_fake_build_program_shared_
int fake_build_program_shared(const fake_main_t main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child;
if (!data_build.setting.build_sources_program.used) return 0;
f_array_length_t source_length = 0;
- for (f_array_length_t i = 0; i < data_build.setting.build_sources_program.used; i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.build_sources_program.used; ++i) {
+
source_length = path_sources->used + data_build.setting.build_sources_program.array[i].used;
char source[source_length + 1];
parameter_file_name_path_length,
};
- for (uint8_t i = 0; i < 2; i++) {
+ for (uint8_t i = 0; i < 2; ++i) {
+
*status = fll_execute_arguments_add(values[i], lengths[i], &arguments);
if (F_status_is_error(*status)) break;
} // for
#ifndef _di_fake_build_program_static_
int fake_build_program_static(const fake_main_t main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
+
if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main.child;
if (!data_build.setting.build_sources_program.used) return 0;
f_array_length_t source_length = 0;
- for (f_array_length_t i = 0; i < data_build.setting.build_sources_program.used; i++) {
+ for (f_array_length_t i = 0; i < data_build.setting.build_sources_program.used; ++i) {
+
if (!data_build.setting.build_sources_program.array[i].used) continue;
source_length = path_sources->used + data_build.setting.build_sources_program.array[i].used;
parameter_file_name_path_length,
};
- for (uint8_t i = 0; i < 4; i++) {
+ for (uint8_t i = 0; i < 4; ++i) {
+
*status = fll_execute_arguments_add(values[i], lengths[i], &arguments);
if (F_status_is_error(*status)) break;
} // for
#ifndef _di_fake_build_touch_
void fake_build_touch(const fake_main_t main, const f_string_dynamic_t file, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
f_mode_t mode = f_mode_t_initialize;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return;
}
#ifndef _di_fake_clean_operate_
f_status_t fake_clean_operate(const fake_main_t main) {
+
f_status_t status = F_none;
if (main.error.verbosity != f_console_verbosity_quiet) {
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.string, "remove", fll_error_file_type_directory);
+
return status;
}
#if !defined(_di_fake_clean_operate_)
int fake_clean_remove_recursively_verbosely(const char *path, const struct stat *file_stat, int type, struct FTW *entity) {
+
if (!entity->level) return 0;
const int result = remove(path);
if (!result) {
+
// @todo in order to get this working, the recursive function that calls this needs to be rewritten with more flexibility or provide a higher-level equivalent function.
printf("Removed '%s'.%c", path, f_string_eol_s[0]);
}
#ifndef _di_fake_execute_
int fake_execute(const fake_main_t main, const f_string_maps_t environment, const f_string_static_t program, const f_string_statics_t arguments, f_status_t *status) {
+
if (F_status_is_error(*status)) return 1;
if (main.error.verbosity == f_console_verbosity_verbose) {
fprintf(main.output.stream, "%s", program.string);
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
+
if (!arguments.array[i].used) continue;
fprintf(main.output.stream, " %s", arguments.array[i].string);
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return 0;
}
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return 0;
}
#ifndef _di_fake_file_buffer_
f_status_t fake_file_buffer(const fake_main_t main, const f_string_t path_file, f_string_dynamic_t *buffer) {
+
f_file_t file = f_file_t_initialize;
f_string_t name_function = "f_file_exists";
f_status_t status = F_none;
#ifndef _di_fake_path_generate_
f_status_t fake_path_generate(fake_main_t *main) {
+
f_status_t status = F_none;
uint8_t i = 0;
parameters_value_2,
};
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 3; ++i) {
+
status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_length[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
+
return status;
}
} // for
&main->path_sources_script,
};
- for (i = 0; i < 15; i++) {
+ for (i = 0; i < 15; ++i) {
+
status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+
return status;
}
} // for
parameters_value_3,
};
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < 4; ++i) {
+
status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_length[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
+
return status;
}
} // for
&main->file_documents_readme,
};
- for (i = 0; i < 11; i++) {
+ for (i = 0; i < 11; ++i) {
+
status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+
return status;
}
} // for
&main->path_work_programs,
};
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 3; ++i) {
+
status = f_string_dynamic_append_nulless(main->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);
+
return status;
}
} // for
&main->path_work_programs,
};
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < 3; ++i) {
+
status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+
return status;
}
} // for
parameters_value_1,
};
- for (i = 0; i < 2; i++) {
+ for (i = 0; i < 2; ++i) {
+
status = fake_path_generate_string_dynamic(main, *parameters_source[i], parameters_value[i], parameters_length[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "fake_path_generate_string_dynamic", F_true);
+
return status;
}
} // for
&main->path_work_programs_static,
};
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < 6; ++i) {
+
status = f_string_append_nulless(parameters_source[i], parameters_length[i], parameters_value[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true);
+
return status;
}
} // for
&main->file_documents_readme,
};
- for (i = 0; i < 34; i++) {
+ for (i = 0; i < 34; ++i) {
+
if (!parameters_value[i]->used) continue;
status = f_string_dynamic_terminate_after(parameters_value[i]);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
+
return status;
}
} // for
#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 status = F_none;
- for (uint8_t i = 0; i < length; i++) {
+ for (uint8_t i = 0; i < length; ++i) {
+
status = f_string_dynamic_append_nulless(source, destination[i]);
if (F_status_is_error(status)) return status;
} // for
F_false,
};
- for (uint8_t i = 0; i < 3; i++) {
+ for (uint8_t i = 0; i < 3; ++i) {
if (main->parameters[parameters_id[i]].result == f_console_result_found) {
fake_print_error_parameter_missing_value(*main, parameters_name[i]);
+
return F_status_set_error(F_parameter);
}
else if (main->parameters[parameters_id[i]].result == f_console_result_additional) {
if (main->parameters[parameters_id[i]].locations.used > 1) {
fake_print_error_parameter_too_many(*main, parameters_name[i]);
+
return F_status_set_error(F_parameter);
}
f_array_length_t j = 0;
f_array_length_t width_max = 0;
- for (j = 0; j < length; j++) {
+ for (j = 0; j < length; ++j) {
+
width_max = length - j;
status = f_utf_is_word_dash_plus(arguments.argv[location] + j, width_max, F_false);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "macro_f_string_dynamic_t_resize", F_true);
+
return status;
}
if (main->parameters[fake_parameter_define].result == f_console_result_found) {
fake_print_error_parameter_missing_value(*main, fake_long_define);
+
return F_status_set_error(F_parameter);
}
&main->path_work,
};
- for (uint8_t i = 0; i < 4; i++) {
+ for (uint8_t i = 0; i < 4; ++i) {
if (main->parameters[parameters_id[i]].result == f_console_result_found) {
fake_print_error_parameter_missing_value(*main, parameters_name[i]);
f_array_length_t j = 0;
f_array_length_t width_max = 0;
- for (; i < main->define.used; i++) {
+ for (; i < main->define.used; ++i) {
- for (j = 0; j < main->define.array[i].used; j++) {
+ for (j = 0; j < main->define.array[i].used; ++j) {
width_max = main->define.array[i].used - j;
f_array_length_t j = 0;
f_array_length_t width_max = 0;
- for (; i < main->mode.used; i++) {
+ for (; i < main->mode.used; ++i) {
- for (j = 0; j < main->mode.array[i].used; j++) {
+ for (j = 0; j < main->mode.array[i].used; ++j) {
width_max = main->mode.array[i].used - j;
struct stat directory_stat;
f_status_t status = F_none;
- for (uint8_t i = 0; i < 3; i++) {
+ for (uint8_t i = 0; i < 3; ++i) {
if (fake_signal_received(main)) {
return F_status_set_error(F_signal);
#ifndef _di_fake_make_get_id_group_
f_status_t fake_make_get_id_group(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, gid_t *id) {
+
const f_string_range_t range = macro_f_string_range_t_initialize(buffer.used);
f_number_unsigned_t number = 0;
if (F_status_is_error(status)) {
fll_error_print(error, F_status_set_fine(status), "f_account_id_group_by_name", F_true);
+
return F_status_set_error(status);
}
else if (status == F_exist_not) {
#ifndef _di_fake_make_get_id_mode_
f_status_t fake_make_get_id_mode(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) {
+
if (!buffer.used) {
fll_error_print(error, F_parameter, "fake_make_get_id_mode", F_true);
+
return F_status_set_error(F_parameter);
}
#ifndef _di_fake_make_get_id_owner_
f_status_t fake_make_get_id_owner(const fake_main_t main, const fll_error_print_t error, const f_string_static_t buffer, uid_t *id) {
+
const f_string_range_t range = macro_f_string_range_t_initialize(buffer.used);
f_number_unsigned_t number = 0;
if (F_status_is_error(status)) {
fll_error_print(error, status, "f_account_id_user_by_name", F_true);
+
return F_status_set_error(status);
}
else if (status == F_exist_not) {
#ifndef _di_fake_make_load_fakefile_
void fake_make_load_fakefile(const fake_main_t main, fake_make_data_t *data_make, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
if (fake_signal_received(main)) {
f_string_range_t content_range = f_string_range_t_initialize;
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
- for (f_array_length_t i = 0; i < list_objects.used; i++) {
+ for (f_array_length_t i = 0; i < list_objects.used; ++i) {
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
break;
}
- data_make->fakefile.used++;
+ ++data_make->fakefile.used;
} // for
macro_f_fss_delimits_t_delete_simple(delimits);
bool unmatched_fail = F_true;
bool unmatched_load = F_true;
- for (f_array_length_t i = 0; i < settings.objects.used; i++) {
+ for (f_array_length_t i = 0; i < settings.objects.used; ++i) {
if (fl_string_dynamic_partial_compare_string(fake_make_setting_compiler, data_make->buffer, fake_make_setting_compiler_length, settings.objects.array[i]) == F_equal_to) {
if (range_compiler) {
f_array_length_t j = 0;
f_array_length_t k = 0;
- for (; j < settings.contents.array[i].used; j++) {
+ for (; j < settings.contents.array[i].used; ++j) {
*status = f_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &name_define);
}
if (fake_make_operate_validate_define_name(name_define) == F_true) {
- for (k = 0; k < data_make->setting_build.environment.used; k++) {
+ for (k = 0; k < data_make->setting_build.environment.used; ++k) {
if (fl_string_dynamic_compare(name_define, data_make->setting_build.environment.array[k]) == F_equal_to) {
break;
}
}
// Include the terminating NULL when copying.
- name_define.used++;
+ ++name_define.used;
*status = f_string_dynamic_append(name_define, &data_make->setting_build.environment.array[data_make->setting_build.environment.used]);
// each define replaces the previous define.
data_make->setting_make.parameter.array[0].value.array[0].used = 0;
- for (f_array_length_t j = 1; j < settings.contents.array[i].used; j++) {
+ for (f_array_length_t j = 1; j < settings.contents.array[i].used; ++j) {
function_name = "f_string_dynamic_partial_append_nulless";
*status = f_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &data_make->setting_make.parameter.array[0].value.array[0]);
if (F_status_is_error(*status)) {
macro_f_fss_set_t_delete_simple(settings);
+
return;
}
f_status_t status_validate = F_none;
f_string_dynamic_t combined = f_string_dynamic_t_initialize;
- for (f_array_length_t i = 0; i < define.used; i++) {
+ for (f_array_length_t i = 0; i < define.used; ++i) {
status_validate = fake_make_operate_validate_define_name(define.array[i].name);
if (status_validate) {
combined.used = 0;
- for (f_array_length_t j = 0; j < define.array[i].value.used; j++) {
+ for (f_array_length_t j = 0; j < define.array[i].value.used; ++j) {
*status = f_string_dynamic_mash(f_string_space_s, 1, define.array[i].value.array[j], &combined);
#ifndef _di_fake_make_load_parameters_
void fake_make_load_parameters(const fake_main_t main, fake_make_data_t *data_make, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_signal);
+
return;
}
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true);
+
return;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_append", F_true);
+
return;
}
else {
- data_make->parameter.color.used++;
+ ++data_make->parameter.color.used;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true);
+
return;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_append", F_true);
+
return;
}
else {
uint8_t i = 0;
f_array_length_t j = 0;
- for (; i < 2; i ++) {
+ for (; i < 2; ++i) {
- for (j = 0; j < source[i]->used; j++) {
+ for (j = 0; j < source[i]->used; ++j) {
if (destination[i]->used >= destination[i]->size) {
*status = f_string_dynamics_increase_by(f_memory_default_allocation_small, destination[i]);
return;
}
else {
- destination[i]->used++;
+ ++destination[i]->used;
}
if (destination[i]->used >= destination[i]->size) {
return;
}
else {
- destination[i]->used++;
+ ++destination[i]->used;
}
} // for
} // for
&data_make->parameter.settings,
};
- for (uint8_t i = 0; i < 7; i ++) {
+ for (uint8_t i = 0; i < 7; ++i) {
if (destination[i]->used >= destination[i]->size) {
*status = f_string_dynamics_increase_by(f_memory_default_allocation_small, destination[i]);
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true);
+
return;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_append", F_true);
+
return;
}
else {
- destination[i]->used++;
+ ++destination[i]->used;
}
if (destination[i]->used >= destination[i]->size) {
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true);
+
return;
}
}
if (F_status_is_error(*status)) {
fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
+
return;
}
else {
- destination[i]->used++;
+ ++destination[i]->used;
}
} // for
}
if (F_status_is_error(*status) || *status == F_string_too_large) {
fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamics_increase_by", F_true);
+
return;
}
}
&data_make->parameter.work,
};
- for (; i < content.used; i++) {
+ for (; i < content.used; ++i) {
if (content.array[i].start > content.array[i].stop) {
continue;
}
}
- for (j = 0, previous = iki_variable.array[0].start; j < iki_variable.used; j++) {
+ for (j = 0, previous = iki_variable.array[0].start; j < iki_variable.used; ++j) {
parameter_is = F_false;
define_is = F_false;
unmatched = F_false;
}
else {
- for (k = 0; k < 11; k++) {
+ for (k = 0; k < 11; ++k) {
if (fl_string_dynamic_partial_compare_string(reserved_name[k], data_make->buffer, reserved_length[k], iki_content.array[j]) == F_equal_to) {
if (arguments->used >= arguments->size) {
}
}
- for (l = 0; l < reserved_value[k]->used; l++) {
+ for (l = 0; l < reserved_value[k]->used; ++l) {
if (l > 0) {
*status = f_string_append(f_string_space_s, 1, &arguments->array[arguments->used]);
if (F_status_is_error_not(*status)) {
unmatched = F_false;
- arguments->used++;
+ ++arguments->used;
}
else {
break;
}
if (unmatched && parameter->used) {
- for (k = 0; k < parameter->used; k++) {
+ for (k = 0; k < parameter->used; ++k) {
// check against iki variable list.
*status = fl_string_dynamic_partial_compare_dynamic(parameter->array[k].name, data_make->buffer, iki_content.array[j]);
if (parameter->array[k].value.used) {
if (quotes.array[i]) {
- for (l = 0; l < parameter->array[k].value.used; l++) {
+ for (l = 0; l < parameter->array[k].value.used; ++l) {
if (l > 0) {
*status = f_string_append(f_string_space_s, 1, &arguments->array[arguments->used]);
}
}
- for (l = 0; l < parameter->array[k].value.used; l++) {
+ for (l = 0; l < parameter->array[k].value.used; ++l) {
*status = f_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]);
break;
}
- arguments->used++;
+ ++arguments->used;
} // for
}
}
break;
}
- arguments->used++;
+ ++arguments->used;
}
macro_f_iki_variable_t_delete_simple(iki_variable);
#ifndef _di_fake_make_operate_expand_build_
f_status_t fake_make_operate_expand_build(const fake_main_t main, const f_fss_quote_t quoted, const f_string_range_t range_name, fake_make_data_t *data_make, f_string_dynamics_t *arguments) {
+
f_status_t status = F_none;
f_string_dynamic_t value = f_string_dynamic_t_initialize;
data_make->setting_build.version_target,
};
- for (uint8_t i = 0; i < 2; i++) {
+ for (uint8_t i = 0; i < 2; ++i) {
status = fl_string_dynamic_partial_compare_string(uint8_name[i], data_make->buffer, uint8_length[i], range_name);
data_make->setting_build.search_static,
};
- for (uint8_t i = 0; i < 7; i++) {
+ for (uint8_t i = 0; i < 7; ++i) {
status = fl_string_dynamic_partial_compare_string(bool_name[i], data_make->buffer, bool_length[i], range_name);
data_make->setting_build.version_minor,
};
- for (uint8_t i = 0; i < 17; i++) {
+ for (uint8_t i = 0; i < 17; ++i) {
status = fl_string_dynamic_partial_compare_string(dynamic_name[i], data_make->buffer, dynamic_length[i], range_name);
data_make->setting_build.modes_default,
};
- for (uint8_t i = 0; i < 17; i++) {
+ for (uint8_t i = 0; i < 17; ++i) {
status = fl_string_dynamic_partial_compare_string(dynamics_name[i], data_make->buffer, dynamics_length[i], range_name);
if (status == F_equal_to) {
unmatched = F_false;
- for (f_array_length_t j = 0; j < dynamics_value[i].used; j++) {
+ for (f_array_length_t j = 0; j < dynamics_value[i].used; ++j) {
status = f_string_dynamic_mash(f_string_space_s, 1, dynamics_value[i].array[j], &value);
if (F_status_is_error(status)) {
macro_f_string_dynamic_t_delete_simple(value);
+
return status;
}
if (unmatched) {
macro_f_string_dynamic_t_delete_simple(value);
+
return F_false;
}
status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
if (F_status_is_error_not(status)) {
- arguments->used++;
+ ++arguments->used;
}
}
}
#ifndef _di_fake_make_operate_expand_environment_
f_status_t fake_make_operate_expand_environment(const fake_main_t main, const f_fss_quote_t quoted, const f_string_range_t range_name, fake_make_data_t *data_make, f_string_dynamics_t *arguments) {
+
f_status_t status = F_none;
f_string_dynamic_t value = f_string_dynamic_t_initialize;
if (F_status_is_error(status)) {
macro_f_string_dynamic_t_delete_simple(value);
+
return status;
}
else if (status == F_exist_not) {
macro_f_string_dynamic_t_delete_simple(value);
+
return F_false;
}
#ifndef _di_fake_make_operate_section_
int fake_make_operate_section(const f_array_length_t id_section, fake_main_t *main, fake_make_data_t *data_make, f_array_lengths_t *section_stack, f_status_t *status) {
+
if (F_status_is_error(*status) || *status == F_child) return main->child;
if (fake_signal_received(*main)) {
}
}
- section_stack->array[section_stack->used] = id_section;
- section_stack->used++;
+ section_stack->array[section_stack->used++] = id_section;
const f_fss_named_t *section = &data_make->fakefile.array[id_section];
}
if (!section->objects.used) {
- section_stack->used--;
+ --section_stack->used;
+
return 0;
}
memset(operations, 0, sizeof(uint8_t) * section->objects.used);
memset(arguments, 0, sizeof(f_string_dynamics_t) * section->objects.used);
- for (i = 0; i < section->objects.used; i++, *status = F_none) {
+ for (i = 0; i < section->objects.used; ++i, *status = F_none) {
+
operation = 0;
operation_name = 0;
break;
}
- for (j = 0; j < fake_make_operation_total; j++) {
+ for (j = 0; j < fake_make_operation_total; ++j) {
if (fl_string_dynamic_partial_compare(operations_name[j], data_make->buffer, operations_range[j], section->objects.array[i]) == F_equal_to) {
operation = operations_type[j];
} // for
if (*status == F_status_set_error(F_signal)) {
- for (i = 0; i < section->objects.used; i++) {
+ for (i = 0; i < section->objects.used; ++i) {
macro_f_string_dynamics_t_delete_simple(arguments[i]);
} // for
*status = F_status_set_error(F_failure);
}
- for (i = 0; i < section->objects.used; i++) {
+ for (i = 0; i < section->objects.used; ++i) {
macro_f_string_dynamics_t_delete_simple(arguments[i]);
} // for
- section_stack->used--;
+ --section_stack->used;
return 0;
}
#ifndef _di_fake_make_operate_process_
int fake_make_operate_process(const f_string_range_t section_name, const uint8_t operation, const f_string_static_t operation_name, const f_string_dynamics_t arguments, const bool success, uint8_t *operation_if, fake_main_t *main, fake_make_data_t *data_make, f_array_lengths_t *section_stack, f_status_t *status) {
+
if (*status == F_child) return main->child;
if (operation == fake_make_operation_type_index) {
if (F_status_set_fine(*status) == F_signal) {
*status = F_status_set_error(F_signal);
+
return 0;
}
if (F_status_set_fine(*status) == F_signal) {
*status = F_status_set_error(F_signal);
+
return 0;
}
if (F_status_is_error(status_file)) {
fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[1].string, "identify", fll_error_file_type_directory);
+
*status = F_status_set_error(F_failure);
return 0;
}
}
}
- for (f_array_length_t i = 0; i < total; i++) {
+ for (f_array_length_t i = 0; i < total; ++i) {
destination_length = arguments.array[total].used;
}
}
- for (f_array_length_t i = 0; i < total; i++) {
+ for (f_array_length_t i = 0; i < total; ++i) {
+
destination_length = arguments.array[total].used;
if (existing) {
const int recursion_max = operation == fake_make_operation_type_delete ? 0 : f_directory_descriptors_max;
struct stat file_stat;
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
+
memset(&file_stat, 0, sizeof(struct stat));
*status = f_file_stat(arguments.array[i].string, F_false, &file_stat);
f_status_t status_file = F_none;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
status_file = fake_make_assure_inside_project(*main, arguments.array[i], data_make);
f_status_t status_file = F_none;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
status_file = fake_make_assure_inside_project(*main, arguments.array[i], data_make);
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 2; i < arguments.used; i++, id_file = 0) {
+ for (f_array_length_t i = 2; i < arguments.used; ++i, id_file = 0) {
*status = f_file_group_read(arguments.array[i].string, &id_file);
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 3; i < arguments.used; i++, mode_file = 0) {
+ for (f_array_length_t i = 3; i < arguments.used; ++i, mode_file = 0) {
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 2; i < arguments.used; i++, id_file = 0) {
+ for (f_array_length_t i = 2; i < arguments.used; ++i, id_file = 0) {
*status = f_file_owner_read(arguments.array[i].string, &id_file);
}
if (*operation_if == fake_make_operation_if_type_if_is) {
+
// block = 0x1 (0000 0001) link = 0x10 (0001 0000)
// character = 0x2 (0000 0010) regular = 0x20 (0010 0000)
// directory = 0x4 (0000 0100) socket = 0x40 (0100 0000)
*status = F_none;
- for (; i < arguments.used; i++) {
+ for (; i < arguments.used; ++i) {
+
if (fl_string_dynamic_compare_string(fake_make_operation_argument_if_is_for, arguments.array[i], fake_make_operation_argument_if_is_for_length) == F_equal_to) {
- i++;
+ ++i;
break;
}
*operation_if = fake_make_operation_if_type_true_next;
- for (; i < arguments.used; i++, mode_file = 0) {
+ for (; i < arguments.used; ++i, mode_file = 0) {
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
if (*operation_if == fake_make_operation_if_type_if_exists) {
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
*status = f_file_exists(arguments.array[i].string);
if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment, arguments.array[1], fake_make_operation_argument_environment_length) == F_equal_to) {
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 2; i < arguments.used; i++) {
+ for (f_array_length_t i = 2; i < arguments.used; ++i) {
if (f_environment_exists(arguments.array[i].string) != F_true) {
*operation_if = fake_make_operation_if_type_false_next;
*operation_if = fake_make_operation_if_type_true_next;
- for (; i < arguments.used; i++, missed = F_true) {
+ for (; i < arguments.used; ++i, missed = F_true) {
- for (j = 0; j < data_make->setting_make.parameter.used; j++) {
+ for (j = 0; j < data_make->setting_make.parameter.used; ++j) {
if (fl_string_dynamic_compare(arguments.array[i], data_make->setting_make.parameter.array[j].name) == F_equal_to) {
missed = F_false;
if (*operation_if == fake_make_operation_if_type_if_equal) {
*operation_if = fake_make_operation_if_type_true_next;
- for (f_array_length_t i = 2; i < arguments.used; i++) {
+ for (f_array_length_t i = 2; i < arguments.used; ++i) {
if (fl_string_dynamic_compare(arguments.array[1], arguments.array[i]) == F_equal_to_not) {
*operation_if = fake_make_operation_if_type_false_next;
f_array_length_t i = 1;
f_array_length_t j = 0;
- for (; i < arguments.used; i++) {
+ for (; i < arguments.used; ++i) {
- for (j = i + 1; j < arguments.used; j++) {
+ for (j = i + 1; j < arguments.used; ++j) {
if (fl_string_dynamic_compare(arguments.array[i], arguments.array[j]) == F_equal_to) {
*operation_if = fake_make_operation_if_type_false_next;
}
if (*operation_if == fake_make_operation_if_type_if_greater || *operation_if == fake_make_operation_if_type_if_greater_equal || *operation_if == fake_make_operation_if_type_if_less || *operation_if == fake_make_operation_if_type_if_less_equal) {
+
f_status_t status_number = F_none;
f_string_range_t range = f_string_range_t_initialize;
}
if (F_status_is_error_not(status_number)) {
- for (i = 2; i < arguments.used; i++, status_number = F_none, number_left = number_right, is_negative_left = is_negative_right) {
+ for (i = 2; i < arguments.used; ++i, status_number = F_none, number_left = number_right, is_negative_left = is_negative_right) {
if (arguments.array[i].used) {
range.start = 0;
mode_t mode = 0;
mode_t mode_file = 0;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
mode = 0;
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
mode_t mode = 0;
mode_t mode_file = 0;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
mode = 0;
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
}
}
- for (f_array_length_t i = 0; i < total; i++) {
+ for (f_array_length_t i = 0; i < total; ++i) {
destination_length = arguments.array[total].used;
if (operation == fake_make_operation_type_operate) {
f_array_length_t id_section = 0;
- for (; id_section < data_make->fakefile.used; id_section++) {
+ for (; id_section < data_make->fakefile.used; ++id_section) {
if (fl_string_dynamic_partial_compare_string(arguments.array[0].string, data_make->buffer, arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) {
break;
f_status_t status_file = F_none;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
status_file = fake_make_assure_inside_project(*main, arguments.array[i], data_make);
f_status_t status_file = F_none;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
status_file = fake_make_assure_inside_project(*main, arguments.array[i], data_make);
}
if (operation == fake_make_operation_type_print) {
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
+
f_print_dynamic(main->output.stream, arguments.array[i]);
if (i + 1 < arguments.used) {
if (operation == fake_make_operation_type_run) {
*status = fake_make_operate_process_run(*main, arguments, F_false, data_make);
+
return 0;
}
if (operation == fake_make_operation_type_shell) {
*status = fake_make_operate_process_run(*main, arguments, F_true, data_make);
+
return 0;
}
if (F_status_set_fine(*status) == F_signal) {
*status = F_status_set_error(F_signal);
+
return 0;
}
if (F_status_set_fine(*status) == F_array_too_large) {
fake_print_message_section_operation_path_stack_max(*main, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", "path stack");
+
return 0;
}
else if (F_status_is_error(*status)) {
fll_error_print(data_make->error, F_status_set_fine(*status), "macro_f_string_dynamics_t_resize", F_true);
+
return 0;
}
}
// copy the entire real path, including the trailing NULL.
- data_make->path_cache.used++;
+ ++data_make->path_cache.used;
f_string_dynamic_append(data_make->path_cache, &data_make->path.stack.array[data_make->path.stack.used]);
if (F_status_is_error(*status)) {
fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+
return 0;
}
*status = fake_make_path_relative(*main, data_make->path.stack.array[data_make->path.stack.used], data_make);
if (F_status_is_error(*status)) {
+
fll_error_print(data_make->error, F_status_set_fine(*status), "fake_make_path_relative", F_true);
return 0;
}
fprintf(main->output.stream, "'.%c", f_string_eol_s[0]);
}
- data_make->path.stack.used++;
+ ++data_make->path.stack.used;
}
return 0;
if (F_status_is_error(*status)) {
fake_print_message_section_operation_path_stack_max(*main, data_make->error, F_status_set_fine(*status), "f_path_change", arguments.array[0].string);
+
return 0;
}
}
// clear stack, except for the project root.
- for (f_array_length_t i = 1; i < data_make->path.stack.used; i++) {
+ for (f_array_length_t i = 1; i < data_make->path.stack.used; ++i) {
macro_f_string_dynamic_t_delete_simple(data_make->path.stack.array[i]);
} // for
macro_f_mode_t_set_default_umask(mode, main->umask);
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_file, arguments.array[0], fake_make_operation_argument_file_length) == F_equal_to) {
*status = f_file_touch(arguments.array[i].string, mode.regular, F_false);
f_color_print_code(main->output.stream, *main->context.set.notable.after);
fprintf(main->output.stream, "'.%c", f_string_eol_s[0]);
}
-
} // for
}
f_status_t status = F_none;
// reset the environment.
- for (f_array_length_t i = 0; i < data_make->environment.used; i++) {
+ for (f_array_length_t i = 0; i < data_make->environment.used; ++i) {
+
data_make->environment.array[i].name.used = 0;
data_make->environment.array[i].value.used = 0;
} // for
if (main.error.verbosity == f_console_verbosity_verbose) {
fprintf(main.output.stream, "%s", program.string);
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
+
if (!arguments.array[i].used) continue;
fprintf(main.output.stream, " %s", arguments.array[i].string);
#ifndef _di_fake_make_operate_process_return_
void fake_make_operate_process_return(const fake_main_t main, const int return_code, fake_make_data_t *data_make, f_status_t *status) {
+
f_status_t status2 = F_none;
data_make->setting_make.parameter.array[0].value.array[0].used = 0;
#ifndef _di_fake_make_operate_process_run_
f_status_t fake_make_operate_process_run(const fake_main_t main, const f_string_statics_t arguments, const bool as_shell, fake_make_data_t *data_make) {
+
const f_string_static_t *program = &arguments.array[0];
f_status_t status = F_none;
return status;
}
- for (f_array_length_t i = 0; i < args.size; i++) {
+ for (f_array_length_t i = 0; i < args.size; ++i) {
status = f_string_dynamic_append(arguments.array[i + 1], &args.array[i]);
return status;
}
- args.used++;
+ ++args.used;
} // for
}
#ifndef _di_fake_make_operate_validate_
void fake_make_operate_validate(const fake_main_t main, const f_string_range_t section_name, const f_array_length_t operation, const f_string_static_t operation_name, const f_string_dynamics_t arguments, uint8_t *operation_if, fake_make_data_t *data_make, f_array_lengths_t *section_stack, f_status_t *status) {
+
if (F_status_is_error(*status)) return;
if (operation == fake_make_operation_type_index || operation == fake_make_operation_type_run || operation == fake_make_operation_type_shell) {
if (operation == fake_make_operation_type_clone) {
if (arguments.used > 1) {
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
*status = fake_make_assure_inside_project(main, arguments.array[i], data_make);
}
} // for
- for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
+ for (f_array_length_t i = 0; i < arguments.used - 1; ++i) {
if (f_file_exists(arguments.array[i].string) != F_true) {
if (main.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
if (operation == fake_make_operation_type_copy) {
if (arguments.used > 1) {
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
*status = fake_make_assure_inside_project(main, arguments.array[i], data_make);
}
} // for
- for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
+ for (f_array_length_t i = 0; i < arguments.used - 1; ++i) {
if (f_file_exists(arguments.array[i].string) != F_true) {
if (main.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
if (operation == fake_make_operation_type_delete || operation == fake_make_operation_type_deletes) {
if (arguments.used) {
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
*status = fake_make_assure_inside_project(main, arguments.array[i], data_make);
if (arguments.used > 1) {
f_status_t status_file = F_none;
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
status_file = f_file_is(arguments.array[i].string, f_file_type_regular, F_false);
f_array_length_t i = 0;
- for (; i < 14; i++) {
+ for (; i < 14; ++i) {
if (fl_string_dynamic_compare_string(if_type_strings[i], arguments.array[0], if_type_lengths[i]) == F_equal_to) {
*operation_if = if_type_codes[i];
bool is_negative = F_false;
// @fixme there needs to handle converting numbers with decimals (like 1.01), perhaps operate on them as strings or provide a special processor.
- for (i = 1; i < arguments.used; i++, status_number = F_none) {
+ for (i = 1; i < arguments.used; ++i, status_number = F_none) {
if (arguments.array[i].used) {
range.start = 0;
if (operation == fake_make_operation_type_move) {
if (arguments.used > 1) {
- for (f_array_length_t i = 0; i < arguments.used; i++) {
+ for (f_array_length_t i = 0; i < arguments.used; ++i) {
*status = fake_make_assure_inside_project(main, arguments.array[i], data_make);
}
} // for
- for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
+ for (f_array_length_t i = 0; i < arguments.used - 1; ++i) {
if (f_file_exists(arguments.array[i].string) != F_true) {
if (main.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
else if (arguments.used == 1) {
f_array_length_t id_section = 0;
- for (; id_section < data_make->fakefile.used; id_section++) {
+ for (; id_section < data_make->fakefile.used; ++id_section) {
if (fl_string_dynamic_partial_compare_string(arguments.array[0].string, data_make->buffer, arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) {
break;
f_color_print(data_make->error.to.stream, data_make->error.context, "' was found.%c", f_string_eol_s[0]);
}
else {
- for (f_array_length_t i = 0; i < section_stack->used; i++) {
+ for (f_array_length_t i = 0; i < section_stack->used; ++i) {
if (section_stack->array[i] == id_section) {
fprintf(data_make->error.to.stream, "%c", f_string_eol_s[0]);
}
}
- for (f_array_length_t i = 1; i < arguments.used; i++) {
+ for (f_array_length_t i = 1; i < arguments.used; ++i) {
*status = fake_make_assure_inside_project(main, arguments.array[i], data_make);
#ifndef _di_fake_make_operate_validate_define_name_
f_status_t fake_make_operate_validate_define_name(const f_string_static_t name) {
+
if (!name.used) return F_none;
if (!(isalpha(name.string[0]) || name.string[0] == '_')) {
return F_false;
}
- for (f_array_length_t i = 0; i < name.used; i++) {
+ for (f_array_length_t i = 0; i < name.used; ++i) {
if (!(isalnum(name.string[i]) || name.string[i] == '_')) {
return F_false;
#ifndef _di_fake_make_path_relative_
f_status_t fake_make_path_relative(const fake_main_t main, const f_string_static_t path, fake_make_data_t *data_make) {
+
data_make->path_cache.used = 0;
if (!path.used || path.used == data_make->path.stack.array[0].used) {
#ifndef _di_fake_print_error_parameter_missing_value_
void fake_print_error_parameter_missing_value(const fake_main_t main, const f_string_t parameter) {
+
if (main.error.verbosity == f_console_verbosity_quiet) return;
fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
#ifndef _di_fake_print_error_parameter_too_many_
void fake_print_error_parameter_too_many(const fake_main_t main, const f_string_t parameter) {
+
if (main.error.verbosity == f_console_verbosity_quiet) return;
fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
#ifndef _di_fake_print_message_section_operation_failed_
void fake_print_message_section_operation_failed(const fake_main_t main, const fll_error_print_t error, 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 || !error.to.stream) return;
f_array_length_t line = 1;
#ifndef _di_fake_print_message_section_operation_path_outside_
void fake_print_message_section_operation_path_outside(const fake_main_t main, const fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) {
+
if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
if (F_status_set_fine(status) == F_false) {
#ifndef _di_fake_print_message_section_operation_path_stack_max_
void fake_print_message_section_operation_path_stack_max(const fake_main_t main, fll_error_print_t error, const f_status_t status, const f_string_t function, const f_string_t path) {
+
if (main.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
if (status == F_array_too_large) {
#ifndef _di_fake_print_message_section_operation_stack_max_
void fake_print_message_section_operation_stack_max(const fake_main_t main, fll_error_print_t error, 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 || !error.to.stream) return;
f_array_length_t line = 1;
#ifndef _di_fake_print_message_section_operation_unknown_
void fake_print_message_section_operation_unknown(const fake_main_t main, const fll_error_print_t error, 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 || !error.to.stream) return;
f_array_length_t line = 1;
#ifndef _di_fake_print_warning_settings_content_empty_
void fake_print_warning_settings_content_empty(const fake_main_t main, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) {
+
if (main.error.verbosity == f_console_verbosity_quiet) return;
fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
#ifndef _di_fake_print_warning_settings_content_invalid_
void fake_print_warning_settings_content_invalid(const fake_main_t main, const f_string_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_t settings_name) {
+
if (main.error.verbosity == f_console_verbosity_quiet) return;
fprintf(main.output.stream, "%c", f_string_eol_s[0]);
#ifndef _di_fake_print_warning_settings_content_multiple_
void fake_print_warning_settings_content_multiple(const fake_main_t main, const f_string_t path_file, const f_string_t name_object) {
+
if (main.error.verbosity != f_console_verbosity_verbose) return;
fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
#ifndef _di_fake_print_warning_settings_object_multiple_
void fake_print_warning_settings_object_multiple(const fake_main_t main, const f_string_t path_file, const f_string_t label, const f_string_t name_object) {
+
if (main.error.verbosity != f_console_verbosity_verbose) return;
fprintf(main.error.to.stream, "%c", f_string_eol_s[0]);
#ifndef _di_fake_skeleton_operate_directory_create_
f_status_t fake_skeleton_operate_directory_create(const fake_main_t main, const f_string_dynamic_t path) {
+
f_status_t status = F_none;
if (!path.used) return F_none;
#ifndef _di_fake_skeleton_operate_file_create_
f_status_t fake_skeleton_operate_file_create(const fake_main_t main, const f_string_dynamic_t path, const bool executable, const f_string_static_t content) {
+
f_status_t status = F_none;
if (!path.used) return F_none;