Move parameter initialization and deallocation for fll program data into main.c.
Move the utf8 data into the private files.
const f_string_static_t utf8_long_to_width_s = macro_f_string_static_t_initialize(UTF8_long_to_width_s, 0, UTF8_long_to_width_s_length);
#endif // _di_utf8_parameters_
-#ifndef _di_utf8_main_delete_
- f_status_t utf8_main_delete(fll_program_data_t *main) {
-
- return fll_program_data_delete(main);
- }
-#endif // _di_utf8_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#define utf8_mode_to_width_d 0x20
#endif // _di_utf8_modes_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing utf8_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see utf8_main()
- */
-#ifndef _di_utf8_main_delete_
- extern f_status_t utf8_main_delete(fll_program_data_t *main);
-#endif // _di_utf8_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp);
fll_program_data_t data = fll_program_data_t_initialize;
+ f_console_parameter_t parameters[] = utf8_console_parameter_t_initialize;
+ data.parameters.array = parameters;
+ data.parameters.used = utf8_total_parameters_d;
+
if (f_pipe_input_exists()) {
data.process_pipe = F_true;
}
fll_program_standard_setdown(&data.signal);
+ fll_program_data_delete(&data);
+
if (F_status_is_error(status)) return 1;
return 0;
extern "C" {
#endif
+#ifndef _di_utf8_data_delete_
+ void utf8_data_delete(utf8_data_t *data) {
+
+ if (data->file.stream != data->main->output.to.stream) {
+ f_file_stream_close(F_true, &data->file);
+ }
+
+ f_string_dynamic_resize(0, &data->buffer);
+ f_string_dynamic_resize(0, &data->text);
+ }
+#endif // _di_utf8_data_delete_
+
#ifndef _di_utf8_signal_received_
f_status_t utf8_signal_received(utf8_data_t * const data) {
#endif // _di_utf8_data_t_
/**
+ * Deallocate program data.
+ *
+ * @param data
+ * The program data.
+ *
+ * @return
+ * F_none on success.
+ */
+#ifndef _di_utf8_data_delete_
+ extern void utf8_data_delete(utf8_data_t *data) F_attribute_visibility_internal_d;
+#endif // _di_utf8_data_delete_
+
+/**
* Check to see if a process signal is received.
*
* Only signals that are blocked via main.signal will be received.
extern "C" {
#endif
-#ifndef _di_utf8_data_delete_
- void utf8_data_delete(utf8_data_t *data) {
-
- if (data->file.stream != data->main->output.to.stream) {
- f_file_stream_close(F_true, &data->file);
- }
-
- f_string_dynamic_resize(0, &data->buffer);
- f_string_dynamic_resize(0, &data->text);
- }
-#endif // _di_utf8_data_delete_
-
#ifndef _di_utf8_process_text_
f_status_t utf8_process_text(utf8_data_t * const data, f_string_static_t text) {
#endif
/**
- * Deallocate program data.
- *
- * @param data
- * The program data.
- *
- * @return
- * F_none on success.
- */
-#ifndef _di_utf8_data_delete_
- extern void utf8_data_delete(utf8_data_t *data);
-#endif // _di_utf8_data_delete_
-
-/**
* Convert the text from one format to other another format or verify text.
*
* @param data
utf8_data_t data = utf8_data_t_initialize;
data.main = main;
- f_console_parameter_t parameters[] = utf8_console_parameter_t_initialize;
- main->parameters.array = parameters;
- main->parameters.used = utf8_total_parameters_d;
-
// Identify priority of color parameters.
{
f_console_parameter_id_t ids[3] = { utf8_parameter_no_color_e, utf8_parameter_light_e, utf8_parameter_dark_e };
fll_error_print(main->error, F_status_set_fine(status), "fll_program_parameter_process", F_true);
utf8_data_delete(&data);
- utf8_main_delete(main);
return F_status_set_error(status);
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
- utf8_main_delete(main);
utf8_data_delete(&data);
return status;
fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
utf8_data_delete(&data);
- utf8_main_delete(main);
return status;
}
fll_error_print(main->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
utf8_data_delete(&data);
- utf8_main_delete(main);
return status;
}
utf8_print_help(main->output.to, main->context);
utf8_data_delete(&data);
- utf8_main_delete(main);
return F_none;
}
fll_program_print_version(main->output.to, utf8_program_version_s);
utf8_data_delete(&data);
- utf8_main_delete(main);
return F_none;
}
}
utf8_data_delete(&data);
- utf8_main_delete(main);
if (F_status_is_error(status) || status == F_signal) {
return status;