libstdc++
cstdio
Go to the documentation of this file.
00001 // -*- C++ -*- forwarding header.
00002 
00003 // Copyright (C) 1997-2013 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the
00008 // Free Software Foundation; either version 3, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 /** @file include/cstdio
00026  *  This is a Standard C++ Library file.  You should @c \#include this file
00027  *  in your programs, rather than any of the @a *.h implementation files.
00028  *
00029  *  This is the C++ version of the Standard C Library header @c stdio.h,
00030  *  and its contents are (mostly) the same as that header, but are all
00031  *  contained in the namespace @c std (except for names which are defined
00032  *  as macros in C).
00033  */
00034 
00035 //
00036 // ISO C++ 14882: 27.8.2  C Library files
00037 //
00038 
00039 #pragma GCC system_header
00040 
00041 #include <bits/c++config.h>
00042 #include <stdio.h>
00043 
00044 #ifndef _GLIBCXX_CSTDIO
00045 #define _GLIBCXX_CSTDIO 1
00046 
00047 #ifndef _GLIBCXX_HAVE_GETS
00048 extern "C" char* gets (char* __s) __attribute__((deprecated));
00049 #endif
00050 
00051 // Get rid of those macros defined in <stdio.h> in lieu of real functions.
00052 #undef clearerr
00053 #undef fclose
00054 #undef feof
00055 #undef ferror
00056 #undef fflush
00057 #undef fgetc
00058 #undef fgetpos
00059 #undef fgets
00060 #undef fopen
00061 #undef fprintf
00062 #undef fputc
00063 #undef fputs
00064 #undef fread
00065 #undef freopen
00066 #undef fscanf
00067 #undef fseek
00068 #undef fsetpos
00069 #undef ftell
00070 #undef fwrite
00071 #undef getc
00072 #undef gets
00073 #undef perror
00074 #undef printf
00075 #undef putc
00076 #undef putchar
00077 #undef puts
00078 #undef remove
00079 #undef rename
00080 #undef rewind
00081 #undef scanf
00082 #undef setbuf
00083 #undef setvbuf
00084 #undef sprintf
00085 #undef sscanf
00086 #undef tmpfile
00087 #undef tmpnam
00088 #undef ungetc
00089 #undef vfprintf
00090 #undef vprintf
00091 #undef vsprintf
00092 
00093 namespace std
00094 {
00095   using ::FILE;
00096   using ::fpos_t;
00097 
00098   using ::clearerr;
00099   using ::fclose;
00100   using ::feof;
00101   using ::ferror;
00102   using ::fflush;
00103   using ::fgetc;
00104   using ::fgetpos;
00105   using ::fgets;
00106   using ::fopen;
00107   using ::fprintf;
00108   using ::fputc;
00109   using ::fputs;
00110   using ::fread;
00111   using ::freopen;
00112   using ::fscanf;
00113   using ::fseek;
00114   using ::fsetpos;
00115   using ::ftell;
00116   using ::fwrite;
00117   using ::getc;
00118   using ::getchar;
00119   using ::gets;
00120   using ::perror;
00121   using ::printf;
00122   using ::putc;
00123   using ::putchar;
00124   using ::puts;
00125   using ::remove;
00126   using ::rename;
00127   using ::rewind;
00128   using ::scanf;
00129   using ::setbuf;
00130   using ::setvbuf;
00131   using ::sprintf;
00132   using ::sscanf;
00133   using ::tmpfile;
00134   using ::tmpnam;
00135   using ::ungetc;
00136   using ::vfprintf;
00137   using ::vprintf;
00138   using ::vsprintf;
00139 } // namespace
00140 
00141 #if _GLIBCXX_USE_C99
00142 
00143 #undef snprintf
00144 #undef vfscanf
00145 #undef vscanf
00146 #undef vsnprintf
00147 #undef vsscanf
00148 
00149 namespace __gnu_cxx
00150 {
00151 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
00152   extern "C" int
00153   (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...)
00154   throw ();
00155   extern "C" int
00156   (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
00157   extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
00158   extern "C" int
00159   (vsnprintf)(char * __restrict, std::size_t, const char * __restrict,
00160           __gnuc_va_list) throw ();
00161   extern "C" int
00162   (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list)
00163   throw ();
00164 #endif
00165 
00166 #if !_GLIBCXX_USE_C99_DYNAMIC
00167   using ::snprintf;
00168   using ::vfscanf;
00169   using ::vscanf;
00170   using ::vsnprintf;
00171   using ::vsscanf;
00172 #endif
00173 } // namespace __gnu_cxx
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 } // namespace std
00183 
00184 #endif // _GLIBCXX_USE_C99
00185 
00186 #endif