main->setting.state.step_small = kt_remove_allocation_small_d;
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & kt_remove_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
kt_remove_print_error(&main->program.error, macro_kt_remove_f(f_console_parameter_process));
return;
main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & kt_remove_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
kt_remove_print_error(&main->program.error, macro_kt_remove_f(fll_program_parameter_process_context));
return;
main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & kt_remove_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
kt_remove_print_error(&main->program.error, macro_kt_remove_f(fll_program_parameter_process_verbosity));
return;
* - link: Remove by file type: link.
* - mode: Remove by mode.
* - option_used: This gets set when when certain options are specified to toggle the default match detection boolean during removal of each file.
- * - print_first: When set, print new line to message output on program begin after loading settings.
- * - print_last: When set, print new line to message output on program end.
* - prompt_all: Operate in interactive mode, prompting for every file.
* - prompt_follow: Operate in interactive mode: prompting for every link that is being followed.
* - prompt_never: Do not operate in interactive mode.
kt_remove_main_flag_link_e = 0x80000,
kt_remove_main_flag_mode_e = 0x100000,
kt_remove_main_flag_option_used_e = 0x200000,
- kt_remove_main_flag_print_first_e = 0x400000,
- kt_remove_main_flag_print_last_e = 0x800000,
- kt_remove_main_flag_prompt_all_e = 0x1000000,
- kt_remove_main_flag_prompt_follow_e = 0x2000000,
- kt_remove_main_flag_prompt_never_e = 0x4000000,
- kt_remove_main_flag_prompt_once_e = 0x8000000,
- kt_remove_main_flag_recurse_e = 0x10000000,
- kt_remove_main_flag_regular_e = 0x20000000,
- kt_remove_main_flag_same_e = 0x40000000,
- kt_remove_main_flag_simulate_e = 0x80000000,
- kt_remove_main_flag_socket_e = 0x100000000,
- kt_remove_main_flag_tree_e = 0x200000000,
- kt_remove_main_flag_updated_e = 0x400000000,
- kt_remove_main_flag_user_e = 0x800000000,
- kt_remove_main_flag_utc_e = 0x1000000000,
- kt_remove_main_flag_version_e = 0x2000000000,
- kt_remove_main_flag_version_copyright_help_e = 0x2000008008,
+ kt_remove_main_flag_prompt_all_e = 0x400000,
+ kt_remove_main_flag_prompt_follow_e = 0x800000,
+ kt_remove_main_flag_prompt_never_e = 0x1000000,
+ kt_remove_main_flag_prompt_once_e = 0x2000000,
+ kt_remove_main_flag_recurse_e = 0x4000000,
+ kt_remove_main_flag_regular_e = 0x8000000,
+ kt_remove_main_flag_same_e = 0x10000000,
+ kt_remove_main_flag_simulate_e = 0x20000000,
+ kt_remove_main_flag_socket_e = 0x40000000,
+ kt_remove_main_flag_tree_e = 0x80000000,
+ kt_remove_main_flag_updated_e = 0x100000000,
+ kt_remove_main_flag_user_e = 0x200000000,
+ kt_remove_main_flag_utc_e = 0x400000000,
+ kt_remove_main_flag_version_e = 0x800000000,
+ kt_remove_main_flag_version_copyright_help_e = 0x800008008,
}; // enum
#endif // _di_kt_remove_flag_e_
macro_f_console_parameter_t_initialize_5( kt_remove_long_utc_s, 0, f_console_flag_normal_e), \
}
- #define kt_remove_total_parameters_d 38
+ #define kt_remove_total_parameters_d (f_console_parameter_state_type_total_d + 25)
#endif // _di_kt_remove_parameter_e_
/**
#ifndef _di_kt_remove_main_
void kt_remove_main(kt_remove_main_t * const main) {
- if (!main) return;
-
- if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & kt_remove_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
- return;
- }
-
- if ((main->setting.flag & kt_remove_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
+ if (!main || F_status_is_error(main->setting.state.status)) return;
main->setting.state.status = F_okay;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
- if ((main->setting.flag & kt_remove_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
return;
}
if (main->setting.state.status == F_status_set_error(F_interrupt)) {
fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
}
-
- if ((main->setting.flag & kt_remove_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
}
#endif // _di_kt_remove_main_
main->setting.state.step_small = kt_tacocat_allocation_small_d;
if (F_status_is_error(main->setting.state.status)) {
- macro_setting_load_print_first();
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(f_console_parameter_process));
return;
main->setting.state.status = fll_program_parameter_process_context(choices, modes, F_true, &main->program);
if (F_status_is_error(main->setting.state.status)) {
- macro_setting_load_print_first();
-
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(fll_program_parameter_process_context));
return;
main->setting.state.status = fll_program_parameter_process_verbosity(choices, verbosity, F_true, &main->program);
if (F_status_is_error(main->setting.state.status)) {
- macro_setting_load_print_first();
-
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(fll_program_parameter_process_verbosity));
return;
if (main->program.parameters.array[kt_tacocat_parameter_resolve_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, kt_tacocat_long_resolve_s);
}
else if (main->program.parameters.array[kt_tacocat_parameter_resolve_e].result & f_console_result_value_e) {
else {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
kt_tacocat_print_error_parameter_value_resolve_unknown(&main->program.error, main->program.parameters.arguments.array[index]);
}
}
main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number);
if (F_status_is_error(main->setting.state.status)) {
- macro_setting_load_print_first();
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(fl_conversion_dynamic_to_unsigned_detect));
return;
else if (main->program.parameters.array[kt_tacocat_parameter_interval_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, kt_tacocat_long_interval_s);
return;
main->setting.state.status = fl_conversion_dynamic_to_unsigned_detect(fl_conversion_data_base_10_c, main->program.parameters.arguments.array[index], &number);
if (F_status_is_error(main->setting.state.status)) {
- macro_setting_load_print_first();
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(fl_conversion_dynamic_to_unsigned_detect));
return;
else if (main->program.parameters.array[kt_tacocat_parameter_max_buffer_e].result & f_console_result_found_e) {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, kt_tacocat_long_max_buffer_s);
return;
if (main->program.parameters.array[parameters[i]].values.used % 2) {
main->setting.state.status = F_status_set_error(F_parameter);
- if ((main->setting.flag & kt_tacocat_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
fll_program_print_error_parameter_missing_value_requires_amount(&main->program.error, f_console_symbol_long_normal_s, longs[i], kt_tacocat_two_s);
if (F_status_is_error_not(failed)) {
kt_tacocat_setting_load_address_port_extract(main, range_ip, &address, &port);
if (F_status_is_error(main->setting.state.status)) {
- macro_setting_load_print_first();
-
if (F_status_set_fine(main->setting.state.status) == F_parameter) {
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(kt_tacocat_setting_load_address_port_extract));
}
if (main->setting.state.status == F_data_not || !host.h_addr_list || !host.h_addr_list[0]) {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
// @todo provide network-specific error messages for when no hosts are returned.
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(f_network_from_ip_name));
if (main->setting.state.status == F_data_not || !host.h_addr_list || !host.h_addr_list[0]) {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
// @todo provide network-specific error messages for when no hosts are returned.
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(f_network_from_ip_name));
else {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
fll_program_print_error_parameter_empty_value(&main->program.error, f_console_symbol_long_normal_s, longs[i]);
if (F_status_is_error_not(failed)) {
else {
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
fll_program_print_error_parameter_empty_value(&main->program.error, f_console_symbol_long_normal_s, longs[i]);
if (F_status_is_error_not(failed)) {
main->setting.flag &= ~flags[i];
main->setting.state.status = F_status_set_error(F_parameter);
- macro_setting_load_print_first();
-
fll_program_print_error_parameter_missing_value(&main->program.error, f_console_symbol_long_normal_s, longs[i]);
if (F_status_is_error_not(failed)) {
/**
* The program macros.
*
- * macro_setting_load_print_first:
- * Intended to be used to simplify the code in kt_tacocat_setting_load() and make it more readable.
- *
* macro_setting_load_handle_send_receive_error_continue_1:
* Intended to be used to simplify the code in kt_tacocat_setting_load_send_receive() and make it more readable.
* This is for the basic error that calls kt_tacocat_print_error() when printing.
* @todo document all macros.
*/
#ifndef _di_kt_tacocat_macros_d_
- #define macro_setting_load_print_first() \
- if ((main->setting.flag & kt_tacocat_main_flag_print_first_e) && main->program.message.verbosity > f_console_verbosity_error_e) { \
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to); \
- }
-
#define macro_setting_load_handle_send_receive_error_continue_1(method) \
if (F_status_is_error(main->setting.state.status)) { \
- macro_setting_load_print_first(); \
- \
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(method)); \
\
if (F_status_is_error_not(failed)) { \
#define macro_setting_load_handle_send_receive_error_continue_2(method) \
if (F_status_is_error(main->setting.state.status)) { \
- macro_setting_load_print_first(); \
- \
kt_tacocat_print_error(&main->program.error, macro_kt_tacocat_f(method)); \
\
if (F_status_is_error_not(failed)) { \
#define macro_setting_load_handle_send_receive_error_file_continue_1(method, name, operation, type) \
if (F_status_is_error(main->setting.state.status)) { \
- macro_setting_load_print_first(); \
- \
kt_tacocat_print_error_file(&main->program.error, macro_kt_tacocat_f(method), name, operation, type); \
\
if (F_status_is_error_not(failed)) { \
* kt_tacocat_main_flag_*_e:
* - none: No flags set.
* - copyright: Print copyright.
- * - print_first: When set, print new line to message output on program begin after loading settings.
- * - print_last: When set, print new line to message output on program end.
* - max_buffer: When set, a maximum buffer on receive is enforced.
* - receive: The address or socket to receive from is specified.
* - resolve_classic: Follow the classic Domain Name Resolution method.
kt_tacocat_main_flag_copyright_e = 0x1,
kt_tacocat_main_flag_help_e = 0x2,
kt_tacocat_main_flag_max_buffer_e = 0x4,
- kt_tacocat_main_flag_print_first_e = 0x8,
- kt_tacocat_main_flag_print_last_e = 0x10,
- kt_tacocat_main_flag_receive_e = 0x20,
- kt_tacocat_main_flag_resolve_classic_e = 0x40,
- kt_tacocat_main_flag_resolve_kevux_e = 0x80,
- kt_tacocat_main_flag_resolve_e = 0x100,
- kt_tacocat_main_flag_send_e = 0x200,
- kt_tacocat_main_flag_version_e = 0x400,
- kt_tacocat_main_flag_version_copyright_help_e = 0x403,
+ kt_tacocat_main_flag_receive_e = 0x8,
+ kt_tacocat_main_flag_resolve_classic_e = 0x10,
+ kt_tacocat_main_flag_resolve_kevux_e = 0x20,
+ kt_tacocat_main_flag_resolve_e = 0x40,
+ kt_tacocat_main_flag_send_e = 0x80,
+ kt_tacocat_main_flag_version_e = 0x100,
+ kt_tacocat_main_flag_version_copyright_help_e = 0x103,
}; // enum
#endif // _di_kt_tacocat_main_flag_e_
macro_f_console_parameter_t_initialize_3(kt_tacocat_short_send_s, kt_tacocat_long_send_s, 2, f_console_flag_normal_e), \
}
- #define kt_tacocat_parameter_total_d 18
+ #define kt_tacocat_parameter_total_d (f_console_parameter_state_type_total_d + 5)
#endif // _di_kt_tacocat_parameter_e_
/**
if (!main) return;
- if (F_status_is_error(main->setting.state.status)) {
- if ((main->setting.flag & kt_tacocat_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
- return;
- }
-
- macro_setting_load_print_first();
+ if (F_status_is_error(main->setting.state.status)) return;
main->setting.state.status = F_okay;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
- if ((main->setting.flag & kt_tacocat_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
-
return;
}
if (main->setting.state.status == F_status_set_error(F_interrupt)) {
fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
}
-
- if ((main->setting.flag & kt_tacocat_main_flag_print_last_e) && main->program.message.verbosity > f_console_verbosity_error_e) {
- fll_print_dynamic_raw(f_string_eol_s, main->program.message.to);
- }
}
#endif // _di_kt_tacocat_main_