VirtualBox

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

Last change on this file since 61034 was 40349, checked in by vboxsync, 13 years ago

Additions/xorg: support X.Org Server 1.12.

  • Property svn:eol-style set to native
File size: 8.4 KB
Line 
1/***********************************************************
2
3Copyright 1987, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25
26Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
28 All Rights Reserved
29
30Permission to use, copy, modify, and distribute this software and its
31documentation for any purpose and without fee is hereby granted,
32provided that the above copyright notice appear in all copies and that
33both that copyright notice and this permission notice appear in
34supporting documentation, and that the name of Digital not be
35used in advertising or publicity pertaining to distribution of the
36software without specific, written prior permission.
37
38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44SOFTWARE.
45
46******************************************************************/
47
48#ifdef HAVE_DIX_CONFIG_H
49#include <dix-config.h>
50#endif
51
52#ifndef _OSDEP_H_
53#define _OSDEP_H_ 1
54
55#if defined(XDMCP) || defined(HASXDMAUTH)
56#include <X11/Xdmcp.h>
57#endif
58
59#ifdef _POSIX_SOURCE
60#include <limits.h>
61#else
62#define _POSIX_SOURCE
63#include <limits.h>
64#undef _POSIX_SOURCE
65#endif
66
67#ifndef OPEN_MAX
68#ifdef SVR4
69#define OPEN_MAX 256
70#else
71#include <sys/param.h>
72#ifndef OPEN_MAX
73#if defined(NOFILE) && !defined(NOFILES_MAX)
74#define OPEN_MAX NOFILE
75#else
76#if !defined(WIN32)
77#define OPEN_MAX NOFILES_MAX
78#else
79#define OPEN_MAX 256
80#endif
81#endif
82#endif
83#endif
84#endif
85
86#include <X11/Xpoll.h>
87
88/*
89 * MAXSOCKS is used only for initialising MaxClients when no other method
90 * like sysconf(_SC_OPEN_MAX) is not supported.
91 */
92
93#if OPEN_MAX <= 256
94#define MAXSOCKS (OPEN_MAX - 1)
95#else
96#define MAXSOCKS 256
97#endif
98
99/* MAXSELECT is the number of fds that select() can handle */
100#define MAXSELECT (sizeof(fd_set) * NBBY)
101
102#include <stddef.h>
103
104#if defined(XDMCP) || defined(HASXDMAUTH)
105typedef Bool (*ValidatorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
106typedef Bool (*GeneratorFunc)(ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
107typedef Bool (*AddAuthorFunc)(unsigned name_length, const char *name,
108 unsigned data_length, char *data);
109#endif
110
111typedef struct _connectionInput {
112 struct _connectionInput *next;
113 char *buffer; /* contains current client input */
114 char *bufptr; /* pointer to current start of data */
115 int bufcnt; /* count of bytes in buffer */
116 int lenLastReq;
117 int size;
118 unsigned int ignoreBytes; /* bytes to ignore before the next request */
119} ConnectionInput, *ConnectionInputPtr;
120
121typedef struct _connectionOutput {
122 struct _connectionOutput *next;
123 int size;
124 unsigned char *buf;
125 int count;
126} ConnectionOutput, *ConnectionOutputPtr;
127
128struct _osComm;
129
130#define AuthInitArgs void
131typedef void (*AuthInitFunc) (AuthInitArgs);
132
133#define AuthAddCArgs unsigned short data_length, const char *data, XID id
134typedef int (*AuthAddCFunc) (AuthAddCArgs);
135
136#define AuthCheckArgs unsigned short data_length, const char *data, ClientPtr client, const char **reason
137typedef XID (*AuthCheckFunc) (AuthCheckArgs);
138
139#define AuthFromIDArgs XID id, unsigned short *data_lenp, char **datap
140typedef int (*AuthFromIDFunc) (AuthFromIDArgs);
141
142#define AuthGenCArgs unsigned data_length, const char *data, XID id, unsigned *data_length_return, char **data_return
143typedef XID (*AuthGenCFunc) (AuthGenCArgs);
144
145#define AuthRemCArgs unsigned short data_length, const char *data
146typedef int (*AuthRemCFunc) (AuthRemCArgs);
147
148#define AuthRstCArgs void
149typedef int (*AuthRstCFunc) (AuthRstCArgs);
150
151#define AuthToIDArgs unsigned short data_length, char *data
152typedef XID (*AuthToIDFunc) (AuthToIDArgs);
153
154typedef void (*OsCloseFunc)(ClientPtr);
155
156typedef int (*OsFlushFunc)(ClientPtr who, struct _osComm * oc, char* extraBuf, int extraCount);
157
158typedef struct _osComm {
159 int fd;
160 ConnectionInputPtr input;
161 ConnectionOutputPtr output;
162 XID auth_id; /* authorization id */
163 CARD32 conn_time; /* timestamp if not established, else 0 */
164 struct _XtransConnInfo *trans_conn; /* transport connection object */
165 Bool local_client;
166} OsCommRec, *OsCommPtr;
167
168extern int FlushClient(
169 ClientPtr /*who*/,
170 OsCommPtr /*oc*/,
171 const void * /*extraBuf*/,
172 int /*extraCount*/
173);
174
175extern void FreeOsBuffers(
176 OsCommPtr /*oc*/
177);
178
179#include "dix.h"
180
181extern fd_set AllSockets;
182extern fd_set AllClients;
183extern fd_set LastSelectMask;
184extern fd_set WellKnownConnections;
185extern fd_set EnabledDevices;
186extern fd_set ClientsWithInput;
187extern fd_set ClientsWriteBlocked;
188extern fd_set OutputPending;
189extern fd_set IgnoredClientsWithInput;
190
191#ifndef WIN32
192extern int *ConnectionTranslation;
193#else
194extern int GetConnectionTranslation(int conn);
195extern void SetConnectionTranslation(int conn, int client);
196extern void ClearConnectionTranslation(void);
197#endif
198
199extern Bool NewOutputPending;
200extern Bool AnyClientsWriteBlocked;
201
202extern WorkQueuePtr workQueue;
203
204/* in WaitFor.c */
205#ifdef WIN32
206typedef long int fd_mask;
207#endif
208#define ffs mffs
209extern int mffs(fd_mask);
210
211/* in access.c */
212extern Bool ComputeLocalClient(ClientPtr client);
213
214/* in auth.c */
215extern void GenerateRandomData (int len, char *buf);
216
217/* in mitauth.c */
218extern XID MitCheckCookie (AuthCheckArgs);
219extern XID MitGenerateCookie (AuthGenCArgs);
220extern XID MitToID (AuthToIDArgs);
221extern int MitAddCookie (AuthAddCArgs);
222extern int MitFromID (AuthFromIDArgs);
223extern int MitRemoveCookie (AuthRemCArgs);
224extern int MitResetCookie (AuthRstCArgs);
225
226/* in xdmauth.c */
227#ifdef HASXDMAUTH
228extern XID XdmCheckCookie (AuthCheckArgs);
229extern XID XdmToID (AuthToIDArgs);
230extern int XdmAddCookie (AuthAddCArgs);
231extern int XdmFromID (AuthFromIDArgs);
232extern int XdmRemoveCookie (AuthRemCArgs);
233extern int XdmResetCookie (AuthRstCArgs);
234#endif
235
236/* in rpcauth.c */
237#ifdef SECURE_RPC
238extern void SecureRPCInit (AuthInitArgs);
239extern XID SecureRPCCheck (AuthCheckArgs);
240extern XID SecureRPCToID (AuthToIDArgs);
241extern int SecureRPCAdd (AuthAddCArgs);
242extern int SecureRPCFromID (AuthFromIDArgs);
243extern int SecureRPCRemove (AuthRemCArgs);
244extern int SecureRPCReset (AuthRstCArgs);
245#endif
246
247#ifdef XDMCP
248/* in xdmcp.c */
249extern void XdmcpUseMsg (void);
250extern int XdmcpOptions(int argc, char **argv, int i);
251extern void XdmcpRegisterConnection (
252 int type,
253 const char *address,
254 int addrlen);
255extern void XdmcpRegisterAuthorizations (void);
256extern void XdmcpRegisterAuthorization (const char *name, int namelen);
257extern void XdmcpInit (void);
258extern void XdmcpReset (void);
259extern void XdmcpOpenDisplay(int sock);
260extern void XdmcpCloseDisplay(int sock);
261extern void XdmcpRegisterAuthentication (
262 const char *name,
263 int namelen,
264 const char *data,
265 int datalen,
266 ValidatorFunc Validator,
267 GeneratorFunc Generator,
268 AddAuthorFunc AddAuth);
269
270struct sockaddr_in;
271extern void XdmcpRegisterBroadcastAddress (const struct sockaddr_in *addr);
272#endif
273
274#ifdef HASXDMAUTH
275extern void XdmAuthenticationInit (const char *cookie, int cookie_length);
276#endif
277
278#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