Also add handling of F_error to the standard error handler.
if (ferror(file.stream)) {
funlockfile(file.stream);
- return F_status_set_error(F_failure); // @todo create F_error and return F_error.
+ return F_status_set_error(F_error);
}
f_status_t status = F_none;
}
if (ferror(file.stream)) {
- return F_status_set_error(F_failure); // @todo create F_error and return F_error.
+ return F_status_set_error(F_error);
}
{
if (ferror(file.stream)) {
funlockfile(file.stream);
- return F_status_set_error(F_failure); // @todo create F_error and return F_error.
+ return F_status_set_error(F_error);
}
{
*
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
+ * F_error (with error bit) if the file is already in the error state at the start of this function.
* F_file_closed (with error bit) if file is not open.
* F_file_descriptor (with error bit) if the file descriptor is invalid.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
+ * F_error (with error bit) if the file is already in the error state at the start of this function.
* F_file_closed (with error bit) if file is not open.
* F_file_descriptor (with error bit) if the file descriptor is invalid.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
+ * F_error (with error bit) if the file is already in the error state at the start of this function.
* F_file_closed (with error bit) if file is not open.
* F_file_descriptor (with error bit) if the file descriptor is invalid.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
F_write_only,
#endif // _di_f_status_basic_
+ #ifndef _di_f_status_return_
+ F_debug,
+ F_debug_not,
+ F_error,
+ F_error_not,
+ F_fine,
+ F_fine_not,
+ F_warning,
+ F_warning_not,
+ #endif // _di_f_status_return_
+
#ifndef _di_f_status_array_
F_array,
F_array_not,
return F_false;
}
+ if (status == F_error) {
+ if (print.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print.to.stream);
+
+ fl_print_format("%r%[%QFailed to %Q %Q '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, operation, type_name, print.context);
+ fl_print_format("%[%Q%]", print.to.stream, print.notable, name, print.notable);
+ fl_print_format("%[', already in an error state.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
+
+ funlockfile(print.to.stream);
+ }
+
+ return F_false;
+ }
+
if (status == F_failure) {
if (print.verbosity != f_console_verbosity_quiet_e) {
flockfile(print.to.stream);
return F_false;
}
+ if (status == F_error) {
+ if (print.verbosity != f_console_verbosity_quiet_e) {
+ flockfile(print.to.stream);
+
+ fl_print_format("%r%[%QAn error has occurred", print.to.stream, f_string_eol_s, print.context, print.prefix);
+
+ private_fll_error_print_function(print, function);
+
+ fl_print_format(".%]%r", print.to.stream, print.context, f_string_eol_s);
+
+ funlockfile(print.to.stream);
+ }
+
+ return F_false;
+ }
+
if (status == F_file_found_not) {
if (print.verbosity != f_console_verbosity_quiet_e) {
flockfile(print.to.stream);
}
#endif // _di_f_status_basic_
+ #ifndef _di_f_status_return_
+ if (fl_string_dynamic_compare(name, f_status_debug_s) == F_equal_to) {
+ *code = F_debug;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_debug_not_s) == F_equal_to) {
+ *code = F_debug_not;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_error_s) == F_equal_to) {
+ *code = F_error;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_error_not_s) == F_equal_to) {
+ *code = F_error_not;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_fine_s) == F_equal_to) {
+ *code = F_fine;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_fine_not_s) == F_equal_to) {
+ *code = F_fine_not;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_warning_s) == F_equal_to) {
+ *code = F_warning;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_warning_not_s) == F_equal_to) {
+ *code = F_warning_not;
+
+ return F_none;
+ }
+ #endif // _di_f_status_return_
+
#ifndef _di_f_status_array_
if (fl_string_dynamic_compare(name, f_status_array_s) == F_equal_to) {
*code = F_array;