# cstdio

Go to the documentation of this file.

    00001 // -*- C++ -*- forwarding header.
    00002
    00003 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
    00004 // Free Software Foundation, Inc.
    00005 //
    00006 // This file is part of the GNU ISO C++ Library.  This library is free
    00007 // software; you can redistribute it and/or modify it under the
    00008 // terms of the GNU General Public License as published by the
    00009 // Free Software Foundation; either version 2, or (at your option)
    00010 // any later version.
    00011
    00012 // This library is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00015 // GNU General Public License for more details.
    00016
    00017 // You should have received a copy of the GNU General Public License along
    00018 // with this library; see the file COPYING.  If not, write to the Free
    00019 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
    00020 // USA.
    00021
    00022 // As a special exception, you may use this file as part of a free software
    00023 // library without restriction.  Specifically, if other files instantiate
    00024 // templates or use macros or inline functions from this file, or you compile
    00025 // this file and link it with other files to produce an executable, this
    00026 // file does not by itself cause the resulting executable to be covered by
    00027 // the GNU General Public License.  This exception does not however
    00028 // invalidate any other reasons why the executable file might be covered by
    00029 // the GNU General Public License.
    00030
    00031 //
    00032 // ISO C++ 14882: 27.8.2  C Library files
    00033 //
    00034
    00035 /** @file cstdio
    00036  *  This is a Standard C++ Library file.  You should @c #include this file
    00037  *  in your programs, rather than any of the "*.h" implementation files.
    00038  *
    00039  *  This is the C++ version of the Standard C Library header @c stdio.h,
    00040  *  and its contents are (mostly) the same as that header, but are all
    00041  *  contained in the namespace @c std.
    00042  */
    00043
    00044 #ifndef _GLIBCXX_CSTDIO
    00045 #define _GLIBCXX_CSTDIO 1
    00046
    00047 #pragma GCC system_header
    00048
    00049 #include <bits/c++config.h>
    00050 #include <cstddef>
    00051
    00052 #include <stdio.h>
    00053
    00054 // Get rid of those macros defined in <stdio.h> in lieu of real functions.
    00055 #undef clearerr
    00056 #undef fclose
    00057 #undef feof
    00058 #undef ferror
    00059 #undef fflush
    00060 #undef fgetc
    00061 #undef fgetpos
    00062 #undef fgets
    00063 #undef fopen
    00064 #undef fprintf
    00065 #undef fputc
    00066 #undef fputs
    00067 #undef fread
    00068 #undef freopen
    00069 #undef fscanf
    00070 #undef fseek
    00071 #undef fsetpos
    00072 #undef ftell
    00073 #undef fwrite
    00074 #undef getc
    00075 #undef getchar
    00076 #undef gets
    00077 #undef perror
    00078 #undef printf
    00079 #undef putc
    00080 #undef putchar
    00081 #undef puts
    00082 #undef remove
    00083 #undef rename
    00084 #undef rewind
    00085 #undef scanf
    00086 #undef setbuf
    00087 #undef setvbuf
    00088 #undef sprintf
    00089 #undef sscanf
    00090 #undef tmpfile
    00091 #undef tmpnam
    00092 #undef ungetc
    00093 #undef vfprintf
    00094 #undef vprintf
    00095 #undef vsprintf
    00096
    00097 namespace std
    00098 {
    00099   using ::FILE;
    00100   using ::fpos_t;
    00101
    00102   using ::clearerr;
    00103   using ::fclose;
    00104   using ::feof;
    00105   using ::ferror;
    00106   using ::fflush;
    00107   using ::fgetc;
    00108   using ::fgetpos;
    00109   using ::fgets;
    00110   using ::fopen;
    00111   using ::fprintf;
    00112   using ::fputc;
    00113   using ::fputs;
    00114   using ::fread;
    00115   using ::freopen;
    00116   using ::fscanf;
    00117   using ::fseek;
    00118   using ::fsetpos;
    00119   using ::ftell;
    00120   using ::fwrite;
    00121   using ::getc;
    00122   using ::getchar;
    00123   using ::gets;
    00124   using ::perror;
    00125   using ::printf;
    00126   using ::putc;
    00127   using ::putchar;
    00128   using ::puts;
    00129   using ::remove;
    00130   using ::rename;
    00131   using ::rewind;
    00132   using ::scanf;
    00133   using ::setbuf;
    00134   using ::setvbuf;
    00135   using ::sprintf;
    00136   using ::sscanf;
    00137   using ::tmpfile;
    00138   using ::tmpnam;
    00139   using ::ungetc;
    00140   using ::vfprintf;
    00141   using ::vprintf;
    00142   using ::vsprintf;
    00143 }
    00144
    00145 #if _GLIBCXX_USE_C99
    00146
    00147 #undef snprintf
    00148 #undef vfscanf
    00149 #undef vscanf
    00150 #undef vsnprintf
    00151 #undef vsscanf
    00152
    00153 namespace __gnu_cxx
    00154 {
    00155 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
    00156   extern "C" int
    00157     (snprintf)(char * restrict, size_t, const char * restrict, ...);
    00158   extern "C" int
    00159     (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
    00160   extern "C" int (vscanf)(const char * restrict, __gnuc_va_list);
    00161   extern "C" int
    00162     (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list);
    00163   extern "C" int
    00164     (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list);
    00165 #endif
    00166 #if !_GLIBCXX_USE_C99_DYNAMIC
    00167   using ::snprintf;
    00168   using ::vfscanf;
    00169   using ::vscanf;
    00170   using ::vsnprintf;
    00171   using ::vsscanf;
    00172 #endif
    00173 }
    00174
    00175 namespace std
    00176 {
    00177   using __gnu_cxx::snprintf;
    00178   using __gnu_cxx::vfscanf;
    00179   using __gnu_cxx::vscanf;
    00180   using __gnu_cxx::vsnprintf;
    00181   using __gnu_cxx::vsscanf;
    00182 }
    00183 #endif
    00184
    00185 #endif