cwchar

Go to the documentation of this file.
00001 // -*- C++ -*- forwarding header.
00002 
00003 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
00004 // 2006, 2007, 2008, 2009
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/cwchar
00028  *  This is a Standard C++ Library file.  You should @c #include this file
00029  *  in your programs, rather than any of the "*.h" implementation files.
00030  *
00031  *  This is the C++ version of the Standard C Library header @c wchar.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: 21.4
00039 //
00040 
00041 #pragma GCC system_header
00042 
00043 #include <bits/c++config.h>
00044 #include <cstddef>
00045 
00046 #if _GLIBCXX_HAVE_WCHAR_H
00047 #include <wchar.h>
00048 #endif
00049 
00050 #ifndef _GLIBCXX_CWCHAR
00051 #define _GLIBCXX_CWCHAR 1
00052 
00053 // Need to do a bit of trickery here with mbstate_t as char_traits
00054 // assumes it is in wchar.h, regardless of wchar_t specializations.
00055 #ifndef _GLIBCXX_HAVE_MBSTATE_T
00056 extern "C"
00057 {
00058   typedef struct
00059   {
00060     int __fill[6];
00061   } mbstate_t;
00062 }
00063 #endif
00064 
00065 _GLIBCXX_BEGIN_NAMESPACE(std)
00066 
00067   using ::mbstate_t;
00068 
00069 _GLIBCXX_END_NAMESPACE
00070 
00071 // Get rid of those macros defined in <wchar.h> in lieu of real functions.
00072 #undef btowc
00073 #undef fgetwc
00074 #undef fgetws
00075 #undef fputwc
00076 #undef fputws
00077 #undef fwide
00078 #undef fwprintf
00079 #undef fwscanf
00080 #undef getwc
00081 #undef getwchar
00082 #undef mbrlen
00083 #undef mbrtowc
00084 #undef mbsinit
00085 #undef mbsrtowcs
00086 #undef putwc
00087 #undef putwchar
00088 #undef swprintf
00089 #undef swscanf
00090 #undef ungetwc
00091 #undef vfwprintf
00092 #if _GLIBCXX_HAVE_VFWSCANF
00093 # undef vfwscanf
00094 #endif
00095 #undef vswprintf
00096 #if _GLIBCXX_HAVE_VSWSCANF
00097 # undef vswscanf
00098 #endif
00099 #undef vwprintf
00100 #if _GLIBCXX_HAVE_VWSCANF
00101 # undef vwscanf
00102 #endif
00103 #undef wcrtomb
00104 #undef wcscat
00105 #undef wcschr
00106 #undef wcscmp
00107 #undef wcscoll
00108 #undef wcscpy
00109 #undef wcscspn
00110 #undef wcsftime
00111 #undef wcslen
00112 #undef wcsncat
00113 #undef wcsncmp
00114 #undef wcsncpy
00115 #undef wcspbrk
00116 #undef wcsrchr
00117 #undef wcsrtombs
00118 #undef wcsspn
00119 #undef wcsstr
00120 #undef wcstod
00121 #if _GLIBCXX_HAVE_WCSTOF
00122 # undef wcstof
00123 #endif
00124 #undef wcstok
00125 #undef wcstol
00126 #undef wcstoul
00127 #undef wcsxfrm
00128 #undef wctob
00129 #undef wmemchr
00130 #undef wmemcmp
00131 #undef wmemcpy
00132 #undef wmemmove
00133 #undef wmemset
00134 #undef wprintf
00135 #undef wscanf
00136 
00137 #if _GLIBCXX_USE_WCHAR_T
00138 
00139 _GLIBCXX_BEGIN_NAMESPACE(std)
00140 
00141   using ::wint_t;
00142 
00143   using ::btowc;
00144   using ::fgetwc;
00145   using ::fgetws;
00146   using ::fputwc;
00147   using ::fputws;
00148   using ::fwide;
00149   using ::fwprintf;
00150   using ::fwscanf;
00151   using ::getwc;
00152   using ::getwchar;
00153   using ::mbrlen;
00154   using ::mbrtowc;
00155   using ::mbsinit;
00156   using ::mbsrtowcs;
00157   using ::putwc;
00158   using ::putwchar;
00159   using ::swprintf;
00160   using ::swscanf;
00161   using ::ungetwc;
00162   using ::vfwprintf;
00163 #if _GLIBCXX_HAVE_VFWSCANF
00164   using ::vfwscanf;
00165 #endif
00166   using ::vswprintf;
00167 #if _GLIBCXX_HAVE_VSWSCANF
00168   using ::vswscanf;
00169 #endif
00170   using ::vwprintf;
00171 #if _GLIBCXX_HAVE_VWSCANF
00172   using ::vwscanf;
00173 #endif
00174   using ::wcrtomb;
00175   using ::wcscat;
00176   using ::wcscmp;
00177   using ::wcscoll;
00178   using ::wcscpy;
00179   using ::wcscspn;
00180   using ::wcsftime;
00181   using ::wcslen;
00182   using ::wcsncat;
00183   using ::wcsncmp;
00184   using ::wcsncpy;
00185   using ::wcsrtombs;
00186   using ::wcsspn;
00187   using ::wcstod;
00188 #if _GLIBCXX_HAVE_WCSTOF
00189   using ::wcstof;
00190 #endif
00191   using ::wcstok;
00192   using ::wcstol;
00193   using ::wcstoul;
00194   using ::wcsxfrm;
00195   using ::wctob;
00196   using ::wmemcmp;
00197   using ::wmemcpy;
00198   using ::wmemmove;
00199   using ::wmemset;
00200   using ::wprintf;
00201   using ::wscanf;
00202   using ::wcschr;
00203   using ::wcspbrk;
00204   using ::wcsrchr;
00205   using ::wcsstr;
00206   using ::wmemchr;
00207 
00208 #ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
00209   inline wchar_t*
00210   wcschr(wchar_t* __p, wchar_t __c)
00211   { return wcschr(const_cast<const wchar_t*>(__p), __c); }
00212 
00213   inline wchar_t*
00214   wcspbrk(wchar_t* __s1, const wchar_t* __s2)
00215   { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
00216 
00217   inline wchar_t*
00218   wcsrchr(wchar_t* __p, wchar_t __c)
00219   { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
00220 
00221   inline wchar_t*
00222   wcsstr(wchar_t* __s1, const wchar_t* __s2)
00223   { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
00224 
00225   inline wchar_t*
00226   wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
00227   { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
00228 #endif
00229 
00230 _GLIBCXX_END_NAMESPACE
00231 
00232 #if _GLIBCXX_USE_C99
00233 
00234 #undef wcstold
00235 #undef wcstoll
00236 #undef wcstoull
00237 
00238 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
00239 
00240 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
00241   extern "C" long double
00242     (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
00243 #endif
00244 #if !_GLIBCXX_USE_C99_DYNAMIC
00245   using ::wcstold;
00246 #endif
00247 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00248   extern "C" long long int
00249     (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
00250   extern "C" unsigned long long int
00251     (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
00252 #endif
00253 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00254   using ::wcstoll;
00255   using ::wcstoull;
00256 #endif
00257 
00258 _GLIBCXX_END_NAMESPACE
00259 
00260 _GLIBCXX_BEGIN_NAMESPACE(std)
00261 
00262   using ::__gnu_cxx::wcstold;
00263   using ::__gnu_cxx::wcstoll;
00264   using ::__gnu_cxx::wcstoull;
00265 
00266 _GLIBCXX_END_NAMESPACE
00267 
00268 #endif
00269 
00270 #endif //_GLIBCXX_USE_WCHAR_T
00271 
00272 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00273 #  if defined(_GLIBCXX_INCLUDE_AS_TR1)
00274 #    error C++0x header cannot be included from TR1 header
00275 #  endif
00276 #  if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
00277 #    include <tr1_impl/cwchar>
00278 #  else
00279 #    define _GLIBCXX_INCLUDE_AS_CXX0X
00280 #    define _GLIBCXX_BEGIN_NAMESPACE_TR1
00281 #    define _GLIBCXX_END_NAMESPACE_TR1
00282 #    define _GLIBCXX_TR1
00283 #    include <tr1_impl/cwchar>
00284 #    undef _GLIBCXX_TR1
00285 #    undef _GLIBCXX_END_NAMESPACE_TR1
00286 #    undef _GLIBCXX_BEGIN_NAMESPACE_TR1
00287 #    undef _GLIBCXX_INCLUDE_AS_CXX0X
00288 #  endif
00289 #endif
00290 
00291 #endif

Generated on Thu Jul 23 21:16:02 2009 for libstdc++ by  doxygen 1.5.8