if (!print) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- f_string_static_t type_name = fll_error_file_type_file_s;
-
- if (type == fll_error_file_type_directory_e) {
- type_name = fll_error_file_type_directory_s;
- }
- else if (type == fll_error_file_type_link_e) {
- type_name = fll_error_file_type_link_s;
- }
- else if (type == fll_error_file_type_path_e) {
- type_name = fll_error_file_type_path_s;
- }
- else if (type == fll_error_file_type_pipe_e) {
- type_name = fll_error_file_type_pipe_s;
- }
- else if (type == fll_error_file_type_socket_e) {
- type_name = fll_error_file_type_socket_s;
- }
+ const f_string_static_t type_name = type == fll_error_file_type_directory_e
+ ? fll_error_file_type_directory_s
+ : type == fll_error_file_type_link_e
+ ? fll_error_file_type_link_s
+ : type == fll_error_file_type_path_e
+ ? fll_error_file_type_path_s
+ : type == fll_error_file_type_pipe_e
+ ? fll_error_file_type_pipe_s
+ : type == fll_error_file_type_socket_e
+ ? fll_error_file_type_socket_s
+ : fll_error_file_type_file_s;
if (status == F_access_denied) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QAccess denied while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QAccess denied while trying to %Q %Q '%]");
}
if (status == F_access_group) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QCurrent user is not allowed to use the given group while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QCurrent user is not allowed to use the given group while trying to %Q %Q '%]");
}
if (status == F_access_owner) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QCurrent user is not allowed to use the given owner while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QCurrent user is not allowed to use the given owner while trying to %Q %Q '%]");
}
if (status == F_directory || status == F_directory_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInvalid directory while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QInvalid directory while trying to %Q %Q '%]");
}
if (status == F_error) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', already in an error state->%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q '%]", "%[', already in an error state.%]%r");
}
if (status == F_failure) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q '%]");
}
if (status == F_file_close) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', failed to close.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', failed to close.%]%r");
}
if (status == F_file_closed) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', is closed.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', is closed.%]%r");
}
if (status == F_file_descriptor) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFile descriptor error while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QFile descriptor error while trying to %Q %Q '%]");
}
if (status == F_file_descriptor_max) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QMax file descriptors reached while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QMax file descriptors reached while trying to %Q %Q '%]");
}
if (status == F_file_descriptor_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInvalid file descriptor while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QInvalid file descriptor while trying to %Q %Q '%]");
}
if (status == F_directory_empty || status == F_file_empty) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', %Q is empty.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_one(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', %Q is empty.%]%r", type_name);
}
if (status == F_directory_empty_not || status == F_file_empty_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', %Q is not empty.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_one(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', %Q is not empty.%]%r", type_name);
}
if (status == F_file_flush) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', flush failed.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', flush failed.%]%r");
}
if (status == F_file_found) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', found existing %Q.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_one(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', found existing %Q.%]%r", type_name);
}
if (status == F_file_found_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', could not find.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', could not find.%]%r");
}
if (status == F_file_open) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', already open.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', already open.%]%r");
}
if (status == F_file_open_max) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QMax open files reached while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QMax open files reached while trying to %Q %Q '%]");
}
if (status == F_file_overflow) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QOverflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QOverflow while trying to %Q %Q '%]");
}
if (status == F_file_purge) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', purge failed.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', purge failed.%]%r");
}
if (status == F_file_read) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QRead failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QRead failed while trying to %Q %Q '%]");
}
if (status == F_file_seek) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QSeek failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QSeek failed while trying to %Q %Q '%]");
}
if (status == F_file_stat) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QStat failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QStat failed while trying to %Q %Q '%]");
}
if (status == F_file_synchronize) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QSynchronize failed while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QSynchronize failed while trying to %Q %Q '%]");
}
if (status == F_file_type_unknown) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[' is an unknown file type.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q, the path '%]", "%[' is an unknown file type.%]%r");
}
if (status == F_file_utf) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUTF failure while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QUTF failure while trying to %Q %Q '%]");
}
if (status == F_file_utf_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInvalid UTF while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QInvalid UTF while trying to %Q %Q '%]");
}
if (status == F_file_underflow) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnderflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QUnderflow while trying to %Q %Q '%]");
}
if (status == F_file_write) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', write failure.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q '%]", "%[', write failure.%]%r");
}
if (status == F_loop) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QLoop while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QLoop while trying to %Q %Q '%]");
}
if (status == F_name) {
}
if (status == F_number_overflow) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QNumber overflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QNumber overflow while trying to %Q %Q '%]");
}
if (status == F_number_underflow) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QNumber underflow while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QNumber underflow while trying to %Q %Q '%]");
}
if (status == F_parameter) {
}
if (status == F_prohibited) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QProhibited by system while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QProhibited by system while trying to %Q %Q '%]");
}
if (status == F_read_only) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', %Q is read only.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_one(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', %Q is read only.%]%r", type_name);
}
if (status == F_write_only) {
private_fll_error_print_unable_to(print, operation, name, type_name, "is write only");
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[', %Q is write only.%]%r", print->to, print->context, type_name, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_one(print, name, operation, type_name, "%[%QUnable to %Q %Q '%]", "%[', %Q is write only.%]%r", type_name);
}
if (type == fll_error_file_type_file_e) {
if (status == F_file_type_not_directory) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInvalid or missing directory in path while trying to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_simple(print, name, operation, type_name, "%[%QInvalid or missing directory in path while trying to %Q %Q '%]");
}
if (status == F_file_type_directory) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[' is a directory.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q, the path '%]", "%[' is a directory.%]%r");
}
}
else if (type == fll_error_file_type_directory_e) {
- if (status == F_file_type_regular) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[' is a file.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
- }
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q, the path '%]", "%[' is a file.%]%r");
}
if (type == fll_error_file_type_file_e || type == fll_error_file_type_directory_e || type == fll_error_file_type_path_e) {
if (status == F_directory_found_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[' due to an invalid directory in the path.%]%r", print->to, print->context, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_simple(print, name, operation, type_name, "%[%QFailed to %Q %Q '%]", "%[' due to an invalid directory in the path.%]%r");
}
if (status == F_file_type_pipe || status == F_file_type_socket) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailed to %Q %Q, the path '%]", print->to, print->context, print->prefix, operation, type_name, print->context);
- fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
- fl_print_format("%[' is a %Q.%]%r", print->to, print->context, status == F_file_type_pipe ? fll_error_file_type_pipe_s : fll_error_file_type_socket_s, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_file_print_before_after_one(print, name, operation, type_name, "%[%QFailed to %Q %Q, the path '%]", "%[' is a %Q.%]%r", status == F_file_type_pipe ? fll_error_file_type_pipe_s : fll_error_file_type_socket_s);
}
}
extern "C" {
#endif
-#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
- f_status_t private_fll_error_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) {
-
- if (status == F_access_denied) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
+#if !defined(_di_fll_error_file_print_)
+ f_status_t private_fll_error_file_print_simple(fl_print_t * const print, const f_string_static_t name, const f_string_static_t operation, const f_string_static_t type_name, const f_string_t message) {
- fl_print_format("%[%QAccess denied", print->to, print->context, print->prefix);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
+ fl_print_format(message, print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
+ fl_print_format(f_string_format_sentence_end_single_quote_s.string, print->to, print->context, print->context, f_string_eol_s);
- return F_false;
+ funlockfile(print->to.stream);
}
- if (status == F_array_too_large) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QMaximum array length reached", print->to, print->context, print->prefix);
+ return F_false;
+ }
+#endif // _di_fll_error_file_print_simple_
- private_fll_error_print_function(print, function);
+#if !defined(_di_fll_error_file_print_)
+ f_status_t private_fll_error_file_print_before_after_one(fl_print_t * const print, const f_string_static_t name, const f_string_static_t operation, const f_string_static_t type_name, const f_string_t before, const f_string_t after, const f_string_static_t one) {
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- funlockfile(print->to.stream);
- }
+ fl_print_format(before, print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
+ fl_print_format(after, print->to, print->context, one, print->context, f_string_eol_s);
- return F_false;
+ funlockfile(print->to.stream);
}
- if (status == F_buffer_too_large) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
+ return F_false;
+ }
+#endif // _di_fll_error_file_print_one_
- fl_print_format("%[%QMaximum buffer length reached", print->to, print->context, print->prefix);
+#if !defined(_di_fll_error_file_print_)
+ f_status_t private_fll_error_file_print_before_after_simple(fl_print_t * const print, const f_string_static_t name, const f_string_static_t operation, const f_string_static_t type_name, const f_string_t before, const f_string_t after) {
- private_fll_error_print_function(print, function);
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
+ fl_print_format(before, print->to, print->context, print->prefix, operation, type_name, print->context);
+ fl_print_format(f_string_format_Q_single_s.string, print->to, print->notable, name, print->notable);
+ fl_print_format(after, print->to, print->context, print->context, f_string_eol_s);
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ funlockfile(print->to.stream);
}
- if (status == F_error) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
+ return F_false;
+ }
+#endif // _di_fll_error_file_print_simple_
- fl_print_format("%[%QAn error has occurred", print->to, print->context, print->prefix);
+#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
+ f_status_t private_fll_error_print(fl_print_t * const print, const f_status_t status, const f_string_t function, const uint8_t flag) {
- private_fll_error_print_function(print, function);
+ if (status == F_access_denied) {
+ return private_fll_error_print_simple(print, function, "%[%QAccess denied");
+ }
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
+ if (status == F_array_too_large) {
+ return private_fll_error_print_simple(print, function, "%[%QMaximum array length reached");
+ }
- funlockfile(print->to.stream);
- }
+ if (status == F_buffer_too_large) {
+ return private_fll_error_print_simple(print, function, "%[%QMaximum buffer length reached");
+ }
- return F_false;
+ if (status == F_error) {
+ return private_fll_error_print_simple(print, function, "%[%QAn error has occurred");
}
if (status == F_file_found_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFile not found", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
+ return private_fll_error_print_simple(print, function, "%[%QFile not found");
+ }
- return F_false;
+ if (status == F_memory) {
+ return private_fll_error_print_simple(print, function, "%[%QMemory problem");
}
if (status == F_memory_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUnable to allocate memory", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QUnable to allocate memory");
}
if (status == F_parameter) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInvalid parameter", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QInvalid parameter");
}
if (status == F_string_too_large) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QMaximum string length reached", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QMaximum string length reached");
}
if (status == F_utf_not) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInvalid UTF-8 character found", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QInvalid UTF-8 character found");
}
if (status == F_utf_fragment) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QUTF-8 character (fragment) found", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QUTF-8 character (fragment) found");
}
if (status == F_complete_not_utf || status == F_complete_not_utf_eos || status == F_complete_not_utf_stop) {
}
if (status == F_failure) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QFailure", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QFailure");
}
if (status == F_signal) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QSignal received", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QSignal received");
}
if (status == F_interrupt) {
- if (print->verbosity != f_console_verbosity_quiet_e) {
- flockfile(print->to.stream);
-
- fl_print_format("%[%QInterrupt signal received", print->to, print->context, print->prefix);
-
- private_fll_error_print_function(print, function);
-
- fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
-
- funlockfile(print->to.stream);
- }
-
- return F_false;
+ return private_fll_error_print_simple(print, function, "%[%QInterrupt signal received");
}
if ((flag & fll_error_file_flag_fallback_e) && print->verbosity != f_console_verbosity_quiet_e) {
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
+ f_status_t private_fll_error_print_simple(fl_print_t * const print, const f_string_t function, const f_string_t message) {
+
+ if (print->verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print->to.stream);
+
+ fl_print_format(message, print->to, print->context, print->prefix);
+
+ private_fll_error_print_function(print, function);
+
+ fl_print_format(".%]%r", print->to, print->context, f_string_eol_s);
+
+ funlockfile(print->to.stream);
+ }
+
+ return F_false;
+ }
+#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
+
+#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_)
void private_fll_error_print_unable_to(fl_print_t * const print, const f_string_static_t operation, const f_string_static_t name, const f_string_static_t type, const f_string_t message) {
if (print->verbosity < f_console_verbosity_error_e) return;