Add a new line before printing the standard "Received signal code" message to ensure that it is always reasonably separated from the output being interrupted.
Simplify the verbosity variable check to a less than because the verbosity list is an enumeration.
Move the `fll_program_print_signal_received()` calls to the main program to help ensure consistent printing at the end of the program.
- Note: I am not certain if I want this instead in the main() function or not and I opted not to do so for now.
Fix some cases where the manual signal checks are still being performed to use the function instead.
if (!print) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- if (print->verbosity != f_console_verbosity_verbose_e && print->verbosity != f_console_verbosity_debug_e) {
+ if (print->verbosity < f_console_verbosity_verbose_e) {
return F_output_not;
}
// Must flush and reset color because the interrupt may have interrupted the middle of a print function.
f_file_stream_flush(print->to);
- fl_print_format("%]%[Received signal code %]", print->to, print->set->reset, print->set->warning, print->set->warning);
+ fl_print_format("%]\n%[Received signal code %]", print->to, print->set->reset, print->set->warning, print->set->warning);
fl_print_format(f_string_format_u_single_s.string, print->to, print->set->notable, signal, print->set->notable);
fl_print_format(f_string_format_sentence_end_single_s.string, print->to, print->set->warning, print->set->warning, f_string_eol_s);
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
byte_dump_print_error_file_none(&main->program.error);
}
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
}
#endif // _di_byte_dump_main_
if (!((++main->program.signal_check) % byte_dump_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
- if (main->setting.state.status == F_status_set_error(F_interrupt)) {
+ if (main->program.signal_received) {
fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
}
}
if (!((++main->program.signal_check) % example_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
}
fake_data_delete(&data);
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
}
#endif // _di_fake_main_
if (!((++main->program.signal_check) % fake_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
firewall_print_error_operation_specified_not(&main->program.error);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_interrupt) return;
main->setting.state.status = F_okay;
if (!((++main->program.signal_check) % firewall_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
}
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_interrupt) return;
main->setting.state.status = F_okay;
if (!((++main->program.signal_check) % fss_identify_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
main->callback.process(void_main);
}
}
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
}
#endif // _di_fss_read_main_
if (!((++main->program.signal_check) % fss_read_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
}
}
}
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
}
#endif // _di_fss_write_main_
if (length) {
for (f_number_unsigned_t i = 0; i < length; ++i) {
- // @todo replace all signal checks with forked main process that independently checks and assigns main->program.signal_received.
- if (!((++main->program.signal_check) % fss_write_signal_check_d)) {
- if (fll_program_standard_signal_received(&main->program)) {
- main->setting.state.status = F_status_set_error(F_interrupt);
-
- return;
- }
-
- main->program.signal_check = 0;
- }
+ if (fss_write_signal_check(main)) return;
if (main->setting.objects.used) {
main->setting.object = &main->setting.objects.array[i];
for (;;) {
- if (!((++main->program.signal_check) % fss_write_signal_check_d)) {
- if (fll_program_standard_signal_received(&main->program)) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
- main->setting.state.status = F_status_set_error(F_interrupt);
-
- break;
- }
-
- main->program.signal_check = 0;
- }
+ if (fss_write_signal_check(main)) break;
if (range.start > range.stop) {
if (status_pipe == F_okay_eof) break;
if (!((++main->program.signal_check) % fss_write_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
f_file_stream_close(&file);
}
}
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
}
#endif // _di_iki_read_main_
if (!((++main->program.signal_check) % iki_read_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
fll_print_dynamic_raw(f_string_eol_s, main->program.output.to);
} // for
}
+
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
}
#endif // _di_iki_write_main_
if (!((++main->program.signal_check) % iki_write_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!((++main->program.signal_check) % status_code_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
for (f_number_unsigned_t i = 0; i < main->program.parameters.remaining.used; ++i) {
- if (!((++main->program.signal_check) % status_code_signal_check_d)) {
- if (fll_program_standard_signal_received(&main->program)) {
- main->setting.state.status = F_status_set_error(F_interrupt);
-
- break;
- }
-
- main->program.signal_check = 0;
- }
+ if (status_code_signal_check(main)) break;
status = main->setting.state.status;
for (f_number_unsigned_t i = 0; i < main->program.parameters.remaining.used; ++i) {
- if (!((++main->program.signal_check) % status_code_signal_check_d)) {
- if (fll_program_standard_signal_received(&main->program)) {
- main->setting.state.status = F_status_set_error(F_interrupt);
-
- break;
- }
-
- main->program.signal_check = 0;
- }
+ if (status_code_signal_check(main)) break;
status = main->setting.state.status;
for (f_number_unsigned_t i = 0; i < main->program.parameters.remaining.used; ++i) {
- if (!((++main->program.signal_check) % status_code_signal_check_d)) {
- if (fll_program_standard_signal_received(&main->program)) {
- main->setting.state.status = F_status_set_error(F_interrupt);
-
- break;
- }
-
- main->program.signal_check = 0;
- }
+ if (status_code_signal_check(main)) break;
status = main->setting.state.status;
}
}
- if (main->setting.state.status == F_status_set_error(F_interrupt)) {
+ if (main->program.signal_received) {
fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
}
}
if (!((++main->program.signal_check) % utf8_signal_check_d)) {
if (F_status_set_fine(fll_program_standard_signal_received(&main->program)) == F_interrupt) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
if (!main) return F_false;
if (main->program.signal_received) {
- fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
-
main->setting.state.status = F_status_set_error(F_interrupt);
return F_true;
fll_program_print_copyright(&main->program.message, fll_program_copyright_year_author_s);
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
return;
}
}
}
+ if (main->program.signal_received) {
+ fll_program_print_signal_received(&main->program.warning, main->program.signal_received);
+ }
+
if (F_status_is_error(main->setting.state.status) || main->setting.state.status == F_interrupt) return;
main->setting.state.status = (main->setting.flag & utf8_main_flag_verify_d) ? valid : F_okay;