~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/xfree86/os-support/xf86_libc.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XdotOrg: xserver/xorg/hw/xfree86/os-support/xf86_libc.h,v 1.9 2005/08/24 11:18:31 daniels Exp $ */
 
2
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.63 2003/12/08 21:46:55 alanh Exp $ */
 
3
/*
 
4
 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
 
5
 *
 
6
 * Permission is hereby granted, free of charge, to any person obtaining a
 
7
 * copy of this software and associated documentation files (the "Software"),
 
8
 * to deal in the Software without restriction, including without limitation
 
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
10
 * and/or sell copies of the Software, and to permit persons to whom the
 
11
 * Software is furnished to do so, subject to the following conditions:
 
12
 *
 
13
 * The above copyright notice and this permission notice shall be included in
 
14
 * all copies or substantial portions of the Software.
 
15
 *
 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
19
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
20
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
21
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
22
 * OTHER DEALINGS IN THE SOFTWARE.
 
23
 *
 
24
 * Except as contained in this notice, the name of the copyright holder(s)
 
25
 * and author(s) shall not be used in advertising or otherwise to promote
 
26
 * the sale, use or other dealings in this Software without prior written
 
27
 * authorization from the copyright holder(s) and author(s).
 
28
 */
 
29
 
 
30
/*
 
31
 * This file is an attempt to make developing code for the new loadable module
 
32
 * architecure simpler. It tries to use macros to hide all libc wrappers so
 
33
 * that all that is needed to "port" a module to this architecture is to
 
34
 * include this one header file
 
35
 *
 
36
 * Revision history:
 
37
 *
 
38
 *
 
39
 * 0.4  Apr 12 1997     add the ANSI defines
 
40
 * 0.3  Feb 24 1997     handle getenv
 
41
 * 0.2  Feb 24 1997     hide few FILE functions
 
42
 * 0.1  Feb 24 1997     hide the trivial functions mem* str*
 
43
 */
 
44
 
 
45
#ifndef XF86_LIBC_H
 
46
#define XF86_LIBC_H 1
 
47
 
 
48
#include <X11/Xfuncs.h>
 
49
#include <stddef.h>
 
50
 
 
51
/*
 
52
 * The first set of definitions are required both for modules and
 
53
 * libc_wrapper.c.
 
54
 */
 
55
 
 
56
#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
 
57
 
 
58
/*
 
59
 * First, the new data types
 
60
 *
 
61
 * note: if some pointer is declared "opaque" here, pass it between
 
62
 * xf86* functions only, and don't rely on it having a whatever internal
 
63
 * structure, even if some source file might reveal the existence of
 
64
 * such a structure.
 
65
 */
 
66
typedef void XF86FILE;          /* opaque FILE replacement */
 
67
extern  XF86FILE* xf86stdin;
 
68
extern  XF86FILE* xf86stdout;
 
69
extern  XF86FILE* xf86stderr;
 
70
 
 
71
typedef void XF86fpos_t;        /* opaque fpos_t replacement */
 
72
 
 
73
#define _XF86NAMELEN    263     /* enough for a larger filename */
 
74
                                /* (divisble by 8) */
 
75
typedef void XF86DIR;           /* opaque DIR replacement */
 
76
 
 
77
/* Note: the following is POSIX! POSIX only requires the d_name member. 
 
78
 * Normal Unix has often a number of other members, but don't rely on that
 
79
 */
 
80
struct _xf86dirent {            /* types in struct dirent/direct: */
 
81
        char    d_name[_XF86NAMELEN+1]; /* char [MAXNAMLEN]; might be smaller or unaligned */
 
82
};
 
83
typedef struct _xf86dirent XF86DIRENT;
 
84
 
 
85
typedef unsigned long xf86size_t;
 
86
typedef signed long xf86ssize_t;
 
87
typedef unsigned long xf86dev_t;
 
88
typedef unsigned int xf86mode_t;
 
89
typedef unsigned int xf86uid_t;
 
90
typedef unsigned int xf86gid_t;
 
91
 
 
92
struct xf86stat {
 
93
    xf86dev_t st_rdev;  /* This is incomplete, and makes assumptions */
 
94
};
 
95
 
 
96
/* sysv IPC */
 
97
typedef int xf86key_t;
 
98
 
 
99
/* setjmp/longjmp */
 
