#endif // _kt_resolve_default_kevux_
}
+ if (main->program.parameters.array[kt_tacocat_parameter_interval_e].result & f_console_result_value_e) {
+ index = main->program.parameters.array[kt_tacocat_parameter_interval_e].values.array[main->program.parameters.array[kt_tacocat_parameter_interval_e].values.used - 1];
+
+ f_number_unsigned_t number = 0;
+
+ 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;
+ }
+
+ if (number == 0 || main->setting.state.status == F_number_negative) {
+ main->setting.state.status = F_status_set_error(F_parameter);
+
+ fll_program_print_error_parameter_integer_less_than(&main->program.error, f_console_symbol_long_normal_s, kt_tacocat_long_interval_s, main->program.parameters.arguments.array[index], f_string_ascii_1_s);
+
+ return;
+ }
+
+ main->setting.interval = number;
+ }
+ 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;
+ }
+
// Only process these when needed to avoid unnecessary operations.
if (main->callback.setting_load_send_receive && !(main->setting.flag & (kt_tacocat_main_flag_copyright_e | kt_tacocat_main_flag_version_e |kt_tacocat_main_flag_help_e))) {
main->callback.setting_load_send_receive(arguments, (void *) main);
kt_tacocat_parameter_line_first_no_e,
kt_tacocat_parameter_line_last_no_e,
+ kt_tacocat_parameter_interval_e,
kt_tacocat_parameter_receive_e,
kt_tacocat_parameter_resolve_e,
kt_tacocat_parameter_send_e,
{ \
macro_fll_program_console_parameter_standard_initialize, \
\
+ macro_f_console_parameter_t_initialize_3(kt_tacocat_short_interval_s, kt_tacocat_long_interval_s, 1, f_console_flag_normal_e), \
macro_f_console_parameter_t_initialize_3(kt_tacocat_short_receive_s, kt_tacocat_long_receive_s, 2, f_console_flag_normal_e), \
macro_f_console_parameter_t_initialize_3(kt_tacocat_short_resolve_s, kt_tacocat_long_resolve_s, 1, f_console_flag_normal_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 16
+ #define kt_tacocat_parameter_total_d 17
#endif // _di_kt_tacocat_parameter_e_
/**
"f_string_dynamic_increase_by",
"f_string_dynamics_increase_by",
"f_thread_create",
+ "fl_conversion_dynamic_to_unsigned_detect",
"fll_program_parameter_process_context",
"fll_program_parameter_process_verbosity",
"kt_tacocat_process_socket_set_error_has",
kt_tacocat_f_f_string_dynamic_increase_by_e,
kt_tacocat_f_f_string_dynamics_increase_by_e,
kt_tacocat_f_f_thread_create_e,
+ kt_tacocat_f_fl_conversion_dynamic_to_unsigned_detect_e,
kt_tacocat_f_fll_program_parameter_process_context_e,
kt_tacocat_f_fll_program_parameter_process_verbosity_e,
kt_tacocat_f_kt_tacocat_process_socket_set_error_has_e,
#endif // _di_kt_tacocat_s_
#ifndef _di_kt_tacocat_parameter_s_
+ const f_string_static_t kt_tacocat_short_interval_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_short_interval_s, 0, KT_TACOCAT_short_interval_s_length);
const f_string_static_t kt_tacocat_short_receive_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_short_receive_s, 0, KT_TACOCAT_short_receive_s_length);
const f_string_static_t kt_tacocat_short_resolve_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_short_resolve_s, 0, KT_TACOCAT_short_resolve_s_length);
const f_string_static_t kt_tacocat_short_send_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_short_send_s, 0, KT_TACOCAT_short_send_s_length);
+ const f_string_static_t kt_tacocat_long_interval_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_long_interval_s, 0, KT_TACOCAT_long_interval_s_length);
const f_string_static_t kt_tacocat_long_receive_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_long_receive_s, 0, KT_TACOCAT_long_receive_s_length);
const f_string_static_t kt_tacocat_long_resolve_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_long_resolve_s, 0, KT_TACOCAT_long_resolve_s_length);
const f_string_static_t kt_tacocat_long_send_s = macro_f_string_static_t_initialize_1(KT_TACOCAT_long_send_s, 0, KT_TACOCAT_long_send_s_length);
* The main program parameters.
*/
#ifndef _di_kt_tacocat_parameter_s_
- #define KT_TACOCAT_short_receive_s "r"
- #define KT_TACOCAT_short_resolve_s "R"
- #define KT_TACOCAT_short_send_s "s"
-
- #define KT_TACOCAT_long_receive_s "receive"
- #define KT_TACOCAT_long_resolve_s "resolve"
- #define KT_TACOCAT_long_send_s "send"
-
- #define KT_TACOCAT_short_receive_s_length 1
- #define KT_TACOCAT_short_resolve_s_length 1
- #define KT_TACOCAT_short_send_s_length 1
-
- #define KT_TACOCAT_long_receive_s_length 7
- #define KT_TACOCAT_long_resolve_s_length 7
- #define KT_TACOCAT_long_send_s_length 4
-
+ #define KT_TACOCAT_short_interval_s "I"
+ #define KT_TACOCAT_short_receive_s "r"
+ #define KT_TACOCAT_short_resolve_s "R"
+ #define KT_TACOCAT_short_send_s "s"
+
+ #define KT_TACOCAT_long_interval_s "interval"
+ #define KT_TACOCAT_long_receive_s "receive"
+ #define KT_TACOCAT_long_resolve_s "resolve"
+ #define KT_TACOCAT_long_send_s "send"
+
+ #define KT_TACOCAT_short_interval_s_length 1
+ #define KT_TACOCAT_short_receive_s_length 1
+ #define KT_TACOCAT_short_resolve_s_length 1
+ #define KT_TACOCAT_short_send_s_length 1
+
+ #define KT_TACOCAT_long_interval_s_length 8
+ #define KT_TACOCAT_long_receive_s_length 7
+ #define KT_TACOCAT_long_resolve_s_length 7
+ #define KT_TACOCAT_long_send_s_length 4
+
+ extern const f_string_static_t kt_tacocat_short_interval_s;
extern const f_string_static_t kt_tacocat_short_receive_s;
extern const f_string_static_t kt_tacocat_short_resolve_s;
extern const f_string_static_t kt_tacocat_short_send_s;
+ extern const f_string_static_t kt_tacocat_long_interval_s;
extern const f_string_static_t kt_tacocat_long_receive_s;
extern const f_string_static_t kt_tacocat_long_resolve_s;
extern const f_string_static_t kt_tacocat_long_send_s;
* This is passed to the program-specific main entry point to designate program settings.
* These program settings are often processed from the program arguments (often called the command line arguments).
*
- * flag: Flags passed to the main function.
+ * flag: Flags passed to the main function.
+ * interval: The poll interval to use.
*
* status_receive: A status used eclusively by the receive thread.
* status_send: A status used eclusively by the send thread.
#ifndef _di_kt_tacocat_setting_t_
typedef struct {
uint64_t flag;
+ uint64_t interval;
f_status_t status_receive;
f_status_t status_send;
#define kt_tacocat_setting_t_initialize \
{ \
kt_tacocat_main_flag_none_e, \
+ kt_tacocat_interval_poll_d, \
F_none, \
F_none, \
F_none, \
f_print_dynamic_raw(f_string_eol_s, print->to);
- fll_program_print_help_option(print, kt_tacocat_short_receive_s, kt_tacocat_long_receive_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Specify an address or socket file to listen to and a file to write to.");
- fll_program_print_help_option(print, kt_tacocat_short_resolve_s, kt_tacocat_long_resolve_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Specify a custom DNS resolution methodology.");
- fll_program_print_help_option(print, kt_tacocat_short_send_s, kt_tacocat_long_send_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify an address or socket file send transmit to and a file to read from.");
+ fll_program_print_help_option(print, kt_tacocat_short_interval_s, kt_tacocat_long_interval_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, "Specify a custom poll interval in milliseconds to use.");
+ fll_program_print_help_option(print, kt_tacocat_short_receive_s, kt_tacocat_long_receive_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify an address or socket file to listen to and a file to write to.");
+ fll_program_print_help_option(print, kt_tacocat_short_resolve_s, kt_tacocat_long_resolve_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify a custom DNS resolution methodology.");
+ fll_program_print_help_option(print, kt_tacocat_short_send_s, kt_tacocat_long_send_s, f_console_symbol_short_normal_s, f_console_symbol_long_normal_s, " Specify an address or socket file send transmit to and a file to read from.");
f_print_dynamic_raw(f_string_eol_s, print->to);
if (F_status_is_error_not(main->setting.status_receive)) {
do {
- main->setting.status_receive = f_file_poll(main->setting.receive.polls, kt_tacocat_interval_poll_d);
+ main->setting.status_receive = f_file_poll(main->setting.receive.polls, main->setting.interval);
if (main->program.signal_received) {
main->setting.status_receive = F_status_set_error(F_interrupt);