Mercurial > kinput2.yaz
comparison include/AsyncErr.h @ 0:92745d501b9a
initial import from kinput2-v3.1
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 08 Mar 2010 04:44:30 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:92745d501b9a |
---|---|
1 /* $Id: AsyncErr.h,v 1.2 1994/05/16 09:07:20 ishisone Rel $ */ | |
2 /* | |
3 * Copyright (C) 1992, 1994 Software Research Associates, Inc. | |
4 * | |
5 * Permission to use, copy, modify, and distribute this software and its | |
6 * documentation for any purpose and without fee is hereby granted, provided | |
7 * that the above copyright notice appear in all copies and that both that | |
8 * copyright notice and this permission notice appear in supporting | |
9 * documentation, and that the name of Software Research Associates not be | |
10 * used in advertising or publicity pertaining to distribution of the | |
11 * software without specific, written prior permission. Software Research | |
12 * Associates makes no representations about the suitability of this software | |
13 * for any purpose. It is provided "as is" without express or implied | |
14 * warranty. | |
15 * | |
16 * Author: Makoto Ishisone, Software Research Associates, Inc., Japan | |
17 */ | |
18 | |
19 #ifndef _AsyncErr_h | |
20 #define _AsyncErr_h | |
21 | |
22 /* | |
23 * X asyncronous error handler | |
24 * | |
25 * This library provides asyncronous error handler mechanism. | |
26 * It enables setting error handlers for particular requests | |
27 * without using XSync(). | |
28 */ | |
29 | |
30 /* | |
31 * XAEHandle -- an opaque type used as a 'handle' in this library | |
32 */ | |
33 typedef struct fe_errdesc_ *XAEHandle; | |
34 | |
35 /* | |
36 * XAEHandler -- an error handler for the async error handler mechanism | |
37 * This function takes an error event and dispatches it to | |
38 * the appropriate async error handler. | |
39 * To enable async error handler mechanism, set this function as | |
40 * the global error handler using XSetErrorHandler, or just call | |
41 * XAEInit, which does the same thing. | |
42 */ | |
43 extern int XAEHandler( | |
44 #if NeedFunctionPrototypes | |
45 Display *dpy, | |
46 XErrorEvent *eev | |
47 #endif | |
48 ); | |
49 | |
50 /* | |
51 * XAESetErrorHandler -- XSetErrorHandler replacement | |
52 * In order to set the global error handler, this function | |
53 * should be used instead of XSetErrorHandler when using | |
54 * async error handler mechanism. | |
55 */ | |
56 extern XErrorHandler XAESetErrorHandler( | |
57 #if NeedFunctionPrototypes | |
58 XErrorHandler handler | |
59 #endif | |
60 ); | |
61 | |
62 /* | |
63 * XAEInit -- async error handler mechanism initializer | |
64 */ | |
65 extern void XAEInit( | |
66 #if NeedFunctionPrototypes | |
67 void | |
68 #endif | |
69 ); | |
70 | |
71 /* | |
72 * XAESet -- set an async error handler | |
73 * XAEUnset -- unset handler set by XAEOpen | |
74 * These function set and unset the specified async error handler. | |
75 * Errors due to the requests issued between calls of XAESet and the | |
76 * corresponding XAEUnset are handled by the handler. | |
77 */ | |
78 extern XAEHandle XAESet( | |
79 #if NeedFunctionPrototypes | |
80 Display *dpy, | |
81 int (*handler)(), /* error handler to be called */ | |
82 void (*destroy)(), /* destroy hook (for freeing cldata etc.) */ | |
83 XPointer client_data | |
84 #endif | |
85 ); | |
86 | |
87 extern void XAEUnset( | |
88 #if NeedFunctionPrototypes | |
89 XAEHandle handle /* handle returned previous XAESet() call */ | |
90 #endif | |
91 ); | |
92 | |
93 /* | |
94 * XAESetIgnoreErrors -- ignore all errors | |
95 * This is a convenient function for setting an error handler that | |
96 * ignores all the errors. It is equivalent to | |
97 * XAESet(dpy, ignore_error_handler, NULL, NULL) | |
98 * where ignore_error_handler is an error handler that simply | |
99 * ignores all kind of errors. | |
100 */ | |
101 extern XAEHandle XAESetIgnoreErrors( | |
102 #if NeedFunctionPrototypes | |
103 Display *dpy | |
104 #endif | |
105 ); | |
106 | |
107 extern XAEHandle XAESetRecordErrors( | |
108 #if NeedFunctionPrototypes | |
109 Display *dpy, | |
110 unsigned long *errorbitsp | |
111 #endif | |
112 ); | |
113 | |
114 | |
115 /* | |
116 * Replace XSetErrorHandler with XAESetErrorHandler | |
117 */ | |
118 #define XSetErrorHandler XAESetErrorHandler | |
119 | |
120 #endif /* _AsyncErr_h */ |