100
#if defined(__ia64__)
 
101
typedef int xf86jmp_buf[1024] __attribute__ ((aligned (16))); /* guarantees 128-bit alignment! */
 
102
#else
 
103
typedef int xf86jmp_buf[1024];
 
104
#endif
 
105
 
 
106
/* for setvbuf */
 
107
#define XF86_IONBF    1
 
108
#define XF86_IOFBF    2
 
109
#define XF86_IOLBF    3
 
110
 
 
111
/* for open (XXX not complete) */
 
112
#define XF86_O_RDONLY   0x0000
 
113
#define XF86_O_WRONLY   0x0001
 
114
#define XF86_O_RDWR     0x0002
 
115
#define XF86_O_CREAT    0x0200
 
116
 
 
117
/* for mmap */
 
118
#define XF86_PROT_EXEC          0x0001
 
119
#define XF86_PROT_READ          0x0002
 
120
#define XF86_PROT_WRITE         0x0004
 
121
#define XF86_PROT_NONE          0x0008
 
122
#define XF86_MAP_FIXED          0x0001
 
123
#define XF86_MAP_SHARED         0x0002
 
124
#define XF86_MAP_PRIVATE        0x0004
 
125
#define XF86_MAP_32BIT          0x0040
 
126
#define XF86_MAP_FAILED         ((void *)-1)
 
127
 
 
128
/* for fseek */
 
129
#define XF86_SEEK_SET   0
 
130
#define XF86_SEEK_CUR   1
 
131
#define XF86_SEEK_END   2
 
132
 
 
133
/* for access */
 
134
#define XF86_R_OK       0
 
135
#define XF86_W_OK       1
 
136
#define XF86_X_OK       2
 
137
#define XF86_F_OK       3
 
138
 
 
139
/* for chmod */
 
140
#define XF86_S_ISUID   04000 /* set user ID on execution */
 
141
#define XF86_S_ISGID   02000 /* set group ID on execution */
 
142
#define XF86_S_ISVTX   01000 /* sticky bit */
 
143
#define XF86_S_IRUSR   00400 /* read by owner */
 
144
#define XF86_S_IWUSR   00200 /* write by owner */
 
145
#define XF86_S_IXUSR   00100 /* execute/search by owner */
 
146
#define XF86_S_IRGRP   00040 /* read by group */
 
147
#define XF86_S_IWGRP   00020 /* write by group */
 
148
#define XF86_S_IXGRP   00010 /* execute/search by group */
 
149
#define XF86_S_IROTH   00004 /* read by others */
 
150
#define XF86_S_IWOTH   00002 /* write by others */
 
151
#define XF86_S_IXOTH   00001 /* execute/search by others */
 
152
 
 
153
/* for mknod */
 
154
#define XF86_S_IFREG 0010000
 
155
#define XF86_S_IFCHR 0020000
 
156
#define XF86_S_IFBLK 0040000
 
157
#define XF86_S_IFIFO 0100000
 
158
 
 
159
/*
 
160
 * errno values
 
161
 * They start at 1000 just so they don't match real errnos at all
 
162
 */
 
163
#define xf86_UNKNOWN            1000
 
164
#define xf86_EACCES             1001
 
165
#define xf86_EAGAIN             1002
 
166
#define xf86_EBADF              1003
 
167
#define xf86_EEXIST             1004
 
168
#define xf86_EFAULT             1005
 
169
#define xf86_EINTR              1006
 
170
#define xf86_EINVAL             1007
 
171
#define xf86_EISDIR             1008
 
172
#define xf86_ELOOP              1009
 
173
#define xf86_EMFILE             1010
 
174
#define xf86_ENAMETOOLONG       1011
 
175
#define xf86_ENFILE             1012
 
176
#define xf86_ENOENT             1013
 
177
#define xf86_ENOMEM             1014
 
178
#define xf86_ENOSPC             1015
 
179
#define xf86_ENOTDIR            1016
 
180
#define xf86_EPIPE              1017
 
181
#define xf86_EROFS              1018
 
182
#define xf86_ETXTBSY            1019
 
183
#define xf86_ENOTTY             1020
 
184
#define xf86_ENOSYS             1021
 
185
#define xf86_EBUSY              1022
 
186
#define xf86_ENODEV             1023
 
187
#define xf86_EIO                1024
 
188
 
 
189
#define xf86_ESRCH              1025
 
190
#define xf86_ENXIO              1026
 
191
#define xf86_E2BIG              1027
 
192
#define xf86_ENOEXEC            1028
 
193
#define xf86_ECHILD             1029
 
194
#define xf86_ENOTBLK            1030
 
195
#define xf86_EXDEV              1031
 
196
#define xf86_EFBIG              1032
 
197
#define xf86_ESPIPE             1033
 
198
#define xf86_EMLINK             1034
 
199
#define xf86_EDOM               1035
 
200
#define xf86_ERANGE             1036
 
201
 
 
202
 
 
203
/* sysv IPV */
 
204
/* xf86shmget() */
 
205
#define XF86IPC_CREAT  01000
 
206
#define XF86IPC_EXCL   02000
 
207
#define XF86IPC_NOWAIT 04000
 
208
#define XF86SHM_R           0400         
 
209
#define XF86SHM_W           0200            
 
210
#define XF86IPC_PRIVATE ((xf86key_t)0)
 
211
/* xf86shmat() */
 
212
#define XF86SHM_RDONLY      010000      /* attach read-only else read-write */
 
213
#define XF86SHM_RND         020000      /* round attach address to SHMLBA */
 
214
#define XF86SHM_REMAP       040000      /* take-over region on attach */
 
215
/* xf86shmclt() */
 
216
#define XF86IPC_RMID 0
 
217
 
 
218
#endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */
 
219
 
 
220
/*
 
221
 * the rest of this file should only be included for code that is supposed
 
222
 * to go into modules
 
223
 */
 
224
 
 
225
#if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS)
 
226
 
 
227
#undef abort
 
228
#define abort()                 xf86abort()
 
229
#undef abs
 
230
#define abs(i)                  xf86abs(i)
 
231
#undef acos
 
232
#define acos(d)                 xf86acos(d)
 
233
#undef asin
 
234
#define asin(d)                 xf86asin(d)
 
235
#undef atan
 
236
#define atan(d)                 xf86atan(d)
 
237
#undef atan2
 
238
#define atan2(d1,d2)            xf86atan2(d1,d2)
 
239
#undef atof
 
240
#define atof(ccp)               xf86atof(ccp)
 
241
#undef atoi
 
242
#define atoi(ccp)               xf86atoi(ccp)
 
243
#undef atol
 
244
#define atol(ccp)               xf86atol(ccp)
 
245
#undef bsearch
 
246
#define bsearch(a,b,c,d,e)      xf86bsearch(a,b,c,d,e)
 
247
#undef ceil
 
248
#define ceil(d)                 xf86ceil(d)
 
249
#undef calloc
 
250
#define calloc(I1,I2)           xf86calloc(I1,I2)
 
251
#undef clearerr
 
252
#define clearerr(FP)            xf86clearerr(FP)
 
253
#undef cos
 
254
#define cos(d)                  xf86cos(d)
 
255
#undef exit
 
256
#define exit(i)                 xf86exit(i)
 
257
#undef exp
 
258
#define exp(d)                  xf86exp(d)
 
259
#undef fabs
 
260
#define fabs(d)                 xf86fabs(d)
 
261
#undef fclose
 
262
#define fclose(FP)              xf86fclose(FP)
 
263
#undef feof
 
264
#define feof(FP)                xf86feof(FP)
 
265
#undef ferror
 
266
#define ferror(FP)              xf86ferror(FP)
 
267
#undef fflush
 
268
#define fflush(FP)              xf86fflush(FP)
 
269
#undef fgetc
 
270
#define fgetc(FP)               xf86fgetc(FP)
 
271
#undef getc
 
272
#define getc(FP)                xf86getc(FP)
 
273
#undef fgetpos
 
274
#define fgetpos(FP,fpp)         xf86fgetpos(FP,fpp)
 
275
#undef fgets
 
276
#define fgets(cp,i,FP)          xf86fgets(cp,i,FP)
 
277
#undef finite
 
278
#define finite(d)               xf86finite(d)
 
279
#undef floor
 
280
#define floor(d)                xf86floor(d)
 
281
#undef fmod
 
282
#define fmod(d1,d2)             xf86fmod(d1,d2)
 
283
#undef fopen
 
284
#define fopen(ccp1,ccp2)        xf86fopen(ccp1,ccp2)
 
285
#undef printf
 
286
#define printf                  xf86printf
 
287
#undef fprintf
 
288
#define fprintf                 xf86fprintf
 
289
#undef fputc
 
290
#define fputc(i,FP)             xf86fputc(i,FP)
 
291
#undef fputs
 
292
#define fputs(ccp,FP)           xf86fputs(ccp,FP)
 
293
#undef fread
 
294
#define fread(vp,I1,I2,FP)      xf86fread(vp,I1,I2,FP)
 
295
#undef free
 
296
#define free(vp)                xf86free(vp)
 
297
#undef freopen
 
298
#define freopen(ccp1,ccp2,FP)   xf86freopen(ccp1,ccp2,FP)
 
299
#undef frexp
 
300
#define frexp(x,exp)            xf86frexp(x,exp)
 
301
#undef fscanf
 
302
#define fscanf                  xf86fscanf
 
303
#undef fseek
 
304
#define fseek(FP,l,i)           xf86fseek(FP,l,i)
 
305
#undef fsetpos
 
306
#define fsetpos(FP,cfpp)        xf86fsetpos(FP,cfpp)
 
307
#undef ftell
 
308
#define ftell(FP)               xf86ftell(FP)
 
309
#undef fwrite
 
310
#define fwrite(cvp,I1,I2,FP)    xf86fwrite(cvp,I1,I2,FP)
 
311
#undef getenv
 
312
#define getenv(ccp)             xf86getenv(ccp)
 
313
#undef isalnum
 
314
#define isalnum(i)              xf86isalnum(i)
 
315
#undef isalpha
 
316
#define isalpha(i)              xf86isalpha(i)
 
317
#undef iscntrl
 
318
#define iscntrl(i)              xf86iscntrl(i)
 
319
#undef isdigit
 
320
#define isdigit(i)              xf86isdigit(i)
 
321
#undef isgraph
 
322
#define isgraph(i)              xf86isgraph(i)
 
323
#undef islower
 
324
#define islower(i)              xf86islower(i)
 
325
#undef isprint
 
326
#define isprint(i)              xf86isprint(i)
 
327
#undef ispunct
 
328
#define ispunct(i)              xf86ispunct(i)
 
329
#undef isspace
 
330
#define isspace(i)              xf86isspace(i)
 
331
#undef isupper
 
332
#define isupper(i)              xf86isupper(i)
 
333
#undef isxdigit
 
334
#define isxdigit(i)             xf86isxdigit(i)
 
335
#undef labs
 
336
#define labs(l)                 xf86labs(l)
 
337
#undef ldexp
 
338
#define ldexp(x, exp)           xf86ldexp(x, exp)
 
339
#undef log
 
340
#define log(d)                  xf86log(d)
 
341
#undef log10
 
342
#define log10(d)                xf86log10(d)
 
343
#undef malloc
 
344
#define malloc(I)               xf86malloc(I)
 
345
#undef memchr
 
346
#define memchr(cvp,i,I)         xf86memchr(cvp,i,I)
 
347
#undef memcmp
 
348
#define memcmp(cvp1,cvp2,I)     xf86memcmp(cvp1,cvp2,I)
 
349
#undef memcpy
 
350
#define memcpy(vp,cvp,I)        xf86memcpy(vp,cvp,I)
 
351
#undef memmove
 
352
#define memmove(vp,cvp,I)       xf86memmove(vp,cvp,I)
 
353
#undef memset
 
354
#define memset(vp,int,I)        xf86memset(vp,int,I)
 
355
#undef modf
 
356
#define modf(d,dp)              xf86modf(d,dp)
 
357
#undef perror
 
358
#define perror(ccp)             xf86perror(ccp)
 
359
#undef pow
 
360
#define pow(d1,d2)              xf86pow(d1,d2)
 
361
#undef realloc
 
362
#define realloc(vp,I)           xf86realloc(vp,I)
 
363
#undef remove
 
364
#define remove(ccp)             xf86remove(ccp)
 
365
#undef rename
 
366
#define rename(ccp1,ccp2)       xf86rename(ccp1,ccp2)
 
367
#undef rewind
 
368
#define rewind(FP)              xf86rewind(FP)
 
369
#undef setbuf
 
370
#define setbuf(FP,cp)           xf86setbuf(FP,cp)
 
371
#undef setvbuf
 
372
#define setvbuf(FP,cp,i,I)      xf86setvbuf(FP,cp,i,I)
 
373
#undef sin
 
374
#define sin(d)                  xf86sin(d)
 
375
#undef snprintf
 
376
#define snprintf                xf86snprintf
 
377
#undef sprintf
 
378
#define sprintf                 xf86sprintf
 
379
#undef sqrt
 
380
#define sqrt(d)                 xf86sqrt(d)
 
381
#undef sscanf
 
382
#define sscanf                  xf86sscanf
 
383
#undef strcat
 
384
#define strcat(cp,ccp)          xf86strcat(cp,ccp)
 
385
#undef strcmp
 
386
#define strcmp(ccp1,ccp2)       xf86strcmp(ccp1,ccp2)
 
387
#undef strcasecmp
 
388
#define strcasecmp(ccp1,ccp2)   xf86strcasecmp(ccp1,ccp2)
 
389
#undef strcpy
 
390
#define strcpy(cp,ccp)          xf86strcpy(cp,ccp)
 
391
#undef strcspn
 
392
#define strcspn(ccp1,ccp2)      xf86strcspn(ccp1,ccp2)
 
393
#undef strerror
 
394
#define strerror(i)             xf86strerror(i)
 
395
#undef strlcat
 
396
#define strlcat(cp,ccp,I)       xf86strlcat(cp,ccp,I)
 
397
#undef strlcpy
 
398
#define strlcpy(cp,ccp,I)       xf86strlcpy(cp,ccp,I)
 
399
#undef strlen
 
400
#define strlen(ccp)             xf86strlen(ccp)
 
401
#undef strncmp
 
402
#define strncmp(ccp1,ccp2,I)    xf86strncmp(ccp1,ccp2,I)
 
403
#undef strncasecmp
 
404
#define strncasecmp(ccp1,ccp2,I) xf86strncasecmp(ccp1,ccp2,I)
 
405
#undef strncpy
 
406
#define strncpy(cp,ccp,I)       xf86strncpy(cp,ccp,I)
 
407
#undef strpbrk
 
408
#define strpbrk(ccp1,ccp2)      xf86strpbrk(ccp1,ccp2)
 
409
#undef strchr
 
410
#define strchr(ccp,i)           xf86strchr(ccp,i)
 
411
#undef strrchr
 
412
#define strrchr(ccp,i)          xf86strrchr(ccp,i)
 
413
#undef strspn
 
414
#define strspn(ccp1,ccp2)       xf86strspn(ccp1,ccp2)
 
415
#undef strstr
 
416
#define strstr(ccp1,ccp2)       xf86strstr(ccp1,ccp2)
 
417
#undef srttod
 
418
#define strtod(ccp,cpp)         xf86strtod(ccp,cpp)
 
419
#undef strtok
 
420
#define strtok(cp,ccp)          xf86strtok(cp,ccp)
 
421
#undef strtol
 
422
#define strtol(ccp,cpp,i)       xf86strtol(ccp,cpp,i)
 
423
#undef strtoul
 
424
#define strtoul(ccp,cpp,i)      xf86strtoul(ccp,cpp,i)
 
425
#undef tan
 
426
#define tan(d)                  xf86tan(d)
 
427
#undef tmpfile
 
428
#define tmpfile()               xf86tmpfile()
 
429
#undef tolower
 
430
#define tolower(i)              xf86tolower(i)
 
431
#undef toupper
 
432
#define toupper(i)              xf86toupper(i)
 
433
#undef ungetc
 
434
#define ungetc(i,FP)            xf86ungetc(i,FP)
 
435
#undef vfprinf
 
436
#define vfprintf(p,f,a)         xf86vfprintf(p,f,a)
 
437
#undef vsnprintf
 
438
#define vsnprintf(s,n,f,a)      xf86vsnprintf(s,n,f,a)
 
439
#undef vsprintf
 
440
#define vsprintf(s,f,a)         xf86vsprintf(s,f,a)
 
441
/* XXX Disable assert as if NDEBUG was defined */
 
442
/* Some X headers defined this away too */
 
443
#undef assert
 
444
#define assert(a)               ((void)0)
 
445
#undef HUGE_VAL
 
446
#define HUGE_VAL                xf86HUGE_VAL
 
447
 
 
448
#undef hypot
 
449
#define hypot(x,y)              xf86hypot(x,y)
 
450
 
 
451
#undef qsort
 
452
#define qsort(b, n, s, f)       xf86qsort(b, n, s, f)
 
453
 
 
454
/* non-ANSI C functions */
 
455
#undef opendir
 
456
#define opendir(cp)             xf86opendir(cp)
 
457
#undef closedir
 
458
#define closedir(DP)            xf86closedir(DP)
 
459
#undef readdir
 
460
#define readdir(DP)             xf86readdir(DP)
 
461
#undef rewinddir
 
462
#define rewinddir(DP)           xf86rewinddir(DP)
 
463
#undef bcopy
 
464
#define bcopy(vp,cvp,I)         xf86memmove(cvp,vp,I)
 
465
#undef ffs
 
466
#define ffs(i)                  xf86ffs(i)
 
467
#undef strdup
 
468
#define strdup(ccp)             xf86strdup(ccp)
 
469
#undef bzero
 
470
#define bzero(vp,ui)            xf86bzero(vp,ui)
 
471
#undef execl
 
472
#define execl                   xf86execl
 
473
#undef chmod
 
474
#define chmod(a,b)              xf86chmod(a,b)
 
475
#undef chown
 
476
#define chown(a,b,c)            xf86chown(a,b,c)
 
477
#undef geteuid
 
478
#define geteuid                 xf86geteuid
 
479
#undef getegid
 
480
#define getegid                 xf86getegid
 
481
#undef getpid
 
482
#define getpid                  xf86getpid
 
483
#undef mknod
 
484
#define mknod(a,b,c)            xf86mknod(a,b,c)
 
485
#undef sleep
 
486
#define sleep(a)                xf86sleep(a)
 
487
#undef mkdir
 
488
#define mkdir(a,b)              xf86mkdir(a,b)
 
489
#undef getpagesize
 
490
#define getpagesize             xf86getpagesize
 
491
#undef shmget
 
492
#define shmget(a,b,c)           xf86shmget(a,b,c)
 
493
#undef shmat
 
494
#define shmat(a,b,c)            xf86shmat(a,b,c)
 
495
#undef shmdt
 
496
#define shmdt(a)                xf86shmdt(a)
 
497
#undef shmctl
 
498
#define shmctl(a,b,c)           xf86shmctl(a,b,c)
 
499
 
 
500
#undef S_ISUID
 
501
#define S_ISUID XF86_S_ISUID
 
502
#undef S_ISGID
 
503
#define S_ISGID XF86_S_ISGID
 
504
#undef S_ISVTX
 
505
#define S_ISVTX XF86_S_ISVTX
 
506
#undef S_IRUSR
 
507
#define S_IRUSR XF86_S_IRUSR
 
508
#undef S_IWUSR
 
509
#define S_IWUSR XF86_S_IWUSR
 
510
#undef S_IXUSR
 
511
#define S_IXUSR XF86_S_IXUSR
 
512
#undef S_IRGRP
 
513
#define S_IRGRP XF86_S_IRGRP
 
514
#undef S_IWGRP
 
515
#define S_IWGRP XF86_S_IWGRP
 
516
#undef S_IXGRP
 
517
#define S_IXGRP XF86_S_IXGRP
 
518
#undef S_IROTH
 
519
#define S_IROTH XF86_S_IROTH
 
520
#undef S_IWOTH
 
521
#define S_IWOTH XF86_S_IWOTH
 
522
#undef S_IXOTH
 
523
#define S_IXOTH XF86_S_IXOTH
 
524
#undef S_IFREG
 
525
#define S_IFREG XF86_S_IFREG
 
526
#undef S_IFCHR
 
527
#define S_IFCHR XF86_S_IFCHR
 
528
#undef S_IFBLK
 
529
#define S_IFBLK XF86_S_IFBLK
 
530
#undef S_IFIFO
 
531
#define S_IFIFO XF86_S_IFIFO
 
532
 
 
533
/* some types */
 
534
#undef FILE
 
535
#define FILE                    XF86FILE
 
536
#undef fpos_t
 
537
#define fpos_t                  XF86fpos_t
 
538
#undef DIR
 
539
#define DIR                     XF86DIR
 
540
#undef DIRENT
 
541
#define DIRENT                  XF86DIRENT
 
542
#undef size_t
 
543
#define size_t                  xf86size_t
 
544
#undef ssize_t
 
545
#define ssize_t                 xf86ssize_t
 
546
#undef dev_t
 
547
#define dev_t                   xf86dev_t
 
548
#undef mode_t
 
549
#define mode_t                  xf86mode_t
 
550
#undef uid_t
 
551
#define uid_t                   xf86uid_t
 
552
#undef gid_t
 
553
#define gid_t                   xf86gid_t
 
554
#undef stat_t
 
555
#define stat_t                  struct xf86stat
 
556
 
 
557
#undef ulong
 
558
#define ulong                   unsigned long
 
559
 
 
560
/*
 
561
 * There should be no need to #undef any of these.  If they are already
 
562
 * defined it is because some illegal header has been included.
 
563
 */
 
564
 
 
565
/* some vars */
 
566
#undef stdin
 
567
#define stdin                   xf86stdin
 
568
#undef stdout
 
569
#define stdout                  xf86stdout
 
570
#undef stderr
 
571
#define stderr                  xf86stderr
 
572
 
 
573
#undef SEEK_SET
 
574
#define SEEK_SET                XF86_SEEK_SET
 
575
#undef SEEK_CUR
 
576
#define SEEK_CUR                XF86_SEEK_CUR
 
577
#undef SEEK_END
 
578
#define SEEK_END                XF86_SEEK_END
 
579
 
 
580
/*
 
581
 * XXX Basic I/O functions BAD,BAD,BAD!
 
582
 */
 
583
#define open                    xf86open
 
584
#define close(a)                xf86close(a)
 
585
#define lseek(a,b,c)            xf86lseek(a,b,c)
 
586
#if !defined(__DragonFly__)
 
587
#define ioctl(a,b,c)            xf86ioctl(a,b,c)
 
588
#endif
 
589
#define read(a,b,c)             xf86read(a,b,c)
 
590
#define write(a,b,c)            xf86write(a,b,c)
 
591
#define mmap(a,b,c,d,e,f)       xf86mmap(a,b,c,d,e,f)
 
592
#define munmap(a,b)             xf86munmap(a,b)
 
593
#define stat(a,b)               xf86stat(a,b)
 
594
#define fstat(a,b)              xf86fstat(a,b)
 
595
#define access(a,b)             xf86access(a,b)
 
596
#undef O_RDONLY
 
597
#define O_RDONLY                XF86_O_RDONLY
 
598
#undef O_WRONLY
 
599
#define O_WRONLY                XF86_O_WRONLY
 
600
#undef O_RDWR
 
601
#define O_RDWR                  XF86_O_RDWR
 
602
#undef O_CREAT
 
603
#define O_CREAT                 XF86_O_CREAT
 
604
#undef PROT_EXEC
 
605
#define PROT_EXEC               XF86_PROT_EXEC
 
606
#undef PROT_READ
 
607
#define PROT_READ               XF86_PROT_READ
 
608
#undef PROT_WRITE
 
609
#define PROT_WRITE              XF86_PROT_WRITE
 
610
#undef PROT_NONE
 
611
#define PROT_NONE               XF86_PROT_NONE
 
612
#undef MAP_FIXED
 
613
#define MAP_FIXED               XF86_MAP_FIXED
 
614
#undef MAP_SHARED
 
615
#define MAP_SHARED              XF86_MAP_SHARED
 
616
#undef MAP_PRIVATE
 
617
#define MAP_PRIVATE             XF86_MAP_PRIVATE
 
618
#undef MAP_FAILED
 
619
#define MAP_FAILED              XF86_MAP_FAILED
 
620
#undef R_OK
 
621
#define R_OK                    XF86_R_OK
 
622
#undef W_OK
 
623
#define W_OK                    XF86_W_OK
 
624
#undef X_OK
 
625
#define X_OK                    XF86_X_OK
 
626
#undef F_OK
 
627
#define F_OK                    XF86_F_OK
 
628
#undef errno
 
629
#define errno                   xf86errno
 
630
#undef putchar
 
631
#define putchar(i)              xf86fputc(i, xf86stdout)
 
632
#undef puts
 
633
#define puts(s)                 xf86fputs(s, xf86stdout)
 
634
 
 
635
#undef EACCES
 
636
#define EACCES          xf86_EACCES
 
637
#undef EAGAIN
 
638
#define EAGAIN          xf86_EAGAIN
 
639
#undef EBADF
 
640
#define EBADF           xf86_EBADF
 
641
#undef EEXIST
 
642
#define EEXIST          xf86_EEXIST
 
643
#undef EFAULT
 
644
#define EFAULT          xf86_EFAULT
 
645
#undef EINTR
 
646
#define EINTR           xf86_EINTR
 
647
#undef EINVAL
 
648
#define EINVAL          xf86_EINVAL
 
649
#undef EISDIR
 
650
#define EISDIR          xf86_EISDIR
 
651
#undef ELOOP
 
652
#define ELOOP           xf86_ELOOP
 
653
#undef EMFILE
 
654
#define EMFILE          xf86_EMFILE
 
655
#undef ENAMETOOLONG
 
656
#define ENAMETOOLONG    xf86_ENAMETOOLONG
 
657
#undef ENFILE
 
658
#define ENFILE          xf86_ENFILE
 
659
#undef ENOENT
 
660
#define ENOENT          xf86_ENOENT
 
661
#undef ENOMEM
 
662
#define ENOMEM          xf86_ENOMEM
 
663
#undef ENOSPC
 
664
#define ENOSPC          xf86_ENOSPC
 
665
#undef ENOTDIR
 
666
#define ENOTDIR         xf86_ENOTDIR
 
667
#undef EPIPE
 
668
#define EPIPE           xf86_EPIPE
 
669
#undef EROFS
 
670
#define EROFS           xf86_EROFS
 
671
#undef ETXTBSY
 
672
#define ETXTBSY         xf86_ETXTBSY
 
673
#undef ENOTTY
 
674
#define ENOTTY          xf86_ENOTTY
 
675
#undef ENOSYS
 
676
#define ENOSYS          xf86_ENOSYS
 
677
#undef EBUSY
 
678
#define EBUSY           xf86_EBUSY
 
679
#undef ENODEV
 
680
#define ENODEV          xf86_ENODEV
 
681
#undef EIO
 
682
#define EIO             xf86_EIO
 
683
 
 
684
/* IPC stuff */
 
685
#undef SHM_RDONLY
 
686
#define SHM_RDONLY XF86SHM_RDONLY
 
687
#undef SHM_RND
 
688
#define SHM_RND XF86SHM_RND
 
689
#undef SHM_REMAP
 
690
#define SHM_REMAP XF86SHM_REMAP
 
691
#undef IPC_RMID
 
692
#define IPC_RMID XF86IPC_RMID
 
693
#undef IPC_CREAT
 
694
#define IPC_CREAT XF86IPC_CREAT
 
695
#undef IPC_EXCL
 
696
#define IPC_EXCL XF86IPC_EXCL
 
697
#undef PC_NOWAIT
 
698
#define IPC_NOWAIT XF86IPC_NOWAIT
 
699
#undef SHM_R
 
700
#define SHM_R XF86SHM_R
 
701
#undef SHM_W
 
702
#define SHM_W XF86SHM_W
 
703
#undef IPC_PRIVATE
 
704
#define IPC_PRIVATE XF86IPC_PRIVATE
 
705
 
 
706
/* Some ANSI macros */
 
707
#undef FILENAME_MAX
 
708
#define FILENAME_MAX            1024
 
709
 
 
710
#if (defined(sun) && defined(__SVR4)) 
 
711
# define _FILEDEFED /* Already have FILE defined, don't redefine it */
 
712
#endif
 
713
 
 
714
#endif /* XFree86LOADER  && !DONT_DEFINE_WRAPPERS */
 
715
 
 
716
#if defined(XFree86LOADER) && \
 
717
    (!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS))
 
718
#undef setjmp
 
719
#define setjmp(a)               xf86setjmp_macro(a)
 
720
#undef longjmp
 
721
#define longjmp(a,b)            xf86longjmp(a,b) 
 
722
#undef jmp_buf
 
723
#define jmp_buf                 xf86jmp_buf
 
724
#endif
 
725
 
 
726
#endif /* XF86_LIBC_H */