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
commit15fcf943605aa29cb7b512168fdee99679fa044b (patch)
tree9b53492142211d6ff235a15b402b6db075d96974 /aux
parentf3186db090406eb23792d516275b59d2d11209df (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;