if (!main) return;
+ 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, &main->program.parameters, &main->setting.state, 0);
+ f_console_parameter_process(arguments, parameters, &main->setting.state, 0);
main->setting.state.step_small = iki_write_allocation_small_d;
return;
}
- 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;
-
if (callback) {
callback(arguments, main);
if (F_status_is_error(main->setting.state.status)) 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 |= iki_write_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 |= iki_write_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 |= iki_write_main_flag_copyright_d;
return;
main->setting.flag &= ~iki_write_main_flag_pipe_d;
}
- if (main->program.parameters.array[iki_write_parameter_file_e].result & f_console_result_value_e && main->program.parameters.array[iki_write_parameter_file_e].values.used) {
- if (main->program.parameters.array[iki_write_parameter_file_e].values.used > 1) {
+ if (parameters->array[iki_write_parameter_file_e].result & f_console_result_value_e && parameters->array[iki_write_parameter_file_e].values.used) {
+ if (parameters->array[iki_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, iki_write_long_file_s);
return;
}
- const f_number_unsigned_t index = main->program.parameters.array[iki_write_parameter_file_e].values.array[0];
+ const f_number_unsigned_t index = parameters->array[iki_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)) {
- fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_iki_write_f(f_file_stream_open), fll_error_file_flag_fallback_e, main->program.parameters.arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
+ fll_error_file_print(&main->program.error, F_status_set_fine(main->setting.state.status), macro_iki_write_f(f_file_stream_open), fll_error_file_flag_fallback_e, parameters->arguments.array[index], f_file_operation_open_s, fll_error_file_type_file_e);
return;
}
main->setting.flag |= iki_write_main_flag_file_to_d;
}
- else if (main->program.parameters.array[iki_write_parameter_file_e].result & f_console_result_found_e) {
+ else if (parameters->array[iki_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, iki_write_long_file_s);
return;
}
- if (main->program.parameters.array[iki_write_parameter_wrap_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_wrap_e].result & f_console_result_found_e) {
main->setting.flag |= iki_write_main_flag_wrap_d;
main->setting.state.flag |= f_iki_state_flag_force_wrap_e;
}
main->setting.quote = f_iki_syntax_quote_double_s;
- if (main->program.parameters.array[iki_write_parameter_double_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[iki_write_parameter_single_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[iki_write_parameter_double_e].location < main->program.parameters.array[iki_write_parameter_single_e].location) {
+ if (parameters->array[iki_write_parameter_double_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_single_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_double_e].location < parameters->array[iki_write_parameter_single_e].location) {
main->setting.quote = f_iki_syntax_quote_single_s;
- if (main->program.parameters.array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[iki_write_parameter_single_e].location < main->program.parameters.array[iki_write_parameter_grave_e].location) {
+ if (parameters->array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_single_e].location < parameters->array[iki_write_parameter_grave_e].location) {
main->setting.quote = f_iki_syntax_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[iki_write_parameter_double_e].location < main->program.parameters.array[iki_write_parameter_grave_e].location) {
+ else if (parameters->array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_double_e].location < parameters->array[iki_write_parameter_grave_e].location) {
main->setting.quote = f_iki_syntax_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[iki_write_parameter_double_e].location < main->program.parameters.array[iki_write_parameter_grave_e].location) {
+ else if (parameters->array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_double_e].location < parameters->array[iki_write_parameter_grave_e].location) {
main->setting.quote = f_iki_syntax_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[iki_write_parameter_single_e].result & f_console_result_found_e) {
+ else if (parameters->array[iki_write_parameter_single_e].result & f_console_result_found_e) {
main->setting.quote = f_iki_syntax_quote_single_s;
- if (main->program.parameters.array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
- if (main->program.parameters.array[iki_write_parameter_single_e].location < main->program.parameters.array[iki_write_parameter_grave_e].location) {
+ if (parameters->array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
+ if (parameters->array[iki_write_parameter_single_e].location < parameters->array[iki_write_parameter_grave_e].location) {
main->setting.quote = f_iki_syntax_quote_grave_s;
}
}
}
- else if (main->program.parameters.array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
+ else if (parameters->array[iki_write_parameter_grave_e].result & f_console_result_found_e) {
main->setting.quote = f_iki_syntax_quote_grave_s;
}
}
#endif
/**
- * The iki write main program cache.
+ * The IKI write main program cache.
*
- * buffer: A buffer used during processing the file.
- * content: A buffer used to hold a Content during processing.
- * iki: A buffer used for writing the IKI during processing.
- * objects: A buffer used to hold Objects during processing.
+ * Properties:
+ * - buffer: A buffer used during processing the file.
+ * - content: A buffer used to hold a Content during processing.
+ * - iki: A buffer used for writing the IKI during processing.
+ * - objects: A buffer used to hold Objects during processing.
*/
#ifndef _di_iki_write_setting_t_
typedef struct {
/**
* The IKI write callbacks.
*
- * load_objects_content_pipe: Load the Objects and Content from the pipe.
+ * Properties:
+ * - load_objects_content_pipe: Load the Objects and Content from the pipe.
*
- * print_help: Print the main help message.
+ * - print_help: Print the main help message.
*
- * process_objects_content: Process an Objects and Content set.
+ * - process_objects_content: Process an Objects and Content set.
*/
#ifndef _di_iki_write_callback_t_
typedef struct {
#endif // _di_iki_write_callback_t_
/**
- * The iki write main program settings.
+ * The IKI write main program settings.
*
* This is passed to the program-specific main entry point to designate program settings.
* These program settings are often processed from the program arguments (often called the command line arguments).
*
- * flag: Flags passed to the main function.
+ * Properties:
+ * - flag: Flags passed to the main function.
*
- * status_signal: A status used eclusively by the threaded signal handler.
- * state: The state data used when processing the FSS data.
+ * - status_signal: A status used eclusively by the threaded signal handler.
+ * - state: The state data used when processing the FSS data.
*
- * quote: This holds the quote used during processing.
+ * - quote: This holds the quote used during processing.
*
- * contents: An array of content passed as values to the "--content" parameter and must match the length of objects.
- * objectss: An array of an array of objects passed as values to the "--object" parameter.
+ * - contents: An array of content passed as values to the "--content" parameter and must match the length of objects.
+ * - objectss: An array of an array of objects passed as values to the "--object" parameter.
*/
#ifndef _di_iki_write_setting_t_
typedef struct {
/**
* The main program data as a single structure.
*
- * cache: The cache data.
- * callback: The callbacks.
- * program: The main program data.
- * setting: The settings data.
+ * Properties:
+ * - cache: The cache data.
+ * - callback: The callbacks.
+ * - program: The main program data.
+ * - setting: The settings data.
*/
#ifndef _di_iki_write_main_t_
typedef struct {