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 #undef rewind
87 #undef tempnam
88 #undef scanf
89 #undef setbuf
90 #undef setbuffer
91 #undef setlinebuf
92 #undef setvbuf
93 #undef sprintf
94 #undef sscanf
95 #undef tempnam
96 #undef vprintf
97 #undef vfprintf
98 #undef vsprintf
99 #undef _flsbuf
100 
101 #ifndef NULL
102 #define NULL _G_NULL
103 #endif
104 
105 #ifndef size_t
106 #define size_t _G_size_t
107 #endif
108 }
109 
110 extern "C" {
111 
112 int    fclose(FILE*);
113 FILE*  fdopen(int, const char*);
114 int    fflush(FILE*);
115 int    fgetc(FILE*);
116 char*  fgets(char*, unsigned int, FILE *);
117 FILE*  fopen(const char*, const char*);
118 int    fprintf(FILE*, const char* ...);
119 int    fputc(int, FILE*);
120 int    fputs(const char*, FILE*);
121 size_t fread(void*, size_t, size_t, FILE*);
122 #ifdef VMS
123 FILE*  freopen(const char*, const char*, FILE* ...);
124 #else
125 FILE*  freopen(const char*, const char*, FILE*);
126 #endif
127 int    fscanf(FILE*, const char* ...);
128 int    fseek(FILE*, long, int);
129 long   ftell(FILE *);
130 size_t fwrite(const void*, size_t, size_t, FILE*);
131 char*  gets(char*);
132 int    getw(FILE*);
133 int    pclose(FILE*);
134 void   perror(const char*);
135 FILE*  popen(const char*, const char*);
136 int    printf(const char* ...);
137 int    puts(const char*);
138 int    putw(int, FILE*);
139 int    rewind(FILE*);
140 int    scanf(const char* ...);
141 void   setbuf(FILE*, char*);
142 void   setbuffer(FILE*, char*, int);
143 int    setlinebuf(FILE*);
144 int    setvbuf(FILE*, char*, int, size_t);
145 int    sscanf(char*, const char* ...);
146 FILE*  tmpfile();
147 int    ungetc(int, FILE*);
148 int    vfprintf _G_ARGS((FILE*, const char*, _G_va_list));
149 int    vprintf _G_ARGS((const char*, _G_va_list));
150 _G_sprintf_return_type sprintf _G_ARGS((char*, const char* ...));
151 _G_sprintf_return_type vsprintf _G_ARGS((char*, const char*, _G_va_list));
152 
153 extern int _filbuf _G_ARGS((FILE*));
154 extern int _flsbuf _G_ARGS((unsigned, FILE*));
155 
156 }
157 
158 #ifndef L_ctermid
159 #define L_ctermid	9
160 #endif
161 #ifndef L_cuserid
162 #define L_cuserid	9
163 #endif
164 #ifndef P_tmpdir
165 #define	P_tmpdir    "/tmp/"
166 #endif
167 #ifndef L_tmpnam
168 #define	L_tmpnam    (sizeof(P_tmpdir) + 15)
169 #endif
170 
171 #define _stdio_h 1
172 
173 #endif
174 #endif // _stdio_h
175