Make sure fll_program_data_t supports storing the signal.
Move the commonly written functions that are pretty much identical across programs into fll_program:
- fll_program_standard_signal_received()
- fll_program_standard_signal_state()
Increase standard signal check from 10000 to 20000.
I really dislike the signal_check logic that exists purely as a work-around to the signal handling.
Most likely the only way to do this nicely that is available without rewritting the kernel and the libc will be to implement threads.
This will not be done for the 0.6.x versions and will likely happen for the 0.8.x versions.
}
#endif // _di_fll_program_standard_setup_
+#ifndef _di_fll_program_standard_signal_received_
+ f_status_t fll_program_standard_signal_received(fll_program_data_t * const main) {
+
+ if (main->signal.id == -1) {
+ return F_false;
+ }
+
+ struct signalfd_siginfo information;
+
+ memset(&information, 0, sizeof(struct signalfd_siginfo));
+
+ if (f_signal_read(main->signal, 0, &information) == F_signal) {
+ switch (information.ssi_signo) {
+ case F_signal_abort:
+ case F_signal_broken_pipe:
+ case F_signal_hangup:
+ case F_signal_interrupt:
+ case F_signal_quit:
+ case F_signal_termination:
+ return information.ssi_signo;
+ }
+ }
+
+ return F_false;
+ }
+#endif // _di_fss_basic_read_signal_received_
+
+#ifndef _di_fll_program_standard_signal_state_
+ f_status_t fll_program_standard_signal_state(void * const state, void * const internal) {
+
+ if (!state) {
+ return F_interrupt_not;
+ }
+
+ f_state_t *state_ptr = (f_state_t *) state;
+
+ if (!state_ptr->custom) {
+ return F_interrupt_not;
+ }
+
+ fll_program_data_t *main = (fll_program_data_t *) state_ptr->custom;
+
+ main->signal_received = fll_program_standard_signal_received(main);
+
+ if (main->signal_received == F_signal_abort || main->signal_received == F_signal_broken_pipe || main->signal_received == F_signal_hangup || main->signal_received == F_signal_interrupt || main->signal_received == F_signal_quit || main->signal_received == F_signal_termination) {
+ return F_status_set_error(F_interrupt);
+ }
+
+ return F_interrupt_not;
+ }
+#endif // _di_fll_program_standard_signal_state_
+
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fll_program_standard_setup(f_signal_t * const signal);
#endif // _di_fll_program_standard_setup_
+/**
+ * Check to see if a process signal is received.
+ *
+ * Only signals that are blocked via main.signal will be received.
+ *
+ * If no signals are blocked, then this always returns F_false.
+ *
+ * @param main
+ * The main program data.
+ * The main->signal must be used to designate blocked signals.
+ *
+ * @return
+ * A positive number representing a valid signal on signal received.
+ * F_false on no signal received.
+ *
+ * @see f_signal_read()
+ */
+#ifndef _di_fss_basic_read_signal_received_
+ extern f_status_t fll_program_standard_signal_received(fll_program_data_t * const main);
+#endif // _di_fss_basic_read_signal_received_
+
+/**
+ * Standardized callback for checking for interrupts via the f_state_t interrupt callback.
+ *
+ * This only checks for the signals:
+ * - F_signal_abort
+ * - F_signal_broken_pipe
+ * - F_signal_hangup
+ * - F_signal_interrupt
+ * - F_signal_quit
+ * - F_signal_termination
+ *
+ * These signals may not be checked if they are not also blocked via the fll_program_data_t.signals variable.
+ *
+ * When one of the above signals is both blocked and received, then this calls fll_program_standard_signal_received().
+ *
+ * @param state
+ * The state data.
+ * This must be of type (f_state_t *).
+ *
+ * When constructing the f_state_t variable, a fll_program_data_t pointer must be passed into the f_state_t.custom variable.
+ * This requires the state.custom variable to be of type (fll_program_data_t *).
+ * @param internal
+ * Not used.
+ *
+ * @return
+ * F_interrupt_not if not interrupted.
+ *
+ * F_interrupt (with error bit) if interrupted.
+ *
+ * @see fll_program_standard_signal_received()
+ */
+#ifndef _di_fll_program_standard_signal_state_
+ extern f_status_t fll_program_standard_signal_state(void * const state, void * const internal);
+#endif // _di_fll_program_standard_signal_state_
+
#ifdef __cplusplus
} // extern "C"
#endif
* The umask() has design flaws as per specification that requires the umask be changed to read the value!
* As a work-around, a umask variable is provided here so that umask() only ever need be called once.
*
- * child: Reserved for a child process, often representing the child return status or the child process ID.
- * context: The color context.
- * error: The output file for error printing.
- * output: The output file for general printing.
- * parameters: The state of pre-defined parameters passed to the program.
- * pid: The PID of the program.
- * process_pipe: Designate whether or not to process the input pipe.
- * signal: The process signal management structure.
- * signal_check: A counter used to map to for reducing the amount of actual signal check calls.
- * umask: The umask settings, needed for avoiding calls to umask() to read the current umask.
- * warning: The output file for warning printing.
+ * child: Reserved for a child process, often representing the child return status or the child process ID.
+ * context: The color context.
+ * error: The output file for error printing.
+ * output: The output file for general printing.
+ * parameters: The state of pre-defined parameters passed to the program.
+ * pid: The PID of the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * signal: The process signal management structure.
+ * signal_check: A counter used to map to for reducing the amount of actual signal check calls.
+ * signal_received: The signal received (if 0, then no signal is received).
+ * umask: The umask settings, needed for avoiding calls to umask() to read the current umask.
+ * warning: The output file for warning printing.
*/
#ifndef _di_fll_program_data_t_
typedef struct {
f_console_parameters_t parameters;
- uint16_t signal_check;
mode_t umask;
pid_t pid;
- bool process_pipe;
int child;
+ bool process_pipe;
+
+ int signal_received;
+ uint16_t signal_check;
+ f_signal_t signal;
fl_print_t output;
fl_print_t error;
fl_print_t warning;
- f_signal_t signal;
-
f_color_context_t context;
} fll_program_data_t;
0, \
0, \
0, \
- 0, \
F_false, \
+ 0, \
+ 0, \
+ f_signal_t_initialize, \
fl_print_t_initialize, \
macro_fl_print_t_initialize_error(), \
macro_fl_print_t_initialize_warning(), \
- f_signal_t_initialize, \
f_color_context_t_initialize, \
}
- #define macro_fll_program_data_t_initialize(parameters, signal_check, process_pipe, output, error, warning, signal, context) { \
- parameters, \
- signal_check, \
+ #define macro_fll_program_data_t_initialize(umask, pid, child, process_pipe, signal_received, signal_check, signal, output, error, warning, context) { \
+ umask, \
+ pid, \
+ child, \
process_pipe, \
+ signal_received, \
+ signal_check, \
+ signal, \
output, \
error, \
warning, \
- signal, \
context, \
}
#endif // _di_fll_program_data_t_
#define byte_dump_option_wide_d 0x1
- #define byte_dump_signal_check_d 10000
+ #define byte_dump_signal_check_d 20000
#define BYTE_DUMP_character_wall_s "|"
#define BYTE_DUMP_character_placeholder_s "␣" // Other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
for (;;) {
if (!((++data->main->signal_check) % byte_dump_signal_check_d)) {
- if (byte_dump_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ byte_dump_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
#endif
#ifndef _di_byte_dump_print_signal_received_
- void byte_dump_print_signal_received(byte_dump_data_t * const data, const f_status_t signal) {
+ void byte_dump_print_signal_received(byte_dump_data_t * const data) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
flockfile(data->main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
- fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+ fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
funlockfile(data->main->warning.to.stream);
}
#endif // _di_byte_dump_print_signal_received_
-#ifndef _di_byte_dump_signal_received_
- f_status_t byte_dump_signal_received(byte_dump_data_t * const data) {
-
- if (data->main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- byte_dump_print_signal_received(data, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_byte_dump_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_byte_dump_print_signal_received_
- extern void byte_dump_print_signal_received(byte_dump_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void byte_dump_print_signal_received(byte_dump_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_byte_dump_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_byte_dump_signal_received_
- extern f_status_t byte_dump_signal_received(byte_dump_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_byte_dump_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
}
#endif // _di_control_data_delete_
-#ifndef _di_control_signal_received_
- f_status_t control_signal_received(const fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- control_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_control_signal_received_
-
-#ifndef _di_control_signal_state_interrupt_fss_
- f_status_t control_signal_state_interrupt_fss(void * const state, void * const internal) {
-
- if (!state) {
- return F_interrupt_not;
- }
-
- f_state_t * const state_ptr = (f_state_t *) state;
-
- if (!state_ptr->custom) {
- return F_interrupt_not;
- }
-
- fll_program_data_t * const main = (fll_program_data_t *) state_ptr->custom;
-
- if (!((++main->signal_check) % control_signal_check_d)) {
- if (control_signal_received(main)) {
- return F_status_set_error(F_interrupt);
- }
-
- main->signal_check = 0;
- }
-
- return F_interrupt_not;
- }
-#endif // _di_control_signal_state_interrupt_fss_
-
#ifdef __cplusplus
} // extern "C"
#endif
#define control_default_buffer_limit_soft_large_d 2048
#define control_default_buffer_limit_soft_small_d 64
- #define control_signal_check_d 10000
+ #define control_signal_check_d 20000
#define control_allocation_large_d 256
#define control_allocation_small_d 16
extern void control_data_delete(control_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_control_data_delete_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_control_signal_received_
- extern f_status_t control_signal_received(const fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_control_signal_received_
-
-/**
- * Callback passed to FSS functions for checking for interrupts.
- *
- * @param state
- * The f_state_t data.
- * @param internal
- * Not used.
- *
- * @return
- * F_interrupt_not if not interrupted.
- *
- * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
- */
-#ifndef _di_control_signal_state_interrupt_fss_
- extern f_status_t control_signal_state_interrupt_fss(void * const state, void * const internal) F_attribute_visibility_internal_d;
-#endif // _di_control_signal_state_interrupt_fss_
-
#ifdef __cplusplus
} // extern "C"
#endif
}
{
- f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, &control_signal_state_interrupt_fss, 0, (void *) main, 0);
+ f_state_t state = macro_f_state_t_initialize(control_allocation_large_d, control_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range_packet = macro_f_string_range_t_initialize2(data->cache.large.used);
status = fll_fss_basic_list_read(data->cache.large, state, &range_packet, &data->cache.packet_objects, &data->cache.packet_contents, &data->cache.delimits, 0, 0);
#ifndef _di_control_print_signal_received_
void control_print_signal_received(const fll_program_data_t * const main, const f_status_t signal) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
#ifndef _di_controller_print_signal_received_
void controller_print_signal_received(controller_main_t * const main, const f_status_t signal) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
return F_interrupt_not;
}
- controller_state_interrupt_t *custom = (controller_state_interrupt_t *) state_ptr->custom;
+ fll_program_data_t *main = (fll_program_data_t *) state_ptr->custom;
controller_thread_t *thread = custom->thread;
if (!controller_thread_is_enabled(custom->is_normal, thread)) {
fake_operation_skeleton_e,
};
- #define fake_signal_check_d 10000
+ #define fake_signal_check_d 500000
#define fake_signal_check_tiny_d 4
#define fake_signal_check_short_d 16
if (status == F_child) break;
- if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d) && fake_signal_received(&data)) {
- status = F_status_set_error(F_interrupt);
+ if (F_status_set_fine(status) == F_interrupt || !(i % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fake_print_signal_received(&data);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ data->main->signal_check = 0;
}
if (F_status_is_error(status)) {
if (F_status_is_error(*status)) return;
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
return;
f_fss_delimits_t delimits = f_fss_delimits_t_initialize;
{
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
*status = fll_fss_extended_read(buffer, state, &range, &objects, &contents, 0, 0, &delimits, 0);
}
if (F_status_is_error(*status) && buffer.used) return;
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
return;
if (F_status_is_error(*status)) return;
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
return;
if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return;
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
return;
for (f_array_length_t i = 0; i < files.used; ++i) {
- if (!(i % fake_signal_check_short_d) && fake_signal_received(data)) {
- *status = F_status_set_error(F_interrupt);
+ if (!(i % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
- break;
+ *status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ data->main->signal_check = 0;
}
if (!files.array[i].used) continue;
f_string_dynamics_resize(0, &arguments);
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
}
else if (*status != F_child) {
#ifndef _di_fake_build_operate_
f_status_t fake_build_operate(fake_data_t * const data, const f_string_static_t setting_file) {
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
if (F_status_is_error(*status)) return;
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
return;
}
#endif // _di_fake_make_data_delete_
-#ifndef _di_fake_signal_received_
- f_status_t fake_signal_received(fake_data_t * const data) {
-
- if (data->main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fake_print_signal_received(data, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fake_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern f_status_t fake_make_data_delete(fake_make_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_make_data_delete_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- * The program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fake_signal_received_
- extern f_status_t fake_signal_received(fake_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_fake_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
*status = F_status_set_error(F_interrupt);
return 0;
char *name_function = "f_file_exists";
f_status_t status = F_none;
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
}
#endif // _di_fake_process_console_parameters_
-#ifndef _di_fake_signal_state_interrupt_fss_
- f_status_t fake_signal_state_interrupt_fss(void * const state, void * const internal) {
-
- if (!state) {
- return F_interrupt_not;
- }
-
- f_state_t * const state_ptr = (f_state_t *) state;
-
- if (!state_ptr->custom) {
- return F_interrupt_not;
- }
-
- fake_data_t * const data = (fake_data_t *) state_ptr->custom;
-
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fake_signal_received(data)) {
- return F_status_set_error(F_interrupt);
- }
-
- data->main->signal_check = 0;
- }
-
- return F_interrupt_not;
- }
-#endif // _di_fake_signal_state_interrupt_fss_
-
-#ifndef _di_fake_signal_state_interrupt_iki_
- f_status_t fake_signal_state_interrupt_iki(void * const state, void * const internal) {
-
- if (!state) {
- return F_interrupt_not;
- }
-
- f_state_t * const state_ptr = (f_state_t *) state;
-
- if (!state_ptr->custom) {
- return F_interrupt_not;
- }
-
- fake_data_t * const data = (fake_data_t *) state_ptr->custom;
-
- if (!((++data->main->signal_check) % fake_signal_check_d)) {
- if (fake_signal_received(data)) {
- return F_status_set_error(F_interrupt);
- }
-
- data->main->signal_check = 0;
- }
-
- return F_interrupt_not;
- }
-#endif // _di_fake_signal_state_interrupt_iki_
-
#ifndef _di_fake_validate_directories_
f_status_t fake_validate_parameter_directories(fake_data_t * const data) {
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
#endif // _di_validate_console_parameters_
/**
- * Callback passed to FSS functions for checking for interrupts.
- *
- * @param state
- * The f_state_t data.
- * @param internal
- * Not used.
- *
- * @return
- * F_interrupt_not if not interrupted.
- *
- * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
- */
-#ifndef _di_fake_signal_state_interrupt_fss_
- extern f_status_t fake_signal_state_interrupt_fss(void * const state, void * const internal) F_attribute_visibility_internal_d;
-#endif // _di_fake_signal_state_interrupt_fss_
-
-/**
- * Callback passed to IKI functions for checking for interrupts.
- *
- * @param state
- * The f_state_t data.
- * @param internal
- * Not used.
- *
- * @return
- * F_interrupt_not if not interrupted.
- *
- * F_interrupt (with error bit) on receiving a terminate process signal, such as an interrupt signal.
- */
-#ifndef _di_fake_signal_state_interrupt_iki_
- extern f_status_t fake_signal_state_interrupt_iki(void * const state, void * const internal) F_attribute_visibility_internal_d;
-#endif // _di_fake_signal_state_interrupt_iki_
-
-/**
* Validate directories and print any relating error messages.
*
* This should not be called for skeleton as in that case the directories probably do not exist.
if (F_status_is_error(*status)) return;
- if (fake_signal_received(data_make->data)) {
+ if (fll_program_standard_signal_received(data_make->main)) {
+ fake_print_signal_received(data_make->data);
+
*status = F_status_set_error(F_interrupt);
return;
f_fss_comments_t comments = f_fss_comments_t_initialize;
{
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->data, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0);
*status = fll_fss_basic_list_read(data_make->buffer, state, &range, &list_objects, &list_contents, &delimits, 0, &comments);
}
f_fss_set_t settings = f_fss_set_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_fss, 0, (void *) data_make->data, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, (void *) data_make->data, 0);
if (list_objects.used > data_make->fakefile.size) {
macro_f_fss_nameds_t_resize((*status), data_make->fakefile, list_objects.used);
for (f_array_length_t i = 0; i < list_objects.used; ++i) {
- if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->data)) {
- *status = F_status_set_error(F_interrupt);
+ if (!(i % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(data_make->main)) {
+ fake_print_signal_received(data_make->data);
- break;
+ *status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ data_make->main->signal_check = 0;
}
if (fl_string_dynamic_partial_compare_string(fake_make_section_settings_s.string, data_make->buffer, fake_make_section_settings_s.used, list_objects.array[i]) == F_equal_to) {
#ifndef _di_fake_make_operate_
f_status_t fake_make_operate(fake_data_t * const data) {
- if (fake_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fake_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
f_iki_data_t iki_data = f_iki_data_t_initialize;
- f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fake_signal_state_interrupt_iki, 0, (void *) data_make->data, 0);
+ f_state_t state = macro_f_state_t_initialize(fake_common_allocation_large_d, fake_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data_make->data, 0);
f_string_range_t range = f_string_range_t_initialize;
f_string_map_multis_t *parameter = &data_make->setting_make.parameter;
state_process.operation_previous = state_process.operation;
state_process.operation = 0;
- if (!(i % fake_signal_check_short_d) && fake_signal_received(data_make->data)) {
- *status = F_status_set_error(F_interrupt);
+ if (!(i % fake_signal_check_short_d)) {
+ if (fll_program_standard_signal_received(data_make->main)) {
+ fake_print_signal_received(data_make->data);
- break;
+ *status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ data_make->main->signal_check = 0;
}
for (j = 0; j < fake_make_operation_total_d; ++j) {
#ifndef _di_fake_make_operate_process_execute_
f_status_t fake_make_operate_process_execute(fake_make_data_t * const data_make, const f_string_static_t program, const f_string_statics_t arguments, const bool as_shell) {
- if (fake_signal_received(data_make->data)) {
+ if (fll_program_standard_signal_received(data_make->main)) {
+ fake_print_signal_received(data_make->data);
+
return F_status_set_error(F_interrupt);
}
status = fll_execute_program(program, arguments, ¶meter, 0, (void *) &return_code);
- if (fake_signal_received(data_make->data)) {
+ if (fll_program_standard_signal_received(data_make->main)) {
+ fake_print_signal_received(data_make->data);
+
return F_status_set_error(F_interrupt);
}
#endif // _di_fake_print_message_section_operation_unknown_
#ifndef _di_fake_print_signal_received_
- void fake_print_signal_received(fake_data_t * const data, const f_status_t signal) {
+ void fake_print_signal_received(fake_data_t * const data) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
flockfile(data->main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
- fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+ fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
funlockfile(data->main->warning.to.stream);
*
* @param data
* The program data.
- * @param signal
- * The signal received.
*
* @see flockfile()
* @see funlockfile()
* @see fl_print_format()
*/
#ifndef _di_fake_print_signal_received_
- extern void fake_print_signal_received(fake_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fake_print_signal_received(fake_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fake_print_signal_received_
/**
* The program defines.
*/
#ifndef _di_firewall_defines_
- #define firewall_signal_check_d 10000
+ #define firewall_signal_check_d 20000
#endif // _di_firewall_defines_
/**
#ifndef _di_firewall_print_signal_received_
void firewall_print_signal_received(firewall_data_t * const data, const f_status_t signal) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_list_read_defines_
- #define fss_basic_list_read_signal_check_d 10000
+ #define fss_basic_list_read_signal_check_d 20000
#define FSS_BASIC_LIST_READ_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
#endif // _di_fss_basic_list_read_depths_resize_
#ifndef _di_fss_basic_list_read_print_signal_received_
- void fss_basic_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_basic_list_read_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_basic_list_read_print_signal_received_
-#ifndef _di_fss_basic_list_read_signal_received_
- f_status_t fss_basic_list_read_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_basic_list_read_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_basic_list_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_basic_list_read_print_signal_received_
- extern void fss_basic_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_list_read_signal_received_
- extern f_status_t fss_basic_list_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_list_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
#ifndef _di_fss_basic_list_read_load_
f_status_t fss_basic_list_read_load(fll_program_data_t * const main, fss_basic_list_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_basic_list_read_common_allocation_large_d, fss_basic_list_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (i = range.start; i <= range.stop; ++i) {
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[at]) continue;
if (!((++main->signal_check) % fss_basic_list_read_signal_check_d)) {
- if (fss_basic_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_list_write_defines_
- #define fss_basic_list_write_signal_check_d 10000
+ #define fss_basic_list_write_signal_check_d 20000
#define FSS_BASIC_LIST_WRITE_pipe_name_s "(pipe)"
if (main->parameters.array[fss_basic_list_write_parameter_object_e].result == f_console_result_additional_e) {
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].values.used; ++i) {
- if (fss_basic_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
index = main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i];
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_content_e].values.used; ++i) {
- if (fss_basic_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
index = main->parameters.array[fss_basic_list_write_parameter_content_e].values.array[i];
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_list_write_parameter_object_e].values.used; ++i) {
- if (fss_basic_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
index = main->parameters.array[fss_basic_list_write_parameter_object_e].values.array[i];
#endif
#ifndef _di_fss_basic_list_write_print_signal_received_
- void fss_basic_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_basic_list_write_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_basic_list_write_print_signal_received_
-#ifndef _di_fss_basic_list_write_signal_received_
- f_status_t fss_basic_list_write_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_basic_list_write_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_basic_list_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_basic_list_write_print_signal_received_
- extern void fss_basic_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_list_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_list_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_list_write_signal_received_
- extern f_status_t fss_basic_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_list_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t fss_basic_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t * const buffer) {
f_status_t status = F_none;
- f_state_t state = macro_f_state_t_initialize(fss_basic_list_write_common_allocation_large_d, fss_basic_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_basic_list_write_common_allocation_large_d, fss_basic_list_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range = f_string_range_t_initialize;
if (object) {
for (;;) {
- if (fss_basic_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
if (range.start > range.stop) {
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_read_defines_
- #define fss_basic_read_signal_check_d 10000
+ #define fss_basic_read_signal_check_d 20000
#define FSS_BASIC_READ_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
status = F_status_set_error(F_signal);
break;
#endif // _di_fss_basic_read_depths_resize_
#ifndef _di_fss_basic_read_print_signal_received_
- void fss_basic_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_basic_read_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_basic_read_print_signal_received_
-#ifndef _di_fss_basic_read_signal_received_
- f_status_t fss_basic_read_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_basic_read_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_basic_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_basic_read_print_signal_received_
- extern void fss_basic_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_read_signal_received_
- extern f_status_t fss_basic_read_signal_received(fll_program_data_t * const main);
-#endif // _di_fss_basic_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
#ifndef _di_fss_basic_read_load_
f_status_t fss_basic_read_load(fll_program_data_t * const main, fss_basic_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_basic_read_common_allocation_large_d, fss_basic_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits.used = 0;
const f_status_t status = fll_fss_basic_read(data->buffer, state, &input, &data->objects, &data->contents, &data->quotes, &data->delimits, 0);
if (F_status_is_error(status)) {
+ if (F_status_set_fine(status) == F_interrupt) {
+ fss_basic_read_print_signal_received(main);
+
+ return status;
+ }
+
const f_string_static_t file_name = fss_basic_read_file_identify(input.start, data->files);
fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_basic_read", F_true, file_name, f_file_operation_process_s, fll_error_file_type_file_e);
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[at]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_basic_read_signal_check_d)) {
- if (fss_basic_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_basic_write_defines_
- #define fss_basic_write_signal_check_d 10000
+ #define fss_basic_write_signal_check_d 20000
#define FSS_BASIC_WRITE_pipe_name_s "(pipe)"
if (main->parameters.array[fss_basic_write_parameter_object_e].result == f_console_result_additional_e) {
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) {
- if (fss_basic_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_basic_write_process(main, output, quote, &argv[main->parameters.array[fss_basic_write_parameter_object_e].values.array[i]], 0, &buffer);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_content_e].values.used; ++i) {
- if (fss_basic_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_basic_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_basic_write_parameter_content_e].values.array[i]], &buffer);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_basic_write_parameter_object_e].values.used; ++i) {
- if (fss_basic_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_basic_write_process(main, output, quote, &argv[main->parameters.array[fss_basic_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_basic_write_parameter_content_e].values.array[i]], &buffer);
#endif
#ifndef _di_fss_basic_write_print_signal_received_
- void fss_basic_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_basic_write_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_basic_write_print_signal_received_
-#ifndef _di_fss_basic_write_signal_received_
- f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_basic_write_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_basic_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_basic_write_print_signal_received_
- extern void fss_basic_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_basic_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_write_signal_received_
- extern f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t fss_basic_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
- f_state_t state = macro_f_state_t_initialize(fss_basic_write_common_allocation_large_d, fss_basic_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_basic_write_common_allocation_large_d, fss_basic_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range = f_string_range_t_initialize;
if (object) {
for (;;) {
- if (fss_basic_write_signal_received(main)) {
- return F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_basic_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_basic_write_print_signal_received(main);
+
+ return F_status_set_error(F_interrupt);
+ }
+
+ main->signal_check = 0;
}
if (range.start > range.stop) {
extern f_status_t fss_basic_write_process_pipe(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, f_string_dynamic_t *buffer) F_attribute_visibility_internal_d;
#endif // _di_fss_basic_write_process_pipe_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_basic_write_signal_received_
- extern f_status_t fss_basic_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_basic_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_embedded_list_read_defines_
- #define fss_embedded_list_read_signal_check_d 10000
+ #define fss_embedded_list_read_signal_check_d 20000
#define FSS_EMBEDDED_LIST_READ_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_embedded_list_read_signal_check_d)) {
- if (fss_embedded_list_read_signal_received(&data)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_embedded_list_read_print_signal_received(&data);
+
status = F_status_set_error(F_interrupt);
break;
#endif // _di_fss_embedded_list_read_data_delete_
#ifndef _di_fss_embedded_list_read_print_signal_received_
- void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data, const f_status_t signal) {
+ void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
flockfile(data->main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
- fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+ fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
funlockfile(data->main->warning.to.stream);
}
#endif // _di_fss_embedded_list_read_print_signal_received_
-#ifndef _di_fss_embedded_list_read_signal_received_
- f_status_t fss_embedded_list_read_signal_received(fss_embedded_list_read_data_t * const data) {
-
- if (data->main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_embedded_list_read_print_signal_received(data, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_embedded_list_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param data
* The program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_embedded_list_read_print_signal_received_
- extern void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_embedded_list_read_print_signal_received(fss_embedded_list_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- * The program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_embedded_list_read_signal_received_
- extern f_status_t fss_embedded_list_read_signal_received(fss_embedded_list_read_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_fss_embedded_list_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (i = 0; i < values_total; ++i) {
if (!((++data->main->signal_check) % fss_embedded_list_read_signal_check_d)) {
- if (fss_embedded_list_read_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fss_embedded_list_read_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
f_status_t status = F_none;
{
- f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_embedded_list_read_common_allocation_large_d, fss_embedded_list_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
objects_delimits->used = 0;
if (skip[i]) continue;
if (!((++data->main->signal_check) % fss_embedded_list_read_signal_check_d)) {
- if (fss_embedded_list_read_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ fss_embedded_list_read_print_signal_received(data);
+
return F_status_set_error(F_interrupt);
}
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_embedded_list_write_defines_
- #define fss_embedded_list_write_signal_check_d 10000
+ #define fss_embedded_list_write_signal_check_d 20000
#define FSS_EMBEDDED_LIST_WRITE_pipe_name_s "(pipe)"
if (main->parameters.array[fss_embedded_list_write_parameter_object_e].result == f_console_result_additional_e) {
for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used; ++i) {
- if (fss_embedded_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_embedded_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_embedded_list_write_process(main, output, quote, &argv[main->parameters.array[fss_embedded_list_write_parameter_object_e].values.array[i]], 0, 0, &buffer);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_content_e].values.used; ++i) {
- if (fss_embedded_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_embedded_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_embedded_list_write_parameter_object_e].values.used; ++i) {
- if (fss_embedded_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_embedded_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_embedded_list_write_process_parameter_ignore(main, main->parameters.array[fss_embedded_list_write_parameter_content_e].locations, i, &ignore);
#endif
#ifndef _di_fss_embedded_list_write_print_signal_received_
- void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_embedded_list_write_print_signal_received_
-#ifndef _di_fss_embedded_list_write_signal_received_
- f_status_t fss_embedded_list_write_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_embedded_list_write_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_embedded_list_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_embedded_list_write_print_signal_received_
- extern void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_embedded_list_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_embedded_list_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_embedded_list_write_signal_received_
- extern f_status_t fss_embedded_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_embedded_list_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t fss_embedded_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
- f_state_t state = macro_f_state_t_initialize(fss_embedded_list_write_common_allocation_large_d, fss_embedded_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_embedded_list_write_common_allocation_large_d, fss_embedded_list_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range = f_string_range_t_initialize;
if (object) {
for (;;) {
- if (fss_embedded_list_write_signal_received(main)) {
- f_string_dynamic_resize(0, &block);
- f_string_dynamic_resize(0, &object);
- f_string_dynamic_resize(0, &content);
+ if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_embedded_list_write_print_signal_received(main);
- return F_status_set_error(F_interrupt);
+ f_string_dynamic_resize(0, &block);
+ f_string_dynamic_resize(0, &object);
+ f_string_dynamic_resize(0, &content);
+
+ return F_status_set_error(F_interrupt);
+ }
+
+ main->signal_check = 0;
}
if (range.start > range.stop) {
for (; i < main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.used; ++i) {
- if (fss_embedded_list_write_signal_received(main)) {
- return F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_embedded_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_embedded_list_write_print_signal_received(main);
+
+ return F_status_set_error(F_interrupt);
+ }
+
+ main->signal_check = 0;
}
l = main->parameters.array[fss_embedded_list_write_parameter_ignore_e].locations.array[i];
* The program defines.
*/
#ifndef _di_fss_extended_list_read_defines_
- #define fss_extended_list_read_signal_check_d 10000
+ #define fss_extended_list_read_signal_check_d 20000
#define FSS_EXTENDED_LIST_READ_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fss_extended_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fss_extended_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
#endif // _di_fss_extended_list_read_depths_resize_
#ifndef _di_fss_extended_list_read_print_signal_received_
- void fss_extended_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_extended_list_read_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_extended_list_read_print_signal_received_
-#ifndef _di_fss_extended_list_read_signal_received_
- f_status_t fss_extended_list_read_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_extended_list_read_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_extended_list_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_extended_list_read_print_signal_received_
- extern void fss_extended_list_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_list_read_signal_received_
- extern f_status_t fss_extended_list_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_list_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fss_extended_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_extended_list_read_signal_check_d)) {
- if (fss_extended_list_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
#ifndef _di_fss_extended_list_read_load_
f_status_t fss_extended_list_read_load(fll_program_data_t * const main, fss_extended_list_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_extended_list_read_common_allocation_large_d, fss_extended_list_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_list_write_defines_
- #define fss_extended_list_write_signal_check_d 10000
+ #define fss_extended_list_write_signal_check_d 20000
#define FSS_EXTENDED_LIST_WRITE_pipe_name_s "(pipe)"
if (main->parameters.array[fss_extended_list_write_parameter_object_e].result == f_console_result_additional_e) {
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].values.used; ++i) {
- if (fss_extended_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_extended_list_write_process(main, output, quote, &argv[main->parameters.array[fss_extended_list_write_parameter_object_e].values.array[i]], 0, 0, &buffer);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_content_e].values.used; ++i) {
- if (fss_extended_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_list_write_parameter_object_e].values.used; ++i) {
- if (fss_extended_list_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_extended_list_write_process_parameter_ignore(main, main->parameters.array[fss_extended_list_write_parameter_content_e].locations, i, &ignore);
#endif
#ifndef _di_fss_extended_list_write_print_signal_received_
- void fss_extended_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_extended_list_write_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
}
#endif // _di_fss_extended_list_write_print_signal_received_
-#ifndef _di_fss_extended_list_write_signal_received_
- f_status_t fss_extended_list_write_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_extended_list_write_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_extended_list_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_extended_list_write_print_signal_received_
- extern void fss_extended_list_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_list_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_list_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_list_write_signal_received_
- extern f_status_t fss_extended_list_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_list_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t fss_extended_list_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, const f_string_ranges_t *ignore, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
- f_state_t state = macro_f_state_t_initialize(fss_extended_list_write_common_allocation_large_d, fss_extended_list_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_extended_list_write_common_allocation_large_d, fss_extended_list_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range = f_string_range_t_initialize;
if (object) {
for (;;) {
- if (fss_extended_list_write_signal_received(main)) {
- return F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_write_print_signal_received(main);
+
+ return F_status_set_error(F_interrupt);
+ }
+
+ main->signal_check = 0;
}
if (range.start > range.stop) {
for (; i < main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.used; ++i) {
- if (fss_extended_list_write_signal_received(main)) {
- return F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_extended_list_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_list_write_print_signal_received(main);
+
+ return F_status_set_error(F_interrupt);
+ }
+
+ main->signal_check = 0;
}
l = main->parameters.array[fss_extended_list_write_parameter_ignore_e].locations.array[i];
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_read_defines_
- #define fss_extended_read_signal_check_d 10000
+ #define fss_extended_read_signal_check_d 20000
#define FSS_EXTENDED_READ_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fss_extended_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_read_print_signal_received(main);
+
status = F_status_set_error(F_signal);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fss_extended_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_read_print_signal_received(main);
+
status = F_status_set_error(F_signal);
break;
#endif // _di_fss_extended_read_depths_resize_
#ifndef _di_fss_extended_read_print_signal_received_
- void fss_extended_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_extended_read_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_extended_read_print_signal_received_
-#ifndef _di_fss_extended_read_signal_received_
- f_status_t fss_extended_read_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_extended_read_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_extended_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_extended_read_print_signal_received_
- extern void fss_extended_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_read_signal_received_
- extern f_status_t fss_extended_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fss_extended_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_extended_read_signal_check_d)) {
- if (fss_extended_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
#ifndef _di_fss_extended_read_load_
f_status_t fss_extended_read_load(fll_program_data_t * const main, fss_extended_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_extended_read_common_allocation_large_d, fss_extended_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
* - content_start: A code used to represent the start of Content for use in binary formats.
*/
#ifndef _di_fss_extended_write_defines_
- #define fss_extended_write_signal_check_d 10000
+ #define fss_extended_write_signal_check_d 20000
#define FSS_EXTENDED_WRITE_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
- if (fss_extended_write_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_write_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (; i < main->parameters.array[fss_extended_write_parameter_object_e].values.used; ++i) {
if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
- if (fss_extended_write_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_write_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
#endif
#ifndef _di_fss_extended_write_print_signal_received_
- void fss_extended_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_extended_write_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_extended_write_print_signal_received_
-#ifndef _di_fss_extended_write_signal_received_
- f_status_t fss_extended_write_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_extended_write_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_extended_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_extended_write_print_signal_received_
- extern void fss_extended_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_extended_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_extended_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_extended_write_signal_received_
- extern f_status_t fss_extended_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_extended_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t fss_extended_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_statics_t *contents, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
- f_state_t state = macro_f_state_t_initialize(fss_extended_write_common_allocation_large_d, fss_extended_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_extended_write_common_allocation_large_d, fss_extended_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range = f_string_range_t_initialize;
if (object) {
for (;;) {
if (!((++main->signal_check) % fss_extended_write_signal_check_d)) {
- if (fss_extended_write_signal_received(main)) {
- return F_status_set_error(F_interrupt);
+ if (fll_program_standard_signal_received(main)) {
+ fss_extended_write_print_signal_received(main);
+
+ status = F_status_set_error(F_interrupt);
+
+ break;
}
main->signal_check = 0;
* The program defines.
*/
#ifndef _di_fss_identify_defines_
- #define fss_identify_signal_check_d 10000
+ #define fss_identify_signal_check_d 20000
#endif // _di_fss_identify_defines_
/**
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_identify_signal_check_d)) {
- if (fss_identify_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_identify_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
#endif // _di_fss_identify_data_delete_
#ifndef _di_fss_identify_print_signal_received_
- void fss_identify_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_identify_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_identify_print_signal_received_
-#ifndef _di_fss_identify_signal_received_
- f_status_t fss_identify_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_identify_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_identify_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_identify_print_signal_received_
- extern void fss_identify_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_identify_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_identify_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_identify_signal_received_
- extern f_status_t fss_identify_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_identify_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
do {
if (!((++main->signal_check) % fss_identify_signal_check_d)) {
- if (fss_identify_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_identify_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
* The program defines.
*/
#ifndef _di_fss_payload_read_defines_
- #define fss_payload_read_signal_check_d 10000
+ #define fss_payload_read_signal_check_d 20000
#define FSS_PAYLOAD_READ_pipe_name_s "(pipe)"
for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_read_parameter_delimit_e].values.used; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
#endif // _di_fss_payload_read_depths_resize_
#ifndef _di_fss_payload_read_print_signal_received_
- void fss_payload_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_payload_read_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_payload_read_print_signal_received_
-#ifndef _di_fss_payload_read_signal_received_
- f_status_t fss_payload_read_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_payload_read_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_payload_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_payload_read_print_signal_received_
- extern void fss_payload_read_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_payload_read_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_payload_read_signal_received_
- extern f_status_t fss_payload_read_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_payload_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (f_array_length_t i = 0; i < data->depths.used; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (f_array_length_t j = i + 1; j < data->depths.used; ++j) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
#ifndef _di_fss_payload_read_load_
f_status_t fss_payload_read_load(fll_program_data_t * const main, fss_payload_read_data_t * const data) {
- f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_payload_read_common_allocation_large_d, fss_payload_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t input = macro_f_string_range_t_initialize2(data->buffer.used);
data->delimits_object.used = 0;
if (!names[i]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
for (i = range.start; i <= range.stop; ++i) {
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[at]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[i]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
if (!names[at]) continue;
if (!((++main->signal_check) % fss_payload_read_signal_check_d)) {
- if (fss_payload_read_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_read_print_signal_received(main);
+
return F_status_set_error(F_interrupt);
}
* The program defines.
*/
#ifndef _di_fss_payload_write_defines_
- #define fss_payload_write_signal_check_d 10000
+ #define fss_payload_write_signal_check_d 20000
#define FSS_PAYLOAD_WRITE_pipe_content_end_s "\f"
#define FSS_PAYLOAD_WRITE_pipe_content_ignore_s "\v"
if (main->parameters.array[fss_payload_write_parameter_object_e].result == f_console_result_additional_e) {
for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].values.used; ++i) {
- if (fss_payload_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], 0, &buffer);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_content_e].values.used; ++i) {
- if (fss_payload_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_payload_write_process(main, output, quote, 0, &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
else {
for (f_array_length_t i = 0; i < main->parameters.array[fss_payload_write_parameter_object_e].values.used; ++i) {
- if (fss_payload_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
status = fss_payload_write_process(main, output, quote, &argv[main->parameters.array[fss_payload_write_parameter_object_e].values.array[i]], &argv[main->parameters.array[fss_payload_write_parameter_content_e].values.array[i]], &buffer);
#endif
#ifndef _di_fss_payload_write_print_signal_received_
- void fss_payload_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_payload_write_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_payload_write_print_signal_received_
-#ifndef _di_fss_payload_write_signal_received_
- f_status_t fss_payload_write_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_payload_write_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_payload_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_payload_write_print_signal_received_
- extern void fss_payload_write_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_payload_write_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_payload_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_payload_write_signal_received_
- extern f_status_t fss_payload_write_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_payload_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
f_status_t fss_payload_write_process(fll_program_data_t * const main, const f_file_t output, const f_fss_quote_t quote, const f_string_static_t *object, const f_string_static_t *content, f_string_dynamic_t *buffer) {
f_status_t status = F_none;
- f_state_t state = macro_f_state_t_initialize(fss_payload_write_common_allocation_large_d, fss_payload_write_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(fss_payload_write_common_allocation_large_d, fss_payload_write_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) main, 0);
f_string_range_t range = f_string_range_t_initialize;
if (object) {
for (;;) {
- if (fss_payload_write_signal_received(main)) {
- status = F_status_set_error(F_interrupt);
+ if (!((++main->signal_check) % fss_payload_write_signal_check_d)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_payload_write_print_signal_received(main);
- break;
+ status = F_status_set_error(F_interrupt);
+
+ break;
+ }
+
+ main->signal_check = 0;
}
if (range.start > range.stop) {
* The program defines.
*/
#ifndef _di_fss_status_code_defines_
- #define fss_status_code_signal_check_d 10000
+ #define fss_status_code_signal_check_d 20000
#endif // _di_fss_status_code_defines_
/**
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
- if (fss_status_code_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_status_code_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
- if (fss_status_code_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_status_code_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % fss_status_code_signal_check_d)) {
- if (fss_status_code_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ fss_status_code_print_signal_received(main);
+
status = F_status_set_error(F_interrupt);
break;
#endif
#ifndef _di_fss_status_code_print_signal_received_
- void fss_status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void fss_status_code_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_fss_status_code_print_signal_received_
-#ifndef _di_fss_status_code_signal_received_
- f_status_t fss_status_code_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- fss_status_code_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_fss_status_code_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_fss_status_code_print_signal_received_
- extern void fss_status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void fss_status_code_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_fss_status_code_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_fss_status_code_signal_received_
- extern f_status_t fss_status_code_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_fss_status_code_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
* The program defines.
*/
#ifndef _di_iki_read_defines_
- #define iki_read_signal_check_d 10000
+ #define iki_read_signal_check_d 20000
enum {
iki_read_mode_content_e = 1,
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % iki_read_signal_check_d)) {
- if (iki_read_signal_received(&data)) {
+ if (fll_program_standard_signal_received(main)) {
+ iki_read_print_signal_received(&data);
+
status = F_status_set_error(F_interrupt);
break;
#endif // _di_iki_read_data_delete_
#ifndef _di_iki_read_print_signal_received_
- void iki_read_print_signal_received(iki_read_data_t * const data, const f_status_t signal) {
+ void iki_read_print_signal_received(iki_read_data_t * const data) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
flockfile(data->main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
- fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+ fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal_received, data->main->context.set.notable);
fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
funlockfile(data->main->warning.to.stream);
}
#endif // _di_iki_read_print_signal_received_
-#ifndef _di_iki_read_signal_received_
- f_status_t iki_read_signal_received(iki_read_data_t * const data) {
-
- if (data->main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- iki_read_print_signal_received(data, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_iki_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param data
* The program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_iki_read_print_signal_received_
- extern void iki_read_print_signal_received(iki_read_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void iki_read_print_signal_received(iki_read_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_iki_read_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- * The program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_iki_read_signal_received_
- extern f_status_t iki_read_signal_received(iki_read_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_iki_read_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
bool unmatched = F_true;
{
- f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
status = fl_iki_read(state, &data->buffer, buffer_range, iki_data);
}
f_string_range_t range = buffer_range;
{
- f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
status = fl_iki_read(state, &data->buffer, &range, iki_data);
}
}
{
- f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, 0, 0, 0, 0);
+ f_state_t state = macro_f_state_t_initialize(iki_read_common_allocation_large_d, iki_read_common_allocation_small_d, 0, &fll_program_standard_signal_state, 0, (void *) data->main, 0);
status = fl_iki_read(state, &data->buffer, &range, iki_data);
}
for (; i < data->main->parameters.array[iki_read_parameter_name_e].values.used; ++i) {
if (!((++data->main->signal_check) % iki_read_signal_check_d)) {
- if (iki_read_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
+ iki_read_print_signal_received(data);
+
f_string_dynamic_resize(0, &name);
return F_status_set_error(F_interrupt);
* The program defines.
*/
#ifndef _di_iki_write_defines_
- #define iki_write_signal_check_d 10000
+ #define iki_write_signal_check_d 20000
#endif // _di_iki_write_defines_
/**
for (f_status_t status_pipe = F_none; ; ) {
if (!((++main->signal_check) % iki_write_signal_check_d)) {
- if (iki_write_signal_received(&data)) {
+ if (fll_program_standard_signal_received(main)) {
status = F_status_set_error(F_interrupt);
break;
for (f_array_length_t i = 0; i < main->parameters.array[iki_write_parameter_object_e].values.used; ++i) {
if (!((++main->signal_check) % iki_write_signal_check_d)) {
- if (iki_write_signal_received(&data)) {
+ if (fll_program_standard_signal_received(main)) {
status = F_status_set_error(F_interrupt);
break;
#endif // _di_iki_write_data_delete_
#ifndef _di_iki_write_print_signal_received_
- void iki_write_print_signal_received(iki_write_data_t * const data, const f_status_t signal) {
+ void iki_write_print_signal_received(iki_write_data_t * const data) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
flockfile(data->main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", data->main->warning.to.stream, data->main->context.set.reset, f_string_eol_s, f_string_eol_s, data->main->context.set.warning, data->main->context.set.warning);
- fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, signal, data->main->context.set.notable);
+ fl_print_format("%[%i%]", data->main->warning.to.stream, data->main->context.set.notable, data->main->signal, data->main->context.set.notable);
fl_print_format("%[.%]%r", data->main->warning.to.stream, data->main->context.set.warning, data->main->context.set.warning, f_string_eol_s);
funlockfile(data->main->warning.to.stream);
}
#endif // _di_iki_write_print_signal_received_
-#ifndef _di_iki_write_signal_received_
- f_status_t iki_write_signal_received(iki_write_data_t * const data) {
-
- if (data->main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- iki_write_print_signal_received(data, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_iki_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param data
* The program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_iki_write_print_signal_received_
- extern void iki_write_print_signal_received(iki_write_data_t * const data, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void iki_write_print_signal_received(iki_write_data_t * const data) F_attribute_visibility_internal_d;
#endif // _di_iki_write_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- * The program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_iki_write_signal_received_
- extern f_status_t iki_write_signal_received(iki_write_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_iki_write_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
* The program defines.
*/
#ifndef _di_status_code_defines_
- #define status_code_signal_check_d 10000
+ #define status_code_signal_check_d 20000
#endif // _di_status_code_defines_
/**
#endif
#ifndef _di_status_code_print_signal_received_
- void status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) {
+ void status_code_print_signal_received(fll_program_data_t * const main) {
- if (main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (main->warning.verbosity != f_console_verbosity_verbose_e && main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(main->warning.to.stream);
flockfile(main->warning.to.stream);
fl_print_format("%]%r%r%[Received signal code %]", main->warning.to.stream, main->context.set.reset, f_string_eol_s, f_string_eol_s, main->context.set.warning, main->context.set.warning);
- fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, signal, main->context.set.notable);
+ fl_print_format("%[%i%]", main->warning.to.stream, main->context.set.notable, main->signal_received, main->context.set.notable);
fl_print_format("%[.%]%r", main->warning.to.stream, main->context.set.warning, main->context.set.warning, f_string_eol_s);
funlockfile(main->warning.to.stream);
}
#endif // _di_status_code_print_signal_received_
-#ifndef _di_status_code_signal_received_
- f_status_t status_code_signal_received(fll_program_data_t * const main) {
-
- if (main->signal.id == -1) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- status_code_print_signal_received(main, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_status_code_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
*
* @param main
* The main program data.
- * @param signal
- * The signal received.
*/
#ifndef _di_status_code_print_signal_received_
- extern void status_code_print_signal_received(fll_program_data_t * const main, const f_status_t signal) F_attribute_visibility_internal_d;
+ extern void status_code_print_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
#endif // _di_status_code_print_signal_received_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param main
- * The main program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_status_code_signal_received_
- extern f_status_t status_code_signal_received(fll_program_data_t * const main) F_attribute_visibility_internal_d;
-#endif // _di_status_code_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % status_code_signal_check_d)) {
- if (status_code_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ status_code_print_signal_received(main);
+
status = F_status_set_error(F_signal);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % status_code_signal_check_d)) {
- if (status_code_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ status_code_print_signal_received(main);
+
status = F_status_set_error(F_signal);
break;
for (f_array_length_t i = 0; i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % status_code_signal_check_d)) {
- if (status_code_signal_received(main)) {
+ if (fll_program_standard_signal_received(main)) {
+ status_code_print_signal_received(main);
+
status = F_status_set_error(F_signal);
break;
* The program defines.
*/
#ifndef _di_utf8_defines_
- #define utf8_signal_check_d 10000
+ #define utf8_signal_check_d 20000
#define UTF8_string_combining_is_s "C"
#define UTF8_string_combining_not_s "N"
}
#endif // _di_utf8_data_delete_
-#ifndef _di_utf8_signal_received_
- f_status_t utf8_signal_received(utf8_data_t * const data) {
-
- if (!data->main->signal.id) {
- return F_false;
- }
-
- struct signalfd_siginfo information;
-
- memset(&information, 0, sizeof(struct signalfd_siginfo));
-
- if (f_signal_read(data->main->signal, 0, &information) == F_signal) {
- switch (information.ssi_signo) {
- case F_signal_abort:
- case F_signal_broken_pipe:
- case F_signal_hangup:
- case F_signal_interrupt:
- case F_signal_quit:
- case F_signal_termination:
- utf8_print_signal_received(data, information.ssi_signo);
-
- return information.ssi_signo;
- }
- }
-
- return F_false;
- }
-#endif // _di_utf8_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
extern void utf8_data_delete(utf8_data_t *data) F_attribute_visibility_internal_d;
#endif // _di_utf8_data_delete_
-/**
- * Check to see if a process signal is received.
- *
- * Only signals that are blocked via main.signal will be received.
- *
- * @param data
- * The program data.
- *
- * @return
- * A positive number representing a valid signal on signal received.
- * F_false on no signal received.
- *
- * @see f_signal_read()
- */
-#ifndef _di_utf8_signal_received_
- extern f_status_t utf8_signal_received(utf8_data_t * const data) F_attribute_visibility_internal_d;
-#endif // _di_utf8_signal_received_
-
#ifdef __cplusplus
} // extern "C"
#endif
#ifndef _di_utf8_print_signal_received_
void utf8_print_signal_received(utf8_data_t * const data, const f_status_t signal) {
- if (data->main->warning.verbosity != f_console_verbosity_verbose_e) return;
+ if (data->main->warning.verbosity != f_console_verbosity_verbose_e && data->main->warning.verbosity != f_console_verbosity_debug_e) return;
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
fflush(data->main->warning.to.stream);
for (; text.string[0] && F_status_is_error_not(status); ) {
if (!((++data->main->signal_check) % utf8_signal_check_d)) {
- if (utf8_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
utf8_print_signal_received(data, status);
- status = F_status_set_error(F_signal);
+ status = F_status_set_error(F_interrupt);
break;
}
* @return
* F_true on success and is valid.
* F_false on success and contains invalid sequences.
- * F_signal on (exit) signal received.
+ * F_interrupt on (exit) signal received.
*
* Errors (with error bit) from: utf8_convert_binary()
* Errors (with error bit) from: utf8_convert_codepoint()
for (i = 0; F_status_is_fine(status) && i < data->buffer.used; ) {
if (!((++data->main->signal_check) % utf8_signal_check_d)) {
- if (utf8_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
utf8_print_signal_received(data, status);
- status = F_signal;
+ status = F_interrupt;
break;
}
i = 0;
data->buffer.used = 0;
- } while (F_status_is_fine(status) && status != F_signal);
+ } while (F_status_is_fine(status) && status != F_interrupt);
// Handle last (incomplete) character when the buffer ended before the character is supposed to end.
- if (F_status_is_error_not(status) && status != F_signal && next == F_false) {
+ if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) {
character.used = j;
if (data->mode & utf8_mode_from_binary_d) {
data->buffer.used = 0;
- if (F_status_is_error(status) || status == F_signal) {
+ if (F_status_is_error(status) || status == F_interrupt) {
return status;
}
* @return
* F_true on success and is valid.
* F_false on success and contains invalid sequences.
- * F_signal on (exit) signal received.
+ * F_interrupt on (exit) signal received.
*
* Errors (with error bit) from: utf8_convert_binary()
* Errors (with error bit) from: utf8_detect_codepoint()
*
+ * @see fll_program_standard_signal_received()
* @see utf8_convert_binary()
* @see utf8_detect_codepoint()
- * @see utf8_signal_received()
*/
#ifndef _di_utf8_process_file_binary_
extern f_status_t utf8_process_file_binary(utf8_data_t * const data, const f_file_t file) F_attribute_visibility_internal_d;
for (i = 0; F_status_is_fine(status) && i < data->buffer.used; ) {
if (!((++data->main->signal_check) % utf8_signal_check_d)) {
- if (utf8_signal_received(data)) {
+ if (fll_program_standard_signal_received(data->main)) {
utf8_print_signal_received(data, status);
- status = F_signal;
+ status = F_interrupt;
break;
}
i = 0;
data->buffer.used = 0;
- } while (F_status_is_fine(status) && status != F_signal);
+ } while (F_status_is_fine(status) && status != F_interrupt);
// Handle last (incomplete) character when the buffer ended before the character is supposed to end.
- if (F_status_is_error_not(status) && status != F_signal && next == F_false) {
+ if (F_status_is_error_not(status) && status != F_interrupt && next == F_false) {
character.used = j;
if (data->mode & utf8_mode_from_binary_d) {
data->buffer.used = 0;
- if (F_status_is_error(status) || status == F_signal) {
+ if (F_status_is_error(status) || status == F_interrupt) {
return status;
}
* @return
* F_true on success and is valid.
* F_false on success and contains invalid sequences.
- * F_signal on (exit) signal received.
+ * F_interrupt on (exit) signal received.
*
* Errors (with error bit) from: utf8_convert_binary()
* Errors (with error bit) from: utf8_detect_codepoint()
*
+ * @see fll_program_standard_signal_received()
* @see utf8_convert_binary()
* @see utf8_detect_codepoint()
- * @see utf8_signal_received()
*/
#ifndef _di_utf8_process_file_codepoint_
extern f_status_t utf8_process_file_codepoint(utf8_data_t * const data, const f_file_t file) F_attribute_visibility_internal_d;
}
}
- if (F_status_is_error_not(status) && status != F_signal && main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) {
+ if (F_status_is_error_not(status) && status != F_interrupt && main->parameters.array[utf8_parameter_from_file_e].result == f_console_result_additional_e) {
f_array_length_t i = 0;
f_array_length_t index = 0;
f_file_t file = macro_f_file_t_initialize(0, -1, F_file_flag_read_only_d, 32768, F_file_default_write_size_d);
- for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_signal; ++i) {
+ for (; i < main->parameters.array[utf8_parameter_from_file_e].values.used && status != F_interrupt; ++i) {
if (!((++main->signal_check) % utf8_signal_check_d)) {
- if (utf8_signal_received(&data)) {
- status = F_status_set_error(F_signal);
+ if (fll_program_standard_signal_received(main)) {
+ status = F_status_set_error(F_interrupt);
break;
}
} // for
}
- if (F_status_is_error_not(status) && status != F_signal && main->parameters.remaining.used) {
+ if (F_status_is_error_not(status) && status != F_interrupt && main->parameters.remaining.used) {
for (f_array_length_t i = 0; F_status_is_error_not(status) && i < main->parameters.remaining.used; ++i) {
if (!((++main->signal_check) % utf8_signal_check_d)) {
- if (utf8_signal_received(&data)) {
- status = F_status_set_error(F_signal);
+ if (fll_program_standard_signal_received(main)) {
+ status = F_status_set_error(F_interrupt);
break;
}
}
if (main->output.verbosity != f_console_verbosity_quiet_e && main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) {
- if (status == F_signal) {
+ if (status == F_interrupt) {
fflush(data.file.stream);
if (data.file.stream != main->output.to.stream) {
utf8_data_delete(&data);
- if (F_status_is_error(status) || status == F_signal) {
+ if (F_status_is_error(status) || status == F_interrupt) {
return status;
}
* F_none on success.
* F_true on success when performing verification and verify passed.
* F_false on success when performing verification and verify failed.
- * F_signal on (exit) signal received.
+ * F_interrupt on (exit) signal received.
*
* Status codes (with error bit) are returned on any problem.
*/