diff options
author | jcid <devnull@localhost> | 2007-10-07 00:36:34 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2007-10-07 00:36:34 +0200 |
commit | 93715c46a99c96d6c866968312691ec9ab0f6a03 (patch) | |
tree | 573f19ec6aa740844f53a7c0eb7114f04096bf64 /src/msg.h |
Initial revision
Diffstat (limited to 'src/msg.h')
-rw-r--r-- | src/msg.h | 42 |
1 files changed, 42 insertions, 0 deletions
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 <stdio.h> +#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__ */ |