The `void *(*)(void *)` function structure is being used so add that as a function callback type `f_void_pointer_call_t`.
Add `fl_print_call_t` function callback type.
Rename the console parameter callback from `callback` to `on_match`.
Add `f_console_parameters_call_t` function callback type.
Fix documentation comment where `length` should instead be `used`.
The `void_main` are now replaced with literal `main` type now that the typedef structure improvements are in place.
Shorten the `callback` name to `call`.
Use more typedefs for functions.
This better takes advantage of how functions are a "first class citizen" in C.
#define _di_fl_conversion_dynamic_to_signed_detect_
#define _di_fl_conversion_dynamic_to_unsigned_
//#define _di_fl_conversion_dynamic_to_unsigned_detect_
+#define _di_fl_print_call_t_
//#define _di_fl_print_debug_s_
//#define _di_fl_print_error_s_
//#define _di_fl_print_format_
#define _di_f_utf_unicode_to_
#define _di_f_utf_width_e_
#define _di_f_void_call_t_
+#define _di_fl_print_call_t_
//#define _di_fl_print_debug_s_
//#define _di_fl_print_error_s_
//#define _di_fl_print_format_
//#define _di_fl_iki_read_
//#define _di_fl_path_canonical_
#define _di_fl_path_clean_
+#define _di_fl_print_call_t_
//#define _di_fl_print_debug_s_
//#define _di_fl_print_error_s_
//#define _di_fl_print_format_
#define _di_fl_iki_read_
#define _di_fl_path_canonical_
#define _di_fl_path_clean_
+#define _di_fl_print_call_t_
//#define _di_fl_print_debug_s_
//#define _di_fl_print_error_s_
//#define _di_fl_print_format_
#define _di_fl_conversion_dynamic_to_signed_detect_
#define _di_fl_conversion_dynamic_to_unsigned_
//#define _di_fl_conversion_dynamic_to_unsigned_detect_
+#define _di_fl_print_call_t_
//#define _di_fl_print_debug_s_
//#define _di_fl_print_error_s_
//#define _di_fl_print_format_
// Additional parameters must always follow what requests ("needs") them.
if (process.needs.used) {
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_need_e;
process.at = process.needs.array[0];
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break) break;
if (state->status == F_continue) continue;
continue;
}
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_identify_e;
process.at = 0;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break) break;
if (state->status == F_continue) continue;
process.width = macro_f_utf_byte_width_is(arguments.argv[process.location][process.location_sub]);
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_short_preprocess_e;
process.at = i;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break || state->status == F_continue) {
if (!parameters->array[i].match_short.string) continue;
if (arguments.argv[process.location][process.location_sub] != *parameters->array[i].match_short.string) continue;
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_short_e;
process.at = i;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break || state->status == F_continue) {
if (!parameters->array[i].match_long.string) continue;
if (strncmp(&arguments.argv[process.location][process.location_sub], parameters->array[i].match_long.string, parameters->array[i].match_long.used + 1)) continue;
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_long_e;
process.at = i;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break || state->status == F_continue) {
if (!parameters->array[i].match_simple.used && !parameters->array[i].match_simple.string) continue;
if (strncmp(arguments.argv[process.location], parameters->array[i].match_simple.string, parameters->array[i].match_simple.used + 1)) continue;
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_simple_e;
process.at = i;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break || state->status == F_continue) {
// Add the missed parameter to the remaining array.
if (!process.found) {
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_miss_e;
process.at = 0;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
if (F_status_is_error(state->status)) break;
if (state->status == F_break) break;
if (state->status == F_continue) continue;
} // while
// Make sure the entire parameters arguments array is populated.
- if (parameters->callback) {
+ if (parameters->on_match) {
process.type = f_console_parameter_state_type_wrap_up_e;
process.at = 0;
- parameters->callback(arguments, (void * const) parameters, &process, data);
+ parameters->on_match(arguments, (void * const) parameters, &process, data);
}
else {
state->status = F_process;
* - array: Intended to be populated with an array of f_console_parameter_t whose size is defined by the "used" property.
* - arguments: An array of arguments pointing to the argv[] strings with the string lengths already calculated (This is a dynamic array of f_string_static_t).
* - remaining: An array of indexes within the arguments representing unmatched parameters.
- * - length: The total number of parameters in the parameters array.
+ * - used: The total number of parameters in the parameters array.
*
- * callback: A callback to perform when matched in order to handle condition values.
+ * - on_match: A callback to perform when matched in order to handle condition values.
*
* The callback function arguments:
* - arguments: The console arguments being processed.
* Failure to properly handle this can lead to integrity and security issues.
*/
#ifndef _di_f_console_parameters_t_
+ typedef void (*f_console_parameters_call_t) (const f_console_arguments_t arguments, void * const parameters, f_console_parameter_state_t * const state, void * const data);
+
typedef struct {
f_console_parameter_t *array;
f_string_dynamics_t arguments;
f_number_unsigneds_t remaining;
f_number_unsigned_t used;
- void (*callback)(const f_console_arguments_t arguments, void * const parameters, f_console_parameter_state_t * const state, void * const data);
+ f_console_parameters_call_t on_match;
} f_console_parameters_t;
#define f_console_parameters_t_initialize { \
0 \
}
- #define macro_f_console_parameters_t_initialize_1(parameters, used, callback) { \
+ #define macro_f_console_parameters_t_initialize_1(parameters, used, on_match) { \
parameters, \
f_string_dynamics_t_initialize, \
f_number_unsigneds_t_initialize, \
used, \
- callback \
+ on_match \
}
#endif // _di_f_console_parameters_t_
#ifndef _di_f_directory_recurse_do_t_
typedef struct f_directory_recurse_do_t_ f_directory_recurse_do_t;
- typedef void (*f_directory_recurse_do_call_t)(f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint16_t flag);
+ typedef void (*f_directory_recurse_do_call_t) (f_directory_recurse_do_t * const recurse, const f_string_static_t name, const uint16_t flag);
struct f_directory_recurse_do_t_ {
f_number_unsigned_t depth;
#endif // _di_f_thread_condition_wait_timed_
#ifndef _di_f_thread_create_
- f_status_t f_thread_create(const f_thread_attribute_t * const attribute, f_thread_id_t * const id, void *(*routine) (void *), void * const argument) {
+ f_status_t f_thread_create(const f_thread_attribute_t * const attribute, f_thread_id_t * const id, const f_void_pointer_call_t routine, void * const argument) {
#ifndef _di_level_0_parameter_checking_
if (!id) return F_status_set_error(F_parameter);
if (!routine) return F_status_set_error(F_parameter);
* @see pthread_create()
*/
#ifndef _di_f_thread_create_
- extern f_status_t f_thread_create(const f_thread_attribute_t * const attribute, f_thread_id_t * const id, void *(*routine) (void *), void * const argument);
+ extern f_status_t f_thread_create(const f_thread_attribute_t * const attribute, f_thread_id_t * const id, const f_void_pointer_call_t routine, void * const argument);
#endif // _di_f_thread_create_
/**
#ifndef _di_f_state_t_
typedef struct f_state_t_ f_state_t;
- typedef void (*f_state_call_t)(f_state_t * const state, void * const internal);
+ typedef void (*f_state_call_t) (f_state_t * const state, void * const internal);
struct f_state_t_ {
uint16_t step_large;
#endif
/**
- * A generic callback function that accepts no parameters and returns no parameters.
+ * A generic callback function that accepts no parameters and returns no variables.
*/
#ifndef _di_f_void_call_t_
typedef void (*f_void_call_t) (void);
#define f_void_call_t_initialize 0
#endif // _di_f_void_call_t_
+/**
+ * A generic callback function that accepts a single void pointer parameter and returns a void pointer.
+ */
+#ifndef _di_f_void_pointer_call_t_
+ typedef void *(*f_void_pointer_call_t) (void *);
+
+ #define f_void_call_t_initialize 0
+#endif // _di_f_void_pointer_call_t_
+
#ifdef __cplusplus
} // extern "C"
#endif
#define macro_fl_print_t_initialize_warning_2(suffix, set) macro_fl_print_t_initialize_1(macro_f_file_t_initialize_2(F_type_output_d, F_type_descriptor_output_d, F_file_flag_write_only_d), f_console_verbosity_normal_e, 0, fl_print_warning_s, suffix, f_color_set_t_initialize, f_color_set_t_initialize, set, 0)
#endif // _di_fl_print_t_
+/**
+ * Provide a simple callback fo the print function where only fl_print_t is accepted.
+ *
+ * This returns a status.
+ */
+#ifndef _di_fl_print_call_t_
+ typedef f_status_t (*fl_print_call_t)(fl_print_t * const print);
+#endif // _di_fl_print_call_t_
+
#ifdef __cplusplus
} // extern "C"
#endif
f_console_parameter_t parameters[] = fake_console_parameter_t_initialize;
data.program.parameters.array = parameters;
data.program.parameters.used = fake_parameter_total_d;
- data.program.parameters.callback = &fake_setting_load_parameter_callback;
+ data.program.parameters.on_match = &fake_setting_load_parameter_callback;
data.program.environment = envp;
if (f_pipe_input_exists()) {
#endif
#ifndef _di_fss_read_basic_process_help_
- void fss_read_basic_process_help(void * const void_main) {
+ void fss_read_basic_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_basic_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_basic_print_message_help(&main->program.message);
}
#endif // _di_fss_read_basic_process_help_
#ifndef _di_fss_read_basic_process_load_
- void fss_read_basic_process_load(void * const void_main) {
+ void fss_read_basic_process_load(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
fll_fss_basic_read(main->setting.buffer, &main->setting.range, &main->setting.objects, &main->setting.contents, &main->setting.quotes_object, &main->setting.delimits_object, &main->setting.delimits_content, &main->setting.state);
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_basic_process_help_
- extern void fss_read_basic_process_help(void * const main);
+ extern void fss_read_basic_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_basic_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_basic_process_load_
- extern void fss_read_basic_process_load(void * const main);
+ extern void fss_read_basic_process_load(fss_read_main_t * const main);
#endif // _di_fss_read_basic_process_load_
#ifdef __cplusplus
data.setting.standard = fss_read_basic_standard_s;
data.setting.open_object = f_fss_basic_open_s;
- data.callback.process_help = &fss_read_basic_process_help;
- data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process = &fss_read_process;
-
- data.callback.process_at = &fss_read_process_at;
- data.callback.process_at_line = &fss_read_process_at_line;
- data.callback.process_columns = &fss_read_process_columns;
- data.callback.process_load = &fss_read_basic_process_load;
- data.callback.process_name = &fss_read_process_name;
- data.callback.process_total = &fss_read_process_total;
-
- data.callback.print_at = &fss_read_print_at;
- data.callback.print_content = &fss_read_print_content;
- data.callback.print_content_empty = &fss_read_print_content_empty;
- data.callback.print_content_ignore = 0;
- data.callback.print_content_next = 0;
- data.callback.print_object = &fss_read_print_object;
- data.callback.print_object_end = &fss_read_basic_print_object_end;
- data.callback.print_object_end_content = &fss_read_print_object_end_content;
- data.callback.print_object_end_empty = &fss_read_print_content_empty;
- data.callback.print_set_end = &fss_read_print_set_end;
+ data.call.process_help = &fss_read_basic_process_help;
+ data.call.process_last_line = &fss_read_process_last_line;
+ data.call.process = &fss_read_process;
+
+ data.call.process_at = &fss_read_process_at;
+ data.call.process_at_line = &fss_read_process_at_line;
+ data.call.process_columns = &fss_read_process_columns;
+ data.call.process_load = &fss_read_basic_process_load;
+ data.call.process_name = &fss_read_process_name;
+ data.call.process_total = &fss_read_process_total;
+
+ data.call.print_at = &fss_read_print_at;
+ data.call.print_content = &fss_read_print_content;
+ data.call.print_content_empty = &fss_read_print_content_empty;
+ data.call.print_content_ignore = 0;
+ data.call.print_content_next = 0;
+ data.call.print_object = &fss_read_print_object;
+ data.call.print_object_end = &fss_read_basic_print_object_end;
+ data.call.print_object_end_content = &fss_read_print_object_end_content;
+ data.call.print_object_end_empty = &fss_read_print_content_empty;
+ data.call.print_set_end = &fss_read_print_set_end;
f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_read_basic_list_process_help_
- void fss_read_basic_list_process_help(void * const void_main) {
+ void fss_read_basic_list_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_basic_list_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_basic_list_print_message_help(&main->program.message);
}
#endif // _di_fss_read_basic_list_process_help_
#ifndef _di_fss_read_basic_list_process_load_
- void fss_read_basic_list_process_load(void * const void_main) {
+ void fss_read_basic_list_process_load(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
fll_fss_basic_list_read(main->setting.buffer, &main->setting.range, &main->setting.objects, &main->setting.contents, &main->setting.delimits_object, &main->setting.delimits_content, &main->setting.comments, &main->setting.state);
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_basic_list_process_help_
- extern void fss_read_basic_list_process_help(void * const main);
+ extern void fss_read_basic_list_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_basic_list_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_basic_list_process_load_
- extern void fss_read_basic_list_process_load(void * const main);
+ extern void fss_read_basic_list_process_load(fss_read_main_t * const main);
#endif // _di_fss_read_basic_list_process_load_
#ifdef __cplusplus
data.setting.standard = fss_read_basic_list_standard_s;
data.setting.open_object = f_fss_basic_list_open_s;
- data.callback.process_help = &fss_read_basic_list_process_help;
- data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process = &fss_read_process;
-
- data.callback.process_at = &fss_read_process_at;
- data.callback.process_at_line = &fss_read_process_at_line;
- data.callback.process_columns = &fss_read_process_columns;
- data.callback.process_load = &fss_read_basic_list_process_load;
- data.callback.process_name = &fss_read_process_name;
- data.callback.process_total = &fss_read_process_total_multiple;
-
- data.callback.print_at = &fss_read_print_at;
- data.callback.print_content = &fss_read_print_content;
- data.callback.print_content_ignore = &fss_read_print_content_ignore;
- data.callback.print_content_next = 0;
- data.callback.print_object = &fss_read_print_object;
- data.callback.print_object_end = &fss_read_basic_list_print_object_end;
- data.callback.print_object_end_content = &fss_read_print_object_end_content;
- data.callback.print_object_end_empty = &fss_read_print_object_end_empty;
- data.callback.print_set_end = &fss_read_print_set_end_no_eol;
+ data.call.process_help = &fss_read_basic_list_process_help;
+ data.call.process_last_line = &fss_read_process_last_line;
+ data.call.process = &fss_read_process;
+
+ data.call.process_at = &fss_read_process_at;
+ data.call.process_at_line = &fss_read_process_at_line;
+ data.call.process_columns = &fss_read_process_columns;
+ data.call.process_load = &fss_read_basic_list_process_load;
+ data.call.process_name = &fss_read_process_name;
+ data.call.process_total = &fss_read_process_total_multiple;
+
+ data.call.print_at = &fss_read_print_at;
+ data.call.print_content = &fss_read_print_content;
+ data.call.print_content_ignore = &fss_read_print_content_ignore;
+ data.call.print_content_next = 0;
+ data.call.print_object = &fss_read_print_object;
+ data.call.print_object_end = &fss_read_basic_list_print_object_end;
+ data.call.print_object_end_content = &fss_read_print_object_end_content;
+ data.call.print_object_end_empty = &fss_read_print_object_end_empty;
+ data.call.print_set_end = &fss_read_print_set_end_no_eol;
f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_read_embedded_list_process_help_
- void fss_read_embedded_list_process_help(void * const void_main) {
+ void fss_read_embedded_list_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_embedded_list_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_embedded_list_print_message_help(&main->program.message);
}
#endif // _di_fss_read_embedded_list_process_help_
#ifndef _di_fss_read_embedded_list_process_load_
- void fss_read_embedded_list_process_load(void * const void_main) {
+ void fss_read_embedded_list_process_load(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
{
f_state_t state = main->setting.state;
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_embedded_list_process_help_
- extern void fss_read_embedded_list_process_help(void * const main);
+ extern void fss_read_embedded_list_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_embedded_list_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_embedded_list_process_load_
- extern void fss_read_embedded_list_process_load(void * const main);
+ extern void fss_read_embedded_list_process_load(fss_read_main_t * const main);
#endif // _di_fss_read_embedded_list_process_load_
#ifdef __cplusplus
data.setting.standard = fss_read_embedded_list_standard_s;
data.setting.open_object = f_fss_embedded_list_open_s;
- data.callback.process_help = &fss_read_embedded_list_process_help;
- data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process = &fss_read_embedded_list_process;
-
- data.callback.process_at = &fss_read_process_at;
- data.callback.process_at_line = &fss_read_process_at_line;
- data.callback.process_columns = &fss_read_process_columns;
- data.callback.process_load = &fss_read_embedded_list_process_load;
- data.callback.process_name = &fss_read_process_name;
- data.callback.process_total = &fss_read_process_total_multiple;
-
- data.callback.print_at = &fss_read_print_at;
- data.callback.print_content = &fss_read_print_content;
- data.callback.print_content_ignore = &fss_read_print_content_ignore;
- data.callback.print_content_next = 0;
- data.callback.print_object = &fss_read_print_object;
- data.callback.print_object_end = &fss_read_embedded_list_print_object_end;
- data.callback.print_object_end_content = &fss_read_print_object_end_content;
- data.callback.print_object_end_empty = &fss_read_print_object_end_empty;
- data.callback.print_set_end = &fss_read_embedded_list_print_set_end;
+ data.call.process_help = &fss_read_embedded_list_process_help;
+ data.call.process_last_line = &fss_read_process_last_line;
+ data.call.process = &fss_read_embedded_list_process;
+
+ data.call.process_at = &fss_read_process_at;
+ data.call.process_at_line = &fss_read_process_at_line;
+ data.call.process_columns = &fss_read_process_columns;
+ data.call.process_load = &fss_read_embedded_list_process_load;
+ data.call.process_name = &fss_read_process_name;
+ data.call.process_total = &fss_read_process_total_multiple;
+
+ data.call.print_at = &fss_read_print_at;
+ data.call.print_content = &fss_read_print_content;
+ data.call.print_content_ignore = &fss_read_print_content_ignore;
+ data.call.print_content_next = 0;
+ data.call.print_object = &fss_read_print_object;
+ data.call.print_object_end = &fss_read_embedded_list_print_object_end;
+ data.call.print_object_end_content = &fss_read_print_object_end_content;
+ data.call.print_object_end_empty = &fss_read_print_object_end_empty;
+ data.call.print_set_end = &fss_read_embedded_list_print_set_end;
f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_read_embedded_list_process_
- void fss_read_embedded_list_process(void * const void_main) {
+ void fss_read_embedded_list_process(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
// The process_load() callback is required to be non-NULL.
- if (!main->callback.process_load) return;
+ if (!main->call.process_load) return;
// This standard does not support multiple select, so any select greater than 0 can be predicted without processing the buffer.
if ((main->setting.flag & fss_read_main_flag_select_d) && main->setting.select) {
main->setting.quotes_object.used = 0;
main->setting.quotes_content.used = 0;
- main->callback.process_load(main);
+ main->call.process_load(main);
if (F_status_is_error(main->setting.state.status)) return;
fss_read_embedded_list_process_determine_depth(main);
bool names[main->setting.objects.used];
- if (main->callback.process_name) {
- main->callback.process_name(main, names);
+ if (main->call.process_name) {
+ main->call.process_name(main, names);
if (F_status_is_error(main->setting.state.status)) return;
}
else if (main->setting.objects.used) {
}
if (main->setting.flag & fss_read_main_flag_total_d) {
- if (main->callback.process_total) {
- main->callback.process_total(main, names);
+ if (main->call.process_total) {
+ main->call.process_total(main, names);
}
}
else if ((main->setting.flag & fss_read_main_flag_at_d) && main->setting.depth.index_at) {
- if (main->callback.process_at) {
- main->callback.process_at(main, names, *delimits_object, *delimits_content);
+ if (main->call.process_at) {
+ main->call.process_at(main, names, *delimits_object, *delimits_content);
}
}
else if (main->setting.flag & fss_read_main_flag_columns_d) {
- if (main->callback.process_columns) {
- main->callback.process_columns(main, names);
+ if (main->call.process_columns) {
+ main->call.process_columns(main, names);
}
}
else {
f_number_unsigned_t i = 0;
if (main->setting.flag & fss_read_main_flag_line_d) {
- if (main->callback.process_at_line) {
+ if (main->call.process_at_line) {
f_number_unsigned_t line = 0;
for (; i < main->setting.contents.used && main->setting.state.status != F_success; ++i) {
if (!names[i]) continue;
if (fss_read_signal_check(main)) return;
- main->callback.process_at_line(void_main, i, *delimits_object, *delimits_content, &line);
+ main->call.process_at_line(main, i, *delimits_object, *delimits_content, &line);
if (F_status_is_error(main->setting.state.status)) return;
} // for
}
}
- else if (main->callback.print_at) {
+ else if (main->call.print_at) {
for (; i < main->setting.contents.used; ++i) {
if (!names[i]) continue;
if (fss_read_signal_check(main)) return;
- main->callback.print_at(&main->program.output, i, *delimits_object, *delimits_content);
+ main->call.print_at(&main->program.output, i, *delimits_object, *delimits_content);
} // for
}
}
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_embedded_list_process_
- extern void fss_read_embedded_list_process(void * const main);
+ extern void fss_read_embedded_list_process(fss_read_main_t * const main);
#endif // _di_fss_read_embedded_list_process_
/**
#endif
#ifndef _di_fss_read_extended_process_help_
- void fss_read_extended_process_help(void * const void_main) {
+ void fss_read_extended_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_extended_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_extended_print_message_help(&main->program.message);
}
#endif // _di_fss_read_extended_process_help_
#ifndef _di_fss_read_extended_process_load_
- void fss_read_extended_process_load(void * const void_main) {
+ void fss_read_extended_process_load(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
fll_fss_extended_read(main->setting.buffer, &main->setting.range, &main->setting.objects, &main->setting.contents, &main->setting.quotes_object, &main->setting.quotes_content, &main->setting.delimits_object, &main->setting.delimits_content, &main->setting.state);
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
* If FALSE, then this is not the last Content in the Content set.
*/
#ifndef _di_fss_read_extended_process_content_
- extern void fss_read_extended_process_content(void * const main, const bool last);
+ extern void fss_read_extended_process_content(fss_read_main_t * const main, const bool last);
#endif // _di_fss_read_extended_process_content_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_extended_process_help_
- extern void fss_read_extended_process_help(void * const main);
+ extern void fss_read_extended_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_extended_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_extended_process_load_
- extern void fss_read_extended_process_load(void * const main);
+ extern void fss_read_extended_process_load(fss_read_main_t * const main);
#endif // _di_fss_read_extended_process_load_
#ifdef __cplusplus
data.setting.standard = fss_read_extended_standard_s;
data.setting.open_object = f_fss_extended_open_s;
- data.callback.process_help = &fss_read_extended_process_help;
- data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process = &fss_read_process;
-
- data.callback.process_at = &fss_read_process_at;
- data.callback.process_at_line = &fss_read_process_at_line;
- data.callback.process_columns = &fss_read_process_columns;
- data.callback.process_load = &fss_read_extended_process_load;
- data.callback.process_name = &fss_read_process_name;
- data.callback.process_total = &fss_read_process_total;
-
- data.callback.print_at = &fss_read_print_at;
- data.callback.print_content = &fss_read_print_content;
- data.callback.print_content_empty = &fss_read_print_content_empty;
- data.callback.print_content_ignore = &fss_read_print_content_ignore;
- data.callback.print_content_next = &fss_read_extended_print_content_next;
- data.callback.print_object = &fss_read_print_object;
- data.callback.print_object_end = &fss_read_extended_print_object_end;
- data.callback.print_object_end_content = &fss_read_print_object_end_content;
- data.callback.print_object_end_empty = &fss_read_print_content_empty;
- data.callback.print_set_end = &fss_read_print_set_end;
+ data.call.process_help = &fss_read_extended_process_help;
+ data.call.process_last_line = &fss_read_process_last_line;
+ data.call.process = &fss_read_process;
+
+ data.call.process_at = &fss_read_process_at;
+ data.call.process_at_line = &fss_read_process_at_line;
+ data.call.process_columns = &fss_read_process_columns;
+ data.call.process_load = &fss_read_extended_process_load;
+ data.call.process_name = &fss_read_process_name;
+ data.call.process_total = &fss_read_process_total;
+
+ data.call.print_at = &fss_read_print_at;
+ data.call.print_content = &fss_read_print_content;
+ data.call.print_content_empty = &fss_read_print_content_empty;
+ data.call.print_content_ignore = &fss_read_print_content_ignore;
+ data.call.print_content_next = &fss_read_extended_print_content_next;
+ data.call.print_object = &fss_read_print_object;
+ data.call.print_object_end = &fss_read_extended_print_object_end;
+ data.call.print_object_end_content = &fss_read_print_object_end_content;
+ data.call.print_object_end_empty = &fss_read_print_content_empty;
+ data.call.print_set_end = &fss_read_print_set_end;
f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_read_extended_list_process_help_
- void fss_read_extended_list_process_help(void * const void_main) {
+ void fss_read_extended_list_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_extended_list_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_extended_list_print_message_help(&main->program.message);
}
#endif // _di_fss_read_extended_list_process_help_
#ifndef _di_fss_read_extended_list_process_load_
- void fss_read_extended_list_process_load(void * const void_main) {
+ void fss_read_extended_list_process_load(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
fll_fss_extended_list_read(main->setting.buffer, &main->setting.range, &main->setting.objects, &main->setting.closes, &main->setting.contents, &main->setting.delimits_object, &main->setting.delimits_content, &main->setting.comments, &main->setting.state);
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_extended_list_process_help_
- extern void fss_read_extended_list_process_help(void * const main);
+ extern void fss_read_extended_list_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_extended_list_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_extended_list_process_load_
- extern void fss_read_extended_list_process_load(void * const main);
+ extern void fss_read_extended_list_process_load(fss_read_main_t * const main);
#endif // _di_fss_read_extended_list_process_load_
#ifdef __cplusplus
data.setting.standard = fss_read_extended_list_standard_s;
data.setting.open_object = f_fss_extended_list_open_s;
- data.callback.process_help = &fss_read_extended_list_process_help;
- data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process = &fss_read_process;
-
- data.callback.process_at = &fss_read_process_at;
- data.callback.process_at_line = &fss_read_process_at_line;
- data.callback.process_columns = &fss_read_process_columns;
- data.callback.process_load = &fss_read_extended_list_process_load;
- data.callback.process_name = &fss_read_process_name;
- data.callback.process_total = &fss_read_process_total_multiple;
-
- data.callback.print_at = &fss_read_print_at;
- data.callback.print_content = &fss_read_print_content;
- data.callback.print_content_ignore = &fss_read_print_content_ignore;
- data.callback.print_content_next = 0;
- data.callback.print_object = &fss_read_print_object;
- data.callback.print_object_end = &fss_read_extended_list_print_object_end;
- data.callback.print_object_end_content = &fss_read_print_object_end_content;
- data.callback.print_object_end_empty = &fss_read_print_object_end_empty;
- data.callback.print_set_end = &fss_read_extended_list_print_set_end;
+ data.call.process_help = &fss_read_extended_list_process_help;
+ data.call.process_last_line = &fss_read_process_last_line;
+ data.call.process = &fss_read_process;
+
+ data.call.process_at = &fss_read_process_at;
+ data.call.process_at_line = &fss_read_process_at_line;
+ data.call.process_columns = &fss_read_process_columns;
+ data.call.process_load = &fss_read_extended_list_process_load;
+ data.call.process_name = &fss_read_process_name;
+ data.call.process_total = &fss_read_process_total_multiple;
+
+ data.call.print_at = &fss_read_print_at;
+ data.call.print_content = &fss_read_print_content;
+ data.call.print_content_ignore = &fss_read_print_content_ignore;
+ data.call.print_content_next = 0;
+ data.call.print_object = &fss_read_print_object;
+ data.call.print_object_end = &fss_read_extended_list_print_object_end;
+ data.call.print_object_end_content = &fss_read_print_object_end_content;
+ data.call.print_object_end_empty = &fss_read_print_object_end_empty;
+ data.call.print_set_end = &fss_read_extended_list_print_set_end;
f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
data.program.parameters.array = parameters;
if (main->setting.buffer.used) {
main->setting.files.array[0].range.stop = main->setting.buffer.used - 1;
- if (main->callback.process_last_line) {
- main->callback.process_last_line((void *) main);
+ if (main->call.process_last_line) {
+ main->call.process_last_line(main);
if (F_status_is_error(main->setting.state.status)) return;
}
if (main->setting.buffer.used > file_data->range.start) {
main->setting.files.array[main->setting.files.used++].range.stop = main->setting.buffer.used - 1;
- if (main->callback.process_last_line) {
- main->callback.process_last_line((void *) main);
+ if (main->call.process_last_line) {
+ main->call.process_last_line(main);
if (F_status_is_error(main->setting.state.status)) break;
}
}
#endif // _di_fss_read_setting_load_
#ifndef _di_fss_read_setting_load_depth_
- void fss_read_setting_load_depth(const f_console_arguments_t arguments, void * const void_main, f_console_parameters_t * const parameters) {
+ void fss_read_setting_load_depth(const f_console_arguments_t arguments, fss_read_main_t * const main, f_console_parameters_t * const parameters) {
- if (!void_main || !parameters) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main || !parameters) return;
f_number_unsigned_t i = 1;
* The main program data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_setting_load()
*/
#ifndef _di_fss_read_setting_load_depth_
- extern void fss_read_setting_load_depth(const f_console_arguments_t arguments, void * const main, f_console_parameters_t * const parameters);
+ extern void fss_read_setting_load_depth(const f_console_arguments_t arguments, fss_read_main_t * const main, f_console_parameters_t * const parameters);
#endif // _di_fss_read_setting_load_depth_
#ifdef __cplusplus
* print_set_end: Print the Content set end, usually called by several callbacks within the process() callback.
* print_set_end_empty: Print set end for cases where the Content is empty and only something like a closing new line is required.
*/
-#ifndef _di_fss_read_callback_t_
+#ifndef _di_fss_read_call_t_
+ typedef void (*fss_read_process_main_call_t) (fss_read_main_t * const main);
+ typedef void (*fss_read_process_main_at_call_t) (fss_read_main_t * const main, const bool names[], const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
+ typedef void (*fss_read_process_main_at_line_call_t) (fss_read_main_t * const main, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content, f_number_unsigned_t * const line);
+ typedef void (*fss_read_process_main_names_call_t) (fss_read_main_t * const main, bool names[]);
+ typedef void (*fss_read_process_main_names_const_call_t) (fss_read_main_t * const main, const bool names[]);
+
+ typedef f_status_t (*print_at_call_t)(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
+ typedef f_status_t (*print_object_call_t)(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits);
+ typedef f_status_t (*print_object_end_content_call_t)(fl_print_t * const print, const f_number_unsigned_t at, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+ typedef f_status_t (*print_content_call_t)(fl_print_t * const print, const f_number_unsigned_t at, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
+ typedef f_status_t (*print_set_end_call_t)(fl_print_t * const print, const f_number_unsigned_t close);
+
typedef struct {
- void (*process)(void * const main);
- void (*process_help)(void * const main);
- void (*process_last_line)(void * const main);
-
- void (*process_at)(void * const main, const bool names[], const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
- void (*process_at_line)(void * const void_main, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content, f_number_unsigned_t * const line);
- void (*process_columns)(void * const main, const bool names[]);
- void (*process_load)(void * const main);
- void (*process_name)(void * const main, bool names[]);
- void (*process_total)(void * const main, const bool names[]);
-
- f_status_t (*print_at)(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
- f_status_t (*print_object)(fl_print_t * const print, const f_number_unsigned_t at, const f_number_unsigneds_t delimits);
- f_status_t (*print_object_end_content)(fl_print_t * const print, const f_number_unsigned_t at, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
- f_status_t (*print_content)(fl_print_t * const print, const f_number_unsigned_t at, const f_range_t range, const uint8_t quote, const f_number_unsigneds_t delimits);
- f_status_t (*print_content_empty)(fl_print_t * const print);
- f_status_t (*print_content_ignore)(fl_print_t * const print);
- f_status_t (*print_content_next)(fl_print_t * const print);
- f_status_t (*print_object_end)(fl_print_t * const print);
- f_status_t (*print_object_end_empty)(fl_print_t * const print);
- f_status_t (*print_set_end)(fl_print_t * const print, const f_number_unsigned_t close);
- f_status_t (*print_set_end_empty)(fl_print_t * const print);
- } fss_read_callback_t;
-
- #define fss_read_callback_t_initialize \
+ fss_read_process_main_call_t process;
+ fss_read_process_main_call_t process_help;
+ fss_read_process_main_call_t process_last_line;
+
+ fss_read_process_main_at_call_t process_at;
+ fss_read_process_main_at_line_call_t process_at_line;
+ fss_read_process_main_names_const_call_t process_columns;
+ fss_read_process_main_call_t process_load;
+ fss_read_process_main_names_call_t process_name;
+ fss_read_process_main_names_const_call_t process_total;
+
+ print_at_call_t print_at;
+ print_object_call_t print_object;
+ print_object_end_content_call_t print_object_end_content;
+ print_content_call_t print_content;
+ fl_print_call_t print_content_empty;
+ fl_print_call_t print_content_ignore;
+ fl_print_call_t print_content_next;
+ fl_print_call_t print_object_end;
+ fl_print_call_t print_object_end_empty;
+ print_set_end_call_t print_set_end;
+ fl_print_call_t print_set_end_empty;
+ } fss_read_call_t;
+
+ #define fss_read_call_t_initialize \
{ \
0, \
0, \
0, \
0, \
}
-#endif // _di_fss_read_callback_t_
+#endif // _di_fss_read_call_t_
/**
* The fss read main program settings.
/**
* The main program data as a single structure.
*
- * cache: The cache data.
- * callback: The callback data.
- * program: The main program data.
- * setting: The settings data.
+ * Properties:
+ * - cache: The cache data.
+ * - call: The callbacks.
+ * - program: The main program data.
+ * - setting: The settings data.
*/
#ifndef _di_fss_read_main_t_
struct fss_read_main_t_ {
fss_read_cache_t cache;
- fss_read_callback_t callback;
+ fss_read_call_t call;
fll_program_data_t program;
fss_read_setting_t setting;
};
#define fss_read_main_t_initialize \
{ \
fss_read_cache_t_initialize, \
- fss_read_callback_t_initialize, \
+ fss_read_call_t_initialize, \
fll_program_data_t_initialize, \
fss_read_setting_t_initialize, \
}
#endif // _di_fss_read_main_t_
/**
+ * Callback type for the fss_read_setting_load() argument.
+ *
+ * Perform the initial processing for fss_read_setting_load().
+ */
+#ifndef _di_fss_read_setting_load_call_t_
+ typedef void (*fss_read_setting_load_call_t) (const f_console_arguments_t arguments, fss_read_main_t * const main);
+#endif // _di_fss_read_setting_load_call_t_
+
+/**
* Delete the program main cache data.
*
* @param cache
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
#endif // _di_fss_read_delimit_object_is_
#ifndef _di_fss_read_main_
- void fss_read_main(void * const void_main) {
+ void fss_read_main(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
-
- if (F_status_is_error(main->setting.state.status)) return;
+ if (!main || F_status_is_error(main->setting.state.status)) return;
main->setting.state.status = F_okay;
if (main->setting.flag & fss_read_main_flag_version_copyright_help_d) {
if (main->setting.flag & fss_read_main_flag_help_d) {
- if (main->callback.process_help) {
- main->callback.process_help(void_main);
+ if (main->call.process_help) {
+ main->call.process_help(main);
}
else {
fss_read_print_message_help(&main->program.message);
}
if (main->setting.flag & fss_read_main_flag_object_content_d) {
- if (main->callback.process) {
- main->callback.process(void_main);
+ if (main->call.process) {
+ main->call.process(main);
}
}
#endif // _di_fss_read_file_identify_
#ifndef _di_fss_read_process_last_line_
- void fss_read_process_last_line(void * const void_main) {
-
- if (!void_main) return;
+ void fss_read_process_last_line(fss_read_main_t * const main) {
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
main->setting.state.status = f_string_dynamic_append_assure(f_string_eol_s, &main->setting.buffer);
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* Errors (with error bit) from: main.callback.process().
*/
#ifndef _di_fss_read_main_
- extern void fss_read_main(void * const main);
+ extern void fss_read_main(fss_read_main_t * const main);
#endif // _di_fss_read_main_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_last_line_
- extern void fss_read_process_last_line(void * const void_main);
+ extern void fss_read_process_last_line(fss_read_main_t * const main);
#endif // _di_fss_read_process_last_line_
#ifdef __cplusplus
}
#ifndef _di_fss_read_main_process_help_
- void fss_read_main_process_help(void * const void_main) {
+ void fss_read_main_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_main_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_main_print_message_help(&main->program.message);
}
#endif // _di_fss_read_main_process_help_
if (!main || F_status_is_error(main->setting.state.status) || (main->setting.flag & fss_read_main_flag_version_d)) return;
// Use the default standard of: FSS-0000 (Basic)
- main->callback.process_help = &fss_read_main_process_help;
- main->callback.process_last_line = &fss_read_process_last_line;
- main->callback.process = &fss_read_process;
-
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_load = &fss_read_basic_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process_total = &fss_read_process_total;
-
- main->callback.print_at = &fss_read_print_at;
- main->callback.print_content = &fss_read_print_content;
- main->callback.print_content_empty = &fss_read_print_content_empty;
- main->callback.print_content_ignore = 0;
- main->callback.print_content_next = 0;
- main->callback.print_object = &fss_read_print_object;
- main->callback.print_object_end = &fss_read_basic_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_content_empty;
- main->callback.print_set_end = &fss_read_print_set_end;
+ main->call.process_help = &fss_read_main_process_help;
+ main->call.process_last_line = &fss_read_process_last_line;
+ main->call.process = &fss_read_process;
+
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_load = &fss_read_basic_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process_total = &fss_read_process_total;
+
+ main->call.print_at = &fss_read_print_at;
+ main->call.print_content = &fss_read_print_content;
+ main->call.print_content_empty = &fss_read_print_content_empty;
+ main->call.print_content_ignore = 0;
+ main->call.print_content_next = 0;
+ main->call.print_object = &fss_read_print_object;
+ main->call.print_object_end = &fss_read_basic_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_content_empty;
+ main->call.print_set_end = &fss_read_print_set_end;
main->setting.standard = fss_read_basic_standard_s;
main->setting.open_object = f_fss_basic_open_s;
main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_help = &fss_read_basic_process_help;
- main->callback.process_load = &fss_read_basic_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process = &fss_read_process;
- main->callback.process_total = &fss_read_process_total;
-
- main->callback.print_content = &fss_read_print_content;
- main->callback.print_content_ignore = 0;
- main->callback.print_content_next = 0;
- main->callback.print_object_end = &fss_read_basic_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_content_empty;
- main->callback.print_set_end = &fss_read_print_set_end;
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_help = &fss_read_basic_process_help;
+ main->call.process_load = &fss_read_basic_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process = &fss_read_process;
+ main->call.process_total = &fss_read_process_total;
+
+ main->call.print_content = &fss_read_print_content;
+ main->call.print_content_ignore = 0;
+ main->call.print_content_next = 0;
+ main->call.print_object_end = &fss_read_basic_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_content_empty;
+ main->call.print_set_end = &fss_read_print_set_end;
}
else if (f_compare_dynamic(as, fss_read_format_code_short_0001_s) == F_equal_to ||
f_compare_dynamic(as, fss_read_format_code_long_0001_s) == F_equal_to ||
main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_help = &fss_read_extended_process_help;
- main->callback.process_load = &fss_read_extended_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process = &fss_read_process;
- main->callback.process_total = &fss_read_process_total;
-
- main->callback.print_content = &fss_read_print_content;
- main->callback.print_content_next = &fss_read_extended_print_content_next;
- main->callback.print_object_end = &fss_read_extended_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_content_empty;
- main->callback.print_set_end = &fss_read_print_set_end;
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_help = &fss_read_extended_process_help;
+ main->call.process_load = &fss_read_extended_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process = &fss_read_process;
+ main->call.process_total = &fss_read_process_total;
+
+ main->call.print_content = &fss_read_print_content;
+ main->call.print_content_next = &fss_read_extended_print_content_next;
+ main->call.print_object_end = &fss_read_extended_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_content_empty;
+ main->call.print_set_end = &fss_read_print_set_end;
}
else if (f_compare_dynamic(as, fss_read_format_code_short_0002_s) == F_equal_to ||
f_compare_dynamic(as, fss_read_format_code_long_0002_s) == F_equal_to ||
main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_help = &fss_read_basic_list_process_help;
- main->callback.process_load = &fss_read_basic_list_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process = &fss_read_process;
- main->callback.process_total = &fss_read_process_total_multiple;
-
- main->callback.print_content = &fss_read_print_content;
- main->callback.print_content_next = 0;
- main->callback.print_object_end = &fss_read_basic_list_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_object_end_empty;
- main->callback.print_set_end = &fss_read_print_set_end_no_eol;
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_help = &fss_read_basic_list_process_help;
+ main->call.process_load = &fss_read_basic_list_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process = &fss_read_process;
+ main->call.process_total = &fss_read_process_total_multiple;
+
+ main->call.print_content = &fss_read_print_content;
+ main->call.print_content_next = 0;
+ main->call.print_object_end = &fss_read_basic_list_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_object_end_empty;
+ main->call.print_set_end = &fss_read_print_set_end_no_eol;
}
else if (f_compare_dynamic(as, fss_read_format_code_short_0003_s) == F_equal_to ||
f_compare_dynamic(as, fss_read_format_code_long_0003_s) == F_equal_to ||
main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_help = &fss_read_extended_list_process_help;
- main->callback.process_load = &fss_read_extended_list_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process = &fss_read_process;
- main->callback.process_total = &fss_read_process_total_multiple;
-
- main->callback.print_content = &fss_read_print_content;
- main->callback.print_content_next = 0;
- main->callback.print_object_end = &fss_read_extended_list_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_object_end_empty;
- main->callback.print_set_end = &fss_read_extended_list_print_set_end;
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_help = &fss_read_extended_list_process_help;
+ main->call.process_load = &fss_read_extended_list_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process = &fss_read_process;
+ main->call.process_total = &fss_read_process_total_multiple;
+
+ main->call.print_content = &fss_read_print_content;
+ main->call.print_content_next = 0;
+ main->call.print_object_end = &fss_read_extended_list_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_object_end_empty;
+ main->call.print_set_end = &fss_read_extended_list_print_set_end;
}
else if (f_compare_dynamic(as, fss_read_format_code_short_0008_s) == F_equal_to ||
f_compare_dynamic(as, fss_read_format_code_long_0008_s) == F_equal_to ||
main->program.parameters.array[fss_read_parameter_payload_e].flag |= f_console_flag_disable_e;
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_help = &fss_read_embedded_list_process_help;
- main->callback.process_load = &fss_read_embedded_list_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process = &fss_read_embedded_list_process;
- main->callback.process_total = &fss_read_process_total_multiple;
-
- main->callback.print_content = &fss_read_print_content;
- main->callback.print_content_next = 0;
- main->callback.print_object_end = &fss_read_embedded_list_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_object_end_empty;
- main->callback.print_set_end = &fss_read_embedded_list_print_set_end;
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_help = &fss_read_embedded_list_process_help;
+ main->call.process_load = &fss_read_embedded_list_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process = &fss_read_embedded_list_process;
+ main->call.process_total = &fss_read_process_total_multiple;
+
+ main->call.print_content = &fss_read_print_content;
+ main->call.print_content_next = 0;
+ main->call.print_object_end = &fss_read_embedded_list_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_object_end_empty;
+ main->call.print_set_end = &fss_read_embedded_list_print_set_end;
}
else if (f_compare_dynamic(as, fss_read_format_code_short_000e_s) == F_equal_to ||
f_compare_dynamic(as, fss_read_format_code_long_000e_s) == F_equal_to ||
main->program.parameters.array[fss_read_parameter_payload_e].flag &= ~f_console_flag_disable_e;
- main->callback.process_at = &fss_read_process_at;
- main->callback.process_at_line = &fss_read_process_at_line;
- main->callback.process_columns = &fss_read_process_columns;
- main->callback.process_help = &fss_read_payload_process_help;
- main->callback.process_load = &fss_read_payload_process_load;
- main->callback.process_name = &fss_read_process_name;
- main->callback.process = &fss_read_process;
- main->callback.process_total = &fss_read_process_total_multiple;
-
- main->callback.print_content = &fss_read_payload_print_content;
- main->callback.print_content_next = 0;
- main->callback.print_object_end = &fss_read_payload_print_object_end;
- main->callback.print_object_end_content = &fss_read_print_object_end_content;
- main->callback.print_object_end_empty = &fss_read_print_object_end_empty;
- main->callback.print_set_end = &fss_read_print_set_end_no_eol;
+ main->call.process_at = &fss_read_process_at;
+ main->call.process_at_line = &fss_read_process_at_line;
+ main->call.process_columns = &fss_read_process_columns;
+ main->call.process_help = &fss_read_payload_process_help;
+ main->call.process_load = &fss_read_payload_process_load;
+ main->call.process_name = &fss_read_process_name;
+ main->call.process = &fss_read_process;
+ main->call.process_total = &fss_read_process_total_multiple;
+
+ main->call.print_content = &fss_read_payload_print_content;
+ main->call.print_content_next = 0;
+ main->call.print_object_end = &fss_read_payload_print_object_end;
+ main->call.print_object_end_content = &fss_read_print_object_end_content;
+ main->call.print_object_end_empty = &fss_read_print_object_end_empty;
+ main->call.print_set_end = &fss_read_print_set_end_no_eol;
}
else {
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((void *) main);
+ fss_read_main_process_help(main);
}
else {
fss_read_main_print_error_format_unknown(&main->program.error, as);
if (F_status_is_error(main->setting.state.status)) {
if (main->setting.flag & fss_read_main_flag_help_d) {
- fss_read_main_process_help((void *) main);
+ fss_read_main_process_help(main);
}
else {
fss_read_print_error(&main->program.error, macro_fss_read_f(f_console_parameter_reset));
if (F_status_is_error(main->setting.state.status)) {
if (main->setting.flag & fss_read_main_flag_help_d) {
- fss_read_main_process_help((void *) main);
+ fss_read_main_process_help(main);
}
else {
fss_read_print_error(&main->program.error, macro_fss_read_f(f_console_parameter_process));
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((void *) main);
+ 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]);
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((void *) main);
+ fss_read_main_process_help(main);
return;
}
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_main_process_help_
- extern void fss_read_main_process_help(void * const main);
+ extern void fss_read_main_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_main_process_help_
/**
uint8_t print_state = 0x0;
if (main->setting.flag & fss_read_main_flag_object_d) {
- if (main->callback.print_object) {
+ if (main->call.print_object) {
print_state = 0x1;
- main->callback.print_object(&main->program.output, at, delimits_object);
+ main->call.print_object(&main->program.output, at, delimits_object);
}
}
if (main->setting.flag & fss_read_main_flag_content_d) {
if (main->setting.flag & fss_read_main_flag_select_d) {
if (main->setting.select < main->setting.contents.array[at].used && main->setting.contents.array[at].array[main->setting.select].start <= main->setting.contents.array[at].array[main->setting.select].stop) {
- if (main->callback.print_content && main->callback.print_object_end_content) {
+ if (main->call.print_content && main->call.print_object_end_content) {
if (print_state & 0x1) {
if (F_status_set_fine(
- main->callback.print_object_end_content(
+ main->call.print_object_end_content(
&main->program.output,
at,
main->setting.contents.array[at].array[main->setting.select],
}
else {
if (F_status_set_fine(
- main->callback.print_content(
+ main->call.print_content(
&main->program.output,
at,
main->setting.contents.array[at].array[main->setting.select],
}
}
else if (main->setting.contents.array[at].used) {
- if (main->callback.print_content && main->callback.print_object_end_content) {
+ if (main->call.print_content && main->call.print_object_end_content) {
f_number_unsigned_t i = 0;
// Loop through with conditionals only when necessary for performance reasons.
if (print_state & 0x1) {
if (F_status_set_fine(
- main->callback.print_object_end_content(
+ main->call.print_object_end_content(
&main->program.output,
at,
main->setting.contents.array[at].array[i],
}
}
else if (F_status_set_fine(
- main->callback.print_content(
+ main->call.print_content(
&main->program.output,
at,
main->setting.contents.array[at].array[i],
if (fss_read_signal_check(main)) return F_status_set_error(F_interrupt);
if (main->setting.contents.array[at].array[i].start > main->setting.contents.array[at].array[i].stop) continue;
- if (main->callback.print_content_next) {
- main->callback.print_content_next(&main->program.output);
+ if (main->call.print_content_next) {
+ main->call.print_content_next(&main->program.output);
}
- main->callback.print_content(
+ main->call.print_content(
&main->program.output,
at,
main->setting.contents.array[at].array[i],
if (print_state & 0x8) {
if (print_state & 0x1) {
- if (!(print_state & 0x4) && main->callback.print_object_end_empty) {
- main->callback.print_object_end_empty(&main->program.output);
+ if (!(print_state & 0x4) && main->call.print_object_end_empty) {
+ main->call.print_object_end_empty(&main->program.output);
}
}
if ((print_state & 0x1) || !(print_state & 0x10)) {
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
}
}
else {
if ((print_state & 0x3) != 0x3 && (print_state & 0x1)) {
- if (!(print_state & 0x4) && main->callback.print_object_end) {
- main->callback.print_object_end(&main->program.output);
+ if (!(print_state & 0x4) && main->call.print_object_end) {
+ main->call.print_object_end(&main->program.output);
}
}
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
}
}
else if (print_state & 0x1) {
- if (main->callback.print_object_end_empty) {
- main->callback.print_object_end_empty(&main->program.output);
+ if (main->call.print_object_end_empty) {
+ main->call.print_object_end_empty(&main->program.output);
}
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
}
fss_read_main_t * const main = (fss_read_main_t *) print->custom;
- if (main->callback.print_content_ignore) {
- main->callback.print_content_ignore(&main->program.output);
+ if (main->call.print_content_ignore) {
+ main->call.print_content_ignore(&main->program.output);
}
if (main->setting.flag & fss_read_main_flag_original_d) {
}
}
- if (main->callback.print_content_ignore) {
- main->callback.print_content_ignore(&main->program.output);
+ if (main->call.print_content_ignore) {
+ main->call.print_content_ignore(&main->program.output);
}
return F_okay;
fss_read_main_t * const main = (fss_read_main_t *) print->custom;
- if (main->callback.print_object_end) {
- const f_status_t status = main->callback.print_object_end(print);
+ if (main->call.print_object_end) {
+ const f_status_t status = main->call.print_object_end(print);
if (F_status_is_error(status) || status == F_output_not) return status;
}
- if (main->callback.print_content) {
- return main->callback.print_content(print, at, range, quote, delimits);
+ if (main->call.print_content) {
+ return main->call.print_content(print, at, range, quote, delimits);
}
- return main->callback.print_object_end ? F_okay : F_output_not;
+ return main->call.print_object_end ? F_okay : F_output_not;
}
#endif // _di_fss_read_print_object_end_content_
fss_read_main_t * const main = (fss_read_main_t *) print->custom;
- const f_status_t status_1 = (main->callback.print_object_end) ? main->callback.print_object_end(print) : F_output_not;
- const f_status_t status_2 = (main->callback.print_content_empty) ? main->callback.print_content_empty(print) : F_output_not;
+ const f_status_t status_1 = (main->call.print_object_end) ? main->call.print_object_end(print) : F_output_not;
+ const f_status_t status_2 = (main->call.print_content_empty) ? main->call.print_content_empty(print) : F_output_not;
if (F_status_is_error(status_1)) return status_1;
if (F_status_is_error(status_2)) return status_2;
#endif
#ifndef _di_fss_read_process_
- void fss_read_process(void * const void_main) {
+ void fss_read_process(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
// For depth, most standards do not support nesting, so any depth greater than 0 can be predicted without processing the buffer.
// For select, most standards do not support multiple select, so any select greater than 0 can be predicted without processing the buffer.
}
// The process_load() callback is required to be non-NULL.
- if (!main->callback.process_load) return;
+ if (!main->call.process_load) return;
if (main->setting.buffer.used) {
main->setting.range.start = 0;
main->setting.quotes_object.used = 0;
main->setting.quotes_content.used = 0;
- main->callback.process_load(main);
+ main->call.process_load(main);
if (F_status_is_error(main->setting.state.status)) return;
const f_number_unsigneds_t * const delimits_object = !(main->setting.flag & fss_read_main_flag_original_d) && fss_read_delimit_object_is(main, 0) ? &main->setting.delimits_object : &fss_read_except_none_c;
bool names[main->setting.objects.used];
- if (main->callback.process_name) {
- main->callback.process_name(main, names);
+ if (main->call.process_name) {
+ main->call.process_name(main, names);
if (F_status_is_error(main->setting.state.status)) return;
}
else if (main->setting.objects.used) {
}
if (main->setting.flag & fss_read_main_flag_total_d) {
- if (main->callback.process_total) {
- main->callback.process_total(main, names);
+ if (main->call.process_total) {
+ main->call.process_total(main, names);
}
}
else if ((main->setting.flag & fss_read_main_flag_at_d) && main->setting.depth.index_at) {
- if (main->callback.process_at) {
+ if (main->call.process_at) {
- main->callback.process_at(main, names, *delimits_object, *delimits_content);
+ main->call.process_at(main, names, *delimits_object, *delimits_content);
}
}
else if (main->setting.flag & fss_read_main_flag_columns_d) {
- if (main->callback.process_columns) {
- main->callback.process_columns(main, names);
+ if (main->call.process_columns) {
+ main->call.process_columns(main, names);
}
}
else {
f_number_unsigned_t i = 0;
if (main->setting.flag & fss_read_main_flag_line_d) {
- if (main->callback.process_at_line) {
+ if (main->call.process_at_line) {
f_number_unsigned_t line = 0;
for (; i < main->setting.contents.used && main->setting.state.status != F_success; ++i) {
if (!names[i]) continue;
if (fss_read_signal_check(main)) return;
- main->callback.process_at_line(void_main, i, *delimits_object, *delimits_content, &line);
+ main->call.process_at_line(main, i, *delimits_object, *delimits_content, &line);
if (F_status_is_error(main->setting.state.status)) return;
} // for
}
}
- else if (main->callback.print_at) {
+ else if (main->call.print_at) {
for (; i < main->setting.contents.used; ++i) {
if (!names[i]) continue;
if (fss_read_signal_check(main)) return;
- main->callback.print_at(&main->program.output, i, *delimits_object, *delimits_content);
+ main->call.print_at(&main->program.output, i, *delimits_object, *delimits_content);
} // for
}
}
#endif // _di_fss_read_process_
#ifndef _di_fss_read_process_at_
- void fss_read_process_at(void * const void_main, const bool names[], const f_number_unsigneds_t delimits_object, f_number_unsigneds_t delimits_content) {
-
- if (!void_main) return;
+ void fss_read_process_at(fss_read_main_t * const main, const bool names[], const f_number_unsigneds_t delimits_object, f_number_unsigneds_t delimits_content) {
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
if (main->setting.depth.value_at >= main->setting.objects.used) {
if (main->setting.flag & (fss_read_main_flag_columns_d | fss_read_main_flag_total_d)) {
// If using "--at" for standards that only support one line per Object, then the only valid line is line 0.
if ((main->setting.feature & fss_read_feature_flag_line_single_d) && !at) break;
- if (main->callback.process_at_line) {
+ if (main->call.process_at_line) {
f_number_unsigned_t line = 0;
- main->callback.process_at_line(void_main, i, delimits_object, delimits_content, &line);
+ main->call.process_at_line(main, i, delimits_object, delimits_content, &line);
}
}
else if (main->setting.flag & fss_read_main_flag_columns_d) {
fss_read_print_number(&main->program.output, main->setting.contents.array[i].used);
}
- else if (main->callback.print_at) {
- main->callback.print_at(&main->program.output, i, delimits_object, delimits_content);
+ else if (main->call.print_at) {
+ main->call.print_at(&main->program.output, i, delimits_object, delimits_content);
}
if (F_status_is_error(main->setting.state.status)) return;
#endif // _di_fss_read_process_at_
#ifndef _di_fss_read_process_at_line_
- void fss_read_process_at_line(void * const void_main, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content, f_number_unsigned_t * const line) {
+ void fss_read_process_at_line(fss_read_main_t * const main, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content, f_number_unsigned_t * const line) {
- if (!void_main || !line) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main || !line) return;
// 0x1 = object printed, 0x2 = content printed, 0x4 = object end printed, 0x8 = content is empty, 0x10 = select is out of range.
uint8_t print_state = 0x0;
if (main->setting.flag & fss_read_main_flag_object_d) {
if (*line == main->setting.line) {
- if (main->callback.print_object) {
- if (F_status_set_fine(main->callback.print_object(&main->program.output, at, delimits_object)) != F_output_not) {
+ if (main->call.print_object) {
+ if (F_status_set_fine(main->call.print_object(&main->program.output, at, delimits_object)) != F_output_not) {
print_state = 0x1;
}
}
if (!(main->setting.flag & fss_read_main_flag_content_d)) {
- if (main->callback.print_object_end) {
- main->callback.print_object_end(&main->program.output);
+ if (main->call.print_object_end) {
+ main->call.print_object_end(&main->program.output);
}
if (!(main->setting.feature & fss_read_feature_flag_object_as_line_d)) {
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
}
return;
}
- if ((main->setting.feature & fss_read_feature_flag_object_as_line_d) && main->callback.print_object_end) {
- if (F_status_set_fine(main->callback.print_object_end(&main->program.output)) != F_output_not) {
+ if ((main->setting.feature & fss_read_feature_flag_object_as_line_d) && main->call.print_object_end) {
+ if (F_status_set_fine(main->call.print_object_end(&main->program.output)) != F_output_not) {
print_state = 0x4;
}
}
if (main->setting.flag & fss_read_main_flag_object_d) {
if (!(main->setting.feature & fss_read_feature_flag_object_as_line_d)) {
if (*line == main->setting.line) {
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
main->setting.state.status = F_success;
}
else if (main->setting.flag & fss_read_main_flag_empty_d) {
if (*line == main->setting.line) {
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
main->setting.state.status = F_success;
else {
if (main->setting.flag & fss_read_main_flag_empty_d) {
if (*line == main->setting.line) {
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
main->setting.state.status = F_success;
if (main->setting.feature & fss_read_feature_flag_line_single_d) {
if (*line == main->setting.line) {
- if (main->setting.contents.array[at].used && main->callback.print_content && main->callback.print_object_end_content) {
+ if (main->setting.contents.array[at].used && main->call.print_content && main->call.print_object_end_content) {
for (f_status_t printed = F_okay; ; ) {
if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) {
if ((print_state & 0x1) && !(print_state & 0x4)) {
- printed = main->callback.print_object_end_content(&main->program.output, at, main->setting.contents.array[at].array[i], (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
+ printed = main->call.print_object_end_content(&main->program.output, at, main->setting.contents.array[at].array[i], (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
if (F_status_set_fine(printed) != F_output_not) {
print_state |= 0x6;
}
}
else {
- printed = main->callback.print_content(&main->program.output, at, main->setting.contents.array[at].array[i], (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
+ printed = main->call.print_content(&main->program.output, at, main->setting.contents.array[at].array[i], (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
if (F_status_set_fine(printed) != F_output_not) {
print_state |= 0x2;
if (++i >= main->setting.contents.array[at].used) break;
- if (F_status_set_fine(printed) != F_output_not && main->callback.print_content_next) {
- main->callback.print_content_next(&main->program.output);
+ if (F_status_set_fine(printed) != F_output_not && main->call.print_content_next) {
+ main->call.print_content_next(&main->program.output);
}
} // for
}
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
main->setting.state.status = F_success;
++(*line);
}
- else if (main->callback.print_content && main->callback.print_object_end_content) {
+ else if (main->call.print_content && main->call.print_object_end_content) {
f_number_unsigned_t j = 0;
f_number_unsigned_t k = 0;
main->setting.range.stop = j;
if ((print_state & 0x1) && !(print_state & 0x4)) {
- main->callback.print_object_end_content(&main->program.output, at, main->setting.range, (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
+ main->call.print_object_end_content(&main->program.output, at, main->setting.range, (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
}
else {
- main->callback.print_content(&main->program.output, at, main->setting.range, (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
+ main->call.print_content(&main->program.output, at, main->setting.range, (at < main->setting.quotes_content.used && i < main->setting.quotes_content.array[at].used) ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content);
}
main->setting.state.status = F_success;
// Simulate the ending by printing.
if ((main->setting.flag & fss_read_main_flag_object_d) && (main->setting.feature & fss_read_feature_flag_content_has_close_d)) {
if (*line == main->setting.line) {
- if (main->callback.print_set_end) {
- main->callback.print_set_end(&main->program.output, at);
+ if (main->call.print_set_end) {
+ main->call.print_set_end(&main->program.output, at);
}
main->setting.state.status = F_success;
#endif // _di_fss_read_process_at_line_
#ifndef _di_fss_read_process_columns_
- void fss_read_process_columns(void * const void_main, const bool names[]) {
-
- if (!void_main) return;
+ void fss_read_process_columns(fss_read_main_t * const main, const bool names[]) {
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
if (!(main->setting.flag & fss_read_main_flag_content_d)) {
fss_read_print_number(&main->program.output, 0);
#endif // _di_fss_read_process_columns_
#ifndef _di_fss_read_process_name_
- void fss_read_process_name(void * const void_main, bool names[]) {
+ void fss_read_process_name(fss_read_main_t * const main, bool names[]) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
if (main->setting.depth.index_name) {
f_number_unsigned_t i = 0;
#endif // _di_fss_read_process_name_
#ifndef _di_fss_read_process_total_
- void fss_read_process_total(void * const void_main, const bool names[]) {
-
- if (!void_main) return;
+ void fss_read_process_total(fss_read_main_t * const main, const bool names[]) {
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
f_number_unsigned_t total = 0;
f_number_unsigned_t i = 0;
#endif // _di_fss_read_process_total_
#ifndef _di_fss_read_process_total_multiple_
- void fss_read_process_total_multiple(void * const void_main, const bool names[]) {
-
- if (!void_main) return;
+ void fss_read_process_total_multiple(fss_read_main_t * const main, const bool names[]) {
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
f_number_unsigned_t total = 0;
f_number_unsigned_t at = 0;
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_
- extern void fss_read_process(void * const main);
+ extern void fss_read_process(fss_read_main_t * const main);
#endif // _di_fss_read_process_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_at_
- extern void fss_read_process_at(void * const main, const bool names[], const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
+ extern void fss_read_process_at(fss_read_main_t * const main, const bool names[], const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content);
#endif // _di_fss_read_process_at_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.range.
*
* Must not be NULL.
*/
#ifndef _di_fss_read_process_at_line_
- extern void fss_read_process_at_line(void * const main, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content, f_number_unsigned_t * const line);
+ extern void fss_read_process_at_line(fss_read_main_t * const main, const f_number_unsigned_t at, const f_number_unsigneds_t delimits_object, const f_number_unsigneds_t delimits_content, f_number_unsigned_t * const line);
#endif // _di_fss_read_process_at_line_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_columns_
- extern void fss_read_process_columns(void * const main, const bool names[]);
+ extern void fss_read_process_columns(fss_read_main_t * const main, const bool names[]);
#endif // _di_fss_read_process_columns_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_name_
- extern void fss_read_process_name(void * const main, bool names[]);
+ extern void fss_read_process_name(fss_read_main_t * const main, bool names[]);
#endif // _di_fss_read_process_name_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_total_
- extern void fss_read_process_total(void * const main, const bool names[]);
+ extern void fss_read_process_total(fss_read_main_t * const main, const bool names[]);
#endif // _di_fss_read_process_total_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_signal_check()
*/
#ifndef _di_fss_read_process_total_multiple_
- extern void fss_read_process_total_multiple(void * const main, const bool names[]);
+ extern void fss_read_process_total_multiple(fss_read_main_t * const main, const bool names[]);
#endif // _di_fss_read_process_total_multiple_
#ifdef __cplusplus
#endif
#ifndef _di_fss_read_payload_process_help_
- void fss_read_payload_process_help(void * const void_main) {
+ void fss_read_payload_process_help(fss_read_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_read_payload_print_message_help(&((fss_read_main_t *) void_main)->program.message);
+ fss_read_payload_print_message_help(&main->program.message);
}
#endif // _di_fss_read_payload_process_help_
#ifndef _di_fss_read_payload_process_load_
- void fss_read_payload_process_load(void * const void_main) {
-
- if (!void_main) return;
+ void fss_read_payload_process_load(fss_read_main_t * const main) {
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
if (main->setting.buffer.used) {
main->setting.range.start = 0;
#endif // _di_fss_read_payload_process_load_
#ifndef _di_fss_read_payload_process_set_
- void fss_read_payload_process_set(void * const void_main) {
+ void fss_read_payload_process_set(fss_read_main_t * const main) {
- if (!void_main) return;
-
- fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ if (!main) return;
main->setting.state.status = F_okay;
}
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_read_payload_process_help_
- extern void fss_read_payload_process_help(void * const main);
+ extern void fss_read_payload_process_help(fss_read_main_t * const main);
#endif // _di_fss_read_payload_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* @see fss_read_file_identify()
*/
#ifndef _di_fss_read_payload_process_load_
- extern void fss_read_payload_process_load(void * const main);
+ extern void fss_read_payload_process_load(fss_read_main_t * const main);
#endif // _di_fss_read_payload_process_load_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_read_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
*/
#ifndef _di_fss_read_payload_process_set_
- extern void fss_read_payload_process_set(void * const main);
+ extern void fss_read_payload_process_set(fss_read_main_t * const main);
#endif // _di_fss_read_payload_process_set_
/**
data.setting.standard = fss_read_payload_standard_s;
data.setting.open_object = f_fss_payload_list_open_s;
- data.callback.process_help = &fss_read_payload_process_help;
- data.callback.process_last_line = &fss_read_process_last_line;
- data.callback.process = &fss_read_process;
-
- data.callback.process_at = &fss_read_process_at;
- data.callback.process_at_line = &fss_read_process_at_line;
- data.callback.process_columns = &fss_read_process_columns;
- data.callback.process_load = &fss_read_payload_process_load;
- data.callback.process_name = &fss_read_process_name;
- data.callback.process_total = &fss_read_process_total_multiple;
-
- data.callback.print_at = &fss_read_print_at;
- data.callback.print_content = &fss_read_payload_print_content;
- data.callback.print_content_empty = &fss_read_print_content_empty;
- data.callback.print_content_ignore = &fss_read_print_content_ignore;
- data.callback.print_content_next = 0;
- data.callback.print_object = &fss_read_print_object;
- data.callback.print_object_end = &fss_read_payload_print_object_end;
- data.callback.print_object_end_content = &fss_read_print_object_end_content;
- data.callback.print_object_end_empty = &fss_read_print_object_end_empty;
- data.callback.print_set_end = &fss_read_print_set_end_no_eol;
+ data.call.process_help = &fss_read_payload_process_help;
+ data.call.process_last_line = &fss_read_process_last_line;
+ data.call.process = &fss_read_process;
+
+ data.call.process_at = &fss_read_process_at;
+ data.call.process_at_line = &fss_read_process_at_line;
+ data.call.process_columns = &fss_read_process_columns;
+ data.call.process_load = &fss_read_payload_process_load;
+ data.call.process_name = &fss_read_process_name;
+ data.call.process_total = &fss_read_process_total_multiple;
+
+ data.call.print_at = &fss_read_print_at;
+ data.call.print_content = &fss_read_payload_print_content;
+ data.call.print_content_empty = &fss_read_print_content_empty;
+ data.call.print_content_ignore = &fss_read_print_content_ignore;
+ data.call.print_content_next = 0;
+ data.call.print_object = &fss_read_print_object;
+ data.call.print_object_end = &fss_read_payload_print_object_end;
+ data.call.print_object_end_content = &fss_read_print_object_end_content;
+ data.call.print_object_end_empty = &fss_read_print_object_end_empty;
+ data.call.print_set_end = &fss_read_print_set_end_no_eol;
f_console_parameter_t parameters[] = fss_read_console_parameter_t_initialize;
data.program.parameters.array = parameters;
return fll_print_dynamic_partial_raw(main->setting.buffer, range, print->to);
}
- if (main->callback.print_content_ignore) {
- main->callback.print_content_ignore(&main->program.output);
+ if (main->call.print_content_ignore) {
+ main->call.print_content_ignore(&main->program.output);
}
if (main->setting.flag & fss_read_main_flag_original_d) {
}
}
- if (main->callback.print_content_ignore) {
- main->callback.print_content_ignore(&main->program.output);
+ if (main->call.print_content_ignore) {
+ main->call.print_content_ignore(&main->program.output);
}
return F_okay;
#endif
#ifndef _di_fss_write_basic_process_content_
- void fss_write_basic_process_content(void * const void_main, const bool last) {
+ void fss_write_basic_process_content(fss_write_main_t * const main, const bool last) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.content) {
fl_fss_basic_content_write(
#endif // _di_fss_write_basic_process_content_
#ifndef _di_fss_write_basic_process_help_
- void fss_write_basic_process_help(void * const void_main) {
+ void fss_write_basic_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_basic_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_basic_print_help(&main->program.message);
}
#endif // _di_fss_write_basic_process_help_
#ifndef _di_fss_write_basic_process_object_
- void fss_write_basic_process_object(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_basic_process_object(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.object) {
fl_fss_basic_object_write(
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
* If FALSE, then this is not the last Content in the Content set.
*/
#ifndef _di_fss_write_basic_process_content_
- extern void fss_write_basic_process_content(void * const main, const bool last);
+ extern void fss_write_basic_process_content(fss_write_main_t * const main, const bool last);
#endif // _di_fss_write_basic_process_content_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_basic_process_help_
- extern void fss_write_basic_process_help(void * const main);
+ extern void fss_write_basic_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_basic_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
*/
#ifndef _di_fss_write_basic_process_object_
- extern void fss_write_basic_process_object(void * const main);
+ extern void fss_write_basic_process_object(fss_write_main_t * const main);
#endif // _di_fss_write_basic_process_object_
#ifdef __cplusplus
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_write_basic_standard_s;
- data.callback.process_content = &fss_write_basic_process_content;
- data.callback.process_help = &fss_write_basic_process_help;
- data.callback.process_normal = &fss_write_process_normal;
- data.callback.process_object = &fss_write_basic_process_object;
- data.callback.process_pipe = &fss_write_process_pipe;
- data.callback.process_set = &fss_write_process_set;
+ data.call.process_content = &fss_write_basic_process_content;
+ data.call.process_help = &fss_write_basic_process_help;
+ data.call.process_normal = &fss_write_process_normal;
+ data.call.process_object = &fss_write_basic_process_object;
+ data.call.process_pipe = &fss_write_process_pipe;
+ data.call.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_write_basic_list_process_content_
- void fss_write_basic_list_process_content(void * const void_main, const bool last) {
+ void fss_write_basic_list_process_content(fss_write_main_t * const main, const bool last) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.content) {
fl_fss_basic_list_content_write(
#endif // _di_fss_write_basic_list_process_content_
#ifndef _di_fss_write_basic_list_process_help_
- void fss_write_basic_list_process_help(void * const void_main) {
+ void fss_write_basic_list_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_basic_list_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_basic_list_print_help(&main->program.message);
}
#endif // _di_fss_write_basic_list_process_help_
#ifndef _di_fss_write_basic_list_process_object_
- void fss_write_basic_list_process_object(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_basic_list_process_object(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.object) {
fl_fss_basic_list_object_write(
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
* If FALSE, then this is not the last Content in the Content set.
*/
#ifndef _di_fss_write_basic_list_process_content_
- extern void fss_write_basic_list_process_content(void * const main, const bool last);
+ extern void fss_write_basic_list_process_content(fss_write_main_t * const main, const bool last);
#endif // _di_fss_write_basic_list_process_content_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_basic_list_process_help_
- extern void fss_write_basic_list_process_help(void * const main);
+ extern void fss_write_basic_list_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_basic_list_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
*/
#ifndef _di_fss_write_basic_list_process_object_
- extern void fss_write_basic_list_process_object(void * const main);
+ extern void fss_write_basic_list_process_object(fss_write_main_t * const main);
#endif // _di_fss_write_basic_list_process_object_
#ifdef __cplusplus
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_write_basic_list_standard_s;
- data.callback.process_content = &fss_write_basic_list_process_content;
- data.callback.process_help = &fss_write_basic_list_process_help;
- data.callback.process_normal = &fss_write_process_normal;
- data.callback.process_object = &fss_write_basic_list_process_object;
- data.callback.process_pipe = &fss_write_process_pipe;
- data.callback.process_set = &fss_write_process_set;
+ data.call.process_content = &fss_write_basic_list_process_content;
+ data.call.process_help = &fss_write_basic_list_process_help;
+ data.call.process_normal = &fss_write_process_normal;
+ data.call.process_object = &fss_write_basic_list_process_object;
+ data.call.process_pipe = &fss_write_process_pipe;
+ data.call.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_write_embedded_list_process_content_
- void fss_write_embedded_list_process_content(void * const void_main, const bool last) {
+ void fss_write_embedded_list_process_content(fss_write_main_t * const main, const bool last) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.content) {
fl_fss_embedded_list_content_write(
#endif // _di_fss_write_embedded_list_process_content_
#ifndef _di_fss_write_embedded_list_process_help_
- void fss_write_embedded_list_process_help(void * const void_main) {
+ void fss_write_embedded_list_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_embedded_list_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_embedded_list_print_help(&main->program.message);
}
#endif // _di_fss_write_embedded_list_process_help_
#ifndef _di_fss_write_embedded_list_process_object_
- void fss_write_embedded_list_process_object(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_embedded_list_process_object(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.object) {
fl_fss_embedded_list_object_write(
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
* If FALSE, then this is not the last Content in the Content set.
*/
#ifndef _di_fss_write_embedded_list_process_content_
- extern void fss_write_embedded_list_process_content(void * const main, const bool last);
+ extern void fss_write_embedded_list_process_content(fss_write_main_t * const main, const bool last);
#endif // _di_fss_write_embedded_list_process_content_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_embedded_list_process_help_
- extern void fss_write_embedded_list_process_help(void * const main);
+ extern void fss_write_embedded_list_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_embedded_list_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
*/
#ifndef _di_fss_write_embedded_list_process_object_
- extern void fss_write_embedded_list_process_object(void * const main);
+ extern void fss_write_embedded_list_process_object(fss_write_main_t * const main);
#endif // _di_fss_write_embedded_list_process_object_
#ifdef __cplusplus
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_write_embedded_list_standard_s;
- data.callback.process_content = &fss_write_embedded_list_process_content;
- data.callback.process_help = &fss_write_embedded_list_process_help;
- data.callback.process_normal = &fss_write_process_normal;
- data.callback.process_object = &fss_write_embedded_list_process_object;
- data.callback.process_pipe = &fss_write_process_pipe;
- data.callback.process_set = &fss_write_process_set;
+ data.call.process_content = &fss_write_embedded_list_process_content;
+ data.call.process_help = &fss_write_embedded_list_process_help;
+ data.call.process_normal = &fss_write_process_normal;
+ data.call.process_object = &fss_write_embedded_list_process_object;
+ data.call.process_pipe = &fss_write_process_pipe;
+ data.call.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_write_extended_process_content_
- void fss_write_extended_process_content(void * const void_main, const bool last) {
+ void fss_write_extended_process_content(fss_write_main_t * const main, const bool last) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.content) {
fl_fss_extended_content_write(
#endif // _di_fss_write_extended_process_content_
#ifndef _di_fss_write_extended_process_help_
- void fss_write_extended_process_help(void * const void_main) {
+ void fss_write_extended_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_extended_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_extended_print_help(&main->program.message);
}
#endif // _di_fss_write_extended_process_help_
#ifndef _di_fss_write_extended_process_object_
- void fss_write_extended_process_object(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_extended_process_object(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.object) {
fl_fss_extended_object_write(
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
* If FALSE, then this is not the last Content in the Content set.
*/
#ifndef _di_fss_write_extended_process_content_
- extern void fss_write_extended_process_content(void * const main, const bool last);
+ extern void fss_write_extended_process_content(fss_write_main_t * const main, const bool last);
#endif // _di_fss_write_extended_process_content_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_extended_process_help_
- extern void fss_write_extended_process_help(void * const main);
+ extern void fss_write_extended_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_extended_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
*/
#ifndef _di_fss_write_extended_process_object_
- extern void fss_write_extended_process_object(void * const main);
+ extern void fss_write_extended_process_object(fss_write_main_t * const main);
#endif // _di_fss_write_extended_process_object_
#ifdef __cplusplus
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_write_extended_standard_s;
- data.callback.process_content = &fss_write_extended_process_content;
- data.callback.process_help = &fss_write_extended_process_help;
- data.callback.process_normal = &fss_write_process_normal;
- data.callback.process_object = &fss_write_extended_process_object;
- data.callback.process_pipe = &fss_write_process_pipe;
- data.callback.process_set = &fss_write_process_set;
+ data.call.process_content = &fss_write_extended_process_content;
+ data.call.process_help = &fss_write_extended_process_help;
+ data.call.process_normal = &fss_write_process_normal;
+ data.call.process_object = &fss_write_extended_process_object;
+ data.call.process_pipe = &fss_write_process_pipe;
+ data.call.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_write_extended_list_process_content_
- void fss_write_extended_list_process_content(void * const void_main, const bool last) {
+ void fss_write_extended_list_process_content(fss_write_main_t * const main, const bool last) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.content) {
fl_fss_extended_list_content_write(
#endif // _di_fss_write_extended_list_process_content_
#ifndef _di_fss_write_extended_list_process_help_
- void fss_write_extended_list_process_help(void * const void_main) {
+ void fss_write_extended_list_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_extended_list_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_extended_list_print_help(&main->program.message);
}
#endif // _di_fss_write_extended_list_process_help_
#ifndef _di_fss_write_extended_list_process_object_
- void fss_write_extended_list_process_object(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_extended_list_process_object(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if (main->setting.object) {
fl_fss_extended_list_object_write(
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
* If FALSE, then this is not the last Content in the Content set.
*/
#ifndef _di_fss_write_extended_list_process_content_
- extern void fss_write_extended_list_process_content(void * const main, const bool last);
+ extern void fss_write_extended_list_process_content(fss_write_main_t * const main, const bool last);
#endif // _di_fss_write_extended_list_process_content_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_extended_list_process_help_
- extern void fss_write_extended_list_process_help(void * const main);
+ extern void fss_write_extended_list_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_extended_list_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status.
* This uses and alters main.setting.buffer.
*/
#ifndef _di_fss_write_extended_list_process_object_
- extern void fss_write_extended_list_process_object(void * const main);
+ extern void fss_write_extended_list_process_object(fss_write_main_t * const main);
#endif // _di_fss_write_extended_list_process_object_
#ifdef __cplusplus
data.setting.flag |= fss_write_main_flag_ignore_d;
- data.callback.process_content = &fss_write_extended_list_process_content;
- data.callback.process_help = &fss_write_extended_list_process_help;
- data.callback.process_normal = &fss_write_process_normal;
- data.callback.process_object = &fss_write_extended_list_process_object;
- data.callback.process_pipe = &fss_write_process_pipe;
- data.callback.process_set = &fss_write_process_set;
+ data.call.process_content = &fss_write_extended_list_process_content;
+ data.call.process_help = &fss_write_extended_list_process_help;
+ data.call.process_normal = &fss_write_process_normal;
+ data.call.process_object = &fss_write_extended_list_process_object;
+ data.call.process_pipe = &fss_write_process_pipe;
+ data.call.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.program.parameters.array = parameters;
#endif
#ifndef _di_fss_write_setting_load_
- void fss_write_setting_load(const f_console_arguments_t arguments, fss_write_main_t * const main, void (*callback)(const f_console_arguments_t arguments, fss_write_main_t * const main)) {
+ void fss_write_setting_load(const f_console_arguments_t arguments, fss_write_main_t * const main, const fss_write_setting_load_call_t load_call) {
if (!main) return;
main->setting.flag &= ~fss_write_main_flag_pipe_d;
}
- if (callback) {
- callback(arguments, main);
+ if (load_call) {
+ load_call(arguments, main);
if (F_status_is_error(main->setting.state.status)) return;
if (main->setting.state.status == F_done) {
* 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().
- * @param callback
+ * @param load_call
* (optional) Designate a function to call after performing the initial processing, but before printing help.
* If the function returns F_done, then this function immediately returns, resetting status to F_okay.
+ *
* Set to NULL to disable.
*
* @see f_console_parameter_process()
* @see fll_program_parameter_process_verbosity_standard()
*/
#ifndef _di_fss_write_setting_load_
- extern void fss_write_setting_load(const f_console_arguments_t arguments, fss_write_main_t * const main, void (*callback)(const f_console_arguments_t arguments, fss_write_main_t * const main));
+ extern void fss_write_setting_load(const f_console_arguments_t arguments, fss_write_main_t * const main, const fss_write_setting_load_call_t load_call);
#endif // _di_fss_write_setting_load_
#ifdef __cplusplus
* process_pipe: Process using the data from input pipe.
* process_set: Process a set of Object and one or more Content.
*/
-#ifndef _di_fss_write_callback_t_
+#ifndef _di_fss_write_call_t_
+ typedef void (*fss_write_process_main_call_t) (fss_write_main_t * const main);
+ typedef void (*fss_write_process_content_call_t) (fss_write_main_t * const main, const bool last);
+
typedef struct {
- void (*process_content)(void * const main, const bool last);
- void (*process_help)(void * const main);
- void (*process_normal)(void * const main);
- void (*process_object)(void * const main);
- void (*process_pipe)(void * const main);
- void (*process_set)(void * const main);
- } fss_write_callback_t;
-
- #define fss_write_callback_t_initialize \
+ fss_write_process_content_call_t process_content;
+ fss_write_process_main_call_t process_help;
+ fss_write_process_main_call_t process_normal;
+ fss_write_process_main_call_t process_object;
+ fss_write_process_main_call_t process_pipe;
+ fss_write_process_main_call_t process_set;
+ } fss_write_call_t;
+
+ #define fss_write_call_t_initialize \
{ \
0, \
0, \
0, \
0, \
}
-#endif // _di_fss_write_callback_t_
+#endif // _di_fss_write_call_t_
/**
* The fss write main program settings.
/**
* The main program data as a single structure.
*
- * callback: The callback data.
- * program: The main program data.
- * setting: The settings data.
+ * Properties:
+ * - call: The callbacks.
+ * - program: The main program data.
+ * - setting: The settings data.
*/
#ifndef _di_fss_write_main_t_
struct fss_write_main_t_ {
- fss_write_callback_t callback;
+ fss_write_call_t call;
fll_program_data_t program;
fss_write_setting_t setting;
};
#define fss_write_main_t_initialize \
{ \
- fss_write_callback_t_initialize, \
+ fss_write_call_t_initialize, \
fll_program_data_t_initialize, \
fss_write_setting_t_initialize, \
}
#endif // _di_fss_write_main_t_
/**
+ * Callback type for the fss_write_setting_load() argument.
+ *
+ * Perform the initial processing for fss_write_setting_load().
+ */
+#ifndef _di_fss_write_setting_load_call_t_
+ typedef void (*fss_write_setting_load_call_t) (const f_console_arguments_t arguments, fss_write_main_t * const main);
+#endif // _di_fss_write_setting_load_call_t_
+
+/**
* De-allocate main program data.
*
* @param main
#endif
#ifndef _di_fss_write_main_
- void fss_write_main(void * const void_main) {
+ void fss_write_main(fss_write_main_t * const main) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
-
- if (F_status_is_error(main->setting.state.status)) return;
+ if (!main || F_status_is_error(main->setting.state.status)) return;
main->setting.state.status = F_okay;
if (main->setting.flag & fss_write_main_flag_version_copyright_help_d) {
if (main->setting.flag & fss_write_main_flag_help_d) {
- if (main->callback.process_help) {
- main->callback.process_help(void_main);
+ if (main->call.process_help) {
+ main->call.process_help(main);
}
else {
fss_write_print_message_help(&main->program.message);
}
if (main->setting.flag & fss_write_main_flag_pipe_d) {
- if (main->callback.process_pipe) {
- main->callback.process_pipe(void_main);
+ if (main->call.process_pipe) {
+ main->call.process_pipe(main);
}
}
if (F_status_is_error_not(main->setting.state.status)) {
if (main->setting.flag & (fss_write_main_flag_object_d | fss_write_main_flag_content_d | fss_write_main_flag_object_open_d | fss_write_main_flag_content_next_d | fss_write_main_flag_content_end_d)) {
- if (main->callback.process_normal) {
- main->callback.process_normal(void_main);
+ if (main->call.process_normal) {
+ main->call.process_normal(main);
}
}
}
#endif // _di_fss_write_main_
#ifndef _di_fss_write_process_normal_
- void fss_write_process_normal(void * const void_main) {
+ void fss_write_process_normal(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
fss_write_process_normal_data(
- (fss_write_main_t *) void_main,
- (((fss_write_main_t *) void_main)->setting.flag & fss_write_main_flag_object_d)
- ? ((fss_write_main_t *) void_main)->setting.objects.used
- : ((fss_write_main_t *) void_main)->setting.contentss.used
+ main,
+ ((main)->setting.flag & fss_write_main_flag_object_d)
+ ? (main)->setting.objects.used
+ : (main)->setting.contentss.used
);
}
#endif // _di_fss_write_process_normal_
#ifndef _di_fss_write_process_normal_data_
- void fss_write_process_normal_data(void * const void_main, const f_number_unsigned_t length) {
+ void fss_write_process_normal_data(fss_write_main_t * const main, const f_number_unsigned_t length) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
main->setting.ignores = 0;
main->setting.object = 0;
main->setting.ignores = &main->setting.ignoress.array[i];
}
- main->callback.process_set(void_main);
+ main->call.process_set(main);
if (F_status_is_error(main->setting.state.status)) break;
} // for
}
main->setting.contents = 0;
main->setting.ignores = 0;
- main->callback.process_set(void_main);
+ main->call.process_set(main);
}
}
}
#endif // _di_fss_write_process_normal_data_
#ifndef _di_fss_write_process_pipe_
- void fss_write_process_pipe(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_process_pipe(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
-
- if (!main->callback.process_set) return;
+ if (!main || !main->call.process_set) return;
if (main->program.message.verbosity > f_console_verbosity_error_e) {
fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
// End Object or Content set.
if (state == 0x3) {
- main->callback.process_set(void_main);
+ main->call.process_set(main);
if (F_status_is_error(main->setting.state.status)) break;
state = 0;
// If the pipe ended before finishing, then attempt to wrap up.
if (F_status_is_error_not(main->setting.state.status) && status_pipe == F_okay_eof && state) {
- main->callback.process_set(void_main);
+ main->call.process_set(main);
flag |= 0x1;
}
#endif // _di_fss_write_process_pipe_
#ifndef _di_fss_write_process_set_
- void fss_write_process_set(void * const void_main) {
-
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ void fss_write_process_set(fss_write_main_t * const main) {
main->setting.buffer.used = 0;
}
}
- if (main->callback.process_object) {
- main->callback.process_object(void_main);
+ if (main->call.process_object) {
+ main->call.process_object(main);
if (F_status_is_error(main->setting.state.status)) return;
}
}
if ((!(main->setting.flag & fss_write_main_flag_partial_d) || (main->setting.flag & fss_write_main_flag_partial_d) && (main->setting.flag & fss_write_main_flag_content_d)) && main->setting.contents || (main->setting.flag & (fss_write_main_flag_content_next_d | fss_write_main_flag_content_end_d))) {
- if (main->callback.process_content) {
+ if (main->call.process_content) {
if (main->setting.contents && main->setting.contents->used) {
for (f_number_unsigned_t i = 0; i < main->setting.contents->used; ++i) {
main->setting.content = &main->setting.contents->array[i];
- main->callback.process_content(void_main, i + 1 == main->setting.contents->used);
+ main->call.process_content(main, i + 1 == main->setting.contents->used);
if (F_status_is_error(main->setting.state.status)) return;
} // for
}
else {
main->setting.content = 0;
- main->callback.process_content(void_main, F_true);
+ main->call.process_content(main, F_true);
if (F_status_is_error(main->setting.state.status)) return;
}
}
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.custom.setting.state.status:
* F_okay on success.
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_write_main_
- extern void fss_write_main(void * const main);
+ extern void fss_write_main(fss_write_main_t * const main);
#endif // _di_fss_write_main_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.custom.setting.state.status:
* status from fss_write_process_normal_data().
* @see fss_write_process_normal_data()
*/
#ifndef _di_fss_write_process_normal_
- extern void fss_write_process_normal(void * const main);
+ extern void fss_write_process_normal(fss_write_main_t * const main);
#endif // _di_fss_write_process_normal_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.custom.setting.state.status:
* F_okay on success.
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_write_process_normal_data_
- void fss_write_process_normal_data(void * const main, const f_number_unsigned_t length);
+ void fss_write_process_normal_data(fss_write_main_t * const main, const f_number_unsigned_t length);
#endif // _di_fss_write_process_normal_data_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_write_process_pipe_
- extern void fss_write_process_pipe(void * const main);
+ extern void fss_write_process_pipe(fss_write_main_t * const main);
#endif // _di_fss_write_process_pipe_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_write_process_set_
- extern void fss_write_process_set(void * const main);
+ extern void fss_write_process_set(fss_write_main_t * const main);
#endif // _di_fss_write_process_set_
#ifdef __cplusplus
}
#ifndef _di_fss_write_main_process_help_
- void fss_write_main_process_help(void * const void_main) {
+ void fss_write_main_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_main_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_main_print_help(&main->program.message);
}
#endif // _di_fss_write_main_process_help_
main->setting.standard = fss_write_basic_standard_s;
- main->callback.process_content = &fss_write_basic_process_content;
- main->callback.process_help = &fss_write_main_process_help;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_object = &fss_write_basic_process_object;
- main->callback.process_pipe = &fss_write_process_pipe;
- main->callback.process_set = &fss_write_process_set;
+ main->call.process_content = &fss_write_basic_process_content;
+ main->call.process_help = &fss_write_main_process_help;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_object = &fss_write_basic_process_object;
+ main->call.process_pipe = &fss_write_process_pipe;
+ main->call.process_set = &fss_write_process_set;
if (main->program.parameters.array[fss_write_parameter_as_e].result & f_console_result_value_e && main->program.parameters.array[fss_write_parameter_as_e].values.used) {
// Remove flags not supported for this standard.
main->setting.flag &= ~(fss_write_main_flag_ignore_d | fss_write_main_flag_content_multiple_d);
- main->callback.process_content = &fss_write_basic_process_content;
- main->callback.process_help = &fss_write_basic_process_help;
- main->callback.process_object = &fss_write_basic_process_object;
- main->callback.process_pipe = &fss_write_process_pipe;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_set = &fss_write_process_set;
+ main->call.process_content = &fss_write_basic_process_content;
+ main->call.process_help = &fss_write_basic_process_help;
+ main->call.process_object = &fss_write_basic_process_object;
+ main->call.process_pipe = &fss_write_process_pipe;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_set = &fss_write_process_set;
}
else if (f_compare_dynamic(argv[index], fss_write_format_code_short_0001_s) == F_equal_to ||
f_compare_dynamic(argv[index], fss_write_format_code_long_0001_s) == F_equal_to ||
main->setting.flag &= ~fss_write_main_flag_ignore_d;
main->setting.flag |= fss_write_main_flag_content_multiple_d;
- main->callback.process_content = &fss_write_extended_process_content;
- main->callback.process_help = &fss_write_extended_process_help;
- main->callback.process_object = &fss_write_extended_process_object;
- main->callback.process_pipe = &fss_write_process_pipe;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_set = &fss_write_process_set;
+ main->call.process_content = &fss_write_extended_process_content;
+ main->call.process_help = &fss_write_extended_process_help;
+ main->call.process_object = &fss_write_extended_process_object;
+ main->call.process_pipe = &fss_write_process_pipe;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_set = &fss_write_process_set;
}
else if (f_compare_dynamic(argv[index], fss_write_format_code_short_0002_s) == F_equal_to ||
f_compare_dynamic(argv[index], fss_write_format_code_long_0002_s) == F_equal_to ||
// Remove flags not supported for this standard.
main->setting.flag &= ~(fss_write_main_flag_ignore_d | fss_write_main_flag_content_multiple_d);
- main->callback.process_content = &fss_write_basic_list_process_content;
- main->callback.process_help = &fss_write_basic_list_process_help;
- main->callback.process_object = &fss_write_basic_list_process_object;
- main->callback.process_pipe = &fss_write_process_pipe;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_set = &fss_write_process_set;
+ main->call.process_content = &fss_write_basic_list_process_content;
+ main->call.process_help = &fss_write_basic_list_process_help;
+ main->call.process_object = &fss_write_basic_list_process_object;
+ main->call.process_pipe = &fss_write_process_pipe;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_set = &fss_write_process_set;
}
else if (f_compare_dynamic(argv[index], fss_write_format_code_short_0003_s) == F_equal_to ||
f_compare_dynamic(argv[index], fss_write_format_code_long_0003_s) == F_equal_to ||
main->setting.flag &= ~fss_write_main_flag_content_multiple_d;
main->setting.flag |= fss_write_main_flag_ignore_d;
- main->callback.process_content = &fss_write_extended_list_process_content;
- main->callback.process_help = &fss_write_extended_list_process_help;
- main->callback.process_object = &fss_write_extended_list_process_object;
- main->callback.process_pipe = &fss_write_process_pipe;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_set = &fss_write_process_set;
+ main->call.process_content = &fss_write_extended_list_process_content;
+ main->call.process_help = &fss_write_extended_list_process_help;
+ main->call.process_object = &fss_write_extended_list_process_object;
+ main->call.process_pipe = &fss_write_process_pipe;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_set = &fss_write_process_set;
}
else if (f_compare_dynamic(argv[index], fss_write_format_code_short_0008_s) == F_equal_to ||
f_compare_dynamic(argv[index], fss_write_format_code_long_0008_s) == F_equal_to ||
main->setting.flag |= fss_write_main_flag_ignore_d;
main->setting.flag |= fss_write_main_flag_content_multiple_d;
- main->callback.process_content = &fss_write_embedded_list_process_content;
- main->callback.process_help = &fss_write_embedded_list_process_help;
- main->callback.process_object = &fss_write_embedded_list_process_object;
- main->callback.process_pipe = &fss_write_process_pipe;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_set = &fss_write_process_set;
+ main->call.process_content = &fss_write_embedded_list_process_content;
+ main->call.process_help = &fss_write_embedded_list_process_help;
+ main->call.process_object = &fss_write_embedded_list_process_object;
+ main->call.process_pipe = &fss_write_process_pipe;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_set = &fss_write_process_set;
}
else if (f_compare_dynamic(argv[index], fss_write_format_code_short_000e_s) == F_equal_to ||
f_compare_dynamic(argv[index], fss_write_format_code_long_000e_s) == F_equal_to ||
// Remove flags not supported for this standard.
main->setting.flag &= ~(fss_write_main_flag_ignore_d | fss_write_main_flag_content_multiple_d);
- main->callback.process_content = 0;
- main->callback.process_help = &fss_write_payload_process_help;
- main->callback.process_normal = &fss_write_process_normal;
- main->callback.process_object = 0;
- main->callback.process_pipe = &fss_write_payload_process_pipe;
- main->callback.process_set = &fss_write_payload_process_set;
+ main->call.process_content = 0;
+ main->call.process_help = &fss_write_payload_process_help;
+ main->call.process_normal = &fss_write_process_normal;
+ main->call.process_object = 0;
+ main->call.process_pipe = &fss_write_payload_process_pipe;
+ main->call.process_set = &fss_write_payload_process_set;
}
else {
if (main->setting.flag & fss_write_main_flag_help_d) {
if (F_status_is_error(main->setting.state.status)) {
if (main->setting.flag & fss_write_main_flag_help_d) {
- fss_write_main_process_help((void *) main);
+ fss_write_main_process_help(main);
}
return;
main->setting.state.status = F_status_set_error(F_parameter);
if (main->setting.flag & fss_write_main_flag_help_d) {
- fss_write_main_process_help((void *) main);
+ fss_write_main_process_help(main);
return;
}
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_main_process_help_
- extern void fss_write_main_process_help(void * const main);
+ extern void fss_write_main_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_main_process_help_
/**
#endif
#ifndef _di_fss_write_payload_process_help_
- void fss_write_payload_process_help(void * const void_main) {
+ void fss_write_payload_process_help(fss_write_main_t * const main) {
- if (!void_main) return;
+ if (!main) return;
- fss_write_payload_print_help(&((fss_write_main_t *) void_main)->program.message);
+ fss_write_payload_print_help(&main->program.message);
}
#endif // _di_fss_write_payload_process_help_
#ifndef _di_fss_write_payload_process_pipe_
- void fss_write_payload_process_pipe(void * const void_main) {
-
- if (!void_main) return;
+ void fss_write_payload_process_pipe(fss_write_main_t * const main) {
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
f_status_t status_pipe = F_okay;
f_file_t input = f_file_t_initialize;
// End Object or Content set.
if (state == 0x3) {
- fss_write_payload_process_set(void_main);
+ fss_write_payload_process_set(main);
if (F_status_is_error(main->setting.state.status)) break;
state = 0;
// If the pipe ended before finishing, then attempt to wrap up.
if (F_status_is_error_not(main->setting.state.status) && status_pipe == F_okay_eof && state) {
- fss_write_payload_process_set(void_main);
+ fss_write_payload_process_set(main);
flag |= 0x1;
}
#endif // _di_fss_write_payload_process_pipe_
#ifndef _di_fss_write_payload_process_set_
- void fss_write_payload_process_set(void * const void_main) {
+ void fss_write_payload_process_set(fss_write_main_t * const main) {
- if (!void_main) return;
-
- fss_write_main_t * const main = (fss_write_main_t *) void_main;
+ if (!main) return;
if ((!(main->setting.flag & fss_write_main_flag_partial_d) || (main->setting.flag & fss_write_main_flag_partial_d) && (main->setting.flag & fss_write_main_flag_object_d))) {
if (main->setting.object && !(main->setting.flag & fss_write_main_flag_partial_d) && main->setting.contents && main->setting.contents->used) {
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This does not alter main.setting.state.status.
*
* F_output_not on success, but no printing is performed.
*/
#ifndef _di_fss_write_payload_process_help_
- extern void fss_write_payload_process_help(void * const main);
+ extern void fss_write_payload_process_help(fss_write_main_t * const main);
#endif // _di_fss_write_payload_process_help_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_write_payload_process_pipe_
- extern void fss_write_payload_process_pipe(void * const main);
+ extern void fss_write_payload_process_pipe(fss_write_main_t * const main);
#endif // _di_fss_write_payload_process_pipe_
/**
* The program and settings data.
*
* Must not be NULL.
- * Must be of type fss_write_main_t.
*
* This alters main.setting.state.status:
* F_okay on success.
* F_parameter (with error bit) if main is NULL or setting is NULL.
*/
#ifndef _di_fss_write_payload_process_set_
- extern void fss_write_payload_process_set(void * const main);
+ extern void fss_write_payload_process_set(fss_write_main_t * const main);
#endif // _di_fss_write_payload_process_set_
/**
* @param setting
* The main program settings.
*
+ * Must not be NULL.
+ *
* This alters setting.process_help, setting.process_normal, and setting.process_pipe.
*
* This alters setting.state.status:
data.setting.state.custom = (void *) &data;
data.setting.standard = fss_write_payload_standard_s;
- data.callback.process_content = 0;
- data.callback.process_help = &fss_write_payload_process_help;
- data.callback.process_normal = &fss_write_process_normal;
- data.callback.process_object = 0;
- data.callback.process_pipe = &fss_write_payload_process_pipe;
- data.callback.process_set = &fss_write_payload_process_set;
+ data.call.process_content = 0;
+ data.call.process_help = &fss_write_payload_process_help;
+ data.call.process_normal = &fss_write_process_normal;
+ data.call.process_object = 0;
+ data.call.process_pipe = &fss_write_payload_process_pipe;
+ data.call.process_set = &fss_write_payload_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.program.parameters.array = parameters;
fll_program_data_delete(&main->program);
iki_read_setting_delete(&main->setting);
- if (main->callback.delete_data) {
- main->callback.delete_data(main);
+ if (main->call.delete_data) {
+ main->call.delete_data(main);
}
}
#endif // _di_iki_read_main_delete_
* - delete_data: Delete the IKI/EKI data.
*/
#ifndef _di_iki_read_callback_t_
+ typedef void (*iki_read_main_call_t) (iki_read_main_t * const main);
+ typedef void (*iki_read_print_data_call_t) (fl_print_t * const print, const f_number_unsigned_t index);
+ typedef void (*iki_read_process_buffer_ranges_call_t) (iki_read_main_t * const main, f_range_t * const range_buffer);
+
typedef struct {
- void (*identify_alteration)(iki_read_main_t * const main);
+ iki_read_main_call_t identify_alteration;
- void (*print_data)(fl_print_t * const print, const f_number_unsigned_t index);
- void (*print_help)(fl_print_t * const print);
+ iki_read_print_data_call_t print_data;
+ fl_print_call_t print_help;
- void (*process_buffer_ranges)(iki_read_main_t * const main, f_range_t * const range_buffer);
- void (*process_buffer_ranges_whole)(iki_read_main_t * const main, f_range_t * const range_buffer);
- void (*process_buffer_total)(iki_read_main_t * const main);
+ iki_read_process_buffer_ranges_call_t process_buffer_ranges;
+ iki_read_process_buffer_ranges_call_t process_buffer_ranges_whole;
+ iki_read_main_call_t process_buffer_total;
- void (*delete_data)(iki_read_main_t * const main);
+ iki_read_main_call_t delete_data;
} iki_read_callback_t;
#define iki_read_callback_t_initialize \
* The main program data as a single structure.
*
* Properties:
- * - cache: The cache data.
- * - callback: The callbacks.
- * - data: A pointer for the structure representing IKI data (or EKI data).
- * - program: The main program data.
- * - setting: The settings data.
+ * - cache: The cache data.
+ * - call: The callbacks.
+ * - data: A pointer for the structure representing IKI data (or EKI data).
+ * - program: The main program data.
+ * - setting: The settings data.
*/
#ifndef _di_iki_read_main_t_
struct iki_read_main_t_ {
iki_read_cache_t cache;
- iki_read_callback_t callback;
+ iki_read_callback_t call;
void * data;
fll_program_data_t program;
iki_read_setting_t setting;
if (main->setting.flag & iki_read_main_flag_version_copyright_help_d) {
if (main->setting.flag & iki_read_main_flag_help_d) {
- if (main->callback.print_help) {
- main->callback.print_help(&main->program.message);
+ if (main->call.print_help) {
+ main->call.print_help(&main->program.message);
}
}
else if (main->setting.flag & iki_read_main_flag_version_d) {
iki_read_process_line(main, &buffer_range);
if (main->setting.flag & iki_read_main_flag_total_d) {
- if (main->callback.process_buffer_total) {
- main->callback.process_buffer_total(main);
+ if (main->call.process_buffer_total) {
+ main->call.process_buffer_total(main);
if (F_status_is_error_not(main->setting.state.status)) {
main->setting.state.status = F_okay;
return;
}
- if (main->callback.process_buffer_ranges_whole) {
- main->callback.process_buffer_ranges_whole(main, &buffer_range);
+ if (main->call.process_buffer_ranges_whole) {
+ main->call.process_buffer_ranges_whole(main, &buffer_range);
}
}
else {
- if (main->callback.process_buffer_ranges) {
- main->callback.process_buffer_ranges(main, &buffer_range);
+ if (main->call.process_buffer_ranges) {
+ main->call.process_buffer_ranges(main, &buffer_range);
}
}
*
* - process_objects_content: Process an Objects and Content set.
*/
-#ifndef _di_iki_write_callback_t_
+#ifndef _di_iki_write_call_t_
+ typedef void (*iki_write_load_objects_content_pipe_call_t)(void * const main, const f_range_t range, uint8_t * const pipe_state);
+ typedef void (*iki_write_process_objects_content_call_t)(void * const main, const f_string_statics_t objects, const f_string_static_t content);
+
typedef struct {
- void (*load_objects_content_pipe)(void * const main, const f_range_t range, uint8_t * const pipe_state);
+ iki_write_load_objects_content_pipe_call_t load_objects_content_pipe;
- void (*print_help)(fl_print_t * const print);
+ fl_print_call_t print_help;
- void (*process_objects_content)(void * const main, const f_string_statics_t objects, const f_string_static_t content);
- } iki_write_callback_t;
+ iki_write_process_objects_content_call_t process_objects_content;
+ } iki_write_call_t;
- #define iki_write_callback_t_initialize \
+ #define iki_write_call_t_initialize \
{ \
0, \
0, \
0, \
}
-#endif // _di_iki_write_callback_t_
+#endif // _di_iki_write_call_t_
/**
* The IKI write main program settings.
* The main program data as a single structure.
*
* Properties:
- * - cache: The cache data.
- * - callback: The callbacks.
- * - program: The main program data.
- * - setting: The settings data.
+ * - cache: The cache data.
+ * - call: The callbacks.
+ * - program: The main program data.
+ * - setting: The settings data.
*/
#ifndef _di_iki_write_main_t_
struct iki_write_main_t_ {
iki_write_cache_t cache;
- iki_write_callback_t callback;
+ iki_write_call_t call;
fll_program_data_t program;
iki_write_setting_t setting;
};
#define iki_write_main_t_initialize \
{ \
iki_write_cache_t_initialize, \
- iki_write_callback_t_initialize, \
+ iki_write_call_t_initialize, \
fll_program_data_t_initialize, \
iki_write_setting_t_initialize, \
}
if (main->setting.flag & iki_write_main_flag_version_copyright_help_d) {
if (main->setting.flag & iki_write_main_flag_help_d) {
- if (main->callback.print_help) {
- main->callback.print_help(&main->program.output);
+ if (main->call.print_help) {
+ main->call.print_help(&main->program.output);
}
}
else if (main->setting.flag & iki_write_main_flag_version_d) {
range.stop = range.start - 1;
range.start = previous;
- if (main->callback.load_objects_content_pipe) {
- main->callback.load_objects_content_pipe((void *) main, range, &pipe_state);
+ if (main->call.load_objects_content_pipe) {
+ main->call.load_objects_content_pipe((void *) main, range, &pipe_state);
if (F_status_is_error(main->setting.state.status)) break;
}
if (iki_write_signal_check(main)) return;
- main->callback.process_objects_content((void *) main, main->setting.objectss.array[i], main->setting.contents.array[i]);
+ main->call.process_objects_content((void *) main, main->setting.objectss.array[i], main->setting.contents.array[i]);
if (F_status_is_error(main->setting.state.status)) break;
fll_print_dynamic_raw(f_string_eol_s, main->program.output.to);