1 | /* $XFree86: xc/programs/Xserver/include/os.h,v 3.43 2002/12/24 17:42:59 tsi Exp $ */
|
---|
2 | /***********************************************************
|
---|
3 |
|
---|
4 | Copyright 1987, 1998 The Open Group
|
---|
5 |
|
---|
6 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | the above copyright notice appear in all copies and that both that
|
---|
9 | copyright notice and this permission notice appear in supporting
|
---|
10 | documentation.
|
---|
11 |
|
---|
12 | The above copyright notice and this permission notice shall be included in
|
---|
13 | all copies or substantial portions of the Software.
|
---|
14 |
|
---|
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
18 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
19 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
21 |
|
---|
22 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
23 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
24 | in this Software without prior written authorization from The Open Group.
|
---|
25 |
|
---|
26 |
|
---|
27 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
28 |
|
---|
29 | All Rights Reserved
|
---|
30 |
|
---|
31 | Permission to use, copy, modify, and distribute this software and its
|
---|
32 | documentation for any purpose and without fee is hereby granted,
|
---|
33 | provided that the above copyright notice appear in all copies and that
|
---|
34 | both that copyright notice and this permission notice appear in
|
---|
35 | supporting documentation, and that the name of Digital not be
|
---|
36 | used in advertising or publicity pertaining to distribution of the
|
---|
37 | software without specific, written prior permission.
|
---|
38 |
|
---|
39 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
40 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
41 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
42 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
43 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
44 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
45 | SOFTWARE.
|
---|
46 |
|
---|
47 | ******************************************************************/
|
---|
48 |
|
---|
49 | /* $Xorg: os.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */
|
---|
50 |
|
---|
51 | #ifndef OS_H
|
---|
52 | #define OS_H
|
---|
53 | #include "misc.h"
|
---|
54 | #define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
|
---|
55 | #define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr))
|
---|
56 | #include "Xalloca.h"
|
---|
57 | #ifndef IN_MODULE
|
---|
58 | #include <stdarg.h>
|
---|
59 | #else
|
---|
60 | #include "xf86_ansic.h"
|
---|
61 | #endif
|
---|
62 |
|
---|
63 | #define NullFID ((FID) 0)
|
---|
64 |
|
---|
65 | #define SCREEN_SAVER_ON 0
|
---|
66 | #define SCREEN_SAVER_OFF 1
|
---|
67 | #define SCREEN_SAVER_FORCER 2
|
---|
68 | #define SCREEN_SAVER_CYCLE 3
|
---|
69 |
|
---|
70 | #ifndef MAX_REQUEST_SIZE
|
---|
71 | #define MAX_REQUEST_SIZE 65535
|
---|
72 | #endif
|
---|
73 | #ifndef MAX_BIG_REQUEST_SIZE
|
---|
74 | #define MAX_BIG_REQUEST_SIZE 1048575
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | typedef pointer FID;
|
---|
78 | typedef struct _FontPathRec *FontPathPtr;
|
---|
79 | typedef struct _NewClientRec *NewClientPtr;
|
---|
80 |
|
---|
81 | #ifndef xalloc
|
---|
82 | #define xnfalloc(size) XNFalloc((unsigned long)(size))
|
---|
83 | #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
|
---|
84 | #define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))
|
---|
85 |
|
---|
86 | #define xalloc(size) Xalloc((unsigned long)(size))
|
---|
87 | #define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))
|
---|
88 | #define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
|
---|
89 | #define xfree(ptr) Xfree((pointer)(ptr))
|
---|
90 | #define xstrdup(s) Xstrdup(s)
|
---|
91 | #define xnfstrdup(s) XNFstrdup(s)
|
---|
92 | #endif
|
---|
93 |
|
---|
94 | #ifndef IN_MODULE
|
---|
95 | #ifdef SCO
|
---|
96 | #include <stdio.h>
|
---|
97 | #endif
|
---|
98 | #include <string.h>
|
---|
99 | #endif
|
---|
100 |
|
---|
101 | /* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */
|
---|
102 | #ifdef SIGNALRETURNSINT
|
---|
103 | #define SIGVAL int
|
---|
104 | #else
|
---|
105 | #define SIGVAL void
|
---|
106 | #endif
|
---|
107 |
|
---|
108 | extern Bool OsDelayInitColors;
|
---|
109 | extern void (*OsVendorVErrorFProc)(const char *, va_list args);
|
---|
110 |
|
---|
111 | extern int WaitForSomething(
|
---|
112 | #if NeedFunctionPrototypes
|
---|
113 | int* /*pClientsReady*/
|
---|
114 | #endif
|
---|
115 | );
|
---|
116 |
|
---|
117 | #ifdef LBX
|
---|
118 | #define ReadRequestFromClient(client) ((client)->readRequest(client))
|
---|
119 | extern int StandardReadRequestFromClient(
|
---|
120 | #if NeedFunctionPrototypes
|
---|
121 | ClientPtr /*client*/
|
---|
122 | #endif
|
---|
123 | );
|
---|
124 |
|
---|
125 | extern int ClientConnectionNumber(
|
---|
126 | #if NeedFunctionPrototypes
|
---|
127 | ClientPtr /*client*/
|
---|
128 | #endif
|
---|
129 | );
|
---|
130 | #else
|
---|
131 | extern int ReadRequestFromClient(
|
---|
132 | #if NeedFunctionPrototypes
|
---|
133 | ClientPtr /*client*/
|
---|
134 | #endif
|
---|
135 | );
|
---|
136 | #endif /* LBX */
|
---|
137 |
|
---|
138 | extern Bool InsertFakeRequest(
|
---|
139 | #if NeedFunctionPrototypes
|
---|
140 | ClientPtr /*client*/,
|
---|
141 | char* /*data*/,
|
---|
142 | int /*count*/
|
---|
143 | #endif
|
---|
144 | );
|
---|
145 |
|
---|
146 | extern void ResetCurrentRequest(
|
---|
147 | #if NeedFunctionPrototypes
|
---|
148 | ClientPtr /*client*/
|
---|
149 | #endif
|
---|
150 | );
|
---|
151 |
|
---|
152 | extern void FlushAllOutput(
|
---|
153 | #if NeedFunctionPrototypes
|
---|
154 | void
|
---|
155 | #endif
|
---|
156 | );
|
---|
157 |
|
---|
158 | extern void FlushIfCriticalOutputPending(
|
---|
159 | #if NeedFunctionPrototypes
|
---|
160 | void
|
---|
161 | #endif
|
---|
162 | );
|
---|
163 |
|
---|
164 | extern void SetCriticalOutputPending(
|
---|
165 | #if NeedFunctionPrototypes
|
---|
166 | void
|
---|
167 | #endif
|
---|
168 | );
|
---|
169 |
|
---|
170 | extern int WriteToClient(
|
---|
171 | #if NeedFunctionPrototypes
|
---|
172 | ClientPtr /*who*/,
|
---|
173 | int /*count*/,
|
---|
174 | char* /*buf*/
|
---|
175 | #endif
|
---|
176 | );
|
---|
177 |
|
---|
178 | extern void ResetOsBuffers(
|
---|
179 | #if NeedFunctionPrototypes
|
---|
180 | void
|
---|
181 | #endif
|
---|
182 | );
|
---|
183 |
|
---|
184 | extern void InitConnectionLimits(
|
---|
185 | #if NeedFunctionPrototypes
|
---|
186 | void
|
---|
187 | #endif
|
---|
188 | );
|
---|
189 |
|
---|
190 | extern void CreateWellKnownSockets(
|
---|
191 | #if NeedFunctionPrototypes
|
---|
192 | void
|
---|
193 | #endif
|
---|
194 | );
|
---|
195 |
|
---|
196 | extern void ResetWellKnownSockets(
|
---|
197 | #if NeedFunctionPrototypes
|
---|
198 | void
|
---|
199 | #endif
|
---|
200 | );
|
---|
201 |
|
---|
202 | extern void CloseWellKnownConnections(
|
---|
203 | #if NeedFunctionPrototypes
|
---|
204 | void
|
---|
205 | #endif
|
---|
206 | );
|
---|
207 |
|
---|
208 | extern XID
|
---|
209 | AuthorizationIDOfClient(
|
---|
210 | #if NeedFunctionPrototypes
|
---|
211 | ClientPtr /*client*/
|
---|
212 | #endif
|
---|
213 | );
|
---|
214 |
|
---|
215 | extern char *ClientAuthorized(
|
---|
216 | #if NeedFunctionPrototypes
|
---|
217 | ClientPtr /*client*/,
|
---|
218 | unsigned int /*proto_n*/,
|
---|
219 | char* /*auth_proto*/,
|
---|
220 | unsigned int /*string_n*/,
|
---|
221 | char* /*auth_string*/
|
---|
222 | #endif
|
---|
223 | );
|
---|
224 |
|
---|
225 | extern Bool EstablishNewConnections(
|
---|
226 | #if NeedFunctionPrototypes
|
---|
227 | ClientPtr /*clientUnused*/,
|
---|
228 | pointer /*closure*/
|
---|
229 | #endif
|
---|
230 | );
|
---|
231 |
|
---|
232 | extern void CheckConnections(
|
---|
233 | #if NeedFunctionPrototypes
|
---|
234 | void
|
---|
235 | #endif
|
---|
236 | );
|
---|
237 |
|
---|
238 | extern void CloseDownConnection(
|
---|
239 | #if NeedFunctionPrototypes
|
---|
240 | ClientPtr /*client*/
|
---|
241 | #endif
|
---|
242 | );
|
---|
243 |
|
---|
244 | extern void AddEnabledDevice(
|
---|
245 | #if NeedFunctionPrototypes
|
---|
246 | int /*fd*/
|
---|
247 | #endif
|
---|
248 | );
|
---|
249 |
|
---|
250 | extern void RemoveEnabledDevice(
|
---|
251 | #if NeedFunctionPrototypes
|
---|
252 | int /*fd*/
|
---|
253 | #endif
|
---|
254 | );
|
---|
255 |
|
---|
256 | extern void OnlyListenToOneClient(
|
---|
257 | #if NeedFunctionPrototypes
|
---|
258 | ClientPtr /*client*/
|
---|
259 | #endif
|
---|
260 | );
|
---|
261 |
|
---|
262 | extern void ListenToAllClients(
|
---|
263 | #if NeedFunctionPrototypes
|
---|
264 | void
|
---|
265 | #endif
|
---|
266 | );
|
---|
267 |
|
---|
268 | extern void IgnoreClient(
|
---|
269 | #if NeedFunctionPrototypes
|
---|
270 | ClientPtr /*client*/
|
---|
271 | #endif
|
---|
272 | );
|
---|
273 |
|
---|
274 | extern void AttendClient(
|
---|
275 | #if NeedFunctionPrototypes
|
---|
276 | ClientPtr /*client*/
|
---|
277 | #endif
|
---|
278 | );
|
---|
279 |
|
---|
280 | extern void MakeClientGrabImpervious(
|
---|
281 | #if NeedFunctionPrototypes
|
---|
282 | ClientPtr /*client*/
|
---|
283 | #endif
|
---|
284 | );
|
---|
285 |
|
---|
286 | extern void MakeClientGrabPervious(
|
---|
287 | #if NeedFunctionPrototypes
|
---|
288 | ClientPtr /*client*/
|
---|
289 | #endif
|
---|
290 | );
|
---|
291 |
|
---|
292 | #ifdef LBX
|
---|
293 | extern void CloseDownFileDescriptor(
|
---|
294 | #if NeedFunctionPrototypes
|
---|
295 | ClientPtr /* client */
|
---|
296 | #endif
|
---|
297 | );
|
---|
298 | #endif
|
---|
299 |
|
---|
300 | extern void AvailableClientInput(
|
---|
301 | #if NeedFunctionPrototypes
|
---|
302 | ClientPtr /* client */
|
---|
303 | #endif
|
---|
304 | );
|
---|
305 |
|
---|
306 | extern void Error(
|
---|
307 | #if NeedFunctionPrototypes
|
---|
308 | char* /*str*/
|
---|
309 | #endif
|
---|
310 | );
|
---|
311 |
|
---|
312 | extern CARD32 GetTimeInMillis(
|
---|
313 | #if NeedFunctionPrototypes
|
---|
314 | void
|
---|
315 | #endif
|
---|
316 | );
|
---|
317 |
|
---|
318 | extern void AdjustWaitForDelay(
|
---|
319 | #if NeedFunctionPrototypes
|
---|
320 | pointer /*waitTime*/,
|
---|
321 | unsigned long /*newdelay*/
|
---|
322 | #endif
|
---|
323 | );
|
---|
324 |
|
---|
325 | typedef struct _OsTimerRec *OsTimerPtr;
|
---|
326 |
|
---|
327 | typedef CARD32 (*OsTimerCallback)(
|
---|
328 | #if NeedFunctionPrototypes
|
---|
329 | OsTimerPtr /* timer */,
|
---|
330 | CARD32 /* time */,
|
---|
331 | pointer /* arg */
|
---|
332 | #endif
|
---|
333 | );
|
---|
334 |
|
---|
335 | extern void TimerInit(
|
---|
336 | #if NeedFunctionPrototypes
|
---|
337 | void
|
---|
338 | #endif
|
---|
339 | );
|
---|
340 |
|
---|
341 | extern Bool TimerForce(
|
---|
342 | #if NeedFunctionPrototypes
|
---|
343 | OsTimerPtr /* timer */
|
---|
344 | #endif
|
---|
345 | );
|
---|
346 |
|
---|
347 | #define TimerAbsolute (1<<0)
|
---|
348 | #define TimerForceOld (1<<1)
|
---|
349 |
|
---|
350 | extern OsTimerPtr TimerSet(
|
---|
351 | #if NeedFunctionPrototypes
|
---|
352 | OsTimerPtr /* timer */,
|
---|
353 | int /* flags */,
|
---|
354 | CARD32 /* millis */,
|
---|
355 | OsTimerCallback /* func */,
|
---|
356 | pointer /* arg */
|
---|
357 | #endif
|
---|
358 | );
|
---|
359 |
|
---|
360 | extern void TimerCheck(
|
---|
361 | #if NeedFunctionPrototypes
|
---|
362 | void
|
---|
363 | #endif
|
---|
364 | );
|
---|
365 |
|
---|
366 | extern void TimerCancel(
|
---|
367 | #if NeedFunctionPrototypes
|
---|
368 | OsTimerPtr /* pTimer */
|
---|
369 | #endif
|
---|
370 | );
|
---|
371 |
|
---|
372 | extern void TimerFree(
|
---|
373 | #if NeedFunctionPrototypes
|
---|
374 | OsTimerPtr /* pTimer */
|
---|
375 | #endif
|
---|
376 | );
|
---|
377 |
|
---|
378 | extern SIGVAL AutoResetServer(
|
---|
379 | #if NeedFunctionPrototypes
|
---|
380 | int /*sig*/
|
---|
381 | #endif
|
---|
382 | );
|
---|
383 |
|
---|
384 | extern SIGVAL GiveUp(
|
---|
385 | #if NeedFunctionPrototypes
|
---|
386 | int /*sig*/
|
---|
387 | #endif
|
---|
388 | );
|
---|
389 |
|
---|
390 | extern void UseMsg(
|
---|
391 | #if NeedFunctionPrototypes
|
---|
392 | void
|
---|
393 | #endif
|
---|
394 | );
|
---|
395 |
|
---|
396 | extern void ProcessCommandLine(
|
---|
397 | #if NeedFunctionPrototypes
|
---|
398 | int /*argc*/,
|
---|
399 | char* /*argv*/[]
|
---|
400 | #endif
|
---|
401 | );
|
---|
402 |
|
---|
403 | extern pointer Xalloc(
|
---|
404 | #if NeedFunctionPrototypes
|
---|
405 | unsigned long /*amount*/
|
---|
406 | #endif
|
---|
407 | );
|
---|
408 |
|
---|
409 | extern pointer XNFalloc(
|
---|
410 | #if NeedFunctionPrototypes
|
---|
411 | unsigned long /*amount*/
|
---|
412 | #endif
|
---|
413 | );
|
---|
414 |
|
---|
415 | extern pointer Xcalloc(
|
---|
416 | #if NeedFunctionPrototypes
|
---|
417 | unsigned long /*amount*/
|
---|
418 | #endif
|
---|
419 | );
|
---|
420 |
|
---|
421 | extern pointer XNFcalloc(
|
---|
422 | #if NeedFunctionPrototypes
|
---|
423 | unsigned long /*amount*/
|
---|
424 | #endif
|
---|
425 | );
|
---|
426 |
|
---|
427 | extern pointer Xrealloc(
|
---|
428 | #if NeedFunctionPrototypes
|
---|
429 | pointer /*ptr*/,
|
---|
430 | unsigned long /*amount*/
|
---|
431 | #endif
|
---|
432 | );
|
---|
433 |
|
---|
434 | extern pointer XNFrealloc(
|
---|
435 | #if NeedFunctionPrototypes
|
---|
436 | pointer /*ptr*/,
|
---|
437 | unsigned long /*amount*/
|
---|
438 | #endif
|
---|
439 | );
|
---|
440 |
|
---|
441 | extern void Xfree(
|
---|
442 | #if NeedFunctionPrototypes
|
---|
443 | pointer /*ptr*/
|
---|
444 | #endif
|
---|
445 | );
|
---|
446 |
|
---|
447 | extern void OsInitAllocator(
|
---|
448 | #if NeedFunctionPrototypes
|
---|
449 | void
|
---|
450 | #endif
|
---|
451 | );
|
---|
452 |
|
---|
453 | extern char *Xstrdup(const char *s);
|
---|
454 | extern char *XNFstrdup(const char *s);
|
---|
455 |
|
---|
456 | typedef SIGVAL (*OsSigHandlerPtr)(
|
---|
457 | #if NeedFunctionPrototypes
|
---|
458 | int /* sig */
|
---|
459 | #endif
|
---|
460 | );
|
---|
461 |
|
---|
462 | extern OsSigHandlerPtr OsSignal(
|
---|
463 | #if NeedFunctionPrototypes
|
---|
464 | int /* sig */,
|
---|
465 | OsSigHandlerPtr /* handler */
|
---|
466 | #endif
|
---|
467 | );
|
---|
468 |
|
---|
469 | extern int auditTrailLevel;
|
---|
470 |
|
---|
471 | extern void AuditPrefix(
|
---|
472 | #if NeedFunctionPrototypes
|
---|
473 | const char *
|
---|
474 | #endif
|
---|
475 | );
|
---|
476 |
|
---|
477 | extern void AuditF(
|
---|
478 | #if NeedVarargsPrototypes
|
---|
479 | const char* /*f*/,
|
---|
480 | ...
|
---|
481 | #endif
|
---|
482 | );
|
---|
483 |
|
---|
484 | extern void FatalError(
|
---|
485 | #if NeedVarargsPrototypes
|
---|
486 | const char* /*f*/,
|
---|
487 | ...
|
---|
488 | #endif
|
---|
489 | )
|
---|
490 | #if defined(__GNUC__) && \
|
---|
491 | ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
|
---|
492 | __attribute((noreturn))
|
---|
493 | #endif
|
---|
494 | ;
|
---|
495 |
|
---|
496 | extern void ErrorF(
|
---|
497 | #if NeedVarargsPrototypes
|
---|
498 | const char* /*f*/,
|
---|
499 | ...
|
---|
500 | #endif
|
---|
501 | );
|
---|
502 |
|
---|
503 | #if NeedVarargsPrototypes
|
---|
504 | extern void VErrorF(const char *f, va_list args);
|
---|
505 | #endif
|
---|
506 |
|
---|
507 | #ifdef SERVER_LOCK
|
---|
508 | extern void LockServer(
|
---|
509 | #if NeedFunctionPrototypes
|
---|
510 | void
|
---|
511 | #endif
|
---|
512 | );
|
---|
513 |
|
---|
514 | extern void UnlockServer(
|
---|
515 | #if NeedFunctionPrototypes
|
---|
516 | void
|
---|
517 | #endif
|
---|
518 | );
|
---|
519 | #endif
|
---|
520 |
|
---|
521 | extern int OsLookupColor(
|
---|
522 | #if NeedFunctionPrototypes
|
---|
523 | int /*screen*/,
|
---|
524 | char * /*name*/,
|
---|
525 | unsigned /*len*/,
|
---|
526 | unsigned short * /*pred*/,
|
---|
527 | unsigned short * /*pgreen*/,
|
---|
528 | unsigned short * /*pblue*/
|
---|
529 | #endif
|
---|
530 | );
|
---|
531 |
|
---|
532 | extern void OsInit(
|
---|
533 | #if NeedFunctionPrototypes
|
---|
534 | void
|
---|
535 | #endif
|
---|
536 | );
|
---|
537 |
|
---|
538 | extern void OsCleanup(
|
---|
539 | #if NeedFunctionPrototypes
|
---|
540 | void
|
---|
541 | #endif
|
---|
542 | );
|
---|
543 |
|
---|
544 | extern void OsVendorFatalError(
|
---|
545 | #if NeedFunctionPrototypes
|
---|
546 | void
|
---|
547 | #endif
|
---|
548 | );
|
---|
549 |
|
---|
550 | extern void OsVendorInit(
|
---|
551 | #if NeedFunctionPrototypes
|
---|
552 | void
|
---|
553 | #endif
|
---|
554 | );
|
---|
555 |
|
---|
556 | extern int OsInitColors(
|
---|
557 | #if NeedFunctionPrototypes
|
---|
558 | void
|
---|
559 | #endif
|
---|
560 | );
|
---|
561 |
|
---|
562 | void OsBlockSignals (
|
---|
563 | #if NeedFunctionPrototypes
|
---|
564 | void
|
---|
565 | #endif
|
---|
566 | );
|
---|
567 |
|
---|
568 | void OsReleaseSignals (
|
---|
569 | #if NeedFunctionPrototypes
|
---|
570 | void
|
---|
571 | #endif
|
---|
572 | );
|
---|
573 |
|
---|
574 | #if !defined(WIN32) && !defined(__UNIXOS2__)
|
---|
575 | extern int System(char *);
|
---|
576 | extern pointer Popen(char *, char *);
|
---|
577 | extern int Pclose(pointer);
|
---|
578 | #else
|
---|
579 | #define System(a) system(a)
|
---|
580 | #define Popen(a,b) popen(a,b)
|
---|
581 | #define Pclose(a) pclose(a)
|
---|
582 | #endif
|
---|
583 |
|
---|
584 | extern void CheckUserParameters(int argc, char **argv, char **envp);
|
---|
585 | extern void CheckUserAuthorization(void);
|
---|
586 |
|
---|
587 | extern int AddHost(
|
---|
588 | #if NeedFunctionPrototypes
|
---|
589 | ClientPtr /*client*/,
|
---|
590 | int /*family*/,
|
---|
591 | unsigned /*length*/,
|
---|
592 | pointer /*pAddr*/
|
---|
593 | #endif
|
---|
594 | );
|
---|
595 |
|
---|
596 | extern Bool ForEachHostInFamily (
|
---|
597 | #if NeedFunctionPrototypes
|
---|
598 | int /*family*/,
|
---|
599 | Bool (* /*func*/ )(
|
---|
600 | #if NeedNestedPrototypes
|
---|
601 | unsigned char * /* addr */,
|
---|
602 | short /* len */,
|
---|
603 | pointer /* closure */
|
---|
604 | #endif
|
---|
605 | ),
|
---|
606 | pointer /*closure*/
|
---|
607 | #endif
|
---|
608 | );
|
---|
609 |
|
---|
610 | extern int RemoveHost(
|
---|
611 | #if NeedFunctionPrototypes
|
---|
612 | ClientPtr /*client*/,
|
---|
613 | int /*family*/,
|
---|
614 | unsigned /*length*/,
|
---|
615 | pointer /*pAddr*/
|
---|
616 | #endif
|
---|
617 | );
|
---|
618 |
|
---|
619 | extern int GetHosts(
|
---|
620 | #if NeedFunctionPrototypes
|
---|
621 | pointer * /*data*/,
|
---|
622 | int * /*pnHosts*/,
|
---|
623 | int * /*pLen*/,
|
---|
624 | BOOL * /*pEnabled*/
|
---|
625 | #endif
|
---|
626 | );
|
---|
627 |
|
---|
628 | typedef struct sockaddr * sockaddrPtr;
|
---|
629 |
|
---|
630 | extern int InvalidHost(
|
---|
631 | #if NeedFunctionPrototypes
|
---|
632 | sockaddrPtr /*saddr*/,
|
---|
633 | int /*len*/
|
---|
634 | #endif
|
---|
635 | );
|
---|
636 |
|
---|
637 | extern int LocalClient(
|
---|
638 | #if NeedFunctionPrototypes
|
---|
639 | ClientPtr /* client */
|
---|
640 | #endif
|
---|
641 | );
|
---|
642 |
|
---|
643 | extern int LocalClientCred(ClientPtr, int *, int *);
|
---|
644 |
|
---|
645 | extern int ChangeAccessControl(
|
---|
646 | #if NeedFunctionPrototypes
|
---|
647 | ClientPtr /*client*/,
|
---|
648 | int /*fEnabled*/
|
---|
649 | #endif
|
---|
650 | );
|
---|
651 |
|
---|
652 | extern int GetAccessControl(
|
---|
653 | #if NeedFunctionPrototypes
|
---|
654 | void
|
---|
655 | #endif
|
---|
656 | );
|
---|
657 |
|
---|
658 |
|
---|
659 | extern void AddLocalHosts(
|
---|
660 | #if NeedFunctionPrototypes
|
---|
661 | void
|
---|
662 | #endif
|
---|
663 | );
|
---|
664 |
|
---|
665 | extern void ResetHosts(
|
---|
666 | #if NeedFunctionPrototypes
|
---|
667 | char *display
|
---|
668 | #endif
|
---|
669 | );
|
---|
670 |
|
---|
671 | extern void EnableLocalHost(
|
---|
672 | #if NeedFunctionPrototypes
|
---|
673 | void
|
---|
674 | #endif
|
---|
675 | );
|
---|
676 |
|
---|
677 | extern void DisableLocalHost(
|
---|
678 | #if NeedFunctionPrototypes
|
---|
679 | void
|
---|
680 | #endif
|
---|
681 | );
|
---|
682 |
|
---|
683 | extern void AccessUsingXdmcp(
|
---|
684 | #if NeedFunctionPrototypes
|
---|
685 | void
|
---|
686 | #endif
|
---|
687 | );
|
---|
688 |
|
---|
689 | extern void DefineSelf(
|
---|
690 | #if NeedFunctionPrototypes
|
---|
691 | int /*fd*/
|
---|
692 | #endif
|
---|
693 | );
|
---|
694 |
|
---|
695 | extern void AugmentSelf(
|
---|
696 | #if NeedFunctionPrototypes
|
---|
697 | pointer /*from*/,
|
---|
698 | int /*len*/
|
---|
699 | #endif
|
---|
700 | );
|
---|
701 |
|
---|
702 | extern void InitAuthorization(
|
---|
703 | #if NeedFunctionPrototypes
|
---|
704 | char * /*filename*/
|
---|
705 | #endif
|
---|
706 | );
|
---|
707 |
|
---|
708 | extern int LoadAuthorization(
|
---|
709 | #if NeedFunctionPrototypes
|
---|
710 | void
|
---|
711 | #endif
|
---|
712 | );
|
---|
713 |
|
---|
714 | extern void RegisterAuthorizations(
|
---|
715 | #if NeedFunctionPrototypes
|
---|
716 | void
|
---|
717 | #endif
|
---|
718 | );
|
---|
719 |
|
---|
720 | extern XID AuthorizationToID (
|
---|
721 | unsigned short name_length,
|
---|
722 | char *name,
|
---|
723 | unsigned short data_length,
|
---|
724 | char *data);
|
---|
725 |
|
---|
726 | extern int AuthorizationFromID (
|
---|
727 | XID id,
|
---|
728 | unsigned short *name_lenp,
|
---|
729 | char **namep,
|
---|
730 | unsigned short *data_lenp,
|
---|
731 | char **datap);
|
---|
732 |
|
---|
733 | extern XID CheckAuthorization(
|
---|
734 | #if NeedFunctionPrototypes
|
---|
735 | unsigned int /*namelength*/,
|
---|
736 | char * /*name*/,
|
---|
737 | unsigned int /*datalength*/,
|
---|
738 | char * /*data*/,
|
---|
739 | ClientPtr /*client*/,
|
---|
740 | char ** /*reason*/
|
---|
741 | #endif
|
---|
742 | );
|
---|
743 |
|
---|
744 | extern void ResetAuthorization(
|
---|
745 | #if NeedFunctionPrototypes
|
---|
746 | void
|
---|
747 | #endif
|
---|
748 | );
|
---|
749 |
|
---|
750 | extern int RemoveAuthorization (
|
---|
751 | unsigned short name_length,
|
---|
752 | char *name,
|
---|
753 | unsigned short data_length,
|
---|
754 | char *data);
|
---|
755 |
|
---|
756 | extern int AddAuthorization(
|
---|
757 | #if NeedFunctionPrototypes
|
---|
758 | unsigned int /*name_length*/,
|
---|
759 | char * /*name*/,
|
---|
760 | unsigned int /*data_length*/,
|
---|
761 | char * /*data*/
|
---|
762 | #endif
|
---|
763 | );
|
---|
764 |
|
---|
765 | extern XID GenerateAuthorization(
|
---|
766 | #if NeedFunctionPrototypes
|
---|
767 | unsigned int /* name_length */,
|
---|
768 | char * /* name */,
|
---|
769 | unsigned int /* data_length */,
|
---|
770 | char * /* data */,
|
---|
771 | unsigned int * /* data_length_return */,
|
---|
772 | char ** /* data_return */
|
---|
773 | #endif
|
---|
774 | );
|
---|
775 |
|
---|
776 | #ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
|
---|
777 | extern void ExpandCommandLine(
|
---|
778 | #if NeedFunctionPrototypes
|
---|
779 | int * /*pargc*/,
|
---|
780 | char *** /*pargv*/
|
---|
781 | #endif
|
---|
782 | );
|
---|
783 | #endif
|
---|
784 |
|
---|
785 | extern int ddxProcessArgument(
|
---|
786 | #if NeedFunctionPrototypes
|
---|
787 | int /*argc*/,
|
---|
788 | char * /*argv*/ [],
|
---|
789 | int /*i*/
|
---|
790 | #endif
|
---|
791 | );
|
---|
792 |
|
---|
793 | extern void ddxUseMsg(void);
|
---|
794 |
|
---|
795 | /*
|
---|
796 | * idiom processing stuff
|
---|
797 | */
|
---|
798 |
|
---|
799 | xReqPtr PeekNextRequest(
|
---|
800 | #if NeedFunctionPrototypes
|
---|
801 | xReqPtr req, ClientPtr client, Bool readmore
|
---|
802 | #endif
|
---|
803 | );
|
---|
804 |
|
---|
805 | void SkipRequests(
|
---|
806 | #if NeedFunctionPrototypes
|
---|
807 | xReqPtr req, ClientPtr client, int numskipped
|
---|
808 | #endif
|
---|
809 | );
|
---|
810 |
|
---|
811 | /* int ReqLen(xReq *req, ClientPtr client)
|
---|
812 | * Given a pointer to a *complete* request, return its length in bytes.
|
---|
813 | * Note that if the request is a big request (as defined in the Big
|
---|
814 | * Requests extension), the macro lies by returning 4 less than the
|
---|
815 | * length that it actually occupies in the request buffer. This is so you
|
---|
816 | * can blindly compare the length with the various sz_<request> constants
|
---|
817 | * in Xproto.h without having to know/care about big requests.
|
---|
818 | */
|
---|
819 | #define ReqLen(_pxReq, _client) \
|
---|
820 | ((_pxReq->length ? \
|
---|
821 | (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \
|
---|
822 | : ((_client->swapped ? \
|
---|
823 | lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \
|
---|
824 | ) << 2)
|
---|
825 |
|
---|
826 | /* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr)
|
---|
827 | * Cast the given request to one of type otherReqTypePtr to access
|
---|
828 | * fields beyond the length field.
|
---|
829 | */
|
---|
830 | #define CastxReq(_pxReq, otherReqTypePtr) \
|
---|
831 | (_pxReq->length ? (otherReqTypePtr)_pxReq \
|
---|
832 | : (otherReqTypePtr)(((CARD32*)_pxReq)+1))
|
---|
833 |
|
---|
834 | /* stuff for SkippedRequestsCallback */
|
---|
835 | extern CallbackListPtr SkippedRequestsCallback;
|
---|
836 | typedef struct {
|
---|
837 | xReqPtr req;
|
---|
838 | ClientPtr client;
|
---|
839 | int numskipped;
|
---|
840 | } SkippedRequestInfoRec;
|
---|
841 |
|
---|
842 | /* stuff for ReplyCallback */
|
---|
843 | extern CallbackListPtr ReplyCallback;
|
---|
844 | typedef struct {
|
---|
845 | ClientPtr client;
|
---|
846 | pointer replyData;
|
---|
847 | unsigned long dataLenBytes;
|
---|
848 | unsigned long bytesRemaining;
|
---|
849 | Bool startOfReply;
|
---|
850 | } ReplyInfoRec;
|
---|
851 |
|
---|
852 | /* stuff for FlushCallback */
|
---|
853 | extern CallbackListPtr FlushCallback;
|
---|
854 |
|
---|
855 | extern void AbortDDX(void);
|
---|
856 | extern void ddxGiveUp(void);
|
---|
857 | extern int TimeSinceLastInputEvent(void);
|
---|
858 |
|
---|
859 | #endif /* OS_H */
|
---|