summaryrefslogtreecommitdiff
path: root/src/base/msg.h
diff options
context:
space:
mode:
authorDusan Durech <dusan.d@Centrum.sk>2009-07-04 16:51:15 +0200
committerDusan Durech <dusan.d@Centrum.sk>2009-07-04 16:51:15 +0200
commit71c1fc9985a4948e47142910f7aaf6a8f035d4bf (patch)
tree9ae4cc14aa39c3e55b515e66e9a19729849c9a1a /src/base/msg.h
parentac74da9c52379e0af5466eddaf695d8c9359b86c (diff)
add messages macros for messages
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 */