2 Copyright (C) 1993 Free Software Foundation
4 This file is part of the GNU IO Library. This library is free
5 software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option)
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this library; see the file COPYING. If not, write to the Free
17 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 As a special exception, if you link this library with files
20 compiled with a GNU compiler to produce an executable, this does not cause
21 the resulting executable to be covered by the GNU General Public License.
22 This exception does not however invalidate any other reasons why
23 the executable file might be covered by the GNU General Public License. */
25 /* This file defines a stdio-like environment, except that it avoid
26 link-time name clashes with an existing stdio.
27 It allows for testing the libio using stdio-using programs
28 with an incompatible libc.a.
29 It is not predantically correct - e.g. some macros are used
30 that may evaluate a stream argument more than once. */
37 typedef _IO_FILE
FILE;
45 /* #define size_t, fpos_t L_tmpname TMP_MAX */
47 #define _IOFBF 0 /* Fully buffered. */
48 #define _IOLBF 1 /* Line buffered. */
49 #define _IONBF 2 /* No buffering. */
55 #define stdin _IO_stdin
56 #define stdout _IO_stdout
57 #define stderr _IO_stderr
59 #define getc(_fp) _IO_getc(_fp)
60 #define putc(_ch, _fp) _IO_putc(_ch, _fp)
62 #define clearerr _IO_clearerr
63 #define fclose _IO_fclose
65 #define ferror _IO_ferror
66 #define fflush _IO_fflush
67 #define fgetc(__fp) _IO_getc(_fp)
68 #define fgetpos _IO_fgetpos
69 #define fgets _IO_fgets
70 #define fopen _IO_fopen
71 #define fprintf _IO_fprintf
72 #define fputc(_ch, _fp) _IO_putc(_ch, _fp)
73 #define fputs _IO_fputs
74 #define fread _IO_fread
75 #define freopen _IO_freopen
76 #define fscanf _IO_fscanf
77 #define fseek _IO_fseek
78 #define fsetpos _IO_fsetpos
79 #define ftell _IO_ftell
80 #define fwrite _IO_fwrite
82 #define perror _IO_perror
83 #define printf _IO_printf
85 #define rewind _IO_rewind
86 #define scanf _IO_scanf
87 #define setbuf _IO_setbuf
88 #define setbuffer _IO_setbuffer
89 #define setvbuf _IO_setvbuf
90 #define sprintf _IO_sprintf
91 #define sscanf _IO_sscanf
92 #define ungetc _IO_ungetc
93 #define vfprintf _IO_vfprintf
94 #define vprintf(__fmt, __args) vfprintf(stdout, __fmt, __args)
95 #define vsprintf _IO_vsprintf
98 /* We can use the libc versions of these, since they don't pass FILE*s. */
99 #define remove ??? __P((const char*))
100 #define rename ??? __P((const char* _old, const char* _new))
101 #define tmpfile ??? __P((void))
102 #define tmpnam ??? __P((char*))
105 #if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
106 #define fdopen _IO_fdopen
107 #define fileno _IO_fileno
108 #define popen _IO_popen
109 #define pclose _IO_pclose
110 #define setbuf _IO_setbuf
111 #define setlinebuf _IO_setlinebuf
114 #endif /* _IOSTDIO_H */