Make the use of `f_console_parameters_t` as a pointer for consistency purposes.
Some programs did this whereas other programs repeatedly called `main->program.parameters`.
This should no longer be the case.
The documentation comments should be referencing `fll_program_parameter_process_context_standard()` and now do.
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->setting.state.step_small = byte_dump_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = byte_dump_allocation_small_d;
}
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_help_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_version_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_copyright_d;
return;
main->setting.flag &= ~byte_dump_main_flag_pipe_d;
}
- if (main->program.parameters.array[byte_dump_parameter_width_e].result & f_console_result_value_e) {
- index = main->program.parameters.array[byte_dump_parameter_width_e].values.array[main->program.parameters.array[byte_dump_parameter_width_e].values.used - 1];
+ if (parameters->array[byte_dump_parameter_width_e].result & f_console_result_value_e) {
+ index = parameters->array[byte_dump_parameter_width_e].values.array[parameters->array[byte_dump_parameter_width_e].values.used - 1];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &number);
// Negative numbers are not supported.
if (main->setting.state.status == F_number_negative) {
}
if (F_status_is_error(main->setting.state.status) || number < 0x1 || number >= 0xfb) {
- byte_dump_print_error_parameter_range_out(&main->program.error, byte_dump_long_width_s, 1, 250, main->program.parameters.arguments.array[index]);
+ byte_dump_print_error_parameter_range_out(&main->program.error, byte_dump_long_width_s, 1, 250, parameters->arguments.array[index]);
return;
}
main->setting.width = (uint8_t) number;
}
- else if (main->program.parameters.array[byte_dump_parameter_width_e].result & f_console_result_found_e) {
+ else if (parameters->array[byte_dump_parameter_width_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, byte_dump_long_width_s);
for (uint8_t i = 0; i < 2; ++i) {
- if (main->program.parameters.array[indexs[i]].result & f_console_result_value_e) {
- index = main->program.parameters.array[indexs[i]].values.array[main->program.parameters.array[indexs[i]].values.used - 1];
+ if (parameters->array[indexs[i]].result & f_console_result_value_e) {
+ index = parameters->array[indexs[i]].values.array[parameters->array[indexs[i]].values.used - 1];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &number);
// Negative numbers are not supported.
if (main->setting.state.status == F_number_negative) {
}
if (F_status_is_error(main->setting.state.status)) {
- byte_dump_print_error_parameter_range_out(&main->program.error, names[i], 0, F_number_t_size_unsigned_d, main->program.parameters.arguments.array[index]);
+ byte_dump_print_error_parameter_range_out(&main->program.error, names[i], 0, F_number_t_size_unsigned_d, parameters->arguments.array[index]);
return;
}
*values[i] = number;
main->setting.flag |= flags[i];
}
- else if (main->program.parameters.array[indexs[i]].result & f_console_result_found_e) {
+ else if (parameters->array[indexs[i]].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, names[i]);
}
}
- if (main->program.parameters.array[byte_dump_parameter_text_e].result & f_console_result_found_e) {
+ if (parameters->array[byte_dump_parameter_text_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_text_d;
}
else {
main->setting.flag &= ~byte_dump_main_flag_text_d;
}
- if (main->program.parameters.array[byte_dump_parameter_unicode_e].result & f_console_result_found_e) {
+ if (parameters->array[byte_dump_parameter_unicode_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_unicode_d;
}
else {
main->setting.flag &= ~byte_dump_main_flag_unicode_d;
}
- if (main->program.parameters.array[byte_dump_parameter_placeholder_e].result & f_console_result_found_e) {
+ if (parameters->array[byte_dump_parameter_placeholder_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_placeholder_d;
}
else {
main->setting.flag &= ~byte_dump_main_flag_placeholder_d;
}
- if (main->program.parameters.array[byte_dump_parameter_classic_e].result & f_console_result_found_e) {
+ if (parameters->array[byte_dump_parameter_classic_e].result & f_console_result_found_e) {
main->setting.flag |= byte_dump_main_flag_classic_d;
}
else {
main->setting.flag &= ~byte_dump_main_flag_classic_d;
}
- if (main->program.parameters.remaining.used) {
- main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size);
+ if (parameters->remaining.used) {
+ main->setting.state.status = f_memory_array_increase_by(parameters->remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size);
if (F_status_is_error(main->setting.state.status)) {
byte_dump_print_error(&main->program.error, macro_byte_dump_f(f_memory_array_increase_by));
f_status_t status_files = F_okay;
- for (index = 0; index < main->program.parameters.remaining.used; ++index) {
+ for (index = 0; index < parameters->remaining.used; ++index) {
if (byte_dump_signal_check(main)) return;
- number = main->program.parameters.remaining.array[index];
+ number = parameters->remaining.array[index];
- if (!main->program.parameters.arguments.array[number].used) continue;
+ if (!parameters->arguments.array[number].used) continue;
// Statically allocate the inner strings.
- main->setting.files.array[main->setting.files.used].string = main->program.parameters.arguments.array[number].string;
- main->setting.files.array[main->setting.files.used].used = main->program.parameters.arguments.array[number].used;
+ main->setting.files.array[main->setting.files.used].string = parameters->arguments.array[number].string;
+ main->setting.files.array[main->setting.files.used].used = parameters->arguments.array[number].used;
main->setting.files.array[main->setting.files.used++].size = 0;
- main->setting.state.status = f_file_exists(main->program.parameters.arguments.array[number], F_true);
+ main->setting.state.status = f_file_exists(parameters->arguments.array[number], F_true);
if (main->setting.state.status == F_false) {
main->setting.state.status = F_status_set_error(F_file_found_not);
status_files = main->setting.state.status;
}
- byte_dump_print_error_file(&main->program.error, macro_byte_dump_f(f_file_exists), main->program.parameters.arguments.array[number], f_file_operation_find_s, fll_error_file_type_file_e);
+ byte_dump_print_error_file(&main->program.error, macro_byte_dump_f(f_file_exists), parameters->arguments.array[number], f_file_operation_find_s, fll_error_file_type_file_e);
}
} // for
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->setting.state.step_small = example_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = example_allocation_small_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= example_main_flag_help_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= example_main_flag_version_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= example_main_flag_copyright_d;
return;
* F_okay on success.
*
* Errors (with error bit) from: f_console_parameter_process().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
*
* @see f_console_parameter_process()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
*/
#ifndef _di_example_setting_load_
extern void example_setting_load(const f_console_arguments_t arguments, example_main_t * const main);
* Errors (with error bit) from: f_path_directory_cleanup().
* Errors (with error bit) from: f_utf_is_word_dash_plus().
* Errors (with error bit) from: fll_program_parameter_additional_rip().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
*
* @see f_console_parameter_process()
* @see f_path_directory_cleanup()
* @see f_utf_is_word_dash_plus()
* @see fll_program_parameter_additional_rip()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
* @see fll_program_parameter_process_verbosity_standard()
*/
#ifndef _di_fake_setting_load_
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->setting.state.step_small = firewall_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = firewall_allocation_small_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= firewall_main_flag_help_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= firewall_main_flag_version_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= firewall_main_flag_copyright_d;
return;
f_number_unsigned_t index = 0;
- if (main->program.parameters.array[firewall_parameter_operation_start_e].result & f_console_result_found_e) {
+ if (parameters->array[firewall_parameter_operation_start_e].result & f_console_result_found_e) {
main->setting.flag &= ~firewall_main_flag_operation_d;
main->setting.flag |= firewall_main_flag_operation_start_d;
- index = main->program.parameters.array[firewall_parameter_operation_start_e].location;
+ index = parameters->array[firewall_parameter_operation_start_e].location;
}
- if (main->program.parameters.array[firewall_parameter_operation_stop_e].result & f_console_result_found_e) {
- if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_stop_e].location > index) {
+ if (parameters->array[firewall_parameter_operation_stop_e].result & f_console_result_found_e) {
+ if (!(main->setting.flag & firewall_main_flag_operation_d) || parameters->array[firewall_parameter_operation_stop_e].location > index) {
main->setting.flag &= ~firewall_main_flag_operation_d;
main->setting.flag |= firewall_main_flag_operation_stop_d;
- index = main->program.parameters.array[firewall_parameter_operation_stop_e].location;
+ index = parameters->array[firewall_parameter_operation_stop_e].location;
}
}
- if (main->program.parameters.array[firewall_parameter_operation_restart_e].result & f_console_result_found_e) {
- if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_restart_e].location > index) {
+ if (parameters->array[firewall_parameter_operation_restart_e].result & f_console_result_found_e) {
+ if (!(main->setting.flag & firewall_main_flag_operation_d) || parameters->array[firewall_parameter_operation_restart_e].location > index) {
main->setting.flag &= ~firewall_main_flag_operation_d;
main->setting.flag |= firewall_main_flag_operation_restart_d;
- index = main->program.parameters.array[firewall_parameter_operation_restart_e].location;
+ index = parameters->array[firewall_parameter_operation_restart_e].location;
}
}
- if (main->program.parameters.array[firewall_parameter_operation_lock_e].result & f_console_result_found_e) {
- if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_lock_e].location > index) {
+ if (parameters->array[firewall_parameter_operation_lock_e].result & f_console_result_found_e) {
+ if (!(main->setting.flag & firewall_main_flag_operation_d) || parameters->array[firewall_parameter_operation_lock_e].location > index) {
main->setting.flag &= ~firewall_main_flag_operation_d;
main->setting.flag |= firewall_main_flag_operation_lock_d;
- index = main->program.parameters.array[firewall_parameter_operation_lock_e].location;
+ index = parameters->array[firewall_parameter_operation_lock_e].location;
}
}
- if (main->program.parameters.array[firewall_parameter_operation_show_e].result & f_console_result_found_e) {
- if (!(main->setting.flag & firewall_main_flag_operation_d) || main->program.parameters.array[firewall_parameter_operation_show_e].location > index) {
+ if (parameters->array[firewall_parameter_operation_show_e].result & f_console_result_found_e) {
+ if (!(main->setting.flag & firewall_main_flag_operation_d) || parameters->array[firewall_parameter_operation_show_e].location > index) {
main->setting.flag &= ~firewall_main_flag_operation_d;
main->setting.flag |= firewall_main_flag_operation_show_d;
}
}
- if (main->program.parameters.array[firewall_parameter_4_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[firewall_parameter_6_e].result & f_console_result_found_e) {
+ if (parameters->array[firewall_parameter_4_e].result & f_console_result_found_e) {
+ if (parameters->array[firewall_parameter_6_e].result & f_console_result_found_e) {
main->setting.flag |= firewall_main_flag_ipv46_d;
}
else {
main->setting.flag |= firewall_main_flag_ipv4_d;
}
}
- else if (main->program.parameters.array[firewall_parameter_6_e].result & f_console_result_found_e) {
+ else if (parameters->array[firewall_parameter_6_e].result & f_console_result_found_e) {
main->setting.flag &= ~firewall_main_flag_ipv4_d;
main->setting.flag |= firewall_main_flag_ipv6_d;
}
}
if (main->setting.flag & firewall_main_flag_operation_show_d) {
- if (main->program.parameters.remaining.used) {
+ if (parameters->remaining.used) {
main->setting.flag &= ~firewall_main_flag_operation_show_filter_nat_mangle_d;
- for (f_number_unsigned_t i = 0; i < main->program.parameters.remaining.used; ++i) {
+ for (f_number_unsigned_t i = 0; i < parameters->remaining.used; ++i) {
if (firewall_signal_check(main)) return;
- index = main->program.parameters.remaining.array[i];
+ index = parameters->remaining.array[i];
- if (f_compare_dynamic(firewall_show_nat_s, main->program.parameters.arguments.array[index]) == F_equal_to) {
+ if (f_compare_dynamic(firewall_show_nat_s, parameters->arguments.array[index]) == F_equal_to) {
main->setting.flag |= firewall_main_flag_operation_show_nat_d;
}
- else if (f_compare_dynamic(firewall_show_mangle_s, main->program.parameters.arguments.array[index]) == F_equal_to) {
+ else if (f_compare_dynamic(firewall_show_mangle_s, parameters->arguments.array[index]) == F_equal_to) {
main->setting.flag |= firewall_main_flag_operation_show_mangle_d;
}
- else if (f_compare_dynamic(firewall_show_filter_s, main->program.parameters.arguments.array[index]) == F_equal_to) {
+ else if (f_compare_dynamic(firewall_show_filter_s, parameters->arguments.array[index]) == F_equal_to) {
main->setting.flag |= firewall_main_flag_operation_show_filter_d;
}
else {
- firewall_print_warning_show_option_unknown(&main->program.warning, main->program.parameters.arguments.array[index]);
+ firewall_print_warning_show_option_unknown(&main->program.warning, parameters->arguments.array[index]);
}
} // for
}
* F_okay on success.
*
* Errors (with error bit) from: f_console_parameter_process().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
*
* @see f_console_parameter_process()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
*/
#ifndef _di_firewall_setting_load_
extern void firewall_setting_load(const f_console_arguments_t arguments, firewall_main_t * const main);
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->setting.state.step_small = fss_identify_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = fss_identify_allocation_small_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= fss_identify_main_flag_help_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= fss_identify_main_flag_version_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= fss_identify_main_flag_copyright_d;
return;
f_number_unsigned_t index = 0;
- if (main->program.parameters.array[fss_identify_parameter_content_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_identify_parameter_content_e].result & f_console_result_found_e) {
main->setting.flag |= fss_identify_main_flag_content_d;
}
else {
main->setting.flag &= ~fss_identify_main_flag_content_d;
}
- if (main->program.parameters.array[fss_identify_parameter_object_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_identify_parameter_object_e].result & f_console_result_found_e) {
main->setting.flag |= fss_identify_main_flag_object_d;
}
else {
main->setting.flag &= ~fss_identify_main_flag_object_d;
}
- if (main->program.parameters.array[fss_identify_parameter_total_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_identify_parameter_total_e].result & f_console_result_found_e) {
main->setting.flag |= fss_identify_main_flag_total_d;
}
else {
main->setting.flag &= ~fss_identify_main_flag_total_d;
}
- if (main->program.parameters.array[fss_identify_parameter_line_e].result & f_console_result_value_e) {
- index = main->program.parameters.array[fss_identify_parameter_line_e].values.array[main->program.parameters.array[fss_identify_parameter_line_e].values.used - 1];
+ if (parameters->array[fss_identify_parameter_line_e].result & f_console_result_value_e) {
+ index = parameters->array[fss_identify_parameter_line_e].values.array[parameters->array[fss_identify_parameter_line_e].values.used - 1];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &main->setting.line);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &main->setting.line);
// Negative numbers are not supported.
if (main->setting.state.status == F_number_negative) {
}
if (F_status_is_error(main->setting.state.status)) {
- fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_identify_long_line_s, main->program.parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_identify_long_line_s, parameters->arguments.array[index]);
return;
}
main->setting.flag |= fss_identify_main_flag_line_d;
}
- else if (main->program.parameters.array[fss_identify_parameter_line_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_identify_parameter_line_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_identify_long_line_s);
main->setting.flag &= ~fss_identify_main_flag_line_d;
}
- if (main->program.parameters.array[fss_identify_parameter_name_e].result & f_console_result_value_e) {
+ if (parameters->array[fss_identify_parameter_name_e].result & f_console_result_value_e) {
main->setting.names.used = 0;
- main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[fss_identify_parameter_name_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.names.array, &main->setting.names.used, &main->setting.names.size);
+ main->setting.state.status = f_memory_array_increase_by(parameters->array[fss_identify_parameter_name_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.names.array, &main->setting.names.used, &main->setting.names.size);
if (F_status_is_error(main->setting.state.status)) {
fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_memory_array_increase_by));
return;
}
- main->setting.names.used = main->program.parameters.array[fss_identify_parameter_name_e].values.used;
+ main->setting.names.used = parameters->array[fss_identify_parameter_name_e].values.used;
f_number_unsigned_t i = 0;
f_number_unsigned_t j = 0;
if (fss_identify_signal_check(main)) return;
- index = main->program.parameters.array[fss_identify_parameter_name_e].values.array[i];
+ index = parameters->array[fss_identify_parameter_name_e].values.array[i];
main->setting.names.array[i].used = 0;
- main->setting.state.status = f_string_dynamic_append_nulless(main->program.parameters.arguments.array[index], &main->setting.names.array[i]);
+ main->setting.state.status = f_string_dynamic_append_nulless(parameters->arguments.array[index], &main->setting.names.array[i]);
if (F_status_is_error(main->setting.state.status)) {
fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_string_dynamic_append_nulless));
main->setting.flag |= fss_identify_main_flag_name_d;
}
- else if (main->program.parameters.array[fss_identify_parameter_name_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_identify_parameter_name_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_identify_long_name_s);
main->setting.flag &= ~fss_identify_parameter_name_e;
}
- if (main->program.parameters.remaining.used) {
+ if (parameters->remaining.used) {
main->setting.files.used = 0;
- main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size);
+ main->setting.state.status = f_memory_array_increase_by(parameters->remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.files.array, &main->setting.files.used, &main->setting.files.size);
if (F_status_is_error(main->setting.state.status)) {
fss_identify_print_error(&main->program.error, macro_fss_identify_f(f_memory_array_increase_by));
}
// Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
- for (f_number_unsigned_t index = 0; main->setting.files.used < main->program.parameters.remaining.used; ) {
+ for (f_number_unsigned_t index = 0; main->setting.files.used < parameters->remaining.used; ) {
if (fss_identify_signal_check(main)) return;
- index = main->program.parameters.remaining.array[main->setting.files.used];
+ index = parameters->remaining.array[main->setting.files.used];
- main->setting.files.array[main->setting.files.used].string = main->program.parameters.arguments.array[index].string;
- main->setting.files.array[main->setting.files.used].used = main->program.parameters.arguments.array[index].used;
+ main->setting.files.array[main->setting.files.used].string = parameters->arguments.array[index].string;
+ main->setting.files.array[main->setting.files.used].used = parameters->arguments.array[index].used;
main->setting.files.array[main->setting.files.used++].size = 0;
} // for
* F_okay on success.
*
* Errors (with error bit) from: f_console_parameter_process().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
*
* @see f_console_parameter_process()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
*/
#ifndef _di_fss_identify_setting_load_
extern void fss_identify_setting_load(const f_console_arguments_t arguments, fss_identify_main_t * const main);
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->program.output.to.id = F_type_descriptor_output_d;
main->program.output.to.stream = F_type_output_d;
main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
- f_console_parameters_t * const parameters = &main->program.parameters;
-
main->setting.state.step_small = fss_read_allocation_console_d;
f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
*
* Errors (with error bit) from: f_console_parameter_process().
* Errors (with error bit) from: f_file_stream_open().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
*
* Errors (with error bit) from: fss_read_setting_load_depth().
*
* @see f_console_parameter_process()
* @see f_file_stream_open()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
* @see fll_program_parameter_process_verbosity_standard()
*
* @see fss_read_setting_load_depth()
if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_read_main_flag_version_d)) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
// Use the default standard of: FSS-0000 (Basic)
main->call.process_help = &fss_read_main_process_help;
main->call.process_last_line = &fss_read_process_last_line;
main->setting.feature |= fss_read_feature_flag_line_single_d;
main->setting.feature |= fss_read_feature_flag_quote_content_d | fss_read_feature_flag_quote_object_d;
- if (main->program.parameters.array[fss_read_parameter_as_e].result & f_console_result_value_e && main->program.parameters.array[fss_read_parameter_as_e].values.used) {
- const f_number_unsigned_t index = main->program.parameters.array[fss_read_parameter_as_e].values.array[main->program.parameters.array[fss_read_parameter_as_e].values.used - 1];
- const f_string_static_t as = main->program.parameters.arguments.array[index];
+ if (parameters->array[fss_read_parameter_as_e].result & f_console_result_value_e && parameters->array[fss_read_parameter_as_e].values.used) {
+ const f_number_unsigned_t index = parameters->array[fss_read_parameter_as_e].values.array[parameters->array[fss_read_parameter_as_e].values.used - 1];
+ const f_string_static_t as = parameters->arguments.array[index];
if (f_compare_dynamic(as, fss_read_format_code_short_0000_s) == F_equal_to ||
f_compare_dynamic(as, fss_read_format_code_long_0000_s) == F_equal_to ||
main->setting.feature |= fss_read_feature_flag_line_single_d;
main->setting.feature |= fss_read_feature_flag_quote_content_d | fss_read_feature_flag_quote_object_d;
- main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+ parameters->array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
main->call.process_at = &fss_read_process_at;
main->call.process_at_line = &fss_read_process_at_line;
main->setting.feature |= fss_read_feature_flag_line_single_d | fss_read_feature_flag_content_multiple_d;
main->setting.feature |= fss_read_feature_flag_quote_content_d | fss_read_feature_flag_quote_object_d;
- main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+ parameters->array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
main->call.process_at = &fss_read_process_at;
main->call.process_at_line = &fss_read_process_at_line;
main->setting.feature |= fss_read_feature_flag_object_as_line_d | fss_read_feature_flag_object_trim_d | fss_read_feature_flag_object_trim_expand_d;
- main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+ parameters->array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
main->call.process_at = &fss_read_process_at;
main->call.process_at_line = &fss_read_process_at_line;
main->setting.feature |= fss_read_feature_flag_object_align_d;
main->setting.feature |= fss_read_feature_flag_object_as_line_d | fss_read_feature_flag_object_trim_d | fss_read_feature_flag_object_trim_expand_d;
- main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+ parameters->array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
main->call.process_at = &fss_read_process_at;
main->call.process_at_line = &fss_read_process_at_line;
main->setting.feature |= fss_read_feature_flag_depth_multiple_d | fss_read_feature_flag_object_align_d;
main->setting.feature |= fss_read_feature_flag_object_as_line_d | fss_read_feature_flag_object_trim_d | fss_read_feature_flag_object_trim_expand_d;
- main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
+ parameters->array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
main->call.process_at = &fss_read_process_at;
main->call.process_at_line = &fss_read_process_at_line;
main->setting.feature |= fss_read_feature_flag_object_trim_d | fss_read_feature_flag_object_trim_expand_d;
main->setting.flag |= fss_read_main_flag_payload_error_d;
- main->program.parameters.array[fss_read_parameter_payload_e].flag &= ~f_console_flag_disable_e;
+ parameters->array[fss_read_parameter_payload_e].flag &= ~f_console_flag_disable_e;
main->call.process_at = &fss_read_process_at;
main->call.process_at_line = &fss_read_process_at_line;
main->setting.state.step_small = fss_read_allocation_console_d;
- main->setting.state.status = f_console_parameter_reset(&main->program.parameters);
+ main->setting.state.status = f_console_parameter_reset(parameters);
if (F_status_is_error(main->setting.state.status)) {
if (main->setting.flag & fss_read_main_flag_help_d) {
return;
}
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
if (F_status_is_error(main->setting.state.status)) {
if (main->setting.flag & fss_read_main_flag_help_d) {
// If the --as parameter changed as a result of the re-run of the parameter processing, then something is wrong with the parameters.
{
- const f_number_unsigned_t index_new = main->program.parameters.array[fss_read_parameter_as_e].values.array[main->program.parameters.array[fss_read_parameter_as_e].values.used - 1];
+ const f_number_unsigned_t index_new = parameters->array[fss_read_parameter_as_e].values.array[parameters->array[fss_read_parameter_as_e].values.used - 1];
- if (f_compare_dynamic(as, main->program.parameters.arguments.array[index_new]) != F_equal_to) {
+ if (f_compare_dynamic(as, parameters->arguments.array[index_new]) != F_equal_to) {
main->setting.state.status = F_status_set_error(F_parameter);
if (main->setting.flag & fss_read_main_flag_help_d) {
fss_read_main_process_help(main);
}
else {
- fss_read_main_print_error_parameter_as_changed(&main->program.error, as, main->program.parameters.arguments.array[index_new]);
+ fss_read_main_print_error_parameter_as_changed(&main->program.error, as, parameters->arguments.array[index_new]);
}
return;
}
}
}
- else if (main->program.parameters.array[fss_read_parameter_as_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_read_parameter_as_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
if (main->setting.flag & fss_read_main_flag_help_d) {
*
* Errors (with error bit) from: f_console_parameter_process().
* Errors (with error bit) from: f_file_stream_open().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
*
* @see f_console_parameter_process()
* @see f_file_stream_open()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
* @see fll_program_parameter_process_verbosity_standard()
*
* @see fss_read_setting_load()
main->setting.state.step_small = fss_write_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = fss_write_allocation_small_d;
main->program.output.to.stream = F_type_output_d;
main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= fss_write_main_flag_help_d;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= fss_write_main_flag_version_d;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= fss_write_main_flag_copyright_d;
}
}
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) return;
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) return;
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) return;
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) return;
- if ((main->program.parameters.array[fss_write_parameter_file_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_file_e].values.used) {
- if (main->program.parameters.array[fss_write_parameter_file_e].values.used > 1) {
+ if ((parameters->array[fss_write_parameter_file_e].result & f_console_result_value_e) && parameters->array[fss_write_parameter_file_e].values.used) {
+ if (parameters->array[fss_write_parameter_file_e].values.used > 1) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_must_specify_once(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
}
- const f_number_unsigned_t index = main->program.parameters.array[fss_write_parameter_file_e].values.array[0];
+ const f_number_unsigned_t index = parameters->array[fss_write_parameter_file_e].values.array[0];
main->program.output.to.id = -1;
main->program.output.to.stream = 0;
- main->setting.state.status = f_file_stream_open(main->program.parameters.arguments.array[index], f_string_empty_s, &main->program.output.to);
+ main->setting.state.status = f_file_stream_open(parameters->arguments.array[index], f_string_empty_s, &main->program.output.to);
if (F_status_is_error(main->setting.state.status)) {
- fss_write_print_error_file(&main->program.error, macro_fss_write_f(f_file_stream_open), main->program.parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
+ fss_write_print_error_file(&main->program.error, macro_fss_write_f(f_file_stream_open), parameters->arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
return;
}
main->setting.flag |= fss_write_main_flag_file_to_d;
}
- else if (main->program.parameters.array[fss_write_parameter_file_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_file_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_file_s);
return;
}
- if ((main->program.parameters.array[fss_write_parameter_object_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_object_e].values.used) {
- f_number_unsigneds_t * const values = &main->program.parameters.array[fss_write_parameter_object_e].values;
+ if ((parameters->array[fss_write_parameter_object_e].result & f_console_result_value_e) && parameters->array[fss_write_parameter_object_e].values.used) {
+ f_number_unsigneds_t * const values = ¶meters->array[fss_write_parameter_object_e].values;
main->setting.objects.used = 0;
index = values->array[main->setting.objects.used];
- main->setting.objects.array[main->setting.objects.used].string = main->program.parameters.arguments.array[index].string;
- main->setting.objects.array[main->setting.objects.used].used = main->program.parameters.arguments.array[index].used;
+ main->setting.objects.array[main->setting.objects.used].string = parameters->arguments.array[index].string;
+ main->setting.objects.array[main->setting.objects.used].used = parameters->arguments.array[index].used;
main->setting.objects.array[main->setting.objects.used++].size = 0;
} // for
main->setting.flag |= fss_write_main_flag_object_d;
}
- else if (main->program.parameters.array[fss_write_parameter_object_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_object_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_object_s);
return;
}
- if ((main->program.parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_content_e].values.used) {
+ if ((parameters->array[fss_write_parameter_content_e].result & f_console_result_value_e) && parameters->array[fss_write_parameter_content_e].values.used) {
if (main->setting.flag & fss_write_main_flag_object_d) {
if (!(main->setting.flag & fss_write_main_flag_content_multiple_d)) {
- if (main->program.parameters.array[fss_write_parameter_content_e].values.used > main->program.parameters.array[fss_write_parameter_object_e].values.used) {
+ if (parameters->array[fss_write_parameter_content_e].values.used > parameters->array[fss_write_parameter_object_e].values.used) {
main->setting.state.status = F_status_set_error(F_support_not);
fss_write_print_error_one_content_only(&main->program.error);
f_number_unsigned_t stub_object_array[1] = { 0 };
f_number_unsigneds_t stub_object = macro_f_number_unsigneds_t_initialize_1(stub_object_array, 0, 1);
- f_number_unsigneds_t * const values_content = &main->program.parameters.array[fss_write_parameter_content_e].values;
- f_number_unsigneds_t * const values_object = main->program.parameters.array[fss_write_parameter_object_e].values.used
- ? &main->program.parameters.array[fss_write_parameter_object_e].values
+ f_number_unsigneds_t * const values_content = ¶meters->array[fss_write_parameter_content_e].values;
+ f_number_unsigneds_t * const values_object = parameters->array[fss_write_parameter_object_e].values.used
+ ? ¶meters->array[fss_write_parameter_object_e].values
: &stub_object;
main->setting.contentss.used = 0;
index = values_content->array[i++];
- main->setting.contentss.array[j].array[main->setting.contentss.array[j].used].string = main->program.parameters.arguments.array[index].string;
- main->setting.contentss.array[j].array[main->setting.contentss.array[j].used].used = main->program.parameters.arguments.array[index].used;
+ main->setting.contentss.array[j].array[main->setting.contentss.array[j].used].string = parameters->arguments.array[index].string;
+ main->setting.contentss.array[j].array[main->setting.contentss.array[j].used].used = parameters->arguments.array[index].used;
main->setting.contentss.array[j].array[main->setting.contentss.array[j].used++].size = 0;
} // for
} // while
main->setting.flag |= fss_write_main_flag_content_d;
}
- else if (main->program.parameters.array[fss_write_parameter_content_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_content_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_content_s);
return;
}
- if ((main->program.parameters.array[fss_write_parameter_prepend_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_prepend_e].values.used) {
- const f_number_unsigned_t index = main->program.parameters.array[fss_write_parameter_prepend_e].values.array[main->program.parameters.array[fss_write_parameter_prepend_e].location];
+ if ((parameters->array[fss_write_parameter_prepend_e].result & f_console_result_value_e) && parameters->array[fss_write_parameter_prepend_e].values.used) {
+ const f_number_unsigned_t index = parameters->array[fss_write_parameter_prepend_e].values.array[parameters->array[fss_write_parameter_prepend_e].location];
main->setting.prepend.used = 0;
- main->setting.state.status = f_string_dynamic_append_nulless(main->program.parameters.arguments.array[index], &main->setting.prepend);
+ main->setting.state.status = f_string_dynamic_append_nulless(parameters->arguments.array[index], &main->setting.prepend);
if (F_status_is_error(main->setting.state.status)) {
fss_write_print_error(&main->program.error, macro_fss_write_f(f_string_dynamic_append_nulless));
return;
}
- if (main->program.parameters.arguments.array[index].used) {
- f_range_t range = macro_f_range_t_initialize_2(main->program.parameters.arguments.array[index].used);
+ if (parameters->arguments.array[index].used) {
+ f_range_t range = macro_f_range_t_initialize_2(parameters->arguments.array[index].used);
- for (; range.start < main->program.parameters.arguments.array[index].used; range.start++) {
+ for (; range.start < parameters->arguments.array[index].used; range.start++) {
- if (f_fss_is_space(main->program.parameters.arguments.array[index], range, &main->setting.state) == F_false) {
+ if (f_fss_is_space(parameters->arguments.array[index], range, &main->setting.state) == F_false) {
if (F_status_is_error(main->setting.state.status)) {
fss_write_print_error(&main->program.error, macro_fss_write_f(f_fss_is_space));
}
main->setting.flag |= fss_write_main_flag_prepend_d;
}
- else if (main->program.parameters.array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_prepend_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_prepend_s);
return;
}
- if ((main->program.parameters.array[fss_write_parameter_ignore_e].result & f_console_result_value_e) && main->program.parameters.array[fss_write_parameter_ignore_e].values.used) {
- if (main->program.parameters.array[fss_write_parameter_ignore_e].values.used % 2) {
+ if ((parameters->array[fss_write_parameter_ignore_e].result & f_console_result_value_e) && parameters->array[fss_write_parameter_ignore_e].values.used) {
+ if (parameters->array[fss_write_parameter_ignore_e].values.used % 2) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value_requires_amount(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, fss_write_string_two_s);
f_number_unsigned_t stub_data_array[1] = { 0 };
f_number_unsigneds_t stub_data = macro_f_number_unsigneds_t_initialize_1(stub_data_array, 0, 1);
- f_number_unsigneds_t * const values_ignore = &main->program.parameters.array[fss_write_parameter_ignore_e].values;
- f_number_unsigneds_t * const values_data = main->program.parameters.array[fss_write_parameter_object_e].values.used
- ? &main->program.parameters.array[fss_write_parameter_object_e].values
- : main->program.parameters.array[fss_write_parameter_content_e].values.used
- ? &main->program.parameters.array[fss_write_parameter_content_e].values
+ f_number_unsigneds_t * const values_ignore = ¶meters->array[fss_write_parameter_ignore_e].values;
+ f_number_unsigneds_t * const values_data = parameters->array[fss_write_parameter_object_e].values.used
+ ? ¶meters->array[fss_write_parameter_object_e].values
+ : parameters->array[fss_write_parameter_content_e].values.used
+ ? ¶meters->array[fss_write_parameter_content_e].values
: &stub_data;
main->setting.ignoress.used = 0;
index = values_ignore->array[i++];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].start);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].start);
if (F_status_is_error(main->setting.state.status)) {
- fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->program.parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, parameters->arguments.array[index]);
return;
}
index = values_ignore->array[i++];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].stop);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &main->setting.ignoress.array[j].array[main->setting.ignoress.array[j].used].stop);
if (F_status_is_error(main->setting.state.status)) {
- fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->program.parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, parameters->arguments.array[index]);
return;
}
&main->program.error,
f_console_symbol_long_normal_s,
fss_write_long_ignore_s,
- main->program.parameters.arguments.array[values_ignore->array[i - 1]],
- main->program.parameters.arguments.array[index]
+ parameters->arguments.array[values_ignore->array[i - 1]],
+ parameters->arguments.array[index]
);
return;
f_number_unsigned_t index = 0;
f_range_t number = f_range_t_initialize;
- while (i < main->program.parameters.array[fss_write_parameter_ignore_e].values.used) {
+ while (i < parameters->array[fss_write_parameter_ignore_e].values.used) {
- index = main->program.parameters.array[fss_write_parameter_ignore_e].values.array[i++];
+ index = parameters->array[fss_write_parameter_ignore_e].values.array[i++];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number.start);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &number.start);
if (F_status_is_error(main->setting.state.status)) {
- fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->program.parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, parameters->arguments.array[index]);
return;
}
- index = main->program.parameters.array[fss_write_parameter_ignore_e].values.array[i++];
+ index = parameters->array[fss_write_parameter_ignore_e].values.array[i++];
- main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number.stop);
+ main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, parameters->arguments.array[index], &number.stop);
if (F_status_is_error(main->setting.state.status)) {
- fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, main->program.parameters.arguments.array[index]);
+ fll_program_print_error_parameter_integer_not(&main->program.error, f_console_symbol_long_normal_s, fss_write_long_ignore_s, parameters->arguments.array[index]);
return;
}
&main->program.error,
f_console_symbol_long_normal_s,
fss_write_long_ignore_s,
- main->program.parameters.arguments.array[main->program.parameters.array[fss_write_parameter_ignore_e].values.array[i - 1]],
- main->program.parameters.arguments.array[index]
+ parameters->arguments.array[parameters->array[fss_write_parameter_ignore_e].values.array[i - 1]],
+ parameters->arguments.array[index]
);
return;
} // while
}
}
- else if (main->program.parameters.array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_ignore_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
main->setting.flag &= ~fss_write_main_flag_ignore_d;
}
- if (main->program.parameters.array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_partial_e].result & f_console_result_found_e) {
main->setting.flag |= fss_write_main_flag_partial_d;
}
for (uint8_t i = 0; i < 3; ++i) {
- if (main->program.parameters.array[has[i]].result & f_console_result_found_e) {
+ if (parameters->array[has[i]].result & f_console_result_found_e) {
if (main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d)) {
if (!(main->setting.flag & fss_write_main_flag_partial_d)) {
main->setting.state.status = F_status_set_error(F_parameter);
}
}
- if (main->program.parameters.array[has_cannots[i][0]].result & f_console_result_found_e) {
+ if (parameters->array[has_cannots[i][0]].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][0]);
return;
}
- if (main->program.parameters.array[has_cannots[i][1]].result & f_console_result_found_e) {
+ if (parameters->array[has_cannots[i][1]].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_cannot_use_with(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, has_string[i], has_cannots_string[i][1]);
if (main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d)) {
if (main->setting.flag & fss_write_main_flag_object_d) {
if (main->setting.flag & fss_write_main_flag_content_multiple_d) {
- if (main->program.parameters.array[fss_write_parameter_object_e].locations_sub.used > main->program.parameters.array[fss_write_parameter_content_e].locations_sub.used && !(main->setting.flag & fss_write_main_flag_partial_d)) {
+ if (parameters->array[fss_write_parameter_object_e].locations_sub.used > parameters->array[fss_write_parameter_content_e].locations_sub.used && !(main->setting.flag & fss_write_main_flag_partial_d)) {
main->setting.state.status = F_status_set_error(F_parameter);
fss_write_print_error_parameter_same_times_at_least(&main->program.error);
}
if ((main->setting.flag & fss_write_main_flag_content_d) && (main->setting.flag & fss_write_main_flag_partial_d)) {
- if (main->program.parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) {
+ if (parameters->array[fss_write_parameter_content_e].result & f_console_result_value_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_cannot_use_with_xor(&main->program.error, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, f_console_symbol_long_normal_s, fss_write_long_partial_s, fss_write_long_object_s, fss_write_long_content_s);
main->setting.quote = f_fss_quote_double_s;
- if (main->program.parameters.array[fss_write_parameter_double_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[fss_write_parameter_single_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[fss_write_parameter_double_e].location < main->program.parameters.array[fss_write_parameter_single_e].location) {
+ if (parameters->array[fss_write_parameter_double_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_single_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_double_e].location < parameters->array[fss_write_parameter_single_e].location) {
main->setting.quote = f_fss_quote_single_s;
- if (main->program.parameters.array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[fss_write_parameter_single_e].location < main->program.parameters.array[fss_write_parameter_grave_e].location) {
+ if (parameters->array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_single_e].location < parameters->array[fss_write_parameter_grave_e].location) {
main->setting.quote = f_fss_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[fss_write_parameter_double_e].location < main->program.parameters.array[fss_write_parameter_grave_e].location) {
+ else if (parameters->array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_double_e].location < parameters->array[fss_write_parameter_grave_e].location) {
main->setting.quote = f_fss_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[fss_write_parameter_double_e].location < main->program.parameters.array[fss_write_parameter_grave_e].location) {
+ else if (parameters->array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_double_e].location < parameters->array[fss_write_parameter_grave_e].location) {
main->setting.quote = f_fss_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[fss_write_parameter_single_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_single_e].result & f_console_result_found_e) {
main->setting.quote = f_fss_quote_single_s;
- if (main->program.parameters.array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[fss_write_parameter_single_e].location < main->program.parameters.array[fss_write_parameter_grave_e].location) {
+ if (parameters->array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_single_e].location < parameters->array[fss_write_parameter_grave_e].location) {
main->setting.quote = f_fss_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
+ else if (parameters->array[fss_write_parameter_grave_e].result & f_console_result_found_e) {
main->setting.quote = f_fss_quote_grave_s;
}
- if (main->program.parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
+ if (parameters->array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
main->setting.flag |= fss_write_main_flag_trim_d;
}
*
* Errors (with error bit) from: f_console_parameter_process().
* Errors (with error bit) from: f_file_stream_open().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
* @param load_call
* (optional) Designate a function to call after performing the initial processing, but before printing help.
*
* @see f_console_parameter_process()
* @see f_file_stream_open()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
* @see fll_program_parameter_process_verbosity_standard()
*/
#ifndef _di_fss_write_setting_load_
* F_okay on success.
* F_data_not on success but nothing was provided to operate with.
*
- * Errors (with error bit) from: f_console_parameter_process().
- * Errors (with error bit) from: f_file_stream_open().
- * Errors (with error bit) from: fll_program_parameter_process_context().
- * Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
- *
- * @see f_console_parameter_process()
- * @see f_file_stream_open()
- * @see fll_program_parameter_process_context()
- * @see fll_program_parameter_process_verbosity_standard()
- *
* @see fss_write_setting_load()
*/
#ifndef _di_fss_write_main_setting_load_as_
data.program.output.flag |= iki_read_print_flag_out_d;
data.program.message.flag |= iki_read_print_flag_message_d | iki_read_print_flag_out_d;
data.program.warning.flag |= iki_read_print_flag_warning_d | iki_read_print_flag_out_d;
+
data.program.error.custom = (void *) &data;
data.program.debug.custom = (void *) &data;
data.program.message.custom = (void *) &data;
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->program.output.to.id = F_type_descriptor_output_d;
main->program.output.to.stream = F_type_output_d;
main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
- f_console_parameters_t * const parameters = &main->program.parameters;
-
main->setting.state.step_small = iki_read_allocation_console_d;
f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
* Errors (with error bit) from: f_file_exists().
* Errors (with error bit) from: f_memory_array_resize().
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
* @param do_settings_load
* (optional) Designate a function to call after performing the initial processing, but before printing help.
* @see f_file_exists()
* @see f_memory_array_resize()
* @see f_string_dynamic_append()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
* @see fll_program_parameter_process_verbosity_standard()
*/
#ifndef _di_iki_read_setting_load_
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->program.output.to.id = F_type_descriptor_output_d;
main->program.output.to.stream = F_type_output_d;
main->program.output.to.flag = F_file_flag_create_d | F_file_flag_write_only_d | F_file_flag_append_d;
- f_console_parameters_t * const parameters = &main->program.parameters;
-
main->setting.state.step_small = iki_write_allocation_console_d;
- f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
main->setting.state.step_small = iki_write_allocation_small_d;
*
* Errors (with error bit) from: f_console_parameter_process().
* Errors (with error bit) from: f_file_stream_open().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
* Errors (with error bit) from: fll_program_parameter_process_verbosity_standard().
* @param do_settings_load
* (optional) Designate a function to call after performing the initial processing, but before printing help.
*
* @see f_console_parameter_process()
* @see f_file_stream_open()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
* @see fll_program_parameter_process_verbosity_standard()
*/
#ifndef _di_iki_write_setting_load_
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->setting.state.step_small = status_code_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = status_code_allocation_small_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_help_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_version_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_copyright_d;
return;
main->setting.flag &= ~status_code_main_flag_pipe_d;
}
- if (main->program.parameters.array[status_code_parameter_error_e].result & f_console_result_found_e) {
+ if (parameters->array[status_code_parameter_error_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_error_d;
}
- if (main->program.parameters.array[status_code_parameter_fine_e].result & f_console_result_found_e) {
+ if (parameters->array[status_code_parameter_fine_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_fine_d;
}
- if (main->program.parameters.array[status_code_parameter_warning_e].result & f_console_result_found_e) {
+ if (parameters->array[status_code_parameter_warning_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_warning_d;
}
- if (main->program.parameters.array[status_code_parameter_number_e].result & f_console_result_found_e) {
+ if (parameters->array[status_code_parameter_number_e].result & f_console_result_found_e) {
main->setting.flag |= status_code_main_flag_number_d;
}
return;
}
- if (main->program.parameters.remaining.used == 0 && !(main->program.pipe & fll_program_data_pipe_input_e)) {
+ if (parameters->remaining.used == 0 && !(main->program.pipe & fll_program_data_pipe_input_e)) {
main->setting.state.status = F_status_set_error(F_parameter);
status_code_print_error_no_status_codes(&main->program.error);
* F_okay on success.
*
* Errors (with error bit) from: f_console_parameter_process().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
*
* @see f_console_parameter_process()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
*/
#ifndef _di_status_code_setting_load_
extern void status_code_setting_load(const f_console_arguments_t arguments, status_code_main_t * const main);
if (!main) return;
+ f_console_parameters_t * const parameters = &main->program.parameters;
+
main->setting.state.step_small = utf8_allocation_console_d;
- f_console_parameter_process(arguments, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = utf8_allocation_small_d;
main->setting.mode &= ~(utf8_mode_to_bytesequence_e | utf8_mode_to_codepoint_e);
// --to_width may be specified with --to_combining.
- if (main->program.parameters.array[utf8_parameter_to_width_e].result & f_console_result_found_e) {
+ if (parameters->array[utf8_parameter_to_width_e].result & f_console_result_found_e) {
main->setting.mode |= utf8_mode_to_width_e;
}
main->setting.mode &= ~(utf8_mode_to_bytesequence_e | utf8_mode_to_codepoint_e);
// --to_width may be specified with --to_combining.
- if (main->program.parameters.array[utf8_parameter_to_combining_e].result & f_console_result_found_e) {
+ if (parameters->array[utf8_parameter_to_combining_e].result & f_console_result_found_e) {
main->setting.mode |= utf8_mode_to_combining_e;
}
}
}
- if (main->program.parameters.array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_help_e].result & f_console_result_found_e) {
main->setting.flag |= utf8_main_flag_help_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_version_e].result & f_console_result_found_e) {
main->setting.flag |= utf8_main_flag_version_d;
return;
}
- if (main->program.parameters.array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
+ if (parameters->array[f_console_standard_parameter_copyright_e].result & f_console_result_found_e) {
main->setting.flag |= utf8_main_flag_copyright_d;
return;
main->setting.flag &= ~utf8_main_flag_pipe_d;
}
- if (main->program.parameters.array[utf8_parameter_to_file_e].result & f_console_result_value_e) {
- if (main->program.parameters.array[utf8_parameter_to_file_e].values.used > 1) {
+ if (parameters->array[utf8_parameter_to_file_e].result & f_console_result_value_e) {
+ if (parameters->array[utf8_parameter_to_file_e].values.used > 1) {
main->setting.state.status = F_status_set_error(F_parameter);
utf8_print_error_parameter_file_to_too_many(&main->program.error);
return;
}
- if (main->program.parameters.arguments.array[main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]].used) {
+ if (parameters->arguments.array[parameters->array[utf8_parameter_to_file_e].values.array[0]].used) {
main->setting.path_files_to.used = 0;
main->setting.state.status = f_memory_array_increase_by(1, sizeof(f_string_dynamic_t), (void **) &main->setting.path_files_to.array, &main->setting.path_files_to.used, &main->setting.path_files_to.size);
main->setting.path_files_to.array[main->setting.path_files_to.used].used = 0;
- main->setting.state.status = f_string_dynamic_append_nulless(main->program.parameters.arguments.array[main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]], &main->setting.path_files_to.array[0]);
+ main->setting.state.status = f_string_dynamic_append_nulless(parameters->arguments.array[parameters->array[utf8_parameter_to_file_e].values.array[0]], &main->setting.path_files_to.array[0]);
if (F_status_is_error(main->setting.state.status)) {
utf8_print_error(&main->program.error, macro_utf8_f(f_string_dynamic_append_nulless));
++main->setting.path_files_to.used;
- main->setting.state.status = f_file_stream_open(main->program.parameters.arguments.array[main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_open_mode_write_append_s, &main->program.output.to);
+ main->setting.state.status = f_file_stream_open(parameters->arguments.array[parameters->array[utf8_parameter_to_file_e].values.array[0]], f_file_open_mode_write_append_s, &main->program.output.to);
if (F_status_is_error(main->setting.state.status)) {
- utf8_print_error_file(&main->program.error, macro_utf8_f(f_file_stream_open), main->program.parameters.arguments.array[main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
+ utf8_print_error_file(&main->program.error, macro_utf8_f(f_file_stream_open), parameters->arguments.array[parameters->array[utf8_parameter_to_file_e].values.array[0]], f_file_operation_open_s, fll_error_file_type_file_e);
return;
}
main->setting.flag |= utf8_main_flag_file_to_d;
}
else {
- utf8_print_error_parameter_file_name_empty(&main->program.error, main->program.parameters.array[utf8_parameter_to_file_e].values.array[0]);
+ utf8_print_error_parameter_file_name_empty(&main->program.error, parameters->array[utf8_parameter_to_file_e].values.array[0]);
main->setting.state.status = F_status_set_error(F_parameter);
return;
}
}
- else if (main->program.parameters.array[utf8_parameter_to_file_e].result & f_console_result_found_e) {
+ else if (parameters->array[utf8_parameter_to_file_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, utf8_long_to_file_s);
main->setting.flag &= ~utf8_main_flag_file_to_d;
}
- if (main->program.parameters.array[utf8_parameter_from_file_e].result & f_console_result_value_e) {
+ if (parameters->array[utf8_parameter_from_file_e].result & f_console_result_value_e) {
main->setting.path_files_from.used = 0;
- main->setting.state.status = f_memory_array_increase_by(main->program.parameters.array[utf8_parameter_from_file_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.path_files_from.array, &main->setting.path_files_from.used, &main->setting.path_files_from.size);
+ main->setting.state.status = f_memory_array_increase_by(parameters->array[utf8_parameter_from_file_e].values.used, sizeof(f_string_dynamic_t), (void **) &main->setting.path_files_from.array, &main->setting.path_files_from.used, &main->setting.path_files_from.size);
if (F_status_is_error(main->setting.state.status)) {
utf8_print_error(&main->program.error, macro_utf8_f(f_memory_array_increase_by));
return;
}
- main->setting.path_files_from.used = main->program.parameters.array[utf8_parameter_from_file_e].values.used;
+ main->setting.path_files_from.used = parameters->array[utf8_parameter_from_file_e].values.used;
f_number_unsigned_t i = 0;
f_number_unsigned_t index = 0;
for (; i < main->setting.path_files_from.used; ++i) {
- index = main->program.parameters.array[utf8_parameter_from_file_e].values.array[i];
+ index = parameters->array[utf8_parameter_from_file_e].values.array[i];
main->setting.path_files_from.array[i].used = 0;
- main->setting.state.status = f_string_dynamic_append(main->program.parameters.arguments.array[index], &main->setting.path_files_from.array[i]);
+ main->setting.state.status = f_string_dynamic_append(parameters->arguments.array[index], &main->setting.path_files_from.array[i]);
if (F_status_is_error(main->setting.state.status)) {
fll_error_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_utf8_f(f_string_dynamic_append_nulless), fll_error_file_flag_fallback_e);
break;
}
- if (main->program.parameters.arguments.array[index].used) {
- if (f_file_exists(main->program.parameters.arguments.array[index], F_true) != F_true) {
- utf8_print_error_parameter_file_not_found(&main->program.error, F_true, main->program.parameters.arguments.array[index]);
+ if (parameters->arguments.array[index].used) {
+ if (f_file_exists(parameters->arguments.array[index], F_true) != F_true) {
+ utf8_print_error_parameter_file_not_found(&main->program.error, F_true, parameters->arguments.array[index]);
if (F_status_is_error_not(main->setting.state.status)) {
main->setting.state.status = F_status_set_error(F_file_found_not);
main->setting.flag |= utf8_main_flag_file_from_d;
}
- else if (main->program.parameters.array[utf8_parameter_from_file_e].result & f_console_result_found_e) {
+ else if (parameters->array[utf8_parameter_from_file_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, utf8_long_from_file_s);
main->setting.flag &= ~utf8_main_flag_file_from_d;
}
- if (main->program.parameters.remaining.used) {
+ if (parameters->remaining.used) {
main->setting.remaining.used = 0;
- main->setting.state.status = f_memory_array_increase_by(main->program.parameters.remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.remaining.array, &main->setting.remaining.used, &main->setting.remaining.size);
+ main->setting.state.status = f_memory_array_increase_by(parameters->remaining.used, sizeof(f_string_dynamic_t), (void **) &main->setting.remaining.array, &main->setting.remaining.used, &main->setting.remaining.size);
if (F_status_is_error(main->setting.state.status)) {
utf8_print_error(&main->program.error, macro_utf8_f(f_memory_array_increase_by));
}
// Construct the array without allocating any more memory by setting this as a static string (used > 0, size = 0).
- for (f_number_unsigned_t index = 0; main->setting.remaining.used < main->program.parameters.remaining.used; ) {
+ for (f_number_unsigned_t index = 0; main->setting.remaining.used < parameters->remaining.used; ) {
- index = main->program.parameters.remaining.array[main->setting.remaining.used];
+ index = parameters->remaining.array[main->setting.remaining.used];
- main->setting.remaining.array[main->setting.remaining.used].string = main->program.parameters.arguments.array[index].string;
- main->setting.remaining.array[main->setting.remaining.used].used = main->program.parameters.arguments.array[index].used;
+ main->setting.remaining.array[main->setting.remaining.used].string = parameters->arguments.array[index].string;
+ main->setting.remaining.array[main->setting.remaining.used].used = parameters->arguments.array[index].used;
main->setting.remaining.array[main->setting.remaining.used++].size = 0;
} // for
}
- if (!((main->setting.flag & (utf8_main_flag_pipe_d | utf8_main_flag_file_from_d)) || main->program.parameters.remaining.used)) {
+ if (!((main->setting.flag & (utf8_main_flag_pipe_d | utf8_main_flag_file_from_d)) || parameters->remaining.used)) {
main->setting.state.status = F_status_set_error(F_parameter);
utf8_print_error_no_from(&main->program.error);
}
if (!(main->setting.mode & utf8_mode_to_bytesequence_e)) {
- if ((main->program.parameters.array[utf8_parameter_separate_e].result & f_console_result_found_e) || (main->program.parameters.array[utf8_parameter_headers_e].result & f_console_result_found_e)) {
+ if ((parameters->array[utf8_parameter_separate_e].result & f_console_result_found_e) || (parameters->array[utf8_parameter_headers_e].result & f_console_result_found_e)) {
main->setting.prepend = utf8_string_prepend_padding_s;
main->setting.append = f_string_eol_s;
}
}
}
- if (main->program.parameters.array[utf8_parameter_headers_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[utf8_parameter_separate_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[utf8_parameter_headers_e].location < main->program.parameters.array[utf8_parameter_separate_e].location) {
+ if (parameters->array[utf8_parameter_headers_e].result & f_console_result_found_e) {
+ if (parameters->array[utf8_parameter_separate_e].result & f_console_result_found_e) {
+ if (parameters->array[utf8_parameter_headers_e].location < parameters->array[utf8_parameter_separate_e].location) {
main->setting.flag |= utf8_main_flag_separate_d;
}
- else if (main->program.parameters.array[utf8_parameter_headers_e].location == main->program.parameters.array[utf8_parameter_separate_e].location) {
- if (main->program.parameters.array[utf8_parameter_headers_e].location_sub < main->program.parameters.array[utf8_parameter_separate_e].location_sub) {
+ else if (parameters->array[utf8_parameter_headers_e].location == parameters->array[utf8_parameter_separate_e].location) {
+ if (parameters->array[utf8_parameter_headers_e].location_sub < parameters->array[utf8_parameter_separate_e].location_sub) {
main->setting.flag |= utf8_main_flag_separate_d;
}
else {
main->setting.flag |= utf8_main_flag_header_d;
}
}
- else if (main->program.parameters.array[utf8_parameter_separate_e].result & f_console_result_found_e) {
+ else if (parameters->array[utf8_parameter_separate_e].result & f_console_result_found_e) {
main->setting.flag |= utf8_main_flag_separate_d;
}
- if (main->program.parameters.array[utf8_parameter_strip_invalid_e].result & f_console_result_found_e) {
+ if (parameters->array[utf8_parameter_strip_invalid_e].result & f_console_result_found_e) {
main->setting.flag |= utf8_main_flag_strip_invalid_d;
}
* F_okay on success.
*
* Errors (with error bit) from: f_console_parameter_process().
- * Errors (with error bit) from: fll_program_parameter_process_context().
+ * Errors (with error bit) from: fll_program_parameter_process_context_standard().
*
* @see f_console_parameter_process()
- * @see fll_program_parameter_process_context()
+ * @see fll_program_parameter_process_context_standard()
*/
#ifndef _di_utf8_setting_load_
extern void utf8_setting_load(const f_console_arguments_t arguments, utf8_main_t * const main);