diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-17 09:45:15 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-08 07:24:07 +1000 |
commit | 4a060f993bf676cf21ad9784e010f54134da7b40 (patch) | |
tree | bd829e85fd7174236818d76bc8c1280937836cb5 /src/XlibInt.c | |
parent | d8956520deb79c1cbb5e974c175bf8493859b22b (diff) | |
download | xorg-lib-libX11-4a060f993bf676cf21ad9784e010f54134da7b40.tar.gz |
Add _XGetRequest as substitute for GetReq/GetReqExtra
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Diffstat (limited to 'src/XlibInt.c')
-rw-r--r-- | src/XlibInt.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/XlibInt.c b/src/XlibInt.c index 3db151e2..a8f5d084 100644 --- a/src/XlibInt.c +++ b/src/XlibInt.c @@ -1956,6 +1956,37 @@ Screen *_XScreenOfWindow(Display *dpy, Window w) } +/* + * WARNING: This implementation's pre-conditions and post-conditions + * must remain compatible with the old macro-based implementations of + * GetReq, GetReqExtra, GetResReq, and GetEmptyReq. The portions of the + * Display structure affected by those macros are part of libX11's + * ABI. + */ +void *_XGetRequest(Display *dpy, CARD8 type, size_t len) +{ + xReq *req; + + WORD64ALIGN + + if (dpy->bufptr + len > dpy->bufmax) + _XFlush(dpy); + + if (len % 4) + fprintf(stderr, + "Xlib: request %d length %zd not a multiple of 4.\n", + type, len); + + dpy->last_req = dpy->bufptr; + + req = (xReq*)dpy->bufptr; + req->reqType = type; + req->length = len / 4; + dpy->bufptr += len; + dpy->request++; + return req; +} + #if defined(WIN32) /* |