std_cstdio.h revision 97403
1114402Sru// -*- C++ -*- forwarding header.
2114402Sru
3114402Sru// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
4114402Sru// Free Software Foundation, Inc.
5114402Sru//
6114402Sru// This file is part of the GNU ISO C++ Library.  This library is free
7114402Sru// software; you can redistribute it and/or modify it under the
8114402Sru// terms of the GNU General Public License as published by the
9114402Sru// Free Software Foundation; either version 2, or (at your option)
10114402Sru// any later version.
11114402Sru
12114402Sru// This library is distributed in the hope that it will be useful,
13114402Sru// but WITHOUT ANY WARRANTY; without even the implied warranty of
14114402Sru// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15114402Sru// GNU General Public License for more details.
16114402Sru
17114402Sru// You should have received a copy of the GNU General Public License along
18114402Sru// with this library; see the file COPYING.  If not, write to the Free
19114402Sru// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20114402Sru// USA.
21114402Sru
22114402Sru// As a special exception, you may use this file as part of a free software
23114402Sru// library without restriction.  Specifically, if other files instantiate
24114402Sru// templates or use macros or inline functions from this file, or you compile
25114402Sru// this file and link it with other files to produce an executable, this
26114402Sru// file does not by itself cause the resulting executable to be covered by
27114402Sru// the GNU General Public License.  This exception does not however
28114402Sru// invalidate any other reasons why the executable file might be covered by
29114402Sru// the GNU General Public License.
30114402Sru
31114402Sru//
32114402Sru// ISO C++ 14882: 27.8.2  C Library files
33114402Sru//
34114402Sru
35114402Sru/** @file cstdio
36114402Sru *  This is a Standard C++ Library file.  You should @c #include this file
37114402Sru *  in your programs, rather than any of the "*.h" implementation files.
38114402Sru *
39114402Sru *  This is the C++ version of the Standard C Library header @c stdio.h,
40114402Sru *  and its contents are (mostly) the same as that header, but are all
41114402Sru *  contained in the namespace @c std.
42114402Sru */
43114402Sru
44114402Sru#ifndef _CPP_CSTDIO
45114402Sru#define _CPP_CSTDIO 1
46114402Sru
47114402Sru#pragma GCC system_header
48114402Sru
49114402Sru#include <bits/c++config.h>
50114402Sru#include <cstddef>
51114402Sru
52114402Sru#include <stdio.h>
53114402Sru
54114402Sru// Get rid of those macros defined in <stdio.h> in lieu of real functions.
55114402Sru#undef clearerr
56114402Sru#undef fclose
57114402Sru#undef feof
58114402Sru#undef ferror
59114402Sru#undef fflush
60114402Sru#undef fgetc
61114402Sru#undef fgetpos
62114402Sru#undef fgets
63114402Sru#undef fopen
64114402Sru#undef fprintf
65114402Sru#undef fputc
66114402Sru#undef fputs
67114402Sru#undef fread
68114402Sru#undef freopen
69114402Sru#undef fscanf
70114402Sru#undef fseek
71114402Sru#undef fsetpos
72114402Sru#undef ftell
73114402Sru#undef fwrite
74114402Sru#undef getc
75114402Sru#undef getchar
76114402Sru#undef gets
77114402Sru#undef perror
78114402Sru#undef printf
79114402Sru#undef putc
80114402Sru#undef putchar
81114402Sru#undef puts
82114402Sru#undef remove
83114402Sru#undef rename
84114402Sru#undef rewind
85114402Sru#undef scanf
86114402Sru#undef setbuf
87114402Sru#undef setvbuf
88114402Sru#undef sprintf
89114402Sru#undef sscanf
90114402Sru#undef tmpfile
91114402Sru#undef tmpnam
92114402Sru#undef ungetc
93114402Sru#undef vfprintf
94114402Sru#undef vprintf
95114402Sru#undef vsprintf
96114402Sru
97114402Srunamespace std
98114402Sru{
99114402Sru  using ::FILE;
100114402Sru  using ::fpos_t;
101114402Sru
102114402Sru  using ::clearerr;
103114402Sru  using ::fclose;
104114402Sru  using ::feof;
105114402Sru  using ::ferror;
106114402Sru  using ::fflush;
107114402Sru  using ::fgetc;
108114402Sru  using ::fgetpos;
109114402Sru  using ::fgets;
110114402Sru  using ::fopen;
111114402Sru  using ::fprintf;
112114402Sru  using ::fputc;
113114402Sru  using ::fputs;
114114402Sru  using ::fread;
115114402Sru  using ::freopen;
116114402Sru  using ::fscanf;
117114402Sru  using ::fseek;
118114402Sru  using ::fsetpos;
119114402Sru  using ::ftell;
120114402Sru  using ::fwrite;
121114402Sru  using ::getc;
122114402Sru  using ::getchar;
123114402Sru  using ::gets;
124114402Sru  using ::perror;
125114402Sru  using ::printf;
126114402Sru  using ::putc;
127114402Sru  using ::putchar;
128114402Sru  using ::puts;
129114402Sru  using ::remove;
130114402Sru  using ::rename;
131114402Sru  using ::rewind;
132114402Sru  using ::scanf;
133114402Sru  using ::setbuf;
134114402Sru  using ::setvbuf;
135114402Sru  using ::sprintf;
136114402Sru  using ::sscanf;
137114402Sru  using ::tmpfile;
138114402Sru  using ::tmpnam;
139114402Sru  using ::ungetc;
140114402Sru  using ::vfprintf;
141114402Sru  using ::vprintf;
142114402Sru  using ::vsprintf;
143114402Sru}
144114402Sru
145114402Sru#if _GLIBCPP_USE_C99
146114402Sru
147114402Sru#undef snprintf
148114402Sru#undef vfscanf
149114402Sru#undef vscanf
150114402Sru#undef vsnprintf
151114402Sru#undef vsscanf
152114402Sru
153114402Srunamespace __gnu_cxx
154114402Sru{
155114402Sru  using ::snprintf;
156114402Sru  using ::vfscanf;
157114402Sru  using ::vscanf;
158114402Sru  using ::vsnprintf;
159114402Sru  using ::vsscanf;
160114402Sru}
161114402Sru
162114402Srunamespace std
163114402Sru{
164114402Sru  using __gnu_cxx::snprintf;
165114402Sru  using __gnu_cxx::vfscanf;
166114402Sru  using __gnu_cxx::vscanf;
167114402Sru  using __gnu_cxx::vsnprintf;
168114402Sru  using __gnu_cxx::vsscanf;
169114402Sru}
170114402Sru#endif
171114402Sru
172114402Sru#endif
173114402Sru