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