Commit | Line | Data |
---|---|---|
32df4d03 PR |
1 | // This may look like C code, but it is really -*- C++ -*- |
2 | /* | |
3 | Copyright (C) 1988 Free Software Foundation | |
4 | written by Doug Lea (dl@rocky.oswego.edu) | |
5 | ||
6 | This file is part of the GNU C++ Library. This library is free | |
7 | software; you can redistribute it and/or modify it under the terms of | |
8 | the GNU Library General Public License as published by the Free | |
9 | Software Foundation; either version 2 of the License, or (at your | |
10 | option) any later version. This library is distributed in the hope | |
11 | that it will be useful, but WITHOUT ANY WARRANTY; without even the | |
12 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
13 | PURPOSE. See the GNU Library General Public License for more details. | |
14 | You should have received a copy of the GNU Library General Public | |
15 | License along with this library; if not, write to the Free Software | |
16 | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
17 | */ | |
18 | ||
19 | #ifndef _stdio_h | |
20 | #ifdef __GNUG__ | |
21 | #pragma interface | |
22 | #endif | |
23 | ||
24 | #ifdef __stdio_h_recursive | |
25 | #include_next <stdio.h> | |
26 | #else | |
27 | #define __stdio_h_recursive | |
28 | ||
29 | // Note: The #define _stdio_h is at the end of this file, | |
30 | // in case #include_next <stdio.h> finds an installed version of this | |
31 | // same file -- we want it to continue until it finds the C version. | |
32 | ||
33 | #include <_G_config.h> | |
34 | ||
35 | extern "C" { | |
36 | ||
37 | #undef NULL | |
38 | ||
39 | #define fdopen __hide_fdopen | |
40 | #define fopen __hide_fopen | |
41 | #define fprintf __hide_fprintf | |
42 | #define fputs __hide_fputs | |
43 | #define fread __hide_fread | |
44 | #define freopen __hide_freopen | |
45 | #define fscanf __hide_fscanf | |
46 | #define ftell __hide_ftell | |
47 | #define fwrite __hide_fwrite | |
48 | #define new __hide_new /* In case 'new' is used as a parameter name. */ | |
49 | #define perror __hide_perror | |
50 | #define popen __hide_popen | |
51 | #define printf __hide_printf | |
52 | #define puts __hide_puts | |
53 | #define putw __hide_putw | |
54 | #define rewind __hide_rewind | |
55 | #define tempnam __hide_tempnam | |
56 | #define scanf __hide_scanf | |
57 | #define setbuf __hide_setbuf | |
58 | #define setbuffer __hide_setbuffer | |
59 | #define setlinebuf __hide_setlinebuf | |
60 | #define setvbuf __hide_setvbuf | |
61 | #define sprintf __hide_sprintf | |
62 | #define sscanf __hide_sscanf | |
63 | #define tempnam __hide_tempnam | |
64 | #define vfprintf __hide_vfprintf | |
65 | #define vprintf __hide_vprintf | |
66 | #define vsprintf __hide_vsprintf | |
67 | #define _flsbuf __hide__flsbuf | |
68 | ||
69 | #include_next <stdio.h> | |
70 | ||
71 | #undef fdopen | |
72 | #undef fopen | |
73 | #undef fprintf | |
74 | #undef fputs | |
75 | #undef fread | |
76 | #undef freopen | |
77 | #undef fscanf | |
78 | #undef ftell | |
79 | #undef fwrite | |
80 | #undef new | |
81 | #undef perror | |
82 | #undef popen | |
83 | #undef printf | |
84 | #undef puts | |
85 | #undef putw | |
86 | /* SCO defines remove to call unlink; that's very dangerous for us. */ | |
87 | #undef remove | |
88 | #undef rewind | |
89 | #undef tempnam | |
90 | #undef scanf | |
91 | #undef setbuf | |
92 | #undef setbuffer | |
93 | #undef setlinebuf | |
94 | #undef setvbuf | |
95 | #undef sprintf | |
96 | #undef sscanf | |
97 | #undef tempnam | |
98 | #undef vprintf | |
99 | #undef vfprintf | |
100 | #undef vsprintf | |
101 | #undef _flsbuf | |
102 | ||
103 | #ifndef NULL | |
104 | #define NULL _G_NULL | |
105 | #endif | |
106 | ||
107 | #ifndef size_t | |
108 | #define size_t _G_size_t | |
109 | #endif | |
110 | } | |
111 | ||
112 | extern "C" { | |
113 | ||
114 | int fclose(FILE*); | |
115 | FILE* fdopen(int, const char*); | |
116 | int fflush(FILE*); | |
117 | int fgetc(FILE*); | |
118 | #ifndef __386BSD__ | |
119 | char* fgets _G_ARGS((char*, int, FILE *)); | |
120 | #else | |
121 | char* fgets _G_ARGS((char*, _G_size_t, FILE *)); | |
122 | #endif | |
123 | FILE* fopen(const char*, const char*); | |
124 | int fprintf(FILE*, const char* ...); | |
125 | int fputc(int, FILE*); | |
126 | int fputs(const char*, FILE*); | |
127 | size_t fread(void*, size_t, size_t, FILE*); | |
128 | #ifdef VMS | |
129 | FILE* freopen(const char*, const char*, FILE* ...); | |
130 | #else | |
131 | FILE* freopen(const char*, const char*, FILE*); | |
132 | #endif | |
133 | int fscanf(FILE*, const char* ...); | |
134 | int fseek(FILE*, long, int); | |
135 | long ftell(FILE *); | |
136 | size_t fwrite(const void*, size_t, size_t, FILE*); | |
137 | char* gets(char*); | |
138 | int getw(FILE*); | |
139 | int pclose(FILE*); | |
140 | void perror(const char*); | |
141 | FILE* popen(const char*, const char*); | |
142 | int printf(const char* ...); | |
143 | int puts(const char*); | |
144 | int putw(int, FILE*); | |
145 | int rewind(FILE*); | |
146 | int scanf(const char* ...); | |
147 | void setbuf(FILE*, char*); | |
148 | void setbuffer(FILE*, char*, int); | |
149 | int setlinebuf(FILE*); | |
150 | int setvbuf(FILE*, char*, int, size_t); | |
9069df10 | 151 | int sscanf(const char*, const char* ...); |
32df4d03 PR |
152 | FILE* tmpfile(); |
153 | int ungetc(int, FILE*); | |
154 | int vfprintf _G_ARGS((FILE*, const char*, _G_va_list)); | |
155 | int vprintf _G_ARGS((const char*, _G_va_list)); | |
156 | _G_sprintf_return_type sprintf _G_ARGS((char*, const char* ...)); | |
157 | _G_sprintf_return_type vsprintf _G_ARGS((char*, const char*, _G_va_list)); | |
158 | ||
159 | extern int _filbuf _G_ARGS((FILE*)); | |
160 | extern int _flsbuf _G_ARGS((unsigned, FILE*)); | |
161 | ||
162 | } | |
163 | ||
164 | #ifndef L_ctermid | |
165 | #define L_ctermid 9 | |
166 | #endif | |
167 | #ifndef L_cuserid | |
168 | #define L_cuserid 9 | |
169 | #endif | |
170 | #ifndef P_tmpdir | |
171 | #define P_tmpdir "/tmp/" | |
172 | #endif | |
173 | #ifndef L_tmpnam | |
174 | #define L_tmpnam (sizeof(P_tmpdir) + 15) | |
175 | #endif | |
176 | ||
177 | #define _stdio_h 1 | |
178 | ||
179 | #endif | |
180 | #endif // _stdio_h |