diff options
| author | Emil | 2023-08-04 09:13:47 -0600 |
|---|---|---|
| committer | Emil | 2023-08-04 09:13:47 -0600 |
| commit | 935243d8b4ea992c50315f0c8fcb300365a5762d (patch) | |
| tree | c22d800773997b7b267d5d6cba5931f22ee2be64 /include/error.h | |
| download | emil-probotic-master.tar.xz emil-probotic-master.tar.zst | |
Diffstat (limited to 'include/error.h')
| -rw-r--r-- | include/error.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/error.h b/include/error.h new file mode 100644 index 0000000..8595431 --- /dev/null +++ b/include/error.h @@ -0,0 +1,22 @@ +#ifndef ERROR_H_ + +#include <stdio.h> + +#define ERR(ret,msg) \ + do { fputs(PROGN ": " msg "\n", stderr); return (ret); } while (0) + +#define ERRFMT(ret,fmt,...) \ + do { fprintf(stderr, PROGN ": " fmt "\n", __VA_ARGS__); return (ret); } while (0) + +#define PERROR(ret) \ + do { perror(PROGN); return (ret); } while (0) + +#define ERRMSG(msg) \ + fputs(msg "\n", stderr) + +#define DB_ERROR 100 +#define IRC_ERROR 200 +#define CREDS_ERROR 300 + +#define ERROR_H_ +#endif |
