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