First import
[xorg_rtime.git] / xorg-server-1.4 / Xext / xace.h
blob4143cd42f11061f4dcf0a5fdf141692df49557cd
1 /************************************************************
3 Author: Eamon Walsh <ewalsh@epoch.ncsc.mil>
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 this permission notice appear in supporting documentation. This permission
8 notice shall be included in all copies or substantial portions of the
9 Software.
11 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14 AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
15 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 ********************************************************/
20 #ifndef _XACE_H
21 #define _XACE_H
23 /* Hook return codes */
24 #define XaceErrorOperation 0
25 #define XaceAllowOperation 1
26 #define XaceIgnoreOperation 2
28 #ifdef XACE
30 #define XACE_EXTENSION_NAME "XAccessControlExtension"
31 #define XACE_MAJOR_VERSION 1
32 #define XACE_MINOR_VERSION 0
34 #include "pixmap.h" /* for DrawablePtr */
35 #include "regionstr.h" /* for RegionPtr */
37 #define XaceNumberEvents 0
38 #define XaceNumberErrors 0
40 /* security hooks */
41 /* Constants used to identify the available security hooks
43 #define XACE_CORE_DISPATCH 0
44 #define XACE_EXT_DISPATCH 1
45 #define XACE_RESOURCE_ACCESS 2
46 #define XACE_DEVICE_ACCESS 3
47 #define XACE_PROPERTY_ACCESS 4
48 #define XACE_DRAWABLE_ACCESS 5
49 #define XACE_MAP_ACCESS 6
50 #define XACE_BACKGRND_ACCESS 7
51 #define XACE_EXT_ACCESS 8
52 #define XACE_HOSTLIST_ACCESS 9
53 #define XACE_SITE_POLICY 10
54 #define XACE_DECLARE_EXT_SECURE 11
55 #define XACE_AUTH_AVAIL 12
56 #define XACE_KEY_AVAIL 13
57 #define XACE_WINDOW_INIT 14
58 #define XACE_AUDIT_BEGIN 15
59 #define XACE_AUDIT_END 16
60 #define XACE_NUM_HOOKS 17
62 extern CallbackListPtr XaceHooks[XACE_NUM_HOOKS];
64 /* Entry point for hook functions. Called by Xserver.
66 extern int XaceHook(
67 int /*hook*/,
68 ... /*appropriate args for hook*/
69 );
71 /* Register a callback for a given hook.
73 #define XaceRegisterCallback(hook,callback,data) \
74 AddCallback(XaceHooks+(hook), callback, data)
76 /* Unregister an existing callback for a given hook.
78 #define XaceDeleteCallback(hook,callback,data) \
79 DeleteCallback(XaceHooks+(hook), callback, data)
82 /* From the original Security extension...
85 extern void XaceCensorImage(
86 ClientPtr client,
87 RegionPtr pVisibleRegion,
88 long widthBytesLine,
89 DrawablePtr pDraw,
90 int x, int y, int w, int h,
91 unsigned int format,
92 char * pBuf
95 #else /* XACE */
97 /* Define calls away when XACE is not being built. */
99 #ifdef __GNUC__
100 #define XaceHook(args...) XaceAllowOperation
101 #define XaceCensorImage(args...) { ; }
102 #else
103 #define XaceHook(...) XaceAllowOperation
104 #define XaceCensorImage(...) { ; }
105 #endif
107 #endif /* XACE */
109 #endif /* _XACE_H */