From 93715c46a99c96d6c866968312691ec9ab0f6a03 Mon Sep 17 00:00:00 2001 From: jcid Date: Sun, 7 Oct 2007 00:36:34 +0200 Subject: Initial revision --- src/msg.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/msg.h (limited to 'src/msg.h') diff --git a/src/msg.h b/src/msg.h new file mode 100644 index 00000000..cf5b8fed --- /dev/null +++ b/src/msg.h @@ -0,0 +1,42 @@ +#ifndef __MSG_H__ +#define __MSG_H__ + +#include +#include "prefs.h" + +/* + * You can disable any MSG* macro by adding the '_' prefix. + */ +#define _MSG(...) +#define _MSG_WARN(...) +#define _MSG_HTML(...) +#define _MSG_HTTP(...) + + +#define MSG(...) \ + D_STMT_START { \ + if (prefs.show_msg) \ + printf(__VA_ARGS__); \ + } 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_HTML(...) \ + D_STMT_START { \ + Html_msg(html, __VA_ARGS__); \ + } D_STMT_END + +#define MSG_HTTP(...) \ + printf("HTTP warning: " __VA_ARGS__) + +#endif /* __MSG_H__ */ -- cgit v1.2.3