std_cstdio.h revision 132720
197403Sobrien// -*- C++ -*- forwarding header.
297403Sobrien
3117397Skan// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
497403Sobrien// Free Software Foundation, Inc.
597403Sobrien//
697403Sobrien// This file is part of the GNU ISO C++ Library.  This library is free
797403Sobrien// software; you can redistribute it and/or modify it under the
897403Sobrien// terms of the GNU General Public License as published by the
997403Sobrien// Free Software Foundation; either version 2, or (at your option)
1097403Sobrien// any later version.
1197403Sobrien
1297403Sobrien// This library is distributed in the hope that it will be useful,
1397403Sobrien// but WITHOUT ANY WARRANTY; without even the implied warranty of
1497403Sobrien// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1597403Sobrien// GNU General Public License for more details.
1697403Sobrien
1797403Sobrien// You should have received a copy of the GNU General Public License along
1897403Sobrien// with this library; see the file COPYING.  If not, write to the Free
1997403Sobrien// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2097403Sobrien// USA.
2197403Sobrien
2297403Sobrien// As a special exception, you may use this file as part of a free software
2397403Sobrien// library without restriction.  Specifically, if other files instantiate
2497403Sobrien// templates or use macros or inline functions from this file, or you compile
2597403Sobrien// this file and link it with other files to produce an executable, this
2697403Sobrien// file does not by itself cause the resulting executable to be covered by
2797403Sobrien// the GNU General Public License.  This exception does not however
2897403Sobrien// invalidate any other reasons why the executable file might be covered by
2997403Sobrien// the GNU General Public License.
3097403Sobrien
3197403Sobrien//
3297403Sobrien// ISO C++ 14882: 27.8.2  C Library files
3397403Sobrien//
3497403Sobrien
3597403Sobrien/** @file cstdio
3697403Sobrien *  This is a Standard C++ Library file.  You should @c #include this file
3797403Sobrien *  in your programs, rather than any of the "*.h" implementation files.
3897403Sobrien *
3997403Sobrien *  This is the C++ version of the Standard C Library header @c stdio.h,
4097403Sobrien *  and its contents are (mostly) the same as that header, but are all
4197403Sobrien *  contained in the namespace @c std.
4297403Sobrien */
4397403Sobrien
44132720Skan#ifndef _GLIBCXX_CSTDIO
45132720Skan#define _GLIBCXX_CSTDIO 1
4697403Sobrien
4797403Sobrien#pragma GCC system_header
4897403Sobrien
4997403Sobrien#include <bits/c++config.h>
5097403Sobrien#include <cstddef>
5197403Sobrien
5297403Sobrien#include <stdio.h>
5397403Sobrien
5497403Sobrien// Get rid of those macros defined in <stdio.h> in lieu of real functions.
5597403Sobrien#undef clearerr
5697403Sobrien#undef fclose
5797403Sobrien#undef feof
5897403Sobrien#undef ferror
5997403Sobrien#undef fflush
6097403Sobrien#undef fgetc
6197403Sobrien#undef fgetpos
6297403Sobrien#undef fgets
6397403Sobrien#undef fopen
6497403Sobrien#undef fprintf
6597403Sobrien#undef fputc
6697403Sobrien#undef fputs
6797403Sobrien#undef fread
6897403Sobrien#undef freopen
6997403Sobrien#undef fscanf
7097403Sobrien#undef fseek
7197403Sobrien#undef fsetpos
7297403Sobrien#undef ftell
7397403Sobrien#undef fwrite
7497403Sobrien#undef getc
7597403Sobrien#undef getchar
7697403Sobrien#undef gets
7797403Sobrien#undef perror
7897403Sobrien#undef printf
7997403Sobrien#undef putc
8097403Sobrien#undef putchar
8197403Sobrien#undef puts
8297403Sobrien#undef remove
8397403Sobrien#undef rename
8497403Sobrien#undef rewind
8597403Sobrien#undef scanf
8697403Sobrien#undef setbuf
8797403Sobrien#undef setvbuf
8897403Sobrien#undef sprintf
8997403Sobrien#undef sscanf
9097403Sobrien#undef tmpfile
9197403Sobrien#undef tmpnam
9297403Sobrien#undef ungetc
9397403Sobrien#undef vfprintf
9497403Sobrien#undef vprintf
9597403Sobrien#undef vsprintf
9697403Sobrien
97132720Skannamespace std
9897403Sobrien{
9997403Sobrien  using ::FILE;
10097403Sobrien  using ::fpos_t;
10197403Sobrien
10297403Sobrien  using ::clearerr;
10397403Sobrien  using ::fclose;
10497403Sobrien  using ::feof;
10597403Sobrien  using ::ferror;
10697403Sobrien  using ::fflush;
10797403Sobrien  using ::fgetc;
10897403Sobrien  using ::fgetpos;
10997403Sobrien  using ::fgets;
11097403Sobrien  using ::fopen;
11197403Sobrien  using ::fprintf;
11297403Sobrien  using ::fputc;
11397403Sobrien  using ::fputs;
11497403Sobrien  using ::fread;
11597403Sobrien  using ::freopen;
11697403Sobrien  using ::fscanf;
11797403Sobrien  using ::fseek;
11897403Sobrien  using ::fsetpos;
11997403Sobrien  using ::ftell;
12097403Sobrien  using ::fwrite;
12197403Sobrien  using ::getc;
12297403Sobrien  using ::getchar;
12397403Sobrien  using ::gets;
12497403Sobrien  using ::perror;
12597403Sobrien  using ::printf;
12697403Sobrien  using ::putc;
12797403Sobrien  using ::putchar;
12897403Sobrien  using ::puts;
12997403Sobrien  using ::remove;
13097403Sobrien  using ::rename;
13197403Sobrien  using ::rewind;
13297403Sobrien  using ::scanf;
13397403Sobrien  using ::setbuf;
13497403Sobrien  using ::setvbuf;
13597403Sobrien  using ::sprintf;
13697403Sobrien  using ::sscanf;
13797403Sobrien  using ::tmpfile;
13897403Sobrien  using ::tmpnam;
13997403Sobrien  using ::ungetc;
14097403Sobrien  using ::vfprintf;
14197403Sobrien  using ::vprintf;
14297403Sobrien  using ::vsprintf;
14397403Sobrien}
14497403Sobrien
145132720Skan#if _GLIBCXX_USE_C99
14697403Sobrien
14797403Sobrien#undef snprintf
14897403Sobrien#undef vfscanf
14997403Sobrien#undef vscanf
15097403Sobrien#undef vsnprintf
15197403Sobrien#undef vsscanf
15297403Sobrien
15397403Sobriennamespace __gnu_cxx
15497403Sobrien{
155132720Skan#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
156117397Skan  extern "C" int
157117397Skan    (snprintf)(char * restrict, size_t, const char * restrict, ...);
158117397Skan  extern "C" int
159117397Skan    (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
160117397Skan  extern "C" int (vscanf)(const char * restrict, __gnuc_va_list);
161117397Skan  extern "C" int
162117397Skan    (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list);
163117397Skan  extern "C" int
164117397Skan    (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list);
165117397Skan#endif
166132720Skan#if !_GLIBCXX_USE_C99_DYNAMIC
16797403Sobrien  using ::snprintf;
16897403Sobrien  using ::vfscanf;
16997403Sobrien  using ::vscanf;
17097403Sobrien  using ::vsnprintf;
17197403Sobrien  using ::vsscanf;
172117397Skan#endif
17397403Sobrien}
17497403Sobrien
17597403Sobriennamespace std
17697403Sobrien{
17797403Sobrien  using __gnu_cxx::snprintf;
17897403Sobrien  using __gnu_cxx::vfscanf;
17997403Sobrien  using __gnu_cxx::vscanf;
18097403Sobrien  using __gnu_cxx::vsnprintf;
18197403Sobrien  using __gnu_cxx::vsscanf;
18297403Sobrien}
183132720Skan#endif
18497403Sobrien
18597403Sobrien#endif
186