1249259Sdim// -*- C++ -*- forwarding header.
2249259Sdim
3249259Sdim// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4249259Sdim// Free Software Foundation, Inc.
5249259Sdim//
6249259Sdim// This file is part of the GNU ISO C++ Library.  This library is free
7249259Sdim// software; you can redistribute it and/or modify it under the
8249259Sdim// terms of the GNU General Public License as published by the
9249259Sdim// Free Software Foundation; either version 2, or (at your option)
10249259Sdim// any later version.
11249259Sdim
12249259Sdim// This library is distributed in the hope that it will be useful,
13249259Sdim// but WITHOUT ANY WARRANTY; without even the implied warranty of
14249259Sdim// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15249259Sdim// GNU General Public License for more details.
16249259Sdim
17249259Sdim// You should have received a copy of the GNU General Public License along
18249259Sdim// with this library; see the file COPYING.  If not, write to the Free
19249259Sdim// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20263508Sdim// USA.
21249259Sdim
22249259Sdim// As a special exception, you may use this file as part of a free software
23249259Sdim// library without restriction.  Specifically, if other files instantiate
24249259Sdim// templates or use macros or inline functions from this file, or you compile
25249259Sdim// this file and link it with other files to produce an executable, this
26249259Sdim// file does not by itself cause the resulting executable to be covered by
27249259Sdim// the GNU General Public License.  This exception does not however
28249259Sdim// invalidate any other reasons why the executable file might be covered by
29249259Sdim// the GNU General Public License.
30249259Sdim
31249259Sdim/** @file include/cstdio
32249259Sdim *  This is a Standard C++ Library file.  You should @c #include this file
33249259Sdim *  in your programs, rather than any of the "*.h" implementation files.
34249259Sdim *
35249259Sdim *  This is the C++ version of the Standard C Library header @c stdio.h,
36249259Sdim *  and its contents are (mostly) the same as that header, but are all
37249259Sdim *  contained in the namespace @c std (except for names which are defined
38249259Sdim *  as macros in C).
39249259Sdim */
40249259Sdim
41249259Sdim//
42249259Sdim// ISO C++ 14882: 27.8.2  C Library files
43249259Sdim//
44249259Sdim
45249259Sdim#ifndef _GLIBCXX_CSTDIO
46249259Sdim#define _GLIBCXX_CSTDIO 1
47249259Sdim
48249259Sdim#pragma GCC system_header
49249259Sdim
50249259Sdim#include <bits/c++config.h>
51249259Sdim#include <cstddef>
52249259Sdim
53249259Sdim#include <stdio.h>
54249259Sdim
55249259Sdim// Get rid of those macros defined in <stdio.h> in lieu of real functions.
56249259Sdim#undef clearerr
57249259Sdim#undef fclose
58249259Sdim#undef feof
59249259Sdim#undef ferror
60249259Sdim#undef fflush
61249259Sdim#undef fgetc
62249259Sdim#undef fgetpos
63249259Sdim#undef fgets
64249259Sdim#undef fopen
65249259Sdim#undef fprintf
66249259Sdim#undef fputc
67249259Sdim#undef fputs
68249259Sdim#undef fread
69249259Sdim#undef freopen
70249259Sdim#undef fscanf
71249259Sdim#undef fseek
72249259Sdim#undef fsetpos
73249259Sdim#undef ftell
74249259Sdim#undef fwrite
75249259Sdim#undef getc
76249259Sdim#undef getchar
77249259Sdim#undef gets
78249259Sdim#undef perror
79249259Sdim#undef printf
80249259Sdim#undef putc
81249259Sdim#undef putchar
82249259Sdim#undef puts
83249259Sdim#undef remove
84249259Sdim#undef rename
85249259Sdim#undef rewind
86249259Sdim#undef scanf
87249259Sdim#undef setbuf
88249259Sdim#undef setvbuf
89249259Sdim#undef sprintf
90249259Sdim#undef sscanf
91249259Sdim#undef tmpfile
92249259Sdim#undef tmpnam
93249259Sdim#undef ungetc
94249259Sdim#undef vfprintf
95249259Sdim#undef vprintf
96249259Sdim#undef vsprintf
97249259Sdim
98249259Sdim_GLIBCXX_BEGIN_NAMESPACE(std)
99249259Sdim
100249259Sdim  using ::FILE;
101249259Sdim  using ::fpos_t;
102249259Sdim
103249259Sdim  using ::clearerr;
104249259Sdim  using ::fclose;
105249259Sdim  using ::feof;
106249259Sdim  using ::ferror;
107249259Sdim  using ::fflush;
108249259Sdim  using ::fgetc;
109249259Sdim  using ::fgetpos;
110249259Sdim  using ::fgets;
111249259Sdim  using ::fopen;
112249259Sdim  using ::fprintf;
113249259Sdim  using ::fputc;
114249259Sdim  using ::fputs;
115249259Sdim  using ::fread;
116249259Sdim  using ::freopen;
117249259Sdim  using ::fscanf;
118249259Sdim  using ::fseek;
119249259Sdim  using ::fsetpos;
120249259Sdim  using ::ftell;
121249259Sdim  using ::fwrite;
122249259Sdim  using ::getc;
123249259Sdim  using ::getchar;
124249259Sdim  using ::gets;
125249259Sdim  using ::perror;
126249259Sdim  using ::printf;
127249259Sdim  using ::putc;
128249259Sdim  using ::putchar;
129249259Sdim  using ::puts;
130249259Sdim  using ::remove;
131249259Sdim  using ::rename;
132249259Sdim  using ::rewind;
133249259Sdim  using ::scanf;
134249259Sdim  using ::setbuf;
135249259Sdim  using ::setvbuf;
136249259Sdim  using ::sprintf;
137249259Sdim  using ::sscanf;
138249259Sdim  using ::tmpfile;
139249259Sdim  using ::tmpnam;
140249259Sdim  using ::ungetc;
141249259Sdim  using ::vfprintf;
142249259Sdim  using ::vprintf;
143249259Sdim  using ::vsprintf;
144249259Sdim
145249259Sdim_GLIBCXX_END_NAMESPACE
146249259Sdim
147249259Sdim#if _GLIBCXX_USE_C99
148249259Sdim
149249259Sdim#undef snprintf
150249259Sdim#undef vfscanf
151249259Sdim#undef vscanf
152249259Sdim#undef vsnprintf
153249259Sdim#undef vsscanf
154249259Sdim
155249259Sdim_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
156249259Sdim
157249259Sdim#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
158249259Sdim  extern "C" int
159249259Sdim  (snprintf)(char * restrict, size_t, const char * restrict, ...);
160249259Sdim  extern "C" int
161249259Sdim  (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
162249259Sdim  extern "C" int (vscanf)(const char * restrict, __gnuc_va_list);
163249259Sdim  extern "C" int
164249259Sdim  (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list);
165249259Sdim  extern "C" int
166249259Sdim  (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list);
167249259Sdim#endif
168249259Sdim
169249259Sdim#if !_GLIBCXX_USE_C99_DYNAMIC
170249259Sdim  using ::snprintf;
171249259Sdim  using ::vfscanf;
172249259Sdim  using ::vscanf;
173249259Sdim  using ::vsnprintf;
174249259Sdim  using ::vsscanf;
175249259Sdim#endif
176249259Sdim
177249259Sdim_GLIBCXX_END_NAMESPACE
178249259Sdim
179249259Sdim_GLIBCXX_BEGIN_NAMESPACE(std)
180249259Sdim
181249259Sdim  using ::__gnu_cxx::snprintf;
182249259Sdim  using ::__gnu_cxx::vfscanf;
183249259Sdim  using ::__gnu_cxx::vscanf;
184249259Sdim  using ::__gnu_cxx::vsnprintf;
185249259Sdim  using ::__gnu_cxx::vsscanf;
186249259Sdim
187249259Sdim_GLIBCXX_END_NAMESPACE
188249259Sdim
189249259Sdim#endif
190249259Sdim
191249259Sdim#endif
192249259Sdim