Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/include/X11/Xlibint.h
6162 views
1
2
/*
3
4
Copyright 1984, 1985, 1987, 1989, 1998 The Open Group
5
6
Permission to use, copy, modify, distribute, and sell this software and its
7
documentation for any purpose is hereby granted without fee, provided that
8
the above copyright notice appear in all copies and that both that
9
copyright notice and this permission notice appear in supporting
10
documentation.
11
12
The above copyright notice and this permission notice shall be included
13
in all copies or substantial portions of the Software.
14
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
OTHER DEALINGS IN THE SOFTWARE.
22
23
Except as contained in this notice, the name of The Open Group shall
24
not be used in advertising or otherwise to promote the sale, use or
25
other dealings in this Software without prior written authorization
26
from The Open Group.
27
28
*/
29
30
#ifndef _X11_XLIBINT_H_
31
#define _X11_XLIBINT_H_ 1
32
33
/*
34
* Xlibint.h - Header definition and support file for the internal
35
* support routines used by the C subroutine interface
36
* library (Xlib) to the X Window System.
37
*
38
* Warning, there be dragons here....
39
*/
40
41
#include <X11/Xlib.h>
42
#include <X11/Xproto.h> /* to declare xEvent */
43
#include <X11/XlibConf.h> /* for configured options like XTHREADS */
44
45
#ifdef WIN32
46
#define _XFlush _XFlushIt
47
#endif
48
49
/*
50
* If your BytesReadable correctly detects broken connections, then
51
* you should NOT define XCONN_CHECK_FREQ.
52
*/
53
#ifndef XCONN_CHECK_FREQ
54
#define XCONN_CHECK_FREQ 256
55
#endif
56
57
struct _XGC
58
{
59
XExtData *ext_data; /* hook for extension to hang data */
60
GContext gid; /* protocol ID for graphics context */
61
Bool rects; /* boolean: TRUE if clipmask is list of rectangles */
62
Bool dashes; /* boolean: TRUE if dash-list is really a list */
63
unsigned long dirty;/* cache dirty bits */
64
XGCValues values; /* shadow structure of values */
65
};
66
67
struct _XDisplay
68
{
69
XExtData *ext_data; /* hook for extension to hang data */
70
struct _XFreeFuncs *free_funcs; /* internal free functions */
71
int fd; /* Network socket. */
72
int conn_checker; /* ugly thing used by _XEventsQueued */
73
int proto_major_version;/* maj. version of server's X protocol */
74
int proto_minor_version;/* minor version of server's X protocol */
75
char *vendor; /* vendor of the server hardware */
76
XID resource_base; /* resource ID base */
77
XID resource_mask; /* resource ID mask bits */
78
XID resource_id; /* allocator current ID */
79
int resource_shift; /* allocator shift to correct bits */
80
XID (*resource_alloc)( /* allocator function */
81
struct _XDisplay*
82
);
83
int byte_order; /* screen byte order, LSBFirst, MSBFirst */
84
int bitmap_unit; /* padding and data requirements */
85
int bitmap_pad; /* padding requirements on bitmaps */
86
int bitmap_bit_order; /* LeastSignificant or MostSignificant */
87
int nformats; /* number of pixmap formats in list */
88
ScreenFormat *pixmap_format; /* pixmap format list */
89
int vnumber; /* Xlib's X protocol version number. */
90
int release; /* release of the server */
91
struct _XSQEvent *head, *tail; /* Input event queue. */
92
int qlen; /* Length of input event queue */
93
unsigned long last_request_read; /* seq number of last event read */
94
unsigned long request; /* sequence number of last request. */
95
char *last_req; /* beginning of last request, or dummy */
96
char *buffer; /* Output buffer starting address. */
97
char *bufptr; /* Output buffer index pointer. */
98
char *bufmax; /* Output buffer maximum+1 address. */
99
unsigned max_request_size; /* maximum number 32 bit words in request*/
100
struct _XrmHashBucketRec *db;
101
int (*synchandler)( /* Synchronization handler */
102
struct _XDisplay*
103
);
104
char *display_name; /* "host:display" string used on this connect*/
105
int default_screen; /* default screen for operations */
106
int nscreens; /* number of screens on this server*/
107
Screen *screens; /* pointer to list of screens */
108
unsigned long motion_buffer; /* size of motion buffer */
109
volatile unsigned long flags; /* internal connection flags */
110
int min_keycode; /* minimum defined keycode */
111
int max_keycode; /* maximum defined keycode */
112
KeySym *keysyms; /* This server's keysyms */
113
XModifierKeymap *modifiermap; /* This server's modifier keymap */
114
int keysyms_per_keycode;/* number of rows */
115
char *xdefaults; /* contents of defaults from server */
116
char *scratch_buffer; /* place to hang scratch buffer */
117
unsigned long scratch_length; /* length of scratch buffer */
118
int ext_number; /* extension number on this display */
119
struct _XExten *ext_procs; /* extensions initialized on this display */
120
/*
121
* the following can be fixed size, as the protocol defines how
122
* much address space is available.
123
* While this could be done using the extension vector, there
124
* may be MANY events processed, so a search through the extension
125
* list to find the right procedure for each event might be
126
* expensive if many extensions are being used.
127
*/
128
Bool (*event_vec[128])( /* vector for wire to event */
129
Display * /* dpy */,
130
XEvent * /* re */,
131
xEvent * /* event */
132
);
133
Status (*wire_vec[128])( /* vector for event to wire */
134
Display * /* dpy */,
135
XEvent * /* re */,
136
xEvent * /* event */
137
);
138
KeySym lock_meaning; /* for XLookupString */
139
struct _XLockInfo *lock; /* multi-thread state, display lock */
140
struct _XInternalAsync *async_handlers; /* for internal async */
141
unsigned long bigreq_size; /* max size of big requests */
142
struct _XLockPtrs *lock_fns; /* pointers to threads functions */
143
void (*idlist_alloc)( /* XID list allocator function */
144
Display * /* dpy */,
145
XID * /* ids */,
146
int /* count */
147
);
148
/* things above this line should not move, for binary compatibility */
149
struct _XKeytrans *key_bindings; /* for XLookupString */
150
Font cursor_font; /* for XCreateFontCursor */
151
struct _XDisplayAtoms *atoms; /* for XInternAtom */
152
unsigned int mode_switch; /* keyboard group modifiers */
153
unsigned int num_lock; /* keyboard numlock modifiers */
154
struct _XContextDB *context_db; /* context database */
155
Bool (**error_vec)( /* vector for wire to error */
156
Display * /* display */,
157
XErrorEvent * /* he */,
158
xError * /* we */
159
);
160
/*
161
* Xcms information
162
*/
163
struct {
164
XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */
165
XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */
166
XPointer perVisualIntensityMaps;
167
/* linked list of XcmsIntensityMap */
168
} cms;
169
struct _XIMFilter *im_filters;
170
struct _XSQEvent *qfree; /* unallocated event queue elements */
171
unsigned long next_event_serial_num; /* inserted into next queue elt */
172
struct _XExten *flushes; /* Flush hooks */
173
struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */
174
int im_fd_length; /* number of im_fd_info */
175
struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */
176
int watcher_count; /* number of conn_watchers */
177
XPointer filedes; /* struct pollfd cache for _XWaitForReadable */
178
int (*savedsynchandler)( /* user synchandler when Xlib usurps */
179
Display * /* dpy */
180
);
181
XID resource_max; /* allocator max ID */
182
int xcmisc_opcode; /* major opcode for XC-MISC */
183
struct _XkbInfoRec *xkb_info; /* XKB info */
184
struct _XtransConnInfo *trans_conn; /* transport connection object */
185
struct _X11XCBPrivate *xcb; /* XCB glue private data */
186
187
/* Generic event cookie handling */
188
unsigned int next_cookie; /* next event cookie */
189
/* vector for wire to generic event, index is (extension - 128) */
190
Bool (*generic_event_vec[128])(
191
Display * /* dpy */,
192
XGenericEventCookie * /* Xlib event */,
193
xEvent * /* wire event */);
194
/* vector for event copy, index is (extension - 128) */
195
Bool (*generic_event_copy_vec[128])(
196
Display * /* dpy */,
197
XGenericEventCookie * /* in */,
198
XGenericEventCookie * /* out*/);
199
void *cookiejar; /* cookie events returned but not claimed */
200
};
201
202
#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
203
204
/*
205
* define the following if you want the Data macro to be a procedure instead
206
*/
207
#ifdef CRAY
208
#define DataRoutineIsProcedure
209
#endif /* CRAY */
210
211
#ifndef _XEVENT_
212
/*
213
* _QEvent datatype for use in input queueing.
214
*/
215
typedef struct _XSQEvent
216
{
217
struct _XSQEvent *next;
218
XEvent event;
219
unsigned long qserial_num; /* so multi-threaded code can find new ones */
220
} _XQEvent;
221
#endif
222
223
#include <X11/Xproto.h>
224
#ifdef __sgi
225
#define _SGI_MP_SOURCE /* turn this on to get MP safe errno */
226
#endif
227
#include <errno.h>
228
#define _XBCOPYFUNC _Xbcopy
229
#include <X11/Xfuncs.h>
230
#include <X11/Xosdefs.h>
231
232
/* Utek leaves kernel macros around in include files (bleah) */
233
#ifdef dirty
234
#undef dirty
235
#endif
236
237
#include <stdlib.h>
238
#include <string.h>
239
240
#include <X11/Xfuncproto.h>
241
242
_XFUNCPROTOBEGIN
243
244
/*
245
* The following definitions can be used for locking requests in multi-threaded
246
* address spaces.
247
*/
248
#ifdef XTHREADS
249
/* Author: Stephen Gildea, MIT X Consortium
250
*
251
* declarations for C Threads locking
252
*/
253
254
typedef struct _LockInfoRec *LockInfoPtr;
255
256
/* interfaces for locking.c */
257
struct _XLockPtrs {
258
/* used by all, including extensions; do not move */
259
void (*lock_display)(
260
Display *dpy
261
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
262
, char *file
263
, int line
264
#endif
265
);
266
void (*unlock_display)(
267
Display *dpy
268
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
269
, char *file
270
, int line
271
#endif
272
);
273
};
274
275
#if defined(WIN32) && !defined(_XLIBINT_)
276
#define _XCreateMutex_fn (*_XCreateMutex_fn_p)
277
#define _XFreeMutex_fn (*_XFreeMutex_fn_p)
278
#define _XLockMutex_fn (*_XLockMutex_fn_p)
279
#define _XUnlockMutex_fn (*_XUnlockMutex_fn_p)
280
#define _Xglobal_lock (*_Xglobal_lock_p)
281
#endif
282
283
/* in XlibInt.c */
284
extern void (*_XCreateMutex_fn)(
285
LockInfoPtr /* lock */
286
);
287
extern void (*_XFreeMutex_fn)(
288
LockInfoPtr /* lock */
289
);
290
extern void (*_XLockMutex_fn)(
291
LockInfoPtr /* lock */
292
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
293
, char * /* file */
294
, int /* line */
295
#endif
296
);
297
extern void (*_XUnlockMutex_fn)(
298
LockInfoPtr /* lock */
299
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
300
, char * /* file */
301
, int /* line */
302
#endif
303
);
304
305
extern LockInfoPtr _Xglobal_lock;
306
307
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
308
#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__)
309
#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__)
310
#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__)
311
#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__)
312
#else
313
/* used everywhere, so must be fast if not using threads */
314
#define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d)
315
#define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d)
316
#define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock)
317
#define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock)
318
#endif
319
#define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock);
320
#define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock);
321
322
#else /* XTHREADS */
323
#define LockDisplay(dis)
324
#define _XLockMutex(lock)
325
#define _XUnlockMutex(lock)
326
#define UnlockDisplay(dis)
327
#define _XCreateMutex(lock)
328
#define _XFreeMutex(lock)
329
#endif
330
331
#define Xfree(ptr) free((ptr))
332
333
/*
334
* Note that some machines do not return a valid pointer for malloc(0), in
335
* which case we provide an alternate under the control of the
336
* define MALLOC_0_RETURNS_NULL. This is necessary because some
337
* Xlib code expects malloc(0) to return a valid pointer to storage.
338
*/
339
#if defined(MALLOC_0_RETURNS_NULL) || defined(__clang_analyzer__)
340
341
# define Xmalloc(size) malloc(((size) == 0 ? 1 : (size)))
342
# define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size)))
343
# define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize))
344
345
#else
346
347
# define Xmalloc(size) malloc((size))
348
# define Xrealloc(ptr, size) realloc((ptr), (size))
349
# define Xcalloc(nelem, elsize) calloc((nelem), (elsize))
350
351
#endif
352
353
#include <stddef.h>
354
355
#define LOCKED 1
356
#define UNLOCKED 0
357
358
#ifndef BUFSIZE
359
#define BUFSIZE 2048 /* X output buffer size. */
360
#endif
361
#ifndef PTSPERBATCH
362
#define PTSPERBATCH 1024 /* point batching */
363
#endif
364
#ifndef WLNSPERBATCH
365
#define WLNSPERBATCH 50 /* wide line batching */
366
#endif
367
#ifndef ZLNSPERBATCH
368
#define ZLNSPERBATCH 1024 /* thin line batching */
369
#endif
370
#ifndef WRCTSPERBATCH
371
#define WRCTSPERBATCH 10 /* wide line rectangle batching */
372
#endif
373
#ifndef ZRCTSPERBATCH
374
#define ZRCTSPERBATCH 256 /* thin line rectangle batching */
375
#endif
376
#ifndef FRCTSPERBATCH
377
#define FRCTSPERBATCH 256 /* filled rectangle batching */
378
#endif
379
#ifndef FARCSPERBATCH
380
#define FARCSPERBATCH 256 /* filled arc batching */
381
#endif
382
#ifndef CURSORFONT
383
#define CURSORFONT "cursor" /* standard cursor fonts */
384
#endif
385
386
/*
387
* Display flags
388
*/
389
#define XlibDisplayIOError (1L << 0)
390
#define XlibDisplayClosing (1L << 1)
391
#define XlibDisplayNoXkb (1L << 2)
392
#define XlibDisplayPrivSync (1L << 3)
393
#define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */
394
#define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */
395
#define XlibDisplayReply (1L << 5) /* in _XReply */
396
#define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */
397
#define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */
398
399
/*
400
* X Protocol packetizing macros.
401
*/
402
403
/* Need to start requests on 64 bit word boundaries
404
* on a CRAY computer so add a NoOp (127) if needed.
405
* A character pointer on a CRAY computer will be non-zero
406
* after shifting right 61 bits of it is not pointing to
407
* a word boundary.
408
*/
409
#ifdef WORD64
410
#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\
411
dpy->last_req = dpy->bufptr;\
412
*(dpy->bufptr) = X_NoOperation;\
413
*(dpy->bufptr+1) = 0;\
414
*(dpy->bufptr+2) = 0;\
415
*(dpy->bufptr+3) = 1;\
416
dpy->request++;\
417
dpy->bufptr += 4;\
418
}
419
#else /* else does not require alignment on 64-bit boundaries */
420
#define WORD64ALIGN
421
#endif /* WORD64 */
422
423
/**
424
* Return a len-sized request buffer for the request type. This function may
425
* flush the output queue.
426
*
427
* @param dpy The display connection
428
* @param type The request type
429
* @param len Length of the request in bytes
430
*
431
* @returns A pointer to the request buffer with a few default values
432
* initialized.
433
*/
434
extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
435
436
/* GetReqSized is the same as GetReq but allows the caller to specify the
437
* size in bytes. 'sz' must be a multiple of 4! */
438
439
#if !defined(UNIXCPP) || defined(ANSICPP)
440
#define GetReqSized(name, sz, req) \
441
req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz)
442
#else
443
#define GetReqSized(name, sz, req) \
444
req = (x/**/name/**/Req *) _XGetRequest(dpy, X_/**/name, sz)
445
#endif
446
447
448
/*
449
* GetReq - Get the next available X request packet in the buffer and
450
* return it.
451
*
452
* "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc.
453
* "req" is the name of the request pointer.
454
*
455
*/
456
457
#if !defined(UNIXCPP) || defined(ANSICPP)
458
#define GetReq(name, req) \
459
GetReqSized(name, SIZEOF(x##name##Req), req)
460
#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
461
#define GetReq(name, req) \
462
GetReqSized(name, SIZEOF(x/**/name/**/Req), req)
463
#endif
464
465
/* GetReqExtra is the same as GetReq, but allocates "n" additional
466
bytes after the request. "n" must be a multiple of 4! */
467
468
#if !defined(UNIXCPP) || defined(ANSICPP)
469
#define GetReqExtra(name, n, req) \
470
GetReqSized(name, SIZEOF(x##name##Req) + n, req)
471
#else
472
#define GetReqExtra(name, n, req) \
473
GetReqSized(name, SIZEOF(x/**/name/**/Req) + n, req)
474
#endif
475
476
477
/*
478
* GetResReq is for those requests that have a resource ID
479
* (Window, Pixmap, GContext, etc.) as their single argument.
480
* "rid" is the name of the resource.
481
*/
482
483
#if !defined(UNIXCPP) || defined(ANSICPP)
484
#define GetResReq(name, rid, req) \
485
req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \
486
req->id = (rid)
487
#else
488
#define GetResReq(name, rid, req) \
489
req = (xResourceReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xResourceReq)); \
490
req->id = (rid)
491
#endif
492
493
/*
494
* GetEmptyReq is for those requests that have no arguments
495
* at all.
496
*/
497
#if !defined(UNIXCPP) || defined(ANSICPP)
498
#define GetEmptyReq(name, req) \
499
req = (xReq *) _XGetRequest(dpy, X_##name, SIZEOF(xReq))
500
#else
501
#define GetEmptyReq(name, req) \
502
req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq))
503
#endif
504
505
#ifdef WORD64
506
#define MakeBigReq(req,n) \
507
{ \
508
char _BRdat[4]; \
509
unsigned long _BRlen = req->length - 1; \
510
req->length = 0; \
511
memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \
512
memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
513
memcpy(((char *)req) + 4, _BRdat, 4); \
514
Data32(dpy, (long *)&_BRdat, 4); \
515
}
516
#else
517
#ifdef LONG64
518
#define MakeBigReq(req,n) \
519
{ \
520
CARD64 _BRdat; \
521
CARD32 _BRlen = req->length - 1; \
522
req->length = 0; \
523
_BRdat = ((CARD32 *)req)[_BRlen]; \
524
memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
525
((CARD32 *)req)[1] = _BRlen + n + 2; \
526
Data32(dpy, &_BRdat, 4); \
527
}
528
#else
529
#define MakeBigReq(req,n) \
530
{ \
531
CARD32 _BRdat; \
532
CARD32 _BRlen = req->length - 1; \
533
req->length = 0; \
534
_BRdat = ((CARD32 *)req)[_BRlen]; \
535
memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
536
((CARD32 *)req)[1] = _BRlen + n + 2; \
537
Data32(dpy, &_BRdat, 4); \
538
}
539
#endif
540
#endif
541
542
#ifndef __clang_analyzer__
543
#define SetReqLen(req,n,badlen) \
544
if ((req->length + n) > (unsigned)65535) { \
545
if (dpy->bigreq_size) { \
546
MakeBigReq(req,n) \
547
} else { \
548
n = badlen; \
549
req->length += n; \
550
} \
551
} else \
552
req->length += n
553
#else
554
#define SetReqLen(req,n,badlen) \
555
req->length += n
556
#endif
557
558
#define SyncHandle() \
559
if (dpy->synchandler) (*dpy->synchandler)(dpy)
560
561
extern void _XFlushGCCache(Display *dpy, GC gc);
562
#define FlushGC(dpy, gc) \
563
if ((gc)->dirty) _XFlushGCCache((dpy), (gc))
564
/*
565
* Data - Place data in the buffer and pad the end to provide
566
* 32 bit word alignment. Transmit if the buffer fills.
567
*
568
* "dpy" is a pointer to a Display.
569
* "data" is a pinter to a data buffer.
570
* "len" is the length of the data buffer.
571
*/
572
#ifndef DataRoutineIsProcedure
573
#define Data(dpy, data, len) {\
574
if (dpy->bufptr + (len) <= dpy->bufmax) {\
575
memcpy(dpy->bufptr, data, (int)len);\
576
dpy->bufptr += ((len) + 3) & ~3;\
577
} else\
578
_XSend(dpy, data, len);\
579
}
580
#endif /* DataRoutineIsProcedure */
581
582
583
/* Allocate bytes from the buffer. No padding is done, so if
584
* the length is not a multiple of 4, the caller must be
585
* careful to leave the buffer aligned after sending the
586
* current request.
587
*
588
* "type" is the type of the pointer being assigned to.
589
* "ptr" is the pointer being assigned to.
590
* "n" is the number of bytes to allocate.
591
*
592
* Example:
593
* xTextElt *elt;
594
* BufAlloc (xTextElt *, elt, nbytes)
595
*/
596
597
#define BufAlloc(type, ptr, n) \
598
if (dpy->bufptr + (n) > dpy->bufmax) \
599
_XFlush (dpy); \
600
ptr = (type) dpy->bufptr; \
601
memset(ptr, '\0', n); \
602
dpy->bufptr += (n);
603
604
#ifdef WORD64
605
#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len)
606
#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
607
#else
608
#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len))
609
#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len))
610
#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len))
611
#ifdef LONG64
612
#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
613
extern int _XData32(
614
Display *dpy,
615
register long *data,
616
unsigned len
617
);
618
extern void _XRead32(
619
Display *dpy,
620
register long *data,
621
long len
622
);
623
#else
624
#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len))
625
#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len))
626
#endif
627
#endif /* not WORD64 */
628
629
#define PackData16(dpy,data,len) Data16 (dpy, data, len)
630
#define PackData32(dpy,data,len) Data32 (dpy, data, len)
631
632
/* Xlib manual is bogus */
633
#define PackData(dpy,data,len) PackData16 (dpy, data, len)
634
635
#define min(a,b) (((a) < (b)) ? (a) : (b))
636
#define max(a,b) (((a) > (b)) ? (a) : (b))
637
638
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
639
(((cs)->rbearing|(cs)->lbearing| \
640
(cs)->ascent|(cs)->descent) == 0))
641
642
/*
643
* CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit
644
* character. If the character is in the column and exists, then return the
645
* appropriate metrics (note that fonts with common per-character metrics will
646
* return min_bounds). If none of these hold true, try again with the default
647
* char.
648
*/
649
#define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \
650
{ \
651
cs = def; \
652
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
653
if (fs->per_char == NULL) { \
654
cs = &fs->min_bounds; \
655
} else { \
656
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
657
if (CI_NONEXISTCHAR(cs)) cs = def; \
658
} \
659
} \
660
}
661
662
#define CI_GET_DEFAULT_INFO_1D(fs,cs) \
663
CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs)
664
665
666
667
/*
668
* CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and
669
* column. This is used for fonts that have more than row zero.
670
*/
671
#define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \
672
{ \
673
cs = def; \
674
if (row >= fs->min_byte1 && row <= fs->max_byte1 && \
675
col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
676
if (fs->per_char == NULL) { \
677
cs = &fs->min_bounds; \
678
} else { \
679
cs = &fs->per_char[((row - fs->min_byte1) * \
680
(fs->max_char_or_byte2 - \
681
fs->min_char_or_byte2 + 1)) + \
682
(col - fs->min_char_or_byte2)]; \
683
if (CI_NONEXISTCHAR(cs)) cs = def; \
684
} \
685
} \
686
}
687
688
#define CI_GET_DEFAULT_INFO_2D(fs,cs) \
689
{ \
690
unsigned int r = (fs->default_char >> 8); \
691
unsigned int c = (fs->default_char & 0xff); \
692
CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \
693
}
694
695
696
#ifdef MUSTCOPY
697
698
/* for when 32-bit alignment is not good enough */
699
#define OneDataCard32(dpy,dstaddr,srcvar) \
700
{ dpy->bufptr -= 4; Data32 (dpy, (char *) &(srcvar), 4); }
701
702
#else
703
704
/* srcvar must be a variable for large architecture version */
705
#define OneDataCard32(dpy,dstaddr,srcvar) \
706
{ *(CARD32 *)(dstaddr) = (srcvar); }
707
708
#endif /* MUSTCOPY */
709
710
typedef struct _XInternalAsync {
711
struct _XInternalAsync *next;
712
/*
713
* handler arguments:
714
* rep is the generic reply that caused this handler
715
* to be invoked. It must also be passed to _XGetAsyncReply.
716
* buf and len are opaque values that must be passed to
717
* _XGetAsyncReply or _XGetAsyncData.
718
* data is the closure stored in this struct.
719
* The handler returns True iff it handled this reply.
720
*/
721
Bool (*handler)(
722
Display* /* dpy */,
723
xReply* /* rep */,
724
char* /* buf */,
725
int /* len */,
726
XPointer /* data */
727
);
728
XPointer data;
729
} _XAsyncHandler;
730
731
typedef struct _XAsyncEState {
732
unsigned long min_sequence_number;
733
unsigned long max_sequence_number;
734
unsigned char error_code;
735
unsigned char major_opcode;
736
unsigned short minor_opcode;
737
unsigned char last_error_received;
738
int error_count;
739
} _XAsyncErrorState;
740
741
extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler);
742
#define DeqAsyncHandler(dpy,handler) { \
743
if (dpy->async_handlers == (handler)) \
744
dpy->async_handlers = (handler)->next; \
745
else \
746
_XDeqAsyncHandler(dpy, handler); \
747
}
748
749
typedef void (*FreeFuncType) (
750
Display* /* display */
751
);
752
753
typedef int (*FreeModmapType) (
754
XModifierKeymap* /* modmap */
755
);
756
757
/*
758
* This structure is private to the library.
759
*/
760
typedef struct _XFreeFuncs {
761
FreeFuncType atoms; /* _XFreeAtomTable */
762
FreeModmapType modifiermap; /* XFreeModifiermap */
763
FreeFuncType key_bindings; /* _XFreeKeyBindings */
764
FreeFuncType context_db; /* _XFreeContextDB */
765
FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */
766
FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */
767
FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */
768
FreeFuncType im_filters; /* _XFreeIMFilters */
769
FreeFuncType xkb; /* _XkbFreeInfo */
770
} _XFreeFuncRec;
771
772
/* types for InitExt.c */
773
typedef int (*CreateGCType) (
774
Display* /* display */,
775
GC /* gc */,
776
XExtCodes* /* codes */
777
);
778
779
typedef int (*CopyGCType)(
780
Display* /* display */,
781
GC /* gc */,
782
XExtCodes* /* codes */
783
);
784
785
typedef int (*FlushGCType) (
786
Display* /* display */,
787
GC /* gc */,
788
XExtCodes* /* codes */
789
);
790
791
typedef int (*FreeGCType) (
792
Display* /* display */,
793
GC /* gc */,
794
XExtCodes* /* codes */
795
);
796
797
typedef int (*CreateFontType) (
798
Display* /* display */,
799
XFontStruct* /* fs */,
800
XExtCodes* /* codes */
801
);
802
803
typedef int (*FreeFontType) (
804
Display* /* display */,
805
XFontStruct* /* fs */,
806
XExtCodes* /* codes */
807
);
808
809
typedef int (*CloseDisplayType) (
810
Display* /* display */,
811
XExtCodes* /* codes */
812
);
813
814
typedef int (*ErrorType) (
815
Display* /* display */,
816
xError* /* err */,
817
XExtCodes* /* codes */,
818
int* /* ret_code */
819
);
820
821
typedef char* (*ErrorStringType) (
822
Display* /* display */,
823
int /* code */,
824
XExtCodes* /* codes */,
825
char* /* buffer */,
826
int /* nbytes */
827
);
828
829
typedef void (*PrintErrorType)(
830
Display* /* display */,
831
XErrorEvent* /* ev */,
832
void* /* fp */
833
);
834
835
typedef void (*BeforeFlushType)(
836
Display* /* display */,
837
XExtCodes* /* codes */,
838
_Xconst char* /* data */,
839
long /* len */
840
);
841
842
/*
843
* This structure is private to the library.
844
*/
845
typedef struct _XExten { /* private to extension mechanism */
846
struct _XExten *next; /* next in list */
847
XExtCodes codes; /* public information, all extension told */
848
CreateGCType create_GC; /* routine to call when GC created */
849
CopyGCType copy_GC; /* routine to call when GC copied */
850
FlushGCType flush_GC; /* routine to call when GC flushed */
851
FreeGCType free_GC; /* routine to call when GC freed */
852
CreateFontType create_Font; /* routine to call when Font created */
853
FreeFontType free_Font; /* routine to call when Font freed */
854
CloseDisplayType close_display; /* routine to call when connection closed */
855
ErrorType error; /* who to call when an error occurs */
856
ErrorStringType error_string; /* routine to supply error string */
857
char *name; /* name of this extension */
858
PrintErrorType error_values; /* routine to supply error values */
859
BeforeFlushType before_flush; /* routine to call when sending data */
860
struct _XExten *next_flush; /* next in list of those with flushes */
861
} _XExtension;
862
863
/* Temporary definition until we can depend on an xproto release with it */
864
#ifdef _X_COLD
865
# define _XLIB_COLD _X_COLD
866
#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */
867
# define _XLIB_COLD __attribute__((__cold__))
868
#else
869
# define _XLIB_COLD /* nothing */
870
#endif
871
872
/* extension hooks */
873
874
#ifdef DataRoutineIsProcedure
875
extern void Data(Display *dpy, char *data, long len);
876
#endif
877
extern int _XError(
878
Display* /* dpy */,
879
xError* /* rep */
880
);
881
extern int _XIOError(
882
Display* /* dpy */
883
) _X_NORETURN;
884
extern int (*_XIOErrorFunction)(
885
Display* /* dpy */
886
);
887
extern int (*_XErrorFunction)(
888
Display* /* dpy */,
889
XErrorEvent* /* error_event */
890
);
891
extern void _XEatData(
892
Display* /* dpy */,
893
unsigned long /* n */
894
) _XLIB_COLD;
895
#ifdef XLIB_WANT_XEATDATAWORDS
896
extern void _XEatDataWords(
897
Display* /* dpy */,
898
unsigned long /* n */
899
) _XLIB_COLD _X_HIDDEN;
900
#endif
901
#if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */
902
# pragma rarely_called(_XEatData, _XEatDataWords)
903
#endif
904
extern char *_XAllocScratch(
905
Display* /* dpy */,
906
unsigned long /* nbytes */
907
);
908
extern char *_XAllocTemp(
909
Display* /* dpy */,
910
unsigned long /* nbytes */
911
);
912
extern void _XFreeTemp(
913
Display* /* dpy */,
914
char* /* buf */,
915
unsigned long /* nbytes */
916
);
917
extern Visual *_XVIDtoVisual(
918
Display* /* dpy */,
919
VisualID /* id */
920
);
921
extern unsigned long _XSetLastRequestRead(
922
Display* /* dpy */,
923
xGenericReply* /* rep */
924
);
925
extern int _XGetHostname(
926
char* /* buf */,
927
int /* maxlen */
928
);
929
extern Screen *_XScreenOfWindow(
930
Display* /* dpy */,
931
Window /* w */
932
);
933
extern Bool _XAsyncErrorHandler(
934
Display* /* dpy */,
935
xReply* /* rep */,
936
char* /* buf */,
937
int /* len */,
938
XPointer /* data */
939
);
940
extern char *_XGetAsyncReply(
941
Display* /* dpy */,
942
char* /* replbuf */,
943
xReply* /* rep */,
944
char* /* buf */,
945
int /* len */,
946
int /* extra */,
947
Bool /* discard */
948
);
949
extern void _XGetAsyncData(
950
Display* /* dpy */,
951
char * /* data */,
952
char * /* buf */,
953
int /* len */,
954
int /* skip */,
955
int /* datalen */,
956
int /* discardtotal */
957
);
958
extern void _XFlush(
959
Display* /* dpy */
960
);
961
extern int _XEventsQueued(
962
Display* /* dpy */,
963
int /* mode */
964
);
965
extern void _XReadEvents(
966
Display* /* dpy */
967
);
968
extern int _XRead(
969
Display* /* dpy */,
970
char* /* data */,
971
long /* size */
972
);
973
extern void _XReadPad(
974
Display* /* dpy */,
975
char* /* data */,
976
long /* size */
977
);
978
extern void _XSend(
979
Display* /* dpy */,
980
_Xconst char* /* data */,
981
long /* size */
982
);
983
extern Status _XReply(
984
Display* /* dpy */,
985
xReply* /* rep */,
986
int /* extra */,
987
Bool /* discard */
988
);
989
extern void _XEnq(
990
Display* /* dpy */,
991
xEvent* /* event */
992
);
993
extern void _XDeq(
994
Display* /* dpy */,
995
_XQEvent* /* prev */,
996
_XQEvent* /* qelt */
997
);
998
999
extern Bool _XUnknownWireEvent(
1000
Display* /* dpy */,
1001
XEvent* /* re */,
1002
xEvent* /* event */
1003
);
1004
1005
extern Bool _XUnknownWireEventCookie(
1006
Display* /* dpy */,
1007
XGenericEventCookie* /* re */,
1008
xEvent* /* event */
1009
);
1010
1011
extern Bool _XUnknownCopyEventCookie(
1012
Display* /* dpy */,
1013
XGenericEventCookie* /* in */,
1014
XGenericEventCookie* /* out */
1015
);
1016
1017
extern Status _XUnknownNativeEvent(
1018
Display* /* dpy */,
1019
XEvent* /* re */,
1020
xEvent* /* event */
1021
);
1022
1023
extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event);
1024
extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we);
1025
extern Bool _XPollfdCacheInit(Display *dpy);
1026
extern void _XPollfdCacheAdd(Display *dpy, int fd);
1027
extern void _XPollfdCacheDel(Display *dpy, int fd);
1028
extern XID _XAllocID(Display *dpy);
1029
extern void _XAllocIDs(Display *dpy, XID *ids, int count);
1030
1031
extern int _XFreeExtData(
1032
XExtData* /* extension */
1033
);
1034
1035
extern int (*XESetCreateGC(
1036
Display* /* display */,
1037
int /* extension */,
1038
int (*) (
1039
Display* /* display */,
1040
GC /* gc */,
1041
XExtCodes* /* codes */
1042
) /* proc */
1043
))(
1044
Display*, GC, XExtCodes*
1045
);
1046
1047
extern int (*XESetCopyGC(
1048
Display* /* display */,
1049
int /* extension */,
1050
int (*) (
1051
Display* /* display */,
1052
GC /* gc */,
1053
XExtCodes* /* codes */
1054
) /* proc */
1055
))(
1056
Display*, GC, XExtCodes*
1057
);
1058
1059
extern int (*XESetFlushGC(
1060
Display* /* display */,
1061
int /* extension */,
1062
int (*) (
1063
Display* /* display */,
1064
GC /* gc */,
1065
XExtCodes* /* codes */
1066
) /* proc */
1067
))(
1068
Display*, GC, XExtCodes*
1069
);
1070
1071
extern int (*XESetFreeGC(
1072
Display* /* display */,
1073
int /* extension */,
1074
int (*) (
1075
Display* /* display */,
1076
GC /* gc */,
1077
XExtCodes* /* codes */
1078
) /* proc */
1079
))(
1080
Display*, GC, XExtCodes*
1081
);
1082
1083
extern int (*XESetCreateFont(
1084
Display* /* display */,
1085
int /* extension */,
1086
int (*) (
1087
Display* /* display */,
1088
XFontStruct* /* fs */,
1089
XExtCodes* /* codes */
1090
) /* proc */
1091
))(
1092
Display*, XFontStruct*, XExtCodes*
1093
);
1094
1095
extern int (*XESetFreeFont(
1096
Display* /* display */,
1097
int /* extension */,
1098
int (*) (
1099
Display* /* display */,
1100
XFontStruct* /* fs */,
1101
XExtCodes* /* codes */
1102
) /* proc */
1103
))(
1104
Display*, XFontStruct*, XExtCodes*
1105
);
1106
1107
extern int (*XESetCloseDisplay(
1108
Display* /* display */,
1109
int /* extension */,
1110
int (*) (
1111
Display* /* display */,
1112
XExtCodes* /* codes */
1113
) /* proc */
1114
))(
1115
Display*, XExtCodes*
1116
);
1117
1118
extern int (*XESetError(
1119
Display* /* display */,
1120
int /* extension */,
1121
int (*) (
1122
Display* /* display */,
1123
xError* /* err */,
1124
XExtCodes* /* codes */,
1125
int* /* ret_code */
1126
) /* proc */
1127
))(
1128
Display*, xError*, XExtCodes*, int*
1129
);
1130
1131
extern char* (*XESetErrorString(
1132
Display* /* display */,
1133
int /* extension */,
1134
char* (*) (
1135
Display* /* display */,
1136
int /* code */,
1137
XExtCodes* /* codes */,
1138
char* /* buffer */,
1139
int /* nbytes */
1140
) /* proc */
1141
))(
1142
Display*, int, XExtCodes*, char*, int
1143
);
1144
1145
extern void (*XESetPrintErrorValues (
1146
Display* /* display */,
1147
int /* extension */,
1148
void (*)(
1149
Display* /* display */,
1150
XErrorEvent* /* ev */,
1151
void* /* fp */
1152
) /* proc */
1153
))(
1154
Display*, XErrorEvent*, void*
1155
);
1156
1157
extern Bool (*XESetWireToEvent(
1158
Display* /* display */,
1159
int /* event_number */,
1160
Bool (*) (
1161
Display* /* display */,
1162
XEvent* /* re */,
1163
xEvent* /* event */
1164
) /* proc */
1165
))(
1166
Display*, XEvent*, xEvent*
1167
);
1168
1169
extern Bool (*XESetWireToEventCookie(
1170
Display* /* display */,
1171
int /* extension */,
1172
Bool (*) (
1173
Display* /* display */,
1174
XGenericEventCookie* /* re */,
1175
xEvent* /* event */
1176
) /* proc */
1177
))(
1178
Display*, XGenericEventCookie*, xEvent*
1179
);
1180
1181
extern Bool (*XESetCopyEventCookie(
1182
Display* /* display */,
1183
int /* extension */,
1184
Bool (*) (
1185
Display* /* display */,
1186
XGenericEventCookie* /* in */,
1187
XGenericEventCookie* /* out */
1188
) /* proc */
1189
))(
1190
Display*, XGenericEventCookie*, XGenericEventCookie*
1191
);
1192
1193
1194
extern Status (*XESetEventToWire(
1195
Display* /* display */,
1196
int /* event_number */,
1197
Status (*) (
1198
Display* /* display */,
1199
XEvent* /* re */,
1200
xEvent* /* event */
1201
) /* proc */
1202
))(
1203
Display*, XEvent*, xEvent*
1204
);
1205
1206
extern Bool (*XESetWireToError(
1207
Display* /* display */,
1208
int /* error_number */,
1209
Bool (*) (
1210
Display* /* display */,
1211
XErrorEvent* /* he */,
1212
xError* /* we */
1213
) /* proc */
1214
))(
1215
Display*, XErrorEvent*, xError*
1216
);
1217
1218
extern void (*XESetBeforeFlush(
1219
Display* /* display */,
1220
int /* error_number */,
1221
void (*) (
1222
Display* /* display */,
1223
XExtCodes* /* codes */,
1224
_Xconst char* /* data */,
1225
long /* len */
1226
) /* proc */
1227
))(
1228
Display*, XExtCodes*, _Xconst char*, long
1229
);
1230
1231
/* internal connections for IMs */
1232
1233
typedef void (*_XInternalConnectionProc)(
1234
Display* /* dpy */,
1235
int /* fd */,
1236
XPointer /* call_data */
1237
);
1238
1239
1240
extern Status _XRegisterInternalConnection(
1241
Display* /* dpy */,
1242
int /* fd */,
1243
_XInternalConnectionProc /* callback */,
1244
XPointer /* call_data */
1245
);
1246
1247
extern void _XUnregisterInternalConnection(
1248
Display* /* dpy */,
1249
int /* fd */
1250
);
1251
1252
extern void _XProcessInternalConnection(
1253
Display* /* dpy */,
1254
struct _XConnectionInfo* /* conn_info */
1255
);
1256
1257
/* Display structure has pointers to these */
1258
1259
struct _XConnectionInfo { /* info from _XRegisterInternalConnection */
1260
int fd;
1261
_XInternalConnectionProc read_callback;
1262
XPointer call_data;
1263
XPointer *watch_data; /* set/used by XConnectionWatchProc */
1264
struct _XConnectionInfo *next;
1265
};
1266
1267
struct _XConnWatchInfo { /* info from XAddConnectionWatch */
1268
XConnectionWatchProc fn;
1269
XPointer client_data;
1270
struct _XConnWatchInfo *next;
1271
};
1272
1273
#ifdef __UNIXOS2__
1274
extern char* __XOS2RedirRoot(
1275
char*
1276
);
1277
#endif
1278
1279
extern int _XTextHeight(
1280
XFontStruct* /* font_struct */,
1281
_Xconst char* /* string */,
1282
int /* count */
1283
);
1284
1285
extern int _XTextHeight16(
1286
XFontStruct* /* font_struct */,
1287
_Xconst XChar2b* /* string */,
1288
int /* count */
1289
);
1290
1291
#if defined(WIN32)
1292
1293
extern int _XOpenFile(
1294
_Xconst char* /* path */,
1295
int /* flags */
1296
);
1297
1298
extern int _XOpenFileMode(
1299
_Xconst char* /* path */,
1300
int /* flags */,
1301
mode_t /* mode */
1302
);
1303
1304
extern void* _XFopenFile(
1305
_Xconst char* /* path */,
1306
_Xconst char* /* mode */
1307
);
1308
1309
extern int _XAccessFile(
1310
_Xconst char* /* path */
1311
);
1312
#else
1313
#define _XOpenFile(path,flags) open(path,flags)
1314
#define _XOpenFileMode(path,flags,mode) open(path,flags,mode)
1315
#define _XFopenFile(path,mode) fopen(path,mode)
1316
#endif
1317
1318
/* EvToWire.c */
1319
extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event);
1320
1321
extern int _XF86LoadQueryLocaleFont(
1322
Display* /* dpy */,
1323
_Xconst char* /* name*/,
1324
XFontStruct** /* xfp*/,
1325
Font* /* fidp */
1326
);
1327
1328
extern void _XProcessWindowAttributes (
1329
register Display *dpy,
1330
xChangeWindowAttributesReq *req,
1331
register unsigned long valuemask,
1332
register XSetWindowAttributes *attributes);
1333
1334
extern int _XDefaultError(
1335
Display *dpy,
1336
XErrorEvent *event);
1337
1338
extern int _XDefaultIOError(
1339
Display *dpy);
1340
1341
extern void _XSetClipRectangles (
1342
register Display *dpy,
1343
GC gc,
1344
int clip_x_origin, int clip_y_origin,
1345
XRectangle *rectangles,
1346
int n,
1347
int ordering);
1348
1349
Status _XGetWindowAttributes(
1350
register Display *dpy,
1351
Window w,
1352
XWindowAttributes *attr);
1353
1354
int _XPutBackEvent (
1355
register Display *dpy,
1356
register XEvent *event);
1357
1358
extern Bool _XIsEventCookie(
1359
Display *dpy,
1360
XEvent *ev);
1361
1362
extern void _XFreeEventCookies(
1363
Display *dpy);
1364
1365
extern void _XStoreEventCookie(
1366
Display *dpy,
1367
XEvent *ev);
1368
1369
extern Bool _XFetchEventCookie(
1370
Display *dpy,
1371
XGenericEventCookie *ev);
1372
1373
extern Bool _XCopyEventCookie(
1374
Display *dpy,
1375
XGenericEventCookie *in,
1376
XGenericEventCookie *out);
1377
1378
/* lcFile.c */
1379
1380
extern void xlocaledir(
1381
char *buf,
1382
int buf_len
1383
);
1384
1385
_XFUNCPROTOEND
1386
1387
#endif /* _X11_XLIBINT_H_ */
1388
1389