VirtualBox

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

最後變更 在這個檔案從62425是 51223,由 vboxsync 提交於 11 年 前

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

  • 屬性 svn:eol-style 設為 native
檔案大小: 10.5 KB
 
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#if !defined(hpux) && !defined(SVR4) && !defined(SYSV)
123#define HAS_GETDTABLESIZE
124#endif
125
126#include <stddef.h>
127
128typedef Bool (*ValidatorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
129typedef Bool (*GeneratorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
130typedef Bool (*AddAuthorFunc)(unsigned name_length, char *name, unsigned data_length, char *data);
131
132typedef struct _connectionInput {
133 struct _connectionInput *next;
134 char *buffer; /* contains current client input */
135 char *bufptr; /* pointer to current start of data */
136 int bufcnt; /* count of bytes in buffer */
137 int lenLastReq;
138 int size;
139} ConnectionInput, *ConnectionInputPtr;
140
141typedef struct _connectionOutput {
142 struct _connectionOutput *next;
143 int size;
144 unsigned char *buf;
145 int count;
146#ifdef LBX
147 Bool nocompress;
148#endif
149} ConnectionOutput, *ConnectionOutputPtr;
150
151#ifdef K5AUTH
152typedef struct _k5_state {
153 int stageno; /* current stage of auth protocol */
154 pointer srvcreds; /* server credentials */
155 pointer srvname; /* server principal name */
156 pointer ktname; /* key table: principal-key pairs */
157 pointer skey; /* session key */
158} k5_state;
159#endif
160
161#ifdef LBX
162typedef struct _LbxProxy *OsProxyPtr;
163#endif
164
165struct _osComm;
166
167#define AuthInitArgs void
168typedef void (*AuthInitFunc) (AuthInitArgs);
169
170#define AuthAddCArgs unsigned short data_length, char *data, XID id
171typedef int (*AuthAddCFunc) (AuthAddCArgs);
172
173#define AuthCheckArgs unsigned short data_length, char *data, ClientPtr client, char **reason
174typedef XID (*AuthCheckFunc) (AuthCheckArgs);
175
176#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
177typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
178
179#define AuthGenCArgs unsigned data_length, char *data, XID id, unsigned *data_length_return, char **data_return
180typedef XID (*AuthGenCFunc) (AuthGenCArgs);
181
182#define AuthRemCArgs unsigned short data_length, char *data
183typedef int (*AuthRemCFunc) (AuthRemCArgs);
184
185#define AuthRstCArgs void
186typedef int (*AuthRstCFunc) (AuthRstCArgs);
187
188#define AuthToIDArgs unsigned short data_length, char *data
189typedef XID (*AuthToIDFunc) (AuthToIDArgs);
190
191typedef void (*OsCloseFunc)(ClientPtr);
192
193typedef int (*OsFlushFunc)(ClientPtr who, struct _osComm * oc, char* extraBuf, int extraCount);
194
195typedef struct _osComm {
196 int fd;
197 ConnectionInputPtr input;
198 ConnectionOutputPtr output;
199 XID auth_id; /* authorization id */
200#ifdef K5AUTH
201 k5_state authstate; /* state of setup auth conversation */
202#endif
203 CARD32 conn_time; /* timestamp if not established, else 0 */
204 struct _XtransConnInfo *trans_conn; /* transport connection object */
205#ifdef LBX
206 OsProxyPtr proxy;
207 ConnectionInputPtr largereq;
208 OsCloseFunc Close;
209 OsFlushFunc Flush;
210#endif
211} OsCommRec, *OsCommPtr;
212
213#ifdef LBX
214#define FlushClient(who, oc, extraBuf, extraCount) \
215 (*(oc)->Flush)(who, oc, extraBuf, extraCount)
216extern int StandardFlushClient(
217 ClientPtr /*who*/,
218 OsCommPtr /*oc*/,
219 char* /*extraBuf*/,
220 int /*extraCount*/
221);
222extern int LbxFlushClient(ClientPtr /*who*/, OsCommPtr /*oc*/,
223 char * /*extraBuf*/, int /*extraCount*/);
224#else
225extern int FlushClient(
226 ClientPtr /*who*/,
227 OsCommPtr /*oc*/,
228 char* /*extraBuf*/,
229 int /*extraCount*/
230);
231#endif
232
233extern void FreeOsBuffers(
234 OsCommPtr /*oc*/
235);
236
237#include "dix.h"
238
239extern ConnectionInputPtr AllocateInputBuffer(void);
240
241extern ConnectionOutputPtr AllocateOutputBuffer(void);
242
243extern fd_set AllSockets;
244extern fd_set AllClients;
245extern fd_set LastSelectMask;
246extern fd_set WellKnownConnections;
247extern fd_set EnabledDevices;
248extern fd_set ClientsWithInput;
249extern fd_set ClientsWriteBlocked;
250extern fd_set OutputPending;
251extern fd_set IgnoredClientsWithInput;
252
253#ifndef WIN32
254extern int *ConnectionTranslation;
255#else
256extern int GetConnectionTranslation(int conn);
257extern void SetConnectionTranslation(int conn, int client);
258extern void ClearConnectionTranslation();
259#endif
260
261extern Bool NewOutputPending;
262extern Bool AnyClientsWriteBlocked;
263extern Bool CriticalOutputPending;
264
265extern int timesThisConnection;
266extern ConnectionInputPtr FreeInputs;
267extern ConnectionOutputPtr FreeOutputs;
268extern OsCommPtr AvailableInput;
269
270extern WorkQueuePtr workQueue;
271
272/* added by raphael */
273#ifdef WIN32
274typedef long int fd_mask;
275#endif
276#define ffs mffs
277extern int mffs(fd_mask);
278
279/* in auth.c */
280extern void GenerateRandomData (int len, char *buf);
281
282/* in mitauth.c */
283extern XID MitCheckCookie (AuthCheckArgs);
284extern XID MitGenerateCookie (AuthGenCArgs);
285extern XID MitToID (AuthToIDArgs);
286extern int MitAddCookie (AuthAddCArgs);
287extern int MitFromID (AuthFromIDArgs);
288extern int MitRemoveCookie (AuthRemCArgs);
289extern int MitResetCookie (AuthRstCArgs);
290
291/* in xdmauth.c */
292#ifdef HASXDMAUTH
293extern XID XdmCheckCookie (AuthCheckArgs);
294extern XID XdmToID (AuthToIDArgs);
295extern int XdmAddCookie (AuthAddCArgs);
296extern int XdmFromID (AuthFromIDArgs);
297extern int XdmRemoveCookie (AuthRemCArgs);
298extern int XdmResetCookie (AuthRstCArgs);
299#endif
300
301/* in rpcauth.c */
302#ifdef SECURE_RPC
303extern void SecureRPCInit (AuthInitArgs);
304extern XID SecureRPCCheck (AuthCheckArgs);
305extern XID SecureRPCToID (AuthToIDArgs);
306extern int SecureRPCAdd (AuthAddCArgs);
307extern int SecureRPCFromID (AuthFromIDArgs);
308extern int SecureRPCRemove (AuthRemCArgs);
309extern int SecureRPCReset (AuthRstCArgs);
310#endif
311
312/* in k5auth.c */
313#ifdef K5AUTH
314extern XID K5Check (AuthCheckArgs);
315extern XID K5ToID (AuthToIDArgs);
316extern int K5Add (AuthAddCArgs);
317extern int K5FromID (AuthFromIDArgs);
318extern int K5Remove (AuthRemCArgs);
319extern int K5Reset (AuthRstCArgs);
320#endif
321
322/* in secauth.c */
323extern XID AuthSecurityCheck (AuthCheckArgs);
324
325/* in xdmcp.c */
326extern void XdmcpUseMsg (void);
327extern int XdmcpOptions(int argc, char **argv, int i);
328extern void XdmcpSetAuthentication (ARRAY8Ptr name);
329extern void XdmcpRegisterConnection (
330 int type,
331 char *address,
332 int addrlen);
333extern void XdmcpRegisterAuthorizations (void);
334extern void XdmcpRegisterAuthorization (char *name, int namelen);
335extern void XdmcpRegisterDisplayClass (char *name, int length);
336extern void XdmcpInit (void);
337extern void XdmcpReset (void);
338extern void XdmcpOpenDisplay(int sock);
339extern void XdmcpCloseDisplay(int sock);
340extern void XdmcpRegisterAuthentication (
341 char *name,
342 int namelen,
343 char *data,
344 int datalen,
345 ValidatorFunc Validator,
346 GeneratorFunc Generator,
347 AddAuthorFunc AddAuth);
348extern int XdmcpCheckAuthentication (ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type);
349extern int XdmcpAddAuthorization (ARRAY8Ptr name, ARRAY8Ptr data);
350
351struct sockaddr_in;
352extern void XdmcpRegisterBroadcastAddress (struct sockaddr_in *addr);
353
354#ifdef HASXDMAUTH
355extern void XdmAuthenticationInit (char *cookie, int cookie_length);
356#endif
357
358#endif /* _OSDEP_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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