aboutsummaryrefslogtreecommitdiff
path: root/src/msg.h
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-20 23:24:19 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2010-08-20 23:24:19 +0200
commitf5c598b518d1f906148534d015f50075d3e8242d (patch)
tree21dd70add5b366c3dd80641b77f6b18e0baa009e /src/msg.h
parente98d02a01ffeb18ede86af025e51ae1ec011c75a (diff)
parent5f0fc0e48b8cbee7e1795935da0abff6627fd498 (diff)
merge
Diffstat (limited to 'src/msg.h')
-rw-r--r--src/msg.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/msg.h b/src/msg.h
index 245ee803..c6ddcb48 100644
--- a/src/msg.h
+++ b/src/msg.h
@@ -11,28 +11,17 @@
#define _MSG_WARN(...)
#define _MSG_HTTP(...)
-
-#define MSG(...) \
+#define MSG_INNARDS(prefix, ...) \
D_STMT_START { \
if (prefs.show_msg){ \
- printf(__VA_ARGS__); \
+ printf(prefix __VA_ARGS__); \
fflush (stdout); \
} \
} D_STMT_END
-#define MSG_WARN(...) \
- D_STMT_START { \
- if (prefs.show_msg) \
- printf("** WARNING **: " __VA_ARGS__); \
- } D_STMT_END
-
-#define MSG_ERR(...) \
- D_STMT_START { \
- if (prefs.show_msg) \
- printf("** ERROR **: " __VA_ARGS__); \
- } D_STMT_END
-
-#define MSG_HTTP(...) \
- printf("HTTP warning: " __VA_ARGS__)
+#define MSG(...) MSG_INNARDS("", __VA_ARGS__)
+#define MSG_WARN(...) MSG_INNARDS("** WARNING **: ", __VA_ARGS__)
+#define MSG_ERR(...) MSG_INNARDS("** ERROR **: ", __VA_ARGS__)
+#define MSG_HTTP(...) MSG_INNARDS("HTTP warning: ", __VA_ARGS__)
#endif /* __MSG_H__ */