diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-30 00:26:37 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-06-30 00:26:37 +0200 |
commit | 5b36f6443a1186d482ae1044b826c9fd67624c31 (patch) | |
tree | 9b93ee34b76bd2e5eac7aabcb7217c6533cd1a78 /nx-X11/lib/X11/Xlibint.h | |
parent | 3314c24a786e8e8bfad3c9ebfdf272839cb4e7e1 (diff) | |
parent | bd2650ca0b17c8a8fc2bc278a998e10893d8147c (diff) | |
download | nx-libs-5b36f6443a1186d482ae1044b826c9fd67624c31.tar.gz nx-libs-5b36f6443a1186d482ae1044b826c9fd67624c31.tar.bz2 nx-libs-5b36f6443a1186d482ae1044b826c9fd67624c31.zip |
Merge branch 'sunweaver-pr/backport-xgetrequest-and-xeatdatawords' into 3.6.x
Attributes GH PR #170: https://github.com/ArcticaProject/nx-libs/pull/170
Diffstat (limited to 'nx-X11/lib/X11/Xlibint.h')
-rw-r--r-- | nx-X11/lib/X11/Xlibint.h | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/nx-X11/lib/X11/Xlibint.h b/nx-X11/lib/X11/Xlibint.h index 474b77349..ca3d28004 100644 --- a/nx-X11/lib/X11/Xlibint.h +++ b/nx-X11/lib/X11/Xlibint.h @@ -422,6 +422,19 @@ extern LockInfoPtr _Xglobal_lock; /* Leftover from CRAY support - was defined empty on all non-Cray systems */ #define WORD64ALIGN +/** + * Return a len-sized request buffer for the request type. This function may + * flush the output queue. + * + * @param dpy The display connection + * @param type The request type + * @param len Length of the request in bytes + * + * @returns A pointer to the request buffer with a few default values + * initialized. + */ +extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); + /* * GetReq - Get the next available X request packet in the buffer and * return it. @@ -433,23 +446,10 @@ extern LockInfoPtr _Xglobal_lock; #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReq(name, req) \ - if ((dpy->bufptr + SIZEOF(x##name##Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req))>>2;\ - dpy->bufptr += SIZEOF(x##name##Req);\ - dpy->request++ - + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req)) #else /* non-ANSI C uses empty comment instead of "##" for token concatenation */ #define GetReq(name, req) \ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req))>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req);\ - dpy->request++ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req)) #endif /* GetReqExtra is the same as GetReq, but allocates "n" additional @@ -457,22 +457,10 @@ extern LockInfoPtr _Xglobal_lock; #if !defined(UNIXCPP) || defined(ANSICPP) #define GetReqExtra(name, n, req) \ - if ((dpy->bufptr + SIZEOF(x##name##Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x##name##Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_##name;\ - req->length = (SIZEOF(x##name##Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x##name##Req) + n;\ - dpy->request++ + req = (x##name##Req *) _XGetRequest(dpy, X_##name, SIZEOF(x##name##Req) + n) #else #define GetReqExtra(name, n, req) \ - if ((dpy->bufptr + SIZEOF(x/**/name/**/Req) + n) > dpy->bufmax)\ - _XFlush(dpy);\ - req = (x/**/name/**/Req *)(dpy->last_req = dpy->bufptr);\ - req->reqType = X_/**/name;\ - req->length = (SIZEOF(x/**/name/**/Req) + n)>>2;\ - dpy->bufptr += SIZEOF(x/**/name/**/Req) + n;\ - dpy->request++ + req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, SIZEOF(x/**/name/**/Req) + n) #endif @@ -891,6 +879,10 @@ extern void _XEatData( Display* /* dpy */, unsigned long /* n */ ); +extern void _XEatDataWords( + Display* /* dpy */, + unsigned long /* n */ +); extern char *_XAllocScratch( Display* /* dpy */, unsigned long /* nbytes */ |