Rev 5963 | Rev 6536 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5963 | Rev 6099 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | 30 | ||
Line 31... | Line 31... | ||
31 | #define _FSTDIO /* ``function stdio'' */ |
31 | #define _FSTDIO /* ``function stdio'' */ |
32 | 32 | ||
- | 33 | #define __need_size_t |
|
33 | #define __need_size_t |
34 | #define __need_NULL |
Line 34... | Line 35... | ||
34 | #define __need_NULL |
35 | #include |
35 | #include |
36 | #include |
Line 46... | Line 47... | ||
46 | #include |
47 | #include |
47 | #include |
48 | #include |
Line 48... | Line 49... | ||
48 | 49 | ||
Line -... | Line 50... | ||
- | 50 | _BEGIN_STD_C |
|
49 | _BEGIN_STD_C |
51 | |
- | 52 | #if !defined(__FILE_defined) |
|
- | 53 | typedef __FILE FILE; |
|
Line 50... | Line 54... | ||
50 | 54 | # define __FILE_defined |
|
51 | typedef __FILE FILE; |
55 | #endif |
52 | 56 | ||
53 | #ifdef __CYGWIN__ |
57 | #ifdef __CYGWIN__ |
Line 80... | Line 84... | ||
80 | # define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */ |
84 | # define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */ |
81 | #endif |
85 | #endif |
82 | #define __SL64 0x8000 /* is 64-bit offset large file */ |
86 | #define __SL64 0x8000 /* is 64-bit offset large file */ |
Line 83... | Line 87... | ||
83 | 87 | ||
- | 88 | /* _flags2 flags */ |
|
84 | /* _flags2 flags */ |
89 | #define __SNLK 0x0001 /* stdio functions do not lock streams themselves */ |
Line 85... | Line 90... | ||
85 | #define __SWID 0x2000 /* true => stream orientation wide, false => byte, only valid if __SORD in _flags is true */ |
90 | #define __SWID 0x2000 /* true => stream orientation wide, false => byte, only valid if __SORD in _flags is true */ |
86 | 91 | ||
87 | /* |
92 | /* |
Line 100... | Line 105... | ||
100 | #define EOF (-1) |
105 | #define EOF (-1) |
Line 101... | Line 106... | ||
101 | 106 | ||
102 | #ifdef __BUFSIZ__ |
107 | #ifdef __BUFSIZ__ |
103 | #define BUFSIZ __BUFSIZ__ |
108 | #define BUFSIZ __BUFSIZ__ |
104 | #else |
109 | #else |
105 | #define BUFSIZ 4096 |
110 | #define BUFSIZ 1024 |
Line 106... | Line 111... | ||
106 | #endif |
111 | #endif |
107 | 112 | ||
108 | #ifdef __FOPEN_MAX__ |
113 | #ifdef __FOPEN_MAX__ |
Line 159... | Line 164... | ||
159 | #endif |
164 | #endif |
160 | #endif |
165 | #endif |
Line 161... | Line 166... | ||
161 | 166 | ||
162 | FILE * _EXFUN(tmpfile, (void)); |
167 | FILE * _EXFUN(tmpfile, (void)); |
- | 168 | char * _EXFUN(tmpnam, (char *)); |
|
- | 169 | #if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 |
|
- | 170 | char * _EXFUN(tempnam, (const char *, const char *)); |
|
163 | char * _EXFUN(tmpnam, (char *)); |
171 | #endif |
164 | int _EXFUN(fclose, (FILE *)); |
172 | int _EXFUN(fclose, (FILE *)); |
165 | int _EXFUN(fflush, (FILE *)); |
173 | int _EXFUN(fflush, (FILE *)); |
166 | FILE * _EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict)); |
174 | FILE * _EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict)); |
167 | void _EXFUN(setbuf, (FILE *__restrict, char *__restrict)); |
175 | void _EXFUN(setbuf, (FILE *__restrict, char *__restrict)); |
Line 229... | Line 237... | ||
229 | #else |
237 | #else |
230 | int _EXFUN(fseeko, (FILE *, off_t, int)); |
238 | int _EXFUN(fseeko, (FILE *, off_t, int)); |
231 | off_t _EXFUN(ftello, ( FILE *)); |
239 | off_t _EXFUN(ftello, ( FILE *)); |
232 | #endif |
240 | #endif |
233 | #endif |
241 | #endif |
- | 242 | #if __GNU_VISIBLE |
|
- | 243 | int _EXFUN(fcloseall, (_VOID)); |
|
- | 244 | #endif |
|
234 | #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) |
245 | #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L) |
235 | #ifndef _REENT_ONLY |
246 | #ifndef _REENT_ONLY |
236 | int _EXFUN(asiprintf, (char **, const char *, ...) |
247 | int _EXFUN(asiprintf, (char **, const char *, ...) |
237 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
248 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
238 | char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...) |
249 | char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...) |
239 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
250 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
Line 243... | Line 254... | ||
243 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
254 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
244 | #ifndef diprintf |
255 | #ifndef diprintf |
245 | int _EXFUN(diprintf, (int, const char *, ...) |
256 | int _EXFUN(diprintf, (int, const char *, ...) |
246 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
257 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
247 | #endif |
258 | #endif |
248 | int _EXFUN(fcloseall, (_VOID)); |
- | |
249 | int _EXFUN(fiprintf, (FILE *, const char *, ...) |
259 | int _EXFUN(fiprintf, (FILE *, const char *, ...) |
250 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
260 | _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); |
251 | int _EXFUN(fiscanf, (FILE *, const char *, ...) |
261 | int _EXFUN(fiscanf, (FILE *, const char *, ...) |
252 | _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); |
262 | _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); |
253 | int _EXFUN(iprintf, (const char *, ...) |
263 | int _EXFUN(iprintf, (const char *, ...) |
Line 260... | Line 270... | ||
260 | _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); |
270 | _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); |
261 | int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...) |
271 | int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...) |
262 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
272 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
263 | int _EXFUN(sniprintf, (char *, size_t, const char *, ...) |
273 | int _EXFUN(sniprintf, (char *, size_t, const char *, ...) |
264 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
274 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
265 | char * _EXFUN(tempnam, (const char *, const char *)); |
- | |
266 | int _EXFUN(vasiprintf, (char **, const char *, __VALIST) |
275 | int _EXFUN(vasiprintf, (char **, const char *, __VALIST) |
267 | _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); |
276 | _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); |
268 | char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST) |
277 | char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST) |
269 | _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); |
278 | _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); |
270 | char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST) |
279 | char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST) |
Line 334... | Line 343... | ||
334 | # endif |
343 | # endif |
335 | FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict)); |
344 | FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict)); |
336 | /* getdelim - see __getdelim for now */ |
345 | /* getdelim - see __getdelim for now */ |
337 | /* getline - see __getline for now */ |
346 | /* getline - see __getline for now */ |
338 | FILE * _EXFUN(open_memstream, (char **, size_t *)); |
347 | FILE * _EXFUN(open_memstream, (char **, size_t *)); |
339 | #if defined (__CYGWIN__) |
348 | #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 |
340 | int _EXFUN(renameat, (int, const char *, int, const char *)); |
349 | int _EXFUN(renameat, (int, const char *, int, const char *)); |
341 | #endif |
350 | #endif |
342 | int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST) |
351 | int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST) |
343 | _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); |
352 | _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); |
344 | # endif |
353 | # endif |
Line 363... | Line 372... | ||
363 | int _EXFUN(_fclose_r, (struct _reent *, FILE *)); |
372 | int _EXFUN(_fclose_r, (struct _reent *, FILE *)); |
364 | int _EXFUN(_fcloseall_r, (struct _reent *)); |
373 | int _EXFUN(_fcloseall_r, (struct _reent *)); |
365 | FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); |
374 | FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); |
366 | int _EXFUN(_fflush_r, (struct _reent *, FILE *)); |
375 | int _EXFUN(_fflush_r, (struct _reent *, FILE *)); |
367 | int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); |
376 | int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); |
- | 377 | int _EXFUN(_fgetc_unlocked_r, (struct _reent *, FILE *)); |
|
368 | char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); |
378 | char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); |
- | 379 | char * _EXFUN(_fgets_unlocked_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); |
|
369 | #ifdef _COMPILING_NEWLIB |
380 | #ifdef _COMPILING_NEWLIB |
370 | int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); |
381 | int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); |
371 | int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); |
382 | int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); |
372 | #else |
383 | #else |
373 | int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); |
384 | int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); |
Line 382... | Line 393... | ||
382 | FILE * _EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict)); |
393 | FILE * _EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict)); |
383 | int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) |
394 | int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) |
384 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
395 | _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); |
385 | int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); |
396 | int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); |
386 | int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); |
397 | int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); |
- | 398 | int _EXFUN(_fputc_unlocked_r, (struct _reent *, int, FILE *)); |
|
387 | int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); |
399 | int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); |
- | 400 | int _EXFUN(_fputs_unlocked_r, (struct _reent *, const char *__restrict, FILE *__restrict)); |
|
388 | size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
401 | size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
- | 402 | size_t _EXFUN(_fread_unlocked_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
|
389 | int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) |
403 | int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) |
390 | _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); |
404 | _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); |
391 | int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); |
405 | int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); |
392 | int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); |
406 | int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); |
393 | long _EXFUN(_ftell_r, (struct _reent *, FILE *)); |
407 | long _EXFUN(_ftell_r, (struct _reent *, FILE *)); |
394 | _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); |
408 | _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); |
395 | void _EXFUN(_rewind_r, (struct _reent *, FILE *)); |
409 | void _EXFUN(_rewind_r, (struct _reent *, FILE *)); |
396 | size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
410 | size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
- | 411 | size_t _EXFUN(_fwrite_unlocked_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
|
397 | int _EXFUN(_getc_r, (struct _reent *, FILE *)); |
412 | int _EXFUN(_getc_r, (struct _reent *, FILE *)); |
398 | int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); |
413 | int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); |
399 | int _EXFUN(_getchar_r, (struct _reent *)); |
414 | int _EXFUN(_getchar_r, (struct _reent *)); |
400 | int _EXFUN(_getchar_unlocked_r, (struct _reent *)); |
415 | int _EXFUN(_getchar_unlocked_r, (struct _reent *)); |
401 | char * _EXFUN(_gets_r, (struct _reent *, char *)); |
416 | char * _EXFUN(_gets_r, (struct _reent *, char *)); |
Line 478... | Line 493... | ||
478 | 493 | ||
479 | int _EXFUN(fpurge, (FILE *)); |
494 | int _EXFUN(fpurge, (FILE *)); |
480 | ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); |
495 | ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); |
Line -... | Line 496... | ||
- | 496 | ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); |
|
- | 497 | ||
- | 498 | #if __BSD_VISIBLE |
|
- | 499 | void _EXFUN(clearerr_unlocked, (FILE *)); |
|
- | 500 | int _EXFUN(feof_unlocked, (FILE *)); |
|
- | 501 | int _EXFUN(ferror_unlocked, (FILE *)); |
|
- | 502 | int _EXFUN(fileno_unlocked, (FILE *)); |
|
- | 503 | int _EXFUN(fflush_unlocked, (FILE *)); |
|
- | 504 | int _EXFUN(fgetc_unlocked, (FILE *)); |
|
- | 505 | int _EXFUN(fputc_unlocked, (int, FILE *)); |
|
- | 506 | size_t _EXFUN(fread_unlocked, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); |
|
- | 507 | size_t _EXFUN(fwrite_unlocked, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); |
|
- | 508 | #endif |
|
- | 509 | ||
- | 510 | #if __GNU_VISIBLE |
|
- | 511 | char * _EXFUN(fgets_unlocked, (char *__restrict, int, FILE *__restrict)); |
|
- | 512 | int _EXFUN(fputs_unlocked, (const char *__restrict, FILE *__restrict)); |
|
481 | ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); |
513 | #endif |
482 | 514 | ||
483 | #ifdef __LARGE64_FILES |
515 | #ifdef __LARGE64_FILES |
484 | #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) |
516 | #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) |
485 | FILE * _EXFUN(fdopen64, (int, const char *)); |
517 | FILE * _EXFUN(fdopen64, (int, const char *)); |
Line 642... | Line 674... | ||
642 | #else |
674 | #else |
643 | #define __sputc_r(__ptr, __c, __p) __sputc_raw_r(__ptr, __c, __p) |
675 | #define __sputc_r(__ptr, __c, __p) __sputc_raw_r(__ptr, __c, __p) |
644 | #endif |
676 | #endif |
645 | #endif |
677 | #endif |
Line 646... | Line 678... | ||
646 | 678 | ||
647 | #define __sfeof(p) (((p)->_flags & __SEOF) != 0) |
679 | #define __sfeof(p) ((int)(((p)->_flags & __SEOF) != 0)) |
648 | #define __sferror(p) (((p)->_flags & __SERR) != 0) |
680 | #define __sferror(p) ((int)(((p)->_flags & __SERR) != 0)) |
649 | #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) |
681 | #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) |
Line 650... | Line 682... | ||
650 | #define __sfileno(p) ((p)->_file) |
682 | #define __sfileno(p) ((p)->_file) |
651 | 683 | ||
652 | #ifndef _REENT_SMALL |
684 | #ifndef _REENT_SMALL |
653 | #define feof(p) __sfeof(p) |
685 | #define feof(p) __sfeof(p) |
- | 686 | #define ferror(p) __sferror(p) |
|
- | 687 | #define clearerr(p) __sclearerr(p) |
|
- | 688 | ||
- | 689 | #if __BSD_VISIBLE |
|
- | 690 | #define feof_unlocked(p) __sfeof(p) |
|
- | 691 | #define ferror_unlocked(p) __sferror(p) |
|
- | 692 | #define clearerr_unlocked(p) __sclearerr(p) |
|
- | 693 | #endif /* __BSD_VISIBLE */ |
|
- | 694 | #endif /* _REENT_SMALL */ |
|
- | 695 | ||
654 | #define ferror(p) __sferror(p) |
696 | #if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */ |
Line 655... | Line 697... | ||
655 | #define clearerr(p) __sclearerr(p) |
697 | #define fileno(p) __sfileno(p) |
656 | #endif |
698 | #endif |
657 | 699 | ||
Line 676... | Line 718... | ||
676 | #endif /* !__CUSTOM_FILE_IO__ */ |
718 | #endif /* !__CUSTOM_FILE_IO__ */ |
Line 677... | Line 719... | ||
677 | 719 | ||
678 | #define getchar() getc(stdin) |
720 | #define getchar() getc(stdin) |
Line -... | Line 721... | ||
- | 721 | #define putchar(x) putc(x, stdout) |
|
- | 722 | ||
- | 723 | #ifndef __STRICT_ANSI__ |
|
- | 724 | #define getchar_unlocked() getc_unlocked(stdin) |
|
- | 725 | #define putchar_unlocked(x) putc_unlocked(x, stdout) |
|
679 | #define putchar(x) putc(x, stdout) |
726 | #endif |
Line 680... | Line 727... | ||
680 | 727 |