Commit | Line | Data |
---|---|---|
e4a0e98e SC |
1 | #include <fcntl.h> |
2 | #include <errno.h> | |
3 | #include <stdio.h> | |
4 | #include <sys/types.h> | |
5 | #include <sys/stat.h> | |
6 | #include <ctype.h> | |
7 | #include <string.h> | |
8 | #include <sys/file.h> | |
dd6cc3c9 | 9 | #include <alloca.h> |
e4a0e98e SC |
10 | #ifndef O_ACCMODE |
11 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) | |
12 | #endif | |
13 | #define SEEK_SET 0 | |
14 | #define SEEK_CUR 1 | |
cb467682 | 15 | #ifdef __STDC__ |
458c4827 KR |
16 | #if __GNUC__ >= 2 |
17 | #define abort __hide_abort | |
18 | #define exit __hide_exit | |
19 | #endif | |
cb467682 | 20 | #include <stdlib.h> |
458c4827 KR |
21 | #undef exit |
22 | #undef abort | |
cb467682 SC |
23 | #include <string.h> |
24 | #else | |
302c8ab1 SC |
25 | extern char *EXFUN(mktemp,(CONST char*)); |
26 | extern int EXFUN(fflush,(FILE *)); | |
27 | extern int EXFUN(write,(int, CONST char *, int)); | |
28 | extern int EXFUN(index,(CONST char *, char c)); | |
29 | extern void EXFUN(abort,(void)); | |
30 | extern int EXFUN(close,(int)); | |
31 | extern int EXFUN(fcntl,(int des, int cmd, int e)); | |
32 | extern int EXFUN(fprintf,(FILE *,char *,...)); | |
33 | extern int EXFUN(printf,(char *,...)); | |
34 | extern int EXFUN(qsort,(void *data,int els, int siz, int func())); | |
35 | extern void EXFUN(exit,(int)); | |
36 | extern int EXFUN(fseek,(FILE*, int, int)); | |
37 | extern int EXFUN(fclose,(FILE*)); | |
38 | extern void EXFUN(bcopy,(char*,char*,int)); | |
39 | extern int EXFUN(bcmp,(char *, char *, int)); | |
40 | extern void EXFUN(bzero,(char *, int)); | |
41 | extern PTR EXFUN(memset,(PTR, int, int)); | |
42 | extern void EXFUN(puts,(CONST char*)); | |
43 | extern void EXFUN(fputs,(CONST char*,FILE*)); | |
44 | extern int EXFUN(rmdir,(CONST char *)); | |
45 | extern int EXFUN(getuid,(void)); | |
46 | extern int EXFUN(getgid,(void)); | |
47 | extern int EXFUN(rename,(CONST char *, CONST char*)); | |
48 | extern int EXFUN(etuid,()); | |
49 | extern int EXFUN(etgid,()); | |
50 | extern void EXFUN(perror,(CONST char *)); | |
51 | #ifndef DONTDECLARE_MALLOC | |
52 | extern PTR EXFUN(malloc,(unsigned)); | |
53 | extern PTR EXFUN(realloc, (PTR, unsigned)); | |
54 | #endif | |
55 | ||
d25efc25 | 56 | #ifndef __GNUC__ |
302c8ab1 | 57 | extern PTR EXFUN(memcpy,(PTR,CONST PTR,unsigned int)); |
d25efc25 | 58 | #else |
56a56f4c | 59 | /* char * EXFUN( memcpy,(char *,CONST char *,unsigned int)); */ |
d25efc25 SC |
60 | #endif |
61 | ||
147a251a | 62 | |
e4a0e98e | 63 | extern char * strchr(); |
e4a0e98e SC |
64 | extern char *getenv(); |
65 | extern char *memchr(); | |
66 | extern char *strrchr(); | |
67 | extern int chmod(); | |
68 | extern int fread(); | |
69 | extern int fstat(); | |
70 | extern int fwrite(); | |
71 | extern int sscanf(); | |
72 | extern int stat(); | |
73 | extern int strtol(); | |
179ca8db | 74 | extern int EXFUN(free,(PTR)); |
19b03b7a | 75 | |
ac677dad | 76 | |
e4a0e98e SC |
77 | extern char *strrchr(); |
78 | extern char *ctime(); | |
79 | extern int _flsbuf(); | |
80 | extern int fclose(); | |
81 | extern int time(); | |
82 | extern int utimes(); | |
83 | extern int vfprintf(); | |
84 | extern long atol(); | |
85 | extern char *getenv(); | |
86 | extern int fputc(); | |
87 | extern int unlink(); | |
cb467682 | 88 | #endif /* __STDC__ */ |
e4a0e98e SC |
89 | |
90 | /* EXACT TYPES */ | |
91 | typedef char int8e_type; | |
92 | typedef unsigned char uint8e_type; | |
93 | typedef short int16e_type; | |
94 | typedef unsigned short uint16e_type; | |
95 | typedef int int32e_type; | |
96 | typedef unsigned int uint32e_type; | |
97 | ||
19b03b7a SC |
98 | |
99 | #ifdef __GNUC__ | |
100 | typedef unsigned long long uint64e_type; | |
101 | ||
102 | #else | |
103 | typedef struct { | |
104 | uint32e_type low, high; | |
105 | } uint64e_type; | |
106 | ||
107 | #endif | |
e4a0e98e SC |
108 | /* CORRECT SIZE OR GREATER */ |
109 | typedef char int8_type; | |
110 | typedef unsigned char uint8_type; | |
111 | typedef short int16_type; | |
112 | typedef unsigned short uint16_type; | |
113 | typedef int int32_type; | |
114 | typedef unsigned int uint32_type; | |
115 | ||
19b03b7a SC |
116 | #ifdef __GNUC__ |
117 | typedef unsigned long long uint64_type; | |
118 | typedef long long int64_type; | |
119 | #else | |
120 | typedef struct { | |
121 | uint32e_type low, high; | |
122 | } uint64_type; | |
123 | ||
124 | typedef struct { | |
125 | uint32e_type low, high; | |
126 | } int64_type; | |
127 | ||
128 | #endif | |
129 | ||
130 | ||
131 | #define BYTES_IN_PRINTF_INT 4 | |
132 | #ifndef __GNUC__ | |
133 | #define uint64_typeLOW(x) (uint32_type)(((x).low)) | |
134 | #define uint64_typeHIGH(x) (uint32_type)(((x).high)) | |
135 | #else | |
136 | #define uint64_typeLOW(x) (uint32_type)(((x) & 0xffffffff)) | |
137 | #define uint64_typeHIGH(x) (uint32_type)(((x) >> 32) & 0xffffffff) | |
138 | #endif | |
147a251a SC |
139 | |
140 | ||
a5431adc | 141 | #include "fopen-same.h" |