aboutsummaryrefslogtreecommitdiff
path: root/include/error.h
diff options
context:
space:
mode:
authorEmil2023-08-04 09:13:47 -0600
committerEmil2023-08-04 09:13:47 -0600
commit935243d8b4ea992c50315f0c8fcb300365a5762d (patch)
treec22d800773997b7b267d5d6cba5931f22ee2be64 /include/error.h
downloademil-probotic-master.tar.xz
emil-probotic-master.tar.zst
Initial commitHEADmaster
Diffstat (limited to 'include/error.h')
-rw-r--r--include/error.h22
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