]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/extnsionst.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / include / extnsionst.h
1 /* $XConsortium: extnsionst.h /main/15 1996/08/01 19:18:11 dpw $ */
2 /* $XFree86: xc/programs/Xserver/include/extnsionst.h,v 3.2 1996/12/23 07:09:27 dawes Exp $ */
3 /***********************************************************
4
5 Copyright (c) 1987  X Consortium
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
27
28
29 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
30
31                         All Rights Reserved
32
33 Permission to use, copy, modify, and distribute this software and its 
34 documentation for any purpose and without fee is hereby granted, 
35 provided that the above copyright notice appear in all copies and that
36 both that copyright notice and this permission notice appear in 
37 supporting documentation, and that the name of Digital not be
38 used in advertising or publicity pertaining to distribution of the
39 software without specific, written prior permission.  
40
41 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47 SOFTWARE.
48
49 ******************************************************************/
50 #ifndef EXTENSIONSTRUCT_H
51 #define EXTENSIONSTRUCT_H 
52
53 #include "misc.h"
54 #include "screenint.h"
55 #include "extension.h"
56 #include "gc.h"
57
58 typedef struct _ExtensionEntry {
59     int index;
60     void (* CloseDown)( /* called at server shutdown */
61 #if NeedNestedPrototypes
62         struct _ExtensionEntry * /* extension */
63 #endif
64 );
65     char *name;               /* extension name */
66     int base;                 /* base request number */
67     int eventBase;            
68     int eventLast;
69     int errorBase;
70     int errorLast;
71     int num_aliases;
72     char **aliases;
73     pointer extPrivate;
74     unsigned short (* MinorOpcode)(     /* called for errors */
75 #if NeedNestedPrototypes
76         ClientPtr /* client */
77 #endif
78 );
79 #ifdef XCSECURITY
80     Bool secure;                /* extension visible to untrusted clients? */
81 #endif
82 } ExtensionEntry;
83
84 /* any attempt to declare the types of the parameters to the functions
85  * in EventSwapVector fails.  The functions take pointers to two events,
86  * but the exact event types that are declared vary from one function 
87  * to another.  You can't even put void *, void * (the ibm compiler
88  * complains, anyway).
89  */
90 typedef void (*EventSwapPtr) (
91 #if NeedFunctionPrototypes && defined(EVENT_SWAP_PTR)
92         xEvent *,
93         xEvent *
94 #endif
95 );
96
97 extern EventSwapPtr EventSwapVector[128];
98
99 extern void NotImplemented (    /* FIXME: this may move to another file... */
100 #if NeedFunctionPrototypes && defined(EVENT_SWAP_PTR)
101         xEvent *,
102         xEvent *
103 #endif
104 );
105
106 typedef void (* ExtensionLookupProc)(   /*args indeterminate*/
107 #ifdef  EXTENSION_PROC_ARGS
108         EXTENSION_PROC_ARGS
109 #endif
110 );
111
112 typedef struct _ProcEntry {
113     char *name;
114     ExtensionLookupProc proc;
115 } ProcEntryRec, *ProcEntryPtr;
116
117 typedef struct _ScreenProcEntry {
118     int num;
119     ProcEntryPtr procList;
120 } ScreenProcEntry;
121
122 #define    SetGCVector(pGC, VectorElement, NewRoutineAddress, Atom)    \
123     pGC->VectorElement = NewRoutineAddress;
124
125 #define    GetGCValue(pGC, GCElement)    (pGC->GCElement)
126
127
128 extern ExtensionEntry *AddExtension(
129 #if NeedFunctionPrototypes
130     char* /*name*/,
131     int /*NumEvents*/,
132     int /*NumErrors*/,
133     int (* /*MainProc*/)(
134 #if NeedNestedPrototypes
135         ClientPtr /*client*/
136 #endif
137 ),
138     int (* /*SwappedMainProc*/)(
139 #if NeedNestedPrototypes
140         ClientPtr /*client*/
141 #endif
142 ),
143     void (* /*CloseDownProc*/)(
144 #if NeedNestedPrototypes
145         ExtensionEntry * /*extension*/
146 #endif
147 ),
148     unsigned short (* /*MinorOpcodeProc*/)(
149 #if NeedNestedPrototypes
150         ClientPtr /*client*/
151 #endif
152         )
153 #endif /* NeedFunctionPrototypes */
154 );
155
156 extern Bool AddExtensionAlias(
157 #if NeedFunctionPrototypes
158     char* /*alias*/,
159     ExtensionEntry * /*extension*/
160 #endif
161 );
162
163 extern ExtensionLookupProc LookupProc(
164 #if NeedFunctionPrototypes
165     char* /*name*/,
166     GCPtr /*pGC*/
167 #endif
168 );
169
170 extern Bool RegisterProc(
171 #if NeedFunctionPrototypes
172     char* /*name*/,
173     GCPtr /*pGC*/,
174     ExtensionLookupProc /*proc*/
175 #endif
176 );
177
178 extern Bool RegisterScreenProc(
179 #if NeedFunctionPrototypes
180     char* /*name*/,
181     ScreenPtr /*pScreen*/,
182     ExtensionLookupProc /*proc*/
183 #endif
184 );
185
186 extern void DeclareExtensionSecurity(
187 #if NeedFunctionPrototypes
188     char * /*extname*/,
189     Bool /*secure*/
190 #endif
191 );
192
193 #endif /* EXTENSIONSTRUCT_H */
194