Commit 3597915f authored by Peter Hutterer's avatar Peter Hutterer Committed by Ulrich Sibiller

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: 's avatarPeter Hutterer <peter.hutterer@who-t.net> Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 3155b9bb
...@@ -450,6 +450,18 @@ extern LockInfoPtr _Xglobal_lock; ...@@ -450,6 +450,18 @@ extern LockInfoPtr _Xglobal_lock;
*/ */
extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); 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 * GetReq - Get the next available X request packet in the buffer and
* return it. * return it.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment