VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/osdep.h@ 78293

Last change on this file since 78293 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 10.5 KB
Line 
1/* $XFree86: xc/programs/Xserver/os/osdep.h,v 3.17 2002/05/31 18:46:06 dawes Exp $ */
2/***********************************************************
3
4Copyright 1987, 1998 The Open Group
5
6Permission to use, copy, modify, distribute, and sell this software and its
7documentation for any purpose is hereby granted without fee, provided that
8the above copyright notice appear in all copies and that both that
9copyright notice and this permission notice appear in supporting
10documentation.
11
12The above copyright notice and this permission notice shall be included in
13all copies or substantial portions of the Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall not be
23used in advertising or otherwise to promote the sale, use or other dealings
24in this Software without prior written authorization from The Open Group.
25
26
27Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
28
29 All Rights Reserved
30
31Permission to use, copy, modify, and distribute this software and its
32documentation for any purpose and without fee is hereby granted,
33provided that the above copyright notice appear in all copies and that
34both that copyright notice and this permission notice appear in
35supporting documentation, and that the name of Digital not be
36used in advertising or publicity pertaining to distribution of the
37software without specific, written prior permission.
38
39DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45SOFTWARE.
46
47******************************************************************/
48/* $Xorg: osdep.h,v 1.5 2001/02/09 02:05:23 xorgcvs Exp $ */
49
50#ifdef HAVE_DIX_CONFIG_H
51#include <dix-config.h>
52#endif
53
54#ifndef _OSDEP_H_
55#define _OSDEP_H_ 1
56
57#define BOTIMEOUT 200 /* in milliseconds */
58#define BUFSIZE 4096
59#define BUFWATERMARK 8192
60#ifndef MAXBUFSIZE
61#define MAXBUFSIZE (1 << 22)
62#endif
63
64#include <X11/Xdmcp.h>
65
66#ifndef sgi /* SGI defines OPEN_MAX in a useless way */
67#ifndef X_NOT_POSIX
68#ifdef _POSIX_SOURCE
69#include <limits.h>
70#else
71#define _POSIX_SOURCE
72#include <limits.h>
73#undef _POSIX_SOURCE
74#endif
75#else /* X_NOT_POSIX */
76#ifdef WIN32
77#define _POSIX_
78#include <limits.h>
79#undef _POSIX_
80#endif
81#endif /* X_NOT_POSIX */
82#endif
83
84#ifdef __QNX__
85#define NOFILES_MAX 256
86#endif
87#ifndef OPEN_MAX
88#ifdef SVR4
89#define OPEN_MAX 256
90#else
91#include <sys/param.h>
92#ifndef OPEN_MAX
93#if defined(NOFILE) && !defined(NOFILES_MAX)
94#define OPEN_MAX NOFILE
95#else
96#if !defined(__UNIXOS2__) && !defined(WIN32)
97#define OPEN_MAX NOFILES_MAX
98#else
99#define OPEN_MAX 256
100#endif
101#endif
102#endif
103#endif
104#endif
105
106#include <X11/Xpoll.h>
107
108/*
109 * MAXSOCKS is used only for initialising MaxClients when no other method
110 * like sysconf(_SC_OPEN_MAX) is not supported.
111 */
112
113#if OPEN_MAX <= 256
114#define MAXSOCKS (OPEN_MAX - 1)
115#else
116#define MAXSOCKS 256
117#endif
118
119/* MAXSELECT is the number of fds that select() can handle */
120#define MAXSELECT (sizeof(fd_set) * NBBY)
121
122#ifndef HAS_GETDTABLESIZE
123#if !defined(hpux) && !defined(SVR4) && !defined(SYSV)
124#define HAS_GETDTABLESIZE
125#endif
126#endif
127
128#include <stddef.h>
129
130typedef Bool (*ValidatorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
131typedef Bool (*GeneratorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
132typedef Bool (*AddAuthorFunc)(unsigned name_length, char *name, unsigned data_length, char *data);
133
134typedef struct _connectionInput {
135 struct _connectionInput *next;
136 char *buffer; /* contains current client input */
137 char *bufptr; /* pointer to current start of data */
138 int bufcnt; /* count of bytes in buffer */
139 int lenLastReq;
140 int size;
141} ConnectionInput, *ConnectionInputPtr;
142
143typedef struct _connectionOutput {
144 struct _connectionOutput *next;
145 int size;
146 unsigned char *buf;
147 int count;
148#ifdef LBX
149 Bool nocompress;
150#endif
151} ConnectionOutput, *ConnectionOutputPtr;
152
153#ifdef K5AUTH
154typedef struct _k5_state {
155 int stageno; /* current stage of auth protocol */
156 pointer srvcreds; /* server credentials */
157 pointer srvname; /* server principal name */
158 pointer ktname; /* key table: principal-key pairs */
159 pointer skey; /* session key */
160} k5_state;
161#endif
162
163#ifdef LBX
164typedef struct _LbxProxy *OsProxyPtr;
165#endif
166
167struct _osComm;
168
169#define AuthInitArgs void
170typedef void (*AuthInitFunc) (AuthInitArgs);
171
172#define AuthAddCArgs unsigned short data_length, char *data, XID id
173typedef int (*AuthAddCFunc) (AuthAddCArgs);
174
175#define AuthCheckArgs unsigned short data_length, char *data, ClientPtr client, char **reason
176typedef XID (*AuthCheckFunc) (AuthCheckArgs);
177
178#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
179typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
180
181#define AuthGenCArgs unsigned data_length, char *data, XID id, unsigned *data_length_return, char **data_return
182typedef XID (*AuthGenCFunc) (AuthGenCArgs);
183
184#define AuthRemCArgs unsigned short data_length, char *data
185typedef int (*AuthRemCFunc) (AuthRemCArgs);
186
187#define AuthRstCArgs void
188typedef int (*AuthRstCFunc) (AuthRstCArgs);
189
190#define AuthToIDArgs unsigned short data_length, char *data
191typedef XID (*AuthToIDFunc) (AuthToIDArgs);
192
193typedef void (*OsCloseFunc)(ClientPtr);
194
195typedef int (*OsFlushFunc)(ClientPtr who, struct _osComm * oc, char* extraBuf, int extraCount);
196
197typedef struct _osComm {
198 int fd;
199 ConnectionInputPtr input;
200 ConnectionOutputPtr output;
201 XID auth_id; /* authorization id */
202#ifdef K5AUTH
203 k5_state authstate; /* state of setup auth conversation */
204#endif
205 CARD32 conn_time; /* timestamp if not established, else 0 */
206 struct _XtransConnInfo *trans_conn; /* transport connection object */
207#ifdef LBX
208 OsProxyPtr proxy;
209 ConnectionInputPtr largereq;
210 OsCloseFunc Close;
211 OsFlushFunc Flush;
212#endif
213} OsCommRec, *OsCommPtr;
214
215#ifdef LBX
216#define FlushClient(who, oc, extraBuf, extraCount) \
217 (*(oc)->Flush)(who, oc, extraBuf, extraCount)
218extern int StandardFlushClient(
219 ClientPtr /*who*/,
220 OsCommPtr /*oc*/,
221 char* /*extraBuf*/,
222 int /*extraCount*/
223);
224extern int LbxFlushClient(ClientPtr /*who*/, OsCommPtr /*oc*/,
225 char * /*extraBuf*/, int /*extraCount*/);
226#else
227extern int FlushClient(
228 ClientPtr /*who*/,
229 OsCommPtr /*oc*/,
230 char* /*extraBuf*/,
231 int /*extraCount*/
232);
233#endif
234
235extern void FreeOsBuffers(
236 OsCommPtr /*oc*/
237);
238
239#include "dix.h"
240
241extern ConnectionInputPtr AllocateInputBuffer(void);
242
243extern ConnectionOutputPtr AllocateOutputBuffer(void);
244
245extern fd_set AllSockets;
246extern fd_set AllClients;
247extern fd_set LastSelectMask;
248extern fd_set WellKnownConnections;
249extern fd_set EnabledDevices;
250extern fd_set ClientsWithInput;
251extern fd_set ClientsWriteBlocked;
252extern fd_set OutputPending;
253extern fd_set IgnoredClientsWithInput;
254
255#ifndef WIN32
256extern int *ConnectionTranslation;
257#else
258extern int GetConnectionTranslation(int conn);
259extern void SetConnectionTranslation(int conn, int client);
260extern void ClearConnectionTranslation();
261#endif
262
263extern Bool NewOutputPending;
264extern Bool AnyClientsWriteBlocked;
265extern Bool CriticalOutputPending;
266
267extern int timesThisConnection;
268extern ConnectionInputPtr FreeInputs;
269extern ConnectionOutputPtr FreeOutputs;
270extern OsCommPtr AvailableInput;
271
272extern WorkQueuePtr workQueue;
273
274/* added by raphael */
275#ifdef WIN32
276typedef long int fd_mask;
277#endif
278#define ffs mffs
279extern int mffs(fd_mask);
280
281/* in auth.c */
282extern void GenerateRandomData (int len, char *buf);
283
284/* in mitauth.c */
285extern XID MitCheckCookie (AuthCheckArgs);
286extern XID MitGenerateCookie (AuthGenCArgs);
287extern XID MitToID (AuthToIDArgs);
288extern int MitAddCookie (AuthAddCArgs);
289extern int MitFromID (AuthFromIDArgs);
290extern int MitRemoveCookie (AuthRemCArgs);
291extern int MitResetCookie (AuthRstCArgs);
292
293/* in xdmauth.c */
294#ifdef HASXDMAUTH
295extern XID XdmCheckCookie (AuthCheckArgs);
296extern XID XdmToID (AuthToIDArgs);
297extern int XdmAddCookie (AuthAddCArgs);
298extern int XdmFromID (AuthFromIDArgs);
299extern int XdmRemoveCookie (AuthRemCArgs);
300extern int XdmResetCookie (AuthRstCArgs);
301#endif
302
303/* in rpcauth.c */
304#ifdef SECURE_RPC
305extern void SecureRPCInit (AuthInitArgs);
306extern XID SecureRPCCheck (AuthCheckArgs);
307extern XID SecureRPCToID (AuthToIDArgs);
308extern int SecureRPCAdd (AuthAddCArgs);
309extern int SecureRPCFromID (AuthFromIDArgs);
310extern int SecureRPCRemove (AuthRemCArgs);
311extern int SecureRPCReset (AuthRstCArgs);
312#endif
313
314/* in k5auth.c */
315#ifdef K5AUTH
316extern XID K5Check (AuthCheckArgs);
317extern XID K5ToID (AuthToIDArgs);
318extern int K5Add (AuthAddCArgs);
319extern int K5FromID (AuthFromIDArgs);
320extern int K5Remove (AuthRemCArgs);
321extern int K5Reset (AuthRstCArgs);
322#endif
323
324/* in secauth.c */
325extern XID AuthSecurityCheck (AuthCheckArgs);
326
327/* in xdmcp.c */
328extern void XdmcpUseMsg (void);
329extern int XdmcpOptions(int argc, char **argv, int i);
330extern void XdmcpSetAuthentication (ARRAY8Ptr name);
331extern void XdmcpRegisterConnection (
332 int type,
333 char *address,
334 int addrlen);
335extern void XdmcpRegisterAuthorizations (void);
336extern void XdmcpRegisterAuthorization (char *name, int namelen);
337extern void XdmcpRegisterDisplayClass (char *name, int length);
338extern void XdmcpInit (void);
339extern void XdmcpReset (void);
340extern void XdmcpOpenDisplay(int sock);
341extern void XdmcpCloseDisplay(int sock);
342extern void XdmcpRegisterAuthentication (
343 char *name,
344 int namelen,
345 char *data,
346 int datalen,
347 ValidatorFunc Validator,
348 GeneratorFunc Generator,
349 AddAuthorFunc AddAuth);
350extern int XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type);
351extern int XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data);
352
353struct sockaddr_in;
354extern void XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr);
355
356#ifdef HASXDMAUTH
357extern void XdmAuthenticationInit (char *cookie, int cookie_length);
358#endif
359
360#endif /* _OSDEP_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette