VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/os.h

Last change on this file was 69098, checked in by vboxsync, 7 years ago

Clean up XFree86 driver header files.
bugref:3810: X11 Guest Additions maintenance
Over the years we have cleaned up the layout in the tree of the X.Org
header files we use to build drivers. The XFree86 ones were still in their
original, rather sub-optimal layout. This change fixes that.

  • Property svn:eol-style set to native
File size: 16.5 KB
Line 
1/* $XFree86: xc/programs/Xserver/include/os.h,v 3.43 2002/12/24 17:42:59 tsi 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
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
77typedef pointer FID;
78typedef struct _FontPathRec *FontPathPtr;
79typedef 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
108extern Bool OsDelayInitColors;
109extern void (*OsVendorVErrorFProc)(const char *, va_list args);
110
111extern int WaitForSomething(
112#if NeedFunctionPrototypes
113 int* /*pClientsReady*/
114#endif
115);
116
117#ifdef LBX
118#define ReadRequestFromClient(client) ((client)->readRequest(client))
119extern int StandardReadRequestFromClient(
120#if NeedFunctionPrototypes
121 ClientPtr /*client*/
122#endif
123);
124
125extern int ClientConnectionNumber(
126#if NeedFunctionPrototypes
127 ClientPtr /*client*/
128#endif
129);
130#else
131extern int ReadRequestFromClient(
132#if NeedFunctionPrototypes
133 ClientPtr /*client*/
134#endif
135);
136#endif /* LBX */
137
138extern Bool InsertFakeRequest(
139#if NeedFunctionPrototypes
140 ClientPtr /*client*/,
141 char* /*data*/,
142 int /*count*/
143#endif
144);
145
146extern void ResetCurrentRequest(
147#if NeedFunctionPrototypes
148 ClientPtr /*client*/
149#endif
150);
151
152extern void FlushAllOutput(
153#if NeedFunctionPrototypes
154 void
155#endif
156);
157
158extern void FlushIfCriticalOutputPending(
159#if NeedFunctionPrototypes
160 void
161#endif
162);
163
164extern void SetCriticalOutputPending(
165#if NeedFunctionPrototypes
166 void
167#endif
168);
169
170extern int WriteToClient(
171#if NeedFunctionPrototypes
172 ClientPtr /*who*/,
173 int /*count*/,
174 char* /*buf*/
175#endif
176);
177
178extern void ResetOsBuffers(
179#if NeedFunctionPrototypes
180 void
181#endif
182);
183
184extern void InitConnectionLimits(
185#if NeedFunctionPrototypes
186 void
187#endif
188);
189
190extern void CreateWellKnownSockets(
191#if NeedFunctionPrototypes
192 void
193#endif
194);
195
196extern void ResetWellKnownSockets(
197#if NeedFunctionPrototypes
198 void
199#endif
200);
201
202extern void CloseWellKnownConnections(
203#if NeedFunctionPrototypes
204 void
205#endif
206);
207
208extern XID
209AuthorizationIDOfClient(
210#if NeedFunctionPrototypes
211 ClientPtr /*client*/
212#endif
213);
214
215extern 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
225extern Bool EstablishNewConnections(
226#if NeedFunctionPrototypes
227 ClientPtr /*clientUnused*/,
228 pointer /*closure*/
229#endif
230);
231
232extern void CheckConnections(
233#if NeedFunctionPrototypes
234 void
235#endif
236);
237
238extern void CloseDownConnection(
239#if NeedFunctionPrototypes
240 ClientPtr /*client*/
241#endif
242);
243
244extern void AddEnabledDevice(
245#if NeedFunctionPrototypes
246 int /*fd*/
247#endif
248);
249
250extern void RemoveEnabledDevice(
251#if NeedFunctionPrototypes
252 int /*fd*/
253#endif
254);
255
256extern void OnlyListenToOneClient(
257#if NeedFunctionPrototypes
258 ClientPtr /*client*/
259#endif
260);
261
262extern void ListenToAllClients(
263#if NeedFunctionPrototypes
264 void
265#endif
266);
267
268extern void IgnoreClient(
269#if NeedFunctionPrototypes
270 ClientPtr /*client*/
271#endif
272);
273
274extern void AttendClient(
275#if NeedFunctionPrototypes
276 ClientPtr /*client*/
277#endif
278);
279
280extern void MakeClientGrabImpervious(
281#if NeedFunctionPrototypes
282 ClientPtr /*client*/
283#endif
284);
285
286extern void MakeClientGrabPervious(
287#if NeedFunctionPrototypes
288 ClientPtr /*client*/
289#endif
290);
291
292#ifdef LBX
293extern void CloseDownFileDescriptor(
294#if NeedFunctionPrototypes
295 ClientPtr /* client */
296#endif
297);
298#endif
299
300extern void AvailableClientInput(
301#if NeedFunctionPrototypes
302 ClientPtr /* client */
303#endif
304);
305
306extern void Error(
307#if NeedFunctionPrototypes
308 char* /*str*/
309#endif
310);
311
312extern CARD32 GetTimeInMillis(
313#if NeedFunctionPrototypes
314 void
315#endif
316);
317
318extern void AdjustWaitForDelay(
319#if NeedFunctionPrototypes
320 pointer /*waitTime*/,
321 unsigned long /*newdelay*/
322#endif
323);
324
325typedef struct _OsTimerRec *OsTimerPtr;
326
327typedef CARD32 (*OsTimerCallback)(
328#if NeedFunctionPrototypes
329 OsTimerPtr /* timer */,
330 CARD32 /* time */,
331 pointer /* arg */
332#endif
333);
334
335extern void TimerInit(
336#if NeedFunctionPrototypes
337 void
338#endif
339);
340
341extern Bool TimerForce(
342#if NeedFunctionPrototypes
343 OsTimerPtr /* timer */
344#endif
345);
346
347#define TimerAbsolute (1<<0)
348#define TimerForceOld (1<<1)
349
350extern OsTimerPtr TimerSet(
351#if NeedFunctionPrototypes
352 OsTimerPtr /* timer */,
353 int /* flags */,
354 CARD32 /* millis */,
355 OsTimerCallback /* func */,
356 pointer /* arg */
357#endif
358);
359
360extern void TimerCheck(
361#if NeedFunctionPrototypes
362 void
363#endif
364);
365
366extern void TimerCancel(
367#if NeedFunctionPrototypes
368 OsTimerPtr /* pTimer */
369#endif
370);
371
372extern void TimerFree(
373#if NeedFunctionPrototypes
374 OsTimerPtr /* pTimer */
375#endif
376);
377
378extern SIGVAL AutoResetServer(
379#if NeedFunctionPrototypes
380 int /*sig*/
381#endif
382);
383
384extern SIGVAL GiveUp(
385#if NeedFunctionPrototypes
386 int /*sig*/
387#endif
388);
389
390extern void UseMsg(
391#if NeedFunctionPrototypes
392 void
393#endif
394);
395
396extern void ProcessCommandLine(
397#if NeedFunctionPrototypes
398 int /*argc*/,
399 char* /*argv*/[]
400#endif
401);
402
403extern pointer Xalloc(
404#if NeedFunctionPrototypes
405 unsigned long /*amount*/
406#endif
407);
408
409extern pointer XNFalloc(
410#if NeedFunctionPrototypes
411 unsigned long /*amount*/
412#endif
413);
414
415extern pointer Xcalloc(
416#if NeedFunctionPrototypes
417 unsigned long /*amount*/
418#endif
419);
420
421extern pointer XNFcalloc(
422#if NeedFunctionPrototypes
423 unsigned long /*amount*/
424#endif
425);
426
427extern pointer Xrealloc(
428#if NeedFunctionPrototypes
429 pointer /*ptr*/,
430 unsigned long /*amount*/
431#endif
432);
433
434extern pointer XNFrealloc(
435#if NeedFunctionPrototypes
436 pointer /*ptr*/,
437 unsigned long /*amount*/
438#endif
439);
440
441extern void Xfree(
442#if NeedFunctionPrototypes
443 pointer /*ptr*/
444#endif
445);
446
447extern void OsInitAllocator(
448#if NeedFunctionPrototypes
449 void
450#endif
451);
452
453extern char *Xstrdup(const char *s);
454extern char *XNFstrdup(const char *s);
455
456typedef SIGVAL (*OsSigHandlerPtr)(
457#if NeedFunctionPrototypes
458 int /* sig */
459#endif
460);
461
462extern OsSigHandlerPtr OsSignal(
463#if NeedFunctionPrototypes
464 int /* sig */,
465 OsSigHandlerPtr /* handler */
466#endif
467);
468
469extern int auditTrailLevel;
470
471extern void AuditPrefix(
472#if NeedFunctionPrototypes
473 const char *
474#endif
475);
476
477extern void AuditF(
478#if NeedVarargsPrototypes
479 const char* /*f*/,
480 ...
481#endif
482);
483
484extern 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
496extern void ErrorF(
497#if NeedVarargsPrototypes
498 const char* /*f*/,
499 ...
500#endif
501);
502
503#if NeedVarargsPrototypes
504extern void VErrorF(const char *f, va_list args);
505#endif
506
507#ifdef SERVER_LOCK
508extern void LockServer(
509#if NeedFunctionPrototypes
510 void
511#endif
512);
513
514extern void UnlockServer(
515#if NeedFunctionPrototypes
516 void
517#endif
518);
519#endif
520
521extern 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
532extern void OsInit(
533#if NeedFunctionPrototypes
534 void
535#endif
536);
537
538extern void OsCleanup(
539#if NeedFunctionPrototypes
540 void
541#endif
542);
543
544extern void OsVendorFatalError(
545#if NeedFunctionPrototypes
546 void
547#endif
548);
549
550extern void OsVendorInit(
551#if NeedFunctionPrototypes
552 void
553#endif
554);
555
556extern int OsInitColors(
557#if NeedFunctionPrototypes
558 void
559#endif
560);
561
562void OsBlockSignals (
563#if NeedFunctionPrototypes
564 void
565#endif
566 );
567
568void OsReleaseSignals (
569#if NeedFunctionPrototypes
570 void
571#endif
572 );
573
574#if !defined(WIN32) && !defined(__UNIXOS2__)
575extern int System(char *);
576extern pointer Popen(char *, char *);
577extern 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
584extern void CheckUserParameters(int argc, char **argv, char **envp);
585extern void CheckUserAuthorization(void);
586
587extern int AddHost(
588#if NeedFunctionPrototypes
589 ClientPtr /*client*/,
590 int /*family*/,
591 unsigned /*length*/,
592 pointer /*pAddr*/
593#endif
594);
595
596extern 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
610extern int RemoveHost(
611#if NeedFunctionPrototypes
612 ClientPtr /*client*/,
613 int /*family*/,
614 unsigned /*length*/,
615 pointer /*pAddr*/
616#endif
617);
618
619extern int GetHosts(
620#if NeedFunctionPrototypes
621 pointer * /*data*/,
622 int * /*pnHosts*/,
623 int * /*pLen*/,
624 BOOL * /*pEnabled*/
625#endif
626);
627
628typedef struct sockaddr * sockaddrPtr;
629
630extern int InvalidHost(
631#if NeedFunctionPrototypes
632 sockaddrPtr /*saddr*/,
633 int /*len*/
634#endif
635);
636
637extern int LocalClient(
638#if NeedFunctionPrototypes
639 ClientPtr /* client */
640#endif
641);
642
643extern int LocalClientCred(ClientPtr, int *, int *);
644
645extern int ChangeAccessControl(
646#if NeedFunctionPrototypes
647 ClientPtr /*client*/,
648 int /*fEnabled*/
649#endif
650);
651
652extern int GetAccessControl(
653#if NeedFunctionPrototypes
654 void
655#endif
656);
657
658
659extern void AddLocalHosts(
660#if NeedFunctionPrototypes
661 void
662#endif
663);
664
665extern void ResetHosts(
666#if NeedFunctionPrototypes
667 char *display
668#endif
669);
670
671extern void EnableLocalHost(
672#if NeedFunctionPrototypes
673 void
674#endif
675);
676
677extern void DisableLocalHost(
678#if NeedFunctionPrototypes
679 void
680#endif
681);
682
683extern void AccessUsingXdmcp(
684#if NeedFunctionPrototypes
685 void
686#endif
687);
688
689extern void DefineSelf(
690#if NeedFunctionPrototypes
691 int /*fd*/
692#endif
693);
694
695extern void AugmentSelf(
696#if NeedFunctionPrototypes
697 pointer /*from*/,
698 int /*len*/
699#endif
700);
701
702extern void InitAuthorization(
703#if NeedFunctionPrototypes
704 char * /*filename*/
705#endif
706);
707
708extern int LoadAuthorization(
709#if NeedFunctionPrototypes
710 void
711#endif
712);
713
714extern void RegisterAuthorizations(
715#if NeedFunctionPrototypes
716 void
717#endif
718);
719
720extern XID AuthorizationToID (
721 unsigned short name_length,
722 char *name,
723 unsigned short data_length,
724 char *data);
725
726extern int AuthorizationFromID (
727 XID id,
728 unsigned short *name_lenp,
729 char **namep,
730 unsigned short *data_lenp,
731 char **datap);
732
733extern 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
744extern void ResetAuthorization(
745#if NeedFunctionPrototypes
746 void
747#endif
748);
749
750extern int RemoveAuthorization (
751 unsigned short name_length,
752 char *name,
753 unsigned short data_length,
754 char *data);
755
756extern 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
765extern 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
777extern void ExpandCommandLine(
778#if NeedFunctionPrototypes
779 int * /*pargc*/,
780 char *** /*pargv*/
781#endif
782);
783#endif
784
785extern int ddxProcessArgument(
786#if NeedFunctionPrototypes
787 int /*argc*/,
788 char * /*argv*/ [],
789 int /*i*/
790#endif
791);
792
793extern void ddxUseMsg(void);
794
795/*
796 * idiom processing stuff
797 */
798
799xReqPtr PeekNextRequest(
800#if NeedFunctionPrototypes
801 xReqPtr req, ClientPtr client, Bool readmore
802#endif
803);
804
805void 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 */
835extern CallbackListPtr SkippedRequestsCallback;
836typedef struct {
837 xReqPtr req;
838 ClientPtr client;
839 int numskipped;
840} SkippedRequestInfoRec;
841
842/* stuff for ReplyCallback */
843extern CallbackListPtr ReplyCallback;
844typedef 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 */
853extern CallbackListPtr FlushCallback;
854
855extern void AbortDDX(void);
856extern void ddxGiveUp(void);
857extern int TimeSinceLastInputEvent(void);
858
859#endif /* OS_H */
Note: See TracBrowser for help on using the repository browser.

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