diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2026-08-24 11:16:07 +0200 |
| commit | c068f22329d5cc722622a2183bbb22eef2093df7 (patch) | |
| tree | 12d56c1aede67988a55e241364606bfbb4dba933 /src/parsec/include/sys_err.h | |
| download | openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.tar.xz openparsec-c068f22329d5cc722622a2183bbb22eef2093df7.zip | |
Diffstat (limited to 'src/parsec/include/sys_err.h')
| -rw-r--r-- | src/parsec/include/sys_err.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/parsec/include/sys_err.h b/src/parsec/include/sys_err.h new file mode 100644 index 0000000..957204e --- /dev/null +++ b/src/parsec/include/sys_err.h @@ -0,0 +1,40 @@ +/* + * PARSEC HEADER: sys_err.h + */ + +#ifndef _SYS_ERR_H_ +#define _SYS_ERR_H_ + + +#include "debug.h" + + +// ---------------------------------------------------------------------------- +// SYSTEM SUBSYSTEM (SYS) ERROR HANDLING - +// ---------------------------------------------------------------------------- + +void SYSs_InitErrorHandling(); + +void SYSs_CriticalCleanUp(); + +FUNCTION_NORETURN(void SYSs_PanicFunction( const char *msg, const char *file, unsigned line )); +FUNCTION_NORETURN(void SYSs_OutOfMemFunction( const char *msg, const char *file, unsigned line )); + +FUNCTION_NORETURN(void SYSs_PError( const char *msg, ... )); +FUNCTION_NORETURN(void SYSs_SError( const char *msg )); +FUNCTION_NORETURN(void SYSs_FError( const char *msg, const char *filename )); + + +// wrappers + +#define PANIC(x) SYSs_PanicFunction( (x), __FILE__, __LINE__ ) +#define OUTOFMEM(x) SYSs_OutOfMemFunction( (x), __FILE__, __LINE__ ) + +#define PERROR SYSs_PError +#define SERROR SYSs_SError +#define FERROR SYSs_FError + + +#endif // _SYS_ERR_H_ + + |
