summaryrefslogtreecommitdiff
path: root/src/base/msg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/msg.h')
-rw-r--r--src/base/msg.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/base/msg.h b/src/base/msg.h
new file mode 100644
index 0000000..65e3ff3
--- /dev/null
+++ b/src/base/msg.h
@@ -0,0 +1,24 @@
+#ifndef MSG_H
+#define MSG_H
+
+#ifdef DEBUG
+#define DEBUG_MSG(msg,arg...) printf(msg, ##arg)
+#else /* DEBUG */
+#define DEBUG_MSG(msg,arg...)
+#endif /* DEBUG * */
+
+#ifdef DEBUG
+#define debug(msg,arg...) fprintf(stdout, "%s ", _("[Debug]")); fprintf(stdout, _(msg) "\n", ##arg)
+#else /* DEBUG */
+#define debug(msg,arg...)
+#endif /* DEBUG */
+
+#define warning(msg,arg...) fprintf(stderr, "%s ", _("[Warning]")); fprintf(stderr, _(msg) "\n", ##arg)
+#define error(msg,arg...) fprintf(stderr, "%s ", _("[Error]"))); fprintf(stderr, _(msg) "\n", ##arg)
+#define fatal(msg,arg...) \
+{ \
+ fprintf(stderr, "%s ", _("[Fatal]")); fprintf(stderr, _(msg) "\n", ##arg); \
+ abort(0); \
+}
+
+#endif /* MSG_H */