annotate lout/msg.h @ 2104:3e7e5395f0bc

non-ASCII keybindings Alexander Voigt has kindly done some testing, and it seems that this makes bindings to most keys on a German keyboard possible -- except those that need AltGr don't work yet.
author corvid <corvid@lavabit.com>
date Thu, 23 Jun 2011 19:24:11 +0000
parents 539fb21aea7d
children
rev   line source
772
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
1 #ifndef __MSG_H__
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
2 #define __MSG_H__
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
3
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
4 #include <stdio.h>
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
5
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
6 #define prefs_show_msg 1
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
7
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
8 #define D_STMT_START do
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
9 #define D_STMT_END while (0)
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
10
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
11 /*
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
12 * You can disable any MSG* macro by adding the '_' prefix.
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
13 */
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
14 #define _MSG(...)
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
15 #define _MSG_WARN(...)
1135
539fb21aea7d lout: rm _MSG_HTTP, add _MSG_ERR
corvid <corvid@lavabit.com>
parents: 1134
diff changeset
16 #define _MSG_ERR(...)
772
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
17
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
18
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
19 #define MSG(...) \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
20 D_STMT_START { \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
21 if (prefs_show_msg){ \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
22 printf(__VA_ARGS__); \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
23 fflush (stdout); \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
24 } \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
25 } D_STMT_END
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
26
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
27 #define MSG_WARN(...) \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
28 D_STMT_START { \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
29 if (prefs_show_msg) \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
30 printf("** WARNING **: " __VA_ARGS__); \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
31 } D_STMT_END
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
32
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
33 #define MSG_ERR(...) \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
34 D_STMT_START { \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
35 if (prefs_show_msg) \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
36 printf("** ERROR **: " __VA_ARGS__); \
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
37 } D_STMT_END
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
38
c1104104babf Added lout/msg.h and normalized debug messages to use it.
Jorge Arellano Cid <jcid@dillo.org>
parents:
diff changeset
39 #endif /* __MSG_H__ */