summaryrefslogtreecommitdiff
path: root/aux
diff options
context:
space:
mode:
authorBart Massey <bart@cs.pdx.edu>2007-12-07 00:24:57 -0800
committerBart Massey <bart@cs.pdx.edu>2007-12-07 00:24:57 -0800
commit1085bf8426d016876aeb551e4894439aecf49d5e (patch)
tree88c447834edeb9bc239f9054ca1b7566bd530e38 /aux
parent5cf63c52ef7759b73eab3762a79333f92ef077b1 (diff)
added PARAM macros
Diffstat (limited to 'aux')
-rw-r--r--aux/xcb_aux.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/aux/xcb_aux.h b/aux/xcb_aux.h
index 6d4d851..6144971 100644
--- a/aux/xcb_aux.h
+++ b/aux/xcb_aux.h
@@ -33,6 +33,13 @@ void xcb_aux_sync (xcb_connection_t *c);
/* less error prone to use structs instead of value lists */
+#define _XCB_AUX_OFFSETOF(paramsp, param) \
+ ((void*)(&((paramsp)->param))-(void*)(paramsp))
+
+#define XCB_AUX_ADD_PARAM(maskp, paramsp, param, value) \
+ ((*(maskp)|=1<<(_XCB_AUX_OFFSETOF((paramsp),param)/sizeof(uint32_t))), \
+ ((paramsp)->param=(value)))
+
typedef struct {
uint32_t back_pixmap;
uint32_t back_pixel;