VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/xf86_ansic.h@ 35398

最後變更 在這個檔案從35398是 35398,由 vboxsync 提交於 14 年 前

re-applied r69255, r69257: properly wrap mem* to xf86mem* for older XF86 modules

  • 屬性 svn:eol-style 設為 native
檔案大小: 11.0 KB
 
1/*
2 * Copyright 1997-2003 by The XFree86 Project, Inc
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the names of the above listed copyright holders
9 * not be used in advertising or publicity pertaining to distribution of
10 * the software without specific, written prior permission. The above listed
11 * copyright holders make no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * THE ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
16 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17 * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDERS BE
18 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
19 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
21 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 */
24
25#ifndef _XF86_ANSIC_H
26#define _XF86_ANSIC_H
27
28/* Handle <stdarg.h> */
29
30#ifndef __OS2ELF__
31# include <stdarg.h>
32#else /* __OS2ELF__ */
33 /* EMX/gcc_elf under OS/2 does not have native header files */
34# if !defined (_VA_LIST)
35# define _VA_LIST
36 typedef char *va_list;
37# endif
38# define _VA_ROUND(t) ((sizeof (t) + 3) & -4)
39# if !defined (va_start)
40# define va_start(ap,v) ap = (va_list)&v + ((sizeof (v) + 3) & -4)
41# define va_end(ap) (ap = 0, (void)0)
42# define va_arg(ap,t) (ap += _VA_ROUND (t), *(t *)(ap - _VA_ROUND (t)))
43# endif
44#endif /* __OS2ELF__ */
45
46/*
47 * The first set of definitions are required both for modules and
48 * libc_wrapper.c.
49 */
50
51#if !defined(SYSV) && !defined(SVR4) && !defined(Lynx) || \
52 defined(__SCO__) || defined(__UNIXWARE__)
53#define HAVE_VSSCANF
54#define HAVE_VFSCANF
55#endif
56
57#ifndef NULL
58#if (defined(SVR4) || defined(SYSV)) && !defined(__GNUC__)
59#define NULL 0
60#else
61#define NULL ((void *)0)
62#endif
63#endif
64#ifndef EOF
65#define EOF (-1)
66#endif
67
68#ifndef PATH_MAX
69#define PATH_MAX 1024
70#endif
71
72/* <limits.h> stuff */
73#define x_BITSPERBYTE 8
74#define x_BITS(type) (x_BITSPERBYTE * (int)sizeof(type))
75#define x_SHORTBITS x_BITS(short)
76#define x_INTBITS x_BITS(int)
77#define x_LONGBITS x_BITS(long)
78#ifndef SHRT_MIN
79#define SHRT_MIN ((short)(1 << (x_SHORTBITS - 1)))
80#endif
81
82#ifndef FONTMODULE
83#include "misc.h"
84#endif
85#include "xf86_libc.h"
86#ifndef SHRT_MAX
87#define SHRT_MAX ((short)~SHRT_MIN)
88#endif
89#ifndef USHRT_MAX
90#define USHRT_MAX ((unsigned short)~0)
91#endif
92#ifndef MINSHORT
93#define MINSHORT SHRT_MIN
94#endif
95#ifndef MAXSHORT
96#define MAXSHORT SHRT_MAX
97#endif
98#ifndef INT_MIN
99#define INT_MIN (1 << (x_INTBITS - 1))
100#endif
101#ifndef INT_MAX
102#define INT_MAX (~INT_MIN)
103#endif
104#ifndef UINT_MAX
105#define UINT_MAX (~0)
106#endif
107#ifndef MININT
108#define MININT INT_MIN
109#endif
110#ifndef MAXINT
111#define MAXINT INT_MAX
112#endif
113#ifndef LONG_MIN
114#define LONG_MIN ((long)(1 << (x_LONGBITS - 1)))
115#endif
116#ifndef LONG_MAX
117#define LONG_MAX ((long)~LONG_MIN)
118#endif
119#ifndef ULONG_MAX
120#define ULONG_MAX ((unsigned long)~0UL)
121#endif
122#ifndef MINLONG
123#define MINLONG LONG_MIN
124#endif
125#ifndef MAXLONG
126#define MAXLONG LONG_MAX
127#endif
128
129/*
130 * ANSI C compilers only.
131 */
132
133/* ANSI C emulation library */
134
135extern void xf86abort(void);
136extern int xf86abs(int);
137extern double xf86acos(double);
138extern double xf86asin(double);
139extern double xf86atan(double);
140extern double xf86atan2(double,double);
141extern double xf86atof(const char*);
142extern int xf86atoi(const char*);
143extern long xf86atol(const char*);
144extern void *xf86bsearch(const void *, const void *, xf86size_t, xf86size_t,
145 int (*)(const void *, const void *));
146extern double xf86ceil(double);
147extern void* xf86calloc(xf86size_t,xf86size_t);
148extern void xf86clearerr(XF86FILE*);
149extern double xf86cos(double);
150extern void xf86exit(int);
151extern double xf86exp(double);
152extern double xf86fabs(double);
153extern int xf86fclose(XF86FILE*);
154extern int xf86feof(XF86FILE*);
155extern int xf86ferror(XF86FILE*);
156extern int xf86fflush(XF86FILE*);
157extern int xf86fgetc(XF86FILE*);
158extern int xf86getc(XF86FILE*);
159extern int xf86fgetpos(XF86FILE*,XF86fpos_t*);
160extern char* xf86fgets(char*,INT32,XF86FILE*);
161extern int xf86finite(double);
162extern double xf86floor(double);
163extern double xf86fmod(double,double);
164extern XF86FILE* xf86fopen(const char*,const char*);
165extern double xf86frexp(double, int*);
166extern int xf86printf(const char*,...);
167extern int xf86fprintf(XF86FILE*,const char*,...);
168extern int xf86fputc(int,XF86FILE*);
169extern int xf86fputs(const char*,XF86FILE*);
170extern xf86size_t xf86fread(void*,xf86size_t,xf86size_t,XF86FILE*);
171extern void xf86free(void*);
172extern XF86FILE* xf86freopen(const char*,const char*,XF86FILE*);
173#if defined(HAVE_VFSCANF) || !defined(NEED_XF86_PROTOTYPES)
174extern int xf86fscanf(XF86FILE*,const char*,...);
175#else
176extern int xf86fscanf(/*XF86FILE*,const char*,char *,char *,char *,char *,
177 char *,char *,char *,char *,char *,char * */);
178#endif
179extern int xf86fseek(XF86FILE*,long,int);
180extern int xf86fsetpos(XF86FILE*,const XF86fpos_t*);
181extern long xf86ftell(XF86FILE*);
182extern xf86size_t xf86fwrite(const void*,xf86size_t,xf86size_t,XF86FILE*);
183extern char* xf86getenv(const char*);
184extern int xf86isalnum(int);
185extern int xf86isalpha(int);
186extern int xf86iscntrl(int);
187extern int xf86isdigit(int);
188extern int xf86isgraph(int);
189extern int xf86islower(int);
190extern int xf86isprint(int);
191extern int xf86ispunct(int);
192extern int xf86isspace(int);
193extern int xf86isupper(int);
194extern int xf86isxdigit(int);
195extern long xf86labs(long);
196extern double xf86ldexp(double,int);
197extern double xf86log(double);
198extern double xf86log10(double);
199extern void* xf86malloc(xf86size_t);
200extern void* xf86memchr(const void*,int,xf86size_t);
201extern int xf86memcmp(const void*,const void*,xf86size_t);
202extern void* xf86memcpy(void*,const void*,xf86size_t);
203extern void* xf86memmove(void*,const void*,xf86size_t);
204extern void* xf86memset(void*,int,xf86size_t);
205extern double xf86modf(double,double*);
206extern void xf86perror(const char*);
207extern double xf86pow(double,double);
208extern void xf86qsort(void*, xf86size_t, xf86size_t,
209 int(*)(const void*, const void*));
210extern void* xf86realloc(void*,xf86size_t);
211extern long xf86random(void);
212extern int xf86remove(const char*);
213extern int xf86rename(const char*,const char*);
214extern void xf86rewind(XF86FILE*);
215extern int xf86setbuf(XF86FILE*,char*);
216extern int xf86setvbuf(XF86FILE*,char*,int,xf86size_t);
217extern double xf86sin(double);
218extern int xf86sprintf(char*,const char*,...);
219extern int xf86snprintf(char*,xf86size_t,const char*,...);
220extern double xf86sqrt(double);
221#if defined(HAVE_VSSCANF) || !defined(NEED_XF86_PROTOTYPES)
222extern int xf86sscanf(char*,const char*,...);
223#else
224extern int xf86sscanf(/*char*,const char*,char *,char *,char *,char *,
225 char *,char *,char *,char *,char *,char * */);
226#endif
227extern char* xf86strcat(char*,const char*);
228extern char* xf86strchr(const char*, int c);
229extern int xf86strcmp(const char*,const char*);
230extern int xf86strcasecmp(const char*,const char*);
231extern char* xf86strcpy(char*,const char*);
232extern xf86size_t xf86strcspn(const char*,const char*);
233extern char* xf86strerror(int);
234extern xf86size_t xf86strlcat(char*,const char*,xf86size_t);
235extern xf86size_t xf86strlcpy(char*,const char*,xf86size_t);
236extern xf86size_t xf86strlen(const char*);
237extern char* xf86strncat(char *, const char *, xf86size_t);
238extern int xf86strncmp(const char*,const char*,xf86size_t);
239extern int xf86strncasecmp(const char*,const char*,xf86size_t);
240extern char* xf86strncpy(char*,const char*,xf86size_t);
241extern char* xf86strpbrk(const char*,const char*);
242extern char* xf86strrchr(const char*,int);
243extern xf86size_t xf86strspn(const char*,const char*);
244extern char* xf86strstr(const char*,const char*);
245extern double xf86strtod(const char*,char**);
246extern char* xf86strtok(char*,const char*);
247extern long xf86strtol(const char*,char**,int);
248extern unsigned long xf86strtoul(const char*,char**,int);
249extern double xf86tan(double);
250extern XF86FILE* xf86tmpfile(void);
251extern char* xf86tmpnam(char*);
252extern int xf86tolower(int);
253extern int xf86toupper(int);
254extern int xf86ungetc(int,XF86FILE*);
255extern int xf86vfprintf(XF86FILE*,const char*,va_list);
256extern int xf86vsprintf(char*,const char*,va_list);
257extern int xf86vsnprintf(char*,xf86size_t,const char*,va_list);
258
259extern int xf86open(const char*, int,...);
260extern int xf86close(int);
261extern long xf86lseek(int, long, int);
262extern int xf86ioctl(int, unsigned long, pointer);
263extern xf86ssize_t xf86read(int, void *, xf86size_t);
264extern xf86ssize_t xf86write(int, const void *, xf86size_t);
265extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */);
266extern int xf86munmap(void*, xf86size_t);
267extern int xf86stat(const char *, struct xf86stat_s *);
268extern int xf86fstat(int, struct xf86stat_s *);
269extern int xf86access(const char *, int);
270extern int xf86errno;
271extern int xf86GetErrno(void);
272
273extern double xf86HUGE_VAL;
274
275extern double xf86hypot(double,double);
276
277/* non-ANSI C functions */
278extern XF86DIR* xf86opendir(const char*);
279extern int xf86closedir(XF86DIR*);
280extern XF86DIRENT* xf86readdir(XF86DIR*);
281extern void xf86rewinddir(XF86DIR*);
282extern void xf86bcopy(const void*,void*,xf86size_t);
283extern int xf86ffs(int);
284extern char* xf86strdup(const char*);
285extern void xf86bzero(void*,unsigned int);
286extern int xf86execl(const char *, const char *, ...);
287extern long xf86fpossize(void);
288extern int xf86chmod(const char *, xf86mode_t);
289extern int xf86chown(const char *, xf86uid_t, xf86gid_t);
290extern xf86uid_t xf86geteuid(void);
291extern xf86gid_t xf86getegid(void);
292extern int xf86getpid(void);
293extern int xf86mknod(const char *, xf86mode_t, xf86dev_t);
294extern int xf86mkdir(const char *, xf86mode_t);
295unsigned int xf86sleep(unsigned int seconds);
296/* sysv IPC */
297extern int xf86shmget(xf86key_t key, int size, int xf86shmflg);
298extern char * xf86shmat(int id, char *addr, int xf86shmflg);
299extern int xf86shmdt(char *addr);
300extern int xf86shmctl(int id, int xf86cmd, pointer buf);
301
302extern int xf86setjmp(xf86jmp_buf env);
303extern int xf86setjmp0(xf86jmp_buf env);
304extern int xf86setjmp1(xf86jmp_buf env, int);
305extern int xf86setjmp1_arg2(void);
306extern int xf86setjmperror(xf86jmp_buf env);
307extern int xf86getjmptype(void);
308extern void xf86longjmp(xf86jmp_buf env, int val);
309#define xf86setjmp_macro(env) \
310 (xf86getjmptype() == 0 ? xf86setjmp0((env)) : \
311 (xf86getjmptype() == 1 ? xf86setjmp1((env), xf86setjmp1_arg2()) : \
312 xf86setjmperror((env))))
313
314/*
315 * These things are always required by drivers (but not by libc_wrapper.c),
316 * even for a static server because some OSs don't provide them.
317 */
318
319extern int xf86getpagesize(void);
320extern void xf86usleep(unsigned long);
321extern void xf86getsecs(long *, long *);
322#ifndef DONT_DEFINE_WRAPPERS
323#undef getpagesize
324#define getpagesize() xf86getpagesize()
325#undef usleep
326#define usleep(ul) xf86usleep(ul)
327#undef getsecs
328#define getsecs(a, b) xf86getsecs(a, b)
329#endif
330#endif /* _XF86_ANSIC_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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