-
Notifications
You must be signed in to change notification settings - Fork 73
/
xclib.h
88 lines (78 loc) · 2.32 KB
/
xclib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
*
*
* xclib.h - header file for functions in xclib.c
* Copyright (C) 2001 Kim Saunders
* Copyright (C) 2007-2008 Peter Åstrand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <X11/Xlib.h>
/* global verbosity output level */
extern int xcverb;
/* global error flags from xchandler() */
extern int xcerrflag;
extern XErrorEvent xcerrevt;
/* output level constants for xcverb */
#define OSILENT 0
#define OQUIET 1
#define OVERBOSE 2
#define ODEBUG 9
/* xcout() contexts */
#define XCLIB_XCOUT_NONE 0 /* no context */
#define XCLIB_XCOUT_SENTCONVSEL 1 /* sent a request */
#define XCLIB_XCOUT_INCR 2 /* in an incr loop */
#define XCLIB_XCOUT_BAD_TARGET 3 /* given target failed */
/* xcin() contexts */
#define XCLIB_XCIN_NONE 0
#define XCLIB_XCIN_SELREQ 1
#define XCLIB_XCIN_INCR 2
/* functions in xclib.c */
extern int xcout(
Display*,
Window,
XEvent,
Atom,
Atom,
Atom*,
unsigned char**,
unsigned long*,
unsigned int*
);
extern int xcin(
Display*,
Window*,
XEvent,
Atom*,
Atom,
unsigned char*,
unsigned long,
unsigned long*,
char*,
unsigned int*,
long*
);
extern void *xcmalloc(size_t);
extern void *xcrealloc(void*, size_t);
extern void *xcstrdup(const char *);
extern void xcmemcheck(void*);
extern int xcfetchname(Display *, Window, char **);
extern char *xcnamestr(Display *, Window);
/* volatile prevents compiler from causing dead-store elimination with optimization enabled */
typedef void *(*memset_t)(void *, int, size_t);
static volatile memset_t memset_func = memset;
void xcmemzero(void *ptr, size_t len);
int xchandler(Display *, XErrorEvent *);
/* Table of event names from event numbers */
extern const char *evtstr[LASTEvent];