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 getchar
00073 #undef gets
00074 #undef perror
00075 #undef printf
00076 #undef putc
00077 #undef putchar
00078 #undef puts
00079 #undef remove
00080 #undef rename
00081 #undef rewind
00082 #undef scanf
00083 #undef setbuf
00084 #undef setvbuf
00085 #undef sprintf
00086 #undef sscanf
00087 #undef tmpfile
00088 #undef tmpnam
00089 #undef ungetc
00090 #undef vfprintf
00091 #undef vprintf
00092 #undef vsprintf
00093 
00094 namespace std
00095 {
00096   using ::FILE;
00097   using ::fpos_t;
00098 
00099   using ::clearerr;
00100   using ::fclose;
00101   using ::feof;
00102   using ::ferror;
00103   using ::fflush;
00104   using ::fgetc;
00105   using ::fgetpos;
00106   using ::fgets;
00107   using ::fopen;
00108   using ::fprintf;
00109   using ::fputc;
00110   using ::fputs;
00111   using ::fread;
00112   using ::freopen;
00113   using ::fscanf;
00114   using ::fseek;
00115   using ::fsetpos;
00116   using ::ftell;
00117   using ::fwrite;
00118   using ::getc;
00119   using ::getchar;
00120   using ::gets;
00121   using ::perror;
00122   using ::printf;
00123   using ::putc;
00124   using ::putchar;
00125   using ::puts;
00126   using ::remove;
00127   using ::rename;
00128   using ::rewind;
00129   using ::scanf;
00130   using ::setbuf;
00131   using ::setvbuf;
00132   using ::sprintf;
00133   using ::sscanf;
00134   using ::tmpfile;
00135   using ::tmpnam;
00136   using ::ungetc;
00137   using ::vfprintf;
00138   using ::vprintf;
00139   using ::vsprintf;
00140 } // namespace
00141 
00142 #if _GLIBCXX_USE_C99
00143 
00144 #undef snprintf
00145 #undef vfscanf
00146 #undef vscanf
00147 #undef vsnprintf
00148 #undef vsscanf
00149 
00150 namespace __gnu_cxx
00151 {
00152 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
00153   extern "C" int
00154   (snprintf)(char * __restrict, std::size_t, const char * __restrict, ...)
00155   throw ();
00156   extern "C" int
00157   (vfscanf)(FILE * __restrict, const char * __restrict, __gnuc_va_list);
00158   extern "C" int (vscanf)(const char * __restrict, __gnuc_va_list);
00159   extern "C" int
00160   (vsnprintf)(char * __restrict, std::size_t, const char * __restrict,
00161           __gnuc_va_list) throw ();
00162   extern "C" int
00163   (vsscanf)(const char * __restrict, const char * __restrict, __gnuc_va_list)
00164   throw ();
00165 #endif
00166 
00167 #if !_GLIBCXX_USE_C99_DYNAMIC
00168   using ::snprintf;
00169   using ::vfscanf;
00170   using ::vscanf;
00171   using ::vsnprintf;
00172   using ::vsscanf;
00173 #endif
00174 } // namespace __gnu_cxx
00175 
00176 namespace std
00177 {
00178   using ::__gnu_cxx::snprintf;
00179   using ::__gnu_cxx::vfscanf;
00180   using ::__gnu_cxx::vscanf;
00181   using ::__gnu_cxx::vsnprintf;
00182   using ::__gnu_cxx::vsscanf;
00183 } // namespace std
00184 
00185 #endif // _GLIBCXX_USE_C99
00186 
00187 #endif