diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-03-27 19:19:39 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2012-03-27 19:19:39 +0000 |
commit | fbff91bd7add4352d4c2545e5c893c6c01e2fdb3 (patch) | |
tree | 87081fa2f11a9eacda6b7254e6e9c639e6c73490 /lib/libX11/src/XlibInt.c | |
parent | e9e64b44a731f7cfd2b301160c9b16a84284b6af (diff) |
Upate to libX11 1.5rc1. Tested by krw@, mpi@, shadchin@.
Diffstat (limited to 'lib/libX11/src/XlibInt.c')
-rw-r--r-- | lib/libX11/src/XlibInt.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/libX11/src/XlibInt.c b/lib/libX11/src/XlibInt.c index 3db151e29..a8f5d0844 100644 --- a/lib/libX11/src/XlibInt.c +++ b/lib/libX11/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) /* |