aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2015-07-10 14:21:52 +0200
committerChristoph Lohmann <20h@r-36.net>2015-07-10 14:21:52 +0200
commitb823f57fa045bf8efa5648adbfeb0b6a7a9eb48b (patch)
tree9b96910c280a837c15c2676ebd2071d90c1e8371 /st.c
parent684f0a0729442e18115f71bc594a159725418ce8 (diff)
downloadst-b823f57fa045bf8efa5648adbfeb0b6a7a9eb48b.tar.gz
st-b823f57fa045bf8efa5648adbfeb0b6a7a9eb48b.zip
Aligning the macros.
Diffstat (limited to 'st.c')
-rw-r--r--st.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/st.c b/st.c
index 97e1800..4f958d8 100644
--- a/st.c
+++ b/st.c
@@ -62,26 +62,28 @@ char *argv0;
62#define XK_SWITCH_MOD (1<<13) 62#define XK_SWITCH_MOD (1<<13)
63 63
64/* macros */ 64/* macros */
65#define MIN(a, b) ((a) < (b) ? (a) : (b)) 65#define MIN(a, b) ((a) < (b) ? (a) : (b))
66#define MAX(a, b) ((a) < (b) ? (b) : (a)) 66#define MAX(a, b) ((a) < (b) ? (b) : (a))
67#define LEN(a) (sizeof(a) / sizeof(a)[0]) 67#define LEN(a) (sizeof(a) / sizeof(a)[0])
68#define DEFAULT(a, b) (a) = (a) ? (a) : (b) 68#define DEFAULT(a, b) (a) = (a) ? (a) : (b)
69#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) 69#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
70#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177') 70#define ISCONTROLC0(c) (BETWEEN(c, 0, 0x1f) || (c) == '\177')
71#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f)) 71#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
72#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c)) 72#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
73#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL) 73#define ISDELIM(u) (utf8strchr(worddelimiters, u) != NULL)
74#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) 74#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
75#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg) 75#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \
76#define IS_SET(flag) ((term.mode & (flag)) != 0) 76 (a).bg != (b).bg)
77#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_nsec-t2.tv_nsec)/1E6) 77#define IS_SET(flag) ((term.mode & (flag)) != 0)
78#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) 78#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \
79 79 (t1.tv_nsec-t2.tv_nsec)/1E6)
80#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) 80#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
81#define IS_TRUECOL(x) (1 << 24 & (x)) 81
82#define TRUERED(x) (((x) & 0xff0000) >> 8) 82#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
83#define TRUEGREEN(x) (((x) & 0xff00)) 83#define IS_TRUECOL(x) (1 << 24 & (x))
84#define TRUEBLUE(x) (((x) & 0xff) << 8) 84#define TRUERED(x) (((x) & 0xff0000) >> 8)
85#define TRUEGREEN(x) (((x) & 0xff00))
86#define TRUEBLUE(x) (((x) & 0xff) << 8)
85 87
86 88
87enum glyph_attribute { 89enum glyph_attribute {