diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-14 14:51:06 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-08 07:24:07 +1000 |
commit | c9c99058b9d98789c0b2d7e78a23443c2b57a047 (patch) | |
tree | 5ccc2cada02d1b130e7fcf01ec56fb9ae32f8b10 | |
parent | ba8a7a19165e30d14bc165f43f67c19b6a115585 (diff) |
include: Add GetReqSized() for request buffers of specific size
Some XI2 requests change in size over different versions and libXi would
need to hack around GetReq and GetReqExtra. Add a new GetReqSized so the
library can explicitly specify the size of the request in 4-byte units.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
-rw-r--r-- | include/X11/Xlibint.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index 01087b8..9d75d06 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -433,6 +433,18 @@ extern LockInfoPtr _Xglobal_lock; */ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); +/* GetReqSized is the same as GetReq but allows the caller to specify the + * size in bytes. 'sz' must be a multiple of 4! */ + +#if !defined(UNIXCPP) || defined(ANSICPP) +#define GetReqSized(name, sz, req) \ + req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz) +#else +#define GetReqSized(name, sz, req) \ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, sz) +#endif + + /* * GetReq - Get the next available X request packet in the buffer and * return it. |