ferror 1.4.1
FERROR is a library to assist with error handling in Fortran projects.
All Classes Namespaces Files Functions Variables Typedefs Pages
ferror.h
Go to the documentation of this file.
1
2#ifndef FERROR_H_DEFINED
3#define FERROR_H_DEFINED
4
91#include <stdbool.h>
92
94typedef struct {
96 void *ptr;
100
105typedef void (*error_callback)(void *args);
106
107#ifdef __cplusplus
108extern "C" {
109#endif
110
116
122
133void get_log_filename(const error_handler *err, char *fname, int *nfname);
134
140void set_log_filename(error_handler *err, const char *fname);
141
150void report_error(error_handler *err, const char *fcn, const char *msg,
151 int flag);
152
161void report_warning(error_handler *err, const char *fcn, const char *msg,
162 int flag);
163
172void log_error(const error_handler *err, const char *fcn, const char *msg,
173 int flag);
174
181
188
195
202
209
216
225
234
243
252
261void get_error_message(const error_handler *err, char *msg, int *nmsg);
262
271void get_warning_message(const error_handler *err, char *msg, int *nmsg);
272
282void get_error_fcn_name(const error_handler *err, char *fname, int *nfname);
283
293void get_warning_fcn_name(const error_handler *err, char *fname, int *nfname);
294
306void report_error_with_callback(error_handler *err, const char *fname,
307 const char *msg, int flag, error_callback cback,
308 void *args);
309
310#ifdef __cplusplus
311}
312#endif
313#endif // END FERROR_H_DEFINED
bool get_exit_on_error(const error_handler *err)
Gets a logical value determining if the application should be terminated when an error is encountered...
int get_error_flag(const error_handler *err)
Gets the current error flag.
void set_log_filename(error_handler *err, const char *fname)
Sets the error log filename.
bool has_warning_occurred(const error_handler *err)
Tests to see if a warning has been encountered.
void report_warning(error_handler *err, const char *fcn, const char *msg, int flag)
Reports a warning condition to the user.
void reset_warning_status(error_handler *err)
Resets the warning status flag to false, and the current warning flag to zero.
void reset_error_status(error_handler *err)
Resets the error status flag to false, and the current error flag to zero.
bool has_error_occurred(const error_handler *err)
Tests to see if an error has been encountered.
void set_suppress_printing(error_handler *err, bool x)
Sets a logical value determining if printing of error and warning messages should be suppressed.
void log_error(const error_handler *err, const char *fcn, const char *msg, int flag)
Writes an error log file.
void report_error(error_handler *err, const char *fcn, const char *msg, int flag)
Reports an error condition to the user.
void(* error_callback)(void *args)
Describes a function to call when an error is encountered.
Definition: ferror.h:105
void get_warning_fcn_name(const error_handler *err, char *fname, int *nfname)
Gets the name of the function or subroutine that issued the last warning message.
void get_log_filename(const error_handler *err, char *fname, int *nfname)
Gets the name of the error log file.
void get_error_message(const error_handler *err, char *msg, int *nmsg)
Gets the current error message.
int get_warning_flag(const error_handler *err)
Gets the current warning flag.
void report_error_with_callback(error_handler *err, const char *fname, const char *msg, int flag, error_callback cback, void *args)
Reports an error condition to the user, and executes a callback routine.
void alloc_error_handler(error_handler *obj)
Initializes a new error handler object.
void free_error_handler(error_handler *obj)
Frees resources held by the error_handler object.
void get_error_fcn_name(const error_handler *err, char *fname, int *nfname)
Gets the name of the function or subroutine that issued the last error message.
void get_warning_message(const error_handler *err, char *msg, int *nmsg)
Gets the current warning message.
void set_exit_on_error(error_handler *err, bool x)
Sets a logical value determining if the application should be terminated when an error is encountered...
bool get_suppress_printing(const error_handler *err)
Gets a logical value determining if printing of error and warning messages should be suppressed.
A C compatible type encapsulating an errors object.
Definition: ferror.h:94
int object_size
The size of the errors object, in bytes.
Definition: ferror.h:98
void * ptr
A pointer to the errors object.
Definition: ferror.h:96