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