1// -*- C++ -*- forwarding header.
2
3// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4// 2009, 2010, 2012  Free Software Foundation, Inc.
5//
6// This file is part of the GNU ISO C++ Library.  This library is free
7// software; you can redistribute it and/or modify it under the
8// terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 3, or (at your option)
10// any later version.
11
12// This library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16
17// Under Section 7 of GPL version 3, you are granted additional
18// permissions described in the GCC Runtime Library Exception, version
19// 3.1, as published by the Free Software Foundation.
20
21// You should have received a copy of the GNU General Public License and
22// a copy of the GCC Runtime Library Exception along with this program;
23// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24// <http://www.gnu.org/licenses/>.
25
26/** @file include/cstdio
27 *  This is a Standard C++ Library file.  You should @c #include this file
28 *  in your programs, rather than any of the @a *.h implementation files.
29 *
30 *  This is the C++ version of the Standard C Library header @c stdio.h,
31 *  and its contents are (mostly) the same as that header, but are all
32 *  contained in the namespace @c std (except for names which are defined
33 *  as macros in C).
34 */
35
36//
37// ISO C++ 14882: 27.8.2  C Library files
38//
39
40#ifndef _GLIBCXX_CSTDIO
41#define _GLIBCXX_CSTDIO 1
42
43#pragma GCC system_header
44
45#include <bits/c++config.h>
46#include <stdio.h>
47
48#ifndef _GLIBCXX_HAVE_GETS
49extern "C" char* gets (char* __s) __attribute__((deprecated));
50#endif
51
52// Get rid of those macros defined in <stdio.h> in lieu of real functions.
53#undef clearerr
54#undef fclose
55#undef feof
56#undef ferror
57#undef fflush
58#undef fgetc
59#undef fgetpos
60#undef fgets
61#undef fopen
62#undef fprintf
63#undef fputc
64#undef fputs
65#undef fread
66#undef freopen
67#undef fscanf
68#undef fseek
69#undef fsetpos
70#undef ftell
71#undef fwrite
72#undef getc
73#undef getchar
74#undef gets
75#undef perror
76#undef printf
77#undef putc
78#undef putchar
79#undef puts
80#undef remove
81#undef rename
82#undef rewind
83#undef scanf
84#undef setbuf
85#undef setvbuf
86#undef sprintf
87#undef sscanf
88#undef tmpfile
89#undef tmpnam
90#undef ungetc
91#undef vfprintf
92#undef vprintf
93#undef vsprintf
94
95namespace std
96{
97  using ::FILE;
98  using ::fpos_t;
99
100  using ::clearerr;
101  using ::fclose;
102  using ::feof;
103  using ::ferror;
104  using ::fflush;
105  using ::fgetc;
106  using ::fgetpos;
107  using ::fgets;
108  using ::fopen;
109  using ::fprintf;
110  using ::fputc;
111  using ::fputs;
112  using ::fread;
113  using ::freopen;
114  using ::fscanf;
115  using ::fseek;
116  using ::fsetpos;
117  using ::ftell;
118  using ::fwrite;
119  using ::getc;
120  using ::getchar;
121  using ::gets;
122  using ::perror;
123  using ::printf;
124  using ::putc;
125  using ::putchar;
126  using ::puts;
127  using ::remove;
128  using ::rename;
129  using ::rewind;
130  using ::scanf;
131  using ::setbuf;
132  using ::setvbuf;
133  using ::sprintf;
134  using ::sscanf;
135  using ::tmpfile;
136  using ::tmpnam;
137  using ::ungetc;
138  using ::vfprintf;
139  using ::vprintf;
140  using ::vsprintf;
141} // namespace std
142
143#if _GLIBCXX_USE_C99
144
145#undef snprintf
146#undef vfscanf
147#undef vscanf
148#undef vsnprintf
149#undef vsscanf
150
151namespace __gnu_cxx
152{
153#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
154  extern "C" int
155  (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...)
156  throw ();
157  extern "C" int
158  (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
159  extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
160  extern "C" int
161  (vsnprintf)(char * __restrict, std::size_t, const char * __restrict,
162	      __gnuc_va_list) throw ();
163  extern "C" int
164  (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list)
165  throw ();
166#endif
167
168#if !_GLIBCXX_USE_C99_DYNAMIC
169  using ::snprintf;
170  using ::vfscanf;
171  using ::vscanf;
172  using ::vsnprintf;
173  using ::vsscanf;
174#endif
175} // namespace __gnu_cxx
176
177namespace std
178{
179  using ::__gnu_cxx::snprintf;
180  using ::__gnu_cxx::vfscanf;
181  using ::__gnu_cxx::vscanf;
182  using ::__gnu_cxx::vsnprintf;
183  using ::__gnu_cxx::vsscanf;
184} // namespace std
185
186#endif
187
188#endif
189