197403Sobrien// -*- C++ -*- forwarding header.
297403Sobrien
3169691Skan// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
497403Sobrien// Free Software Foundation, Inc.
597403Sobrien//
697403Sobrien// This file is part of the GNU ISO C++ Library.  This library is free
797403Sobrien// software; you can redistribute it and/or modify it under the
897403Sobrien// terms of the GNU General Public License as published by the
997403Sobrien// Free Software Foundation; either version 2, or (at your option)
1097403Sobrien// any later version.
1197403Sobrien
1297403Sobrien// This library is distributed in the hope that it will be useful,
1397403Sobrien// but WITHOUT ANY WARRANTY; without even the implied warranty of
1497403Sobrien// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1597403Sobrien// GNU General Public License for more details.
1697403Sobrien
1797403Sobrien// You should have received a copy of the GNU General Public License along
1897403Sobrien// with this library; see the file COPYING.  If not, write to the Free
19169691Skan// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2097403Sobrien// USA.
2197403Sobrien
2297403Sobrien// As a special exception, you may use this file as part of a free software
2397403Sobrien// library without restriction.  Specifically, if other files instantiate
2497403Sobrien// templates or use macros or inline functions from this file, or you compile
2597403Sobrien// this file and link it with other files to produce an executable, this
2697403Sobrien// file does not by itself cause the resulting executable to be covered by
2797403Sobrien// the GNU General Public License.  This exception does not however
2897403Sobrien// invalidate any other reasons why the executable file might be covered by
2997403Sobrien// the GNU General Public License.
3097403Sobrien
31169691Skan/** @file include/cwchar
3297403Sobrien *  This is a Standard C++ Library file.  You should @c #include this file
3397403Sobrien *  in your programs, rather than any of the "*.h" implementation files.
3497403Sobrien *
3597403Sobrien *  This is the C++ version of the Standard C Library header @c wchar.h,
3697403Sobrien *  and its contents are (mostly) the same as that header, but are all
37169691Skan *  contained in the namespace @c std (except for names which are defined
38169691Skan *  as macros in C).
3997403Sobrien */
4097403Sobrien
41169691Skan//
42169691Skan// ISO C++ 14882: 21.4
43169691Skan//
44169691Skan
45132720Skan#ifndef _GLIBCXX_CWCHAR
46132720Skan#define _GLIBCXX_CWCHAR 1
4797403Sobrien
4897403Sobrien#pragma GCC system_header
4997403Sobrien
5097403Sobrien#include <bits/c++config.h>
5197403Sobrien#include <cstddef>
5297403Sobrien#include <ctime>
5397403Sobrien
54132720Skan#if _GLIBCXX_HAVE_WCHAR_H
5597403Sobrien#include <wchar.h>
5697403Sobrien#endif
5797403Sobrien
5897403Sobrien// Need to do a bit of trickery here with mbstate_t as char_traits
5997403Sobrien// assumes it is in wchar.h, regardless of wchar_t specializations.
60132720Skan#ifndef _GLIBCXX_HAVE_MBSTATE_T
61132720Skanextern "C"
6297403Sobrien{
63132720Skan  typedef struct
6497403Sobrien  {
6597403Sobrien    int __fill[6];
6697403Sobrien  } mbstate_t;
6797403Sobrien}
6897403Sobrien#endif
6997403Sobrien
70169691Skan_GLIBCXX_BEGIN_NAMESPACE(std)
71169691Skan
7297403Sobrien  using ::mbstate_t;
7397403Sobrien
74169691Skan_GLIBCXX_END_NAMESPACE
75169691Skan
7697403Sobrien// Get rid of those macros defined in <wchar.h> in lieu of real functions.
7797403Sobrien#undef btowc
7897403Sobrien#undef fgetwc
7997403Sobrien#undef fgetws
8097403Sobrien#undef fputwc
8197403Sobrien#undef fputws
8297403Sobrien#undef fwide
8397403Sobrien#undef fwprintf
8497403Sobrien#undef fwscanf
8597403Sobrien#undef getwc
8697403Sobrien#undef getwchar
8797403Sobrien#undef mbrlen
8897403Sobrien#undef mbrtowc
8997403Sobrien#undef mbsinit
9097403Sobrien#undef mbsrtowcs
9197403Sobrien#undef putwc
9297403Sobrien#undef putwchar
9397403Sobrien#undef swprintf
9497403Sobrien#undef swscanf
9597403Sobrien#undef ungetwc
9697403Sobrien#undef vfwprintf
97132720Skan#if _GLIBCXX_HAVE_VFWSCANF
98132720Skan# undef vfwscanf
99132720Skan#endif
10097403Sobrien#undef vswprintf
101132720Skan#if _GLIBCXX_HAVE_VSWSCANF
102132720Skan# undef vswscanf
103132720Skan#endif
10497403Sobrien#undef vwprintf
105132720Skan#if _GLIBCXX_HAVE_VWSCANF
106132720Skan# undef vwscanf
107132720Skan#endif
10897403Sobrien#undef wcrtomb
10997403Sobrien#undef wcscat
11097403Sobrien#undef wcschr
11197403Sobrien#undef wcscmp
11297403Sobrien#undef wcscoll
11397403Sobrien#undef wcscpy
11497403Sobrien#undef wcscspn
11597403Sobrien#undef wcsftime
11697403Sobrien#undef wcslen
11797403Sobrien#undef wcsncat
11897403Sobrien#undef wcsncmp
11997403Sobrien#undef wcsncpy
12097403Sobrien#undef wcspbrk
12197403Sobrien#undef wcsrchr
12297403Sobrien#undef wcsrtombs
12397403Sobrien#undef wcsspn
12497403Sobrien#undef wcsstr
12597403Sobrien#undef wcstod
126132720Skan#if _GLIBCXX_HAVE_WCSTOF
127132720Skan# undef wcstof
128132720Skan#endif
12997403Sobrien#undef wcstok
13097403Sobrien#undef wcstol
13197403Sobrien#undef wcstoul
13297403Sobrien#undef wcsxfrm
13397403Sobrien#undef wctob
13497403Sobrien#undef wmemchr
13597403Sobrien#undef wmemcmp
13697403Sobrien#undef wmemcpy
13797403Sobrien#undef wmemmove
13897403Sobrien#undef wmemset
13997403Sobrien#undef wprintf
14097403Sobrien#undef wscanf
14197403Sobrien
142132720Skan#if _GLIBCXX_USE_WCHAR_T
143169691Skan
144169691Skan_GLIBCXX_BEGIN_NAMESPACE(std)
145169691Skan
14697403Sobrien  using ::wint_t;
14797403Sobrien
14897403Sobrien  using ::btowc;
14997403Sobrien  using ::fgetwc;
15097403Sobrien  using ::fgetws;
15197403Sobrien  using ::fputwc;
15297403Sobrien  using ::fputws;
15397403Sobrien  using ::fwide;
15497403Sobrien  using ::fwprintf;
15597403Sobrien  using ::fwscanf;
15697403Sobrien  using ::getwc;
15797403Sobrien  using ::getwchar;
15897403Sobrien  using ::mbrlen;
15997403Sobrien  using ::mbrtowc;
16097403Sobrien  using ::mbsinit;
16197403Sobrien  using ::mbsrtowcs;
16297403Sobrien  using ::putwc;
16397403Sobrien  using ::putwchar;
16497403Sobrien  using ::swprintf;
16597403Sobrien  using ::swscanf;
16697403Sobrien  using ::ungetwc;
16797403Sobrien  using ::vfwprintf;
168132720Skan#if _GLIBCXX_HAVE_VFWSCANF
16997403Sobrien  using ::vfwscanf;
170132720Skan#endif
17197403Sobrien  using ::vswprintf;
172132720Skan#if _GLIBCXX_HAVE_VSWSCANF
17397403Sobrien  using ::vswscanf;
174132720Skan#endif
17597403Sobrien  using ::vwprintf;
176132720Skan#if _GLIBCXX_HAVE_VWSCANF
17797403Sobrien  using ::vwscanf;
178132720Skan#endif
17997403Sobrien  using ::wcrtomb;
18097403Sobrien  using ::wcscat;
18197403Sobrien  using ::wcscmp;
18297403Sobrien  using ::wcscoll;
18397403Sobrien  using ::wcscpy;
18497403Sobrien  using ::wcscspn;
18597403Sobrien  using ::wcsftime;
18697403Sobrien  using ::wcslen;
18797403Sobrien  using ::wcsncat;
18897403Sobrien  using ::wcsncmp;
18997403Sobrien  using ::wcsncpy;
19097403Sobrien  using ::wcsrtombs;
19197403Sobrien  using ::wcsspn;
19297403Sobrien  using ::wcstod;
193132720Skan#if _GLIBCXX_HAVE_WCSTOF
19497403Sobrien  using ::wcstof;
195132720Skan#endif
19697403Sobrien  using ::wcstok;
19797403Sobrien  using ::wcstol;
19897403Sobrien  using ::wcstoul;
19997403Sobrien  using ::wcsxfrm;
20097403Sobrien  using ::wctob;
20197403Sobrien  using ::wmemcmp;
20297403Sobrien  using ::wmemcpy;
20397403Sobrien  using ::wmemmove;
20497403Sobrien  using ::wmemset;
20597403Sobrien  using ::wprintf;
20697403Sobrien  using ::wscanf;
20797403Sobrien
20897403Sobrien  using ::wcschr;
20997403Sobrien
21097403Sobrien  inline wchar_t*
21197403Sobrien  wcschr(wchar_t* __p, wchar_t __c)
21297403Sobrien  { return wcschr(const_cast<const wchar_t*>(__p), __c); }
21397403Sobrien
21497403Sobrien  using ::wcspbrk;
21597403Sobrien
21697403Sobrien  inline wchar_t*
217169691Skan  wcspbrk(wchar_t* __s1, const wchar_t* __s2)
21897403Sobrien  { return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
21997403Sobrien
22097403Sobrien  using ::wcsrchr;
22197403Sobrien
22297403Sobrien  inline wchar_t*
22397403Sobrien  wcsrchr(wchar_t* __p, wchar_t __c)
22497403Sobrien  { return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
22597403Sobrien
22697403Sobrien  using ::wcsstr;
22797403Sobrien
22897403Sobrien  inline wchar_t*
229132720Skan  wcsstr(wchar_t* __s1, const wchar_t* __s2)
23097403Sobrien  { return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
23197403Sobrien
23297403Sobrien  using ::wmemchr;
23397403Sobrien
23497403Sobrien  inline wchar_t*
23597403Sobrien  wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
23697403Sobrien  { return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
23797403Sobrien
238169691Skan_GLIBCXX_END_NAMESPACE
239169691Skan
240132720Skan#if _GLIBCXX_USE_C99
24197403Sobrien
24297403Sobrien#undef wcstold
24397403Sobrien#undef wcstoll
24497403Sobrien#undef wcstoull
24597403Sobrien
246169691Skan_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
247169691Skan
248132720Skan#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
249117397Skan  extern "C" long double
250117397Skan    (wcstold)(const wchar_t * restrict, wchar_t ** restrict);
251117397Skan#endif
252132720Skan#if !_GLIBCXX_USE_C99_DYNAMIC
25397403Sobrien  using ::wcstold;
254117397Skan#endif
255132720Skan#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
256117397Skan  extern "C" long long int
257117397Skan    (wcstoll)(const wchar_t * restrict, wchar_t ** restrict, int);
258117397Skan  extern "C" unsigned long long int
259117397Skan    (wcstoull)(const wchar_t * restrict, wchar_t ** restrict, int);
260117397Skan#endif
261132720Skan#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
26297403Sobrien  using ::wcstoll;
26397403Sobrien  using ::wcstoull;
264117397Skan#endif
26597403Sobrien
266169691Skan_GLIBCXX_END_NAMESPACE
267169691Skan
268169691Skan_GLIBCXX_BEGIN_NAMESPACE(std)
269169691Skan
270169691Skan  using ::__gnu_cxx::wcstold;
271169691Skan  using ::__gnu_cxx::wcstoll;
272169691Skan  using ::__gnu_cxx::wcstoull;
273169691Skan
274169691Skan_GLIBCXX_END_NAMESPACE
275169691Skan
27697403Sobrien#endif
27797403Sobrien
278132720Skan#endif //_GLIBCXX_USE_WCHAR_T
27997403Sobrien
280132720Skan#endif
281