summaryrefslogtreecommitdiff
path: root/src
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
parentac74da9c52379e0af5466eddaf695d8c9359b86c (diff)
add messages macros for messages
Diffstat (limited to 'src')
-rw-r--r--src/base/main.h12
-rw-r--r--src/base/msg.h24
2 files changed, 25 insertions, 11 deletions
diff --git a/src/base/main.h b/src/base/main.h
index 12efa80..17c9838 100644
--- a/src/base/main.h
+++ b/src/base/main.h
@@ -19,20 +19,10 @@
#define _(text) (text)
#endif /* NLS */
-#ifdef DEBUG
-#define DEBUG_MSG(msg,arg...) printf(msg, ##arg)
-#else /* DEBUG */
-#define DEBUG_MSG(msg,arg...)
-#endif /* DEBUG */
+#include "msg.h"
#define UNUSED(var) if (0 && var) {}
-#define FATAL(msg,arg...) \
- do{ \
- fprintf(stderr, msg, ##arg); \
- abort(0); \
- }while(0)
-
extern char *getParam(char *s);
extern char *getParamElse(char *s1, char *s2);
extern bool_t isParamFlag(char *s);
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 */