1 | /* stdio.h (emx+gcc) */
|
---|
2 |
|
---|
3 | #ifndef _STDIO_H
|
---|
4 | #define _STDIO_H
|
---|
5 |
|
---|
6 | #if defined (__cplusplus)
|
---|
7 | extern "C" {
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #if !defined (_SIZE_T)
|
---|
11 | #define _SIZE_T
|
---|
12 | typedef unsigned long size_t;
|
---|
13 | #endif
|
---|
14 |
|
---|
15 | #if !defined (NULL)
|
---|
16 | #if defined (__cplusplus)
|
---|
17 | #define NULL 0
|
---|
18 | #else
|
---|
19 | #define NULL ((void *)0)
|
---|
20 | #endif
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | #if !defined (BUFSIZ)
|
---|
24 | #define BUFSIZ 5120
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | #if !defined (_FILE_T)
|
---|
28 | #define _FILE_T
|
---|
29 | #define _FILE_MEMBERS_HAVE_UNDERSCORE
|
---|
30 | struct _file2;
|
---|
31 | struct _FILE
|
---|
32 | {
|
---|
33 | char * _ptr;
|
---|
34 | char * _buffer;
|
---|
35 | int _rcount;
|
---|
36 | int _wcount;
|
---|
37 | int _handle;
|
---|
38 | int _flags;
|
---|
39 | int _buf_size;
|
---|
40 | int _tmpidx;
|
---|
41 | int _pid;
|
---|
42 | char _char_buf;
|
---|
43 | unsigned char _ungetc_count;
|
---|
44 | short _mbstate;
|
---|
45 | int (*_flush)(struct _FILE *, int);
|
---|
46 | struct _file2 *_more;
|
---|
47 | };
|
---|
48 |
|
---|
49 | typedef struct _FILE FILE;
|
---|
50 |
|
---|
51 | extern FILE _streamv[];
|
---|
52 |
|
---|
53 | #define stdin (&_streamv[0])
|
---|
54 | #define stdout (&_streamv[1])
|
---|
55 | #define stderr (&_streamv[2])
|
---|
56 |
|
---|
57 | #endif
|
---|
58 |
|
---|
59 | #if !defined (SEEK_SET)
|
---|
60 | #define SEEK_SET 0
|
---|
61 | #define SEEK_CUR 1
|
---|
62 | #define SEEK_END 2
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | #if !defined (EOF)
|
---|
66 | #define EOF (-1)
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | #if !defined (_IOREAD)
|
---|
70 | #define _IOREAD 0x01
|
---|
71 | #define _IOWRT 0x02
|
---|
72 | #define _IORW 0x04
|
---|
73 | #define _IOEOF 0x08
|
---|
74 | #define _IOERR 0x10
|
---|
75 | #define _IOFBF 0x00
|
---|
76 | #define _IOLBF 0x20
|
---|
77 | #define _IONBF 0x40
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | #if !defined (FOPEN_MAX)
|
---|
81 | #define FOPEN_MAX 14
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | #if !defined (FILENAME_MAX)
|
---|
85 | #define FILENAME_MAX 260
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #if !defined (TMP_MAX)
|
---|
89 | #define TMP_MAX 1000
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #if !defined (P_tmpdir)
|
---|
93 | #define P_tmpdir "."
|
---|
94 | #define L_tmpnam (sizeof (P_tmpdir) + 13)
|
---|
95 | #endif
|
---|
96 |
|
---|
97 | #if !defined (L_cuserid)
|
---|
98 | #define L_cuserid 9
|
---|
99 | #endif
|
---|
100 |
|
---|
101 | #if !defined (_FPOS_T)
|
---|
102 | #define _FPOS_T
|
---|
103 | typedef struct
|
---|
104 | {
|
---|
105 | long _pos;
|
---|
106 | long _reserved1;
|
---|
107 | short _mbstate;
|
---|
108 | short _reserved2;
|
---|
109 | } fpos_t;
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | #if !defined (_VA_LIST)
|
---|
113 | #define _VA_LIST
|
---|
114 | typedef __builtin_va_list va_list;
|
---|
115 | #endif
|
---|
116 |
|
---|
117 | void clearerr (FILE *);
|
---|
118 | int fclose (FILE *);
|
---|
119 | int feof (FILE *);
|
---|
120 | int ferror (FILE *);
|
---|
121 | int fflush (FILE *);
|
---|
122 | int fgetc (FILE *);
|
---|
123 | int fgetpos (FILE *, fpos_t *);
|
---|
124 | char *fgets (char *, int, FILE *);
|
---|
125 | FILE *fopen (__const__ char *, __const__ char *);
|
---|
126 | int fprintf (FILE *, __const__ char *, ...);
|
---|
127 | int fputc (int, FILE *);
|
---|
128 | int fputs (__const__ char *, FILE *);
|
---|
129 | size_t fread (void *, size_t, size_t, FILE *);
|
---|
130 | FILE *freopen (__const__ char *, __const__ char *, FILE *);
|
---|
131 | int fscanf (FILE *, __const__ char *, ...);
|
---|
132 | int fseek (FILE *, long, int);
|
---|
133 | int fsetpos (FILE *, __const__ fpos_t *);
|
---|
134 | long ftell (FILE *);
|
---|
135 | size_t fwrite (__const__ void *, size_t, size_t, FILE *);
|
---|
136 | int getchar (void);
|
---|
137 | char *gets (char *);
|
---|
138 | void perror (__const__ char *);
|
---|
139 | int printf (__const__ char *, ...);
|
---|
140 | int putchar (int);
|
---|
141 | int puts (__const__ char *);
|
---|
142 | int remove (__const__ char *);
|
---|
143 | int rename (__const__ char *, __const__ char *);
|
---|
144 | void rewind (FILE *);
|
---|
145 | int scanf (__const__ char *, ...);
|
---|
146 | int setbuf (FILE *, char *);
|
---|
147 | int setvbuf (FILE *, char *, int, size_t);
|
---|
148 | int sprintf (char *, __const__ char *, ...);
|
---|
149 | int sscanf (__const__ char *, __const__ char *, ...);
|
---|
150 | FILE *tmpfile (void);
|
---|
151 | char *tmpnam (char *);
|
---|
152 | int ungetc (int, FILE *);
|
---|
153 | int vfprintf (FILE *, __const__ char *, va_list);
|
---|
154 | int vprintf (__const__ char *, va_list);
|
---|
155 | int vsprintf (char *, __const__ char *, va_list);
|
---|
156 |
|
---|
157 | int _fill (FILE *);
|
---|
158 | int _flush (int, FILE *);
|
---|
159 | int _rmtmp (void);
|
---|
160 |
|
---|
161 | extern __inline__ int feof (FILE *_s)
|
---|
162 | {
|
---|
163 | return (_s->_flags & _IOEOF ? 1 : 0);
|
---|
164 | }
|
---|
165 |
|
---|
166 | extern __inline__ int ferror (FILE *_s)
|
---|
167 | {
|
---|
168 | return (_s->_flags & _IOERR ? 1 : 0);
|
---|
169 | }
|
---|
170 |
|
---|
171 | #define getc(s) fgetc(s)
|
---|
172 | #define putc(c,s) fputc(c,s)
|
---|
173 |
|
---|
174 | extern __inline__ int getchar (void) { return getc (stdin); }
|
---|
175 | extern __inline__ int putchar (int _c) { return putc (_c, stdout); }
|
---|
176 |
|
---|
177 |
|
---|
178 | #if !defined (__STRICT_ANSI__)
|
---|
179 |
|
---|
180 | /* POSIX.1 */
|
---|
181 |
|
---|
182 | /* ctermid() */
|
---|
183 | FILE *fdopen (int, __const__ char *);
|
---|
184 | int fileno (FILE *);
|
---|
185 |
|
---|
186 | extern __inline__ int fileno (FILE *_s) { return _s->_handle; }
|
---|
187 |
|
---|
188 | #endif
|
---|
189 |
|
---|
190 |
|
---|
191 | #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
|
---|
192 |
|
---|
193 | char *cuserid (char *);
|
---|
194 | int getw (FILE *);
|
---|
195 | int fcloseall (void);
|
---|
196 | int fgetchar (void);
|
---|
197 | int flushall (void);
|
---|
198 | int fputchar (int);
|
---|
199 | int pclose (FILE *);
|
---|
200 | FILE *popen (__const__ char *, __const__ char *);
|
---|
201 | int putw (int, FILE *);
|
---|
202 | int setbuffer (FILE *, char *, size_t);
|
---|
203 | int snprintf (char *, size_t, __const__ char *, ...);
|
---|
204 | char *tempnam (__const__ char *, __const__ char *);
|
---|
205 | int vfscanf (FILE *, __const__ char *, va_list);
|
---|
206 | int vscanf (__const__ char *, va_list);
|
---|
207 | int vsnprintf (char *, size_t, __const__ char *, va_list);
|
---|
208 | int vsscanf (__const__ char *, __const__ char *, va_list);
|
---|
209 |
|
---|
210 | #endif
|
---|
211 |
|
---|
212 |
|
---|
213 | #if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \
|
---|
214 | || defined (_WITH_UNDERSCORE)
|
---|
215 |
|
---|
216 | int _fcloseall (void);
|
---|
217 | FILE *_fassign (FILE *, FILE *);
|
---|
218 | FILE *_fdopen (int, __const__ char *);
|
---|
219 | int _fgetchar (void);
|
---|
220 | int _flushall (void);
|
---|
221 | int _fputchar (int);
|
---|
222 | int _fseek_hdr (FILE *);
|
---|
223 | int _fsetmode (FILE *, __const__ char *);
|
---|
224 | FILE *_fsopen (__const__ char *, __const__ char *, int);
|
---|
225 | int _getw (FILE *);
|
---|
226 | char *_mfclose (FILE *);
|
---|
227 | FILE *_mfopen (char *, __const__ char *, size_t, int);
|
---|
228 | int _pclose (FILE *);
|
---|
229 | FILE *_popen (__const__ char *, __const__ char *);
|
---|
230 | int _putw (int, FILE *);
|
---|
231 | int _setbuffer (FILE *, char *, size_t);
|
---|
232 | int _snprintf (char *, size_t, __const__ char *, ...);
|
---|
233 | char *_tempnam (__const__ char *, __const__ char *);
|
---|
234 | int _vsnprintf (char *, size_t, __const__ char *, va_list);
|
---|
235 |
|
---|
236 | #endif
|
---|
237 |
|
---|
238 |
|
---|
239 | #if defined (__cplusplus)
|
---|
240 | }
|
---|
241 | #endif
|
---|
242 |
|
---|
243 | #endif /* not _STDIO_H */
|
---|