]>
Commit | Line | Data |
---|---|---|
98e6e789 | 1 | // -*- C++ -*- forwarding header. |
22aef514 | 2 | |
7b331228 | 3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
22aef514 BK |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
8 | // Free Software Foundation; either version 2, or (at your option) | |
9 | // any later version. | |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
16 | // You should have received a copy of the GNU General Public License along | |
17 | // with this library; see the file COPYING. If not, write to the Free | |
18 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
19 | // USA. | |
20 | ||
21 | // As a special exception, you may use this file as part of a free software | |
22 | // library without restriction. Specifically, if other files instantiate | |
23 | // templates or use macros or inline functions from this file, or you compile | |
24 | // this file and link it with other files to produce an executable, this | |
25 | // file does not by itself cause the resulting executable to be covered by | |
26 | // the GNU General Public License. This exception does not however | |
27 | // invalidate any other reasons why the executable file might be covered by | |
28 | // the GNU General Public License. | |
29 | ||
30 | // | |
98e6e789 BK |
31 | // ISO C++ 14882: ??? |
32 | // | |
22aef514 | 33 | |
98e6e789 | 34 | // Note: This is not a conforming implementation. |
22aef514 | 35 | |
98e6e789 BK |
36 | #ifndef _CPP_CWCHAR |
37 | #define _CPP_CWCHAR 1 | |
38 | ||
39 | #include <bits/c++config.h> | |
7b331228 | 40 | #include <bits/std_cstddef.h> |
98e6e789 BK |
41 | #include <bits/std_cstdio.h> |
42 | #include <bits/std_cstdarg.h> | |
43 | ||
7b331228 | 44 | #if _GLIBCPP_HAVE_WCHAR_H |
98e6e789 BK |
45 | #pragma GCC system_header |
46 | #include <wchar.h> | |
7b331228 BK |
47 | #endif |
48 | ||
8089616e | 49 | |
7b331228 BK |
50 | // Need to do a bit of trickery here with mbstate_t as char_traits |
51 | // assumes it is in wchar.h, regardless of wchar_t specializations. | |
52 | #ifndef _GLIBCPP_HAVE_MBSTATE_T | |
53 | extern "C" | |
54 | { | |
55 | typedef struct | |
56 | { | |
57 | int __fill[6]; | |
58 | } mbstate_t; | |
59 | } | |
60 | #endif | |
61 | ||
62 | namespace std | |
63 | { | |
64 | using ::mbstate_t; | |
65 | } | |
98e6e789 BK |
66 | |
67 | // Get rid of those macros defined in <wchar.h> in lieu of real functions. | |
8089616e BK |
68 | #undef vwprintf |
69 | #undef vwscanf | |
70 | #undef wprintf | |
71 | #undef wscanf | |
72 | #undef getwc | |
98e6e789 | 73 | #undef getwchar |
8089616e BK |
74 | #undef mbsinit |
75 | #undef mbrlen | |
76 | #undef mbrtowc | |
77 | #undef mbsrtowcs | |
78 | #undef wcsrtombs | |
79 | #undef putwc | |
80 | #undef putwchar | |
81 | #undef ungetwc | |
82 | #undef wcrtomb | |
83 | #undef wcstod | |
84 | #undef wcstof | |
85 | #undef wcstol | |
86 | #undef wcstoul | |
87 | #undef wcscpy | |
88 | #undef wcsncpy | |
89 | #undef wcscat | |
90 | #undef wcsncat | |
91 | #undef wcscmp | |
92 | #undef wcscoll | |
93 | #undef wcsncmp | |
94 | #undef wcsxfrm | |
95 | #undef wcschr | |
96 | #undef wcscspn | |
97 | #undef wcslen | |
98 | #undef wcspbrk | |
99 | #undef wcsrchr | |
100 | #undef wcsspn | |
101 | #undef wcsstr | |
102 | #undef wcstok | |
103 | #undef wmemchr | |
104 | #undef wmemcmp | |
105 | #undef wmemcpy | |
106 | #undef wmemmove | |
107 | #undef wmemset | |
108 | #undef wcsftime | |
109 | #undef wcstold | |
110 | #undef wcstoll | |
111 | #undef wcstoull | |
98e6e789 | 112 | |
7b331228 | 113 | #if _GLIBCPP_USE_WCHAR_T |
98e6e789 BK |
114 | namespace std |
115 | { | |
116 | using ::wint_t; | |
98e6e789 BK |
117 | |
118 | extern "C" wint_t btowc(int); | |
119 | extern "C" int wctob(wint_t); | |
120 | extern "C" wint_t fgetwc(FILE*); | |
121 | extern "C" wchar_t* fgetws(wchar_t*, int, FILE*); | |
122 | extern "C" wint_t fputwc(wchar_t, FILE*); | |
123 | extern "C" int fputws(const wchar_t*, FILE*); | |
124 | extern "C" int fwide(FILE*, int); | |
125 | extern "C" int fwprintf(FILE*, const wchar_t*, ...); | |
126 | extern "C" int fwscanf(FILE*, const wchar_t*, ...); | |
127 | extern "C" int swprintf(wchar_t*, size_t, const wchar_t*, ...); | |
128 | extern "C" int swscanf(const wchar_t*, const wchar_t*, ...); | |
129 | extern "C" int vfwprintf(FILE*, const wchar_t*, va_list); | |
130 | extern "C" int vfwscanf(FILE*, const wchar_t*, va_list); | |
131 | extern "C" int vswprintf(wchar_t*, size_t, const wchar_t*, va_list); | |
132 | extern "C" int vswscanf(const wchar_t*, const wchar_t*, va_list); | |
133 | extern "C" int vwprintf(const wchar_t*, va_list); | |
134 | extern "C" int vwscanf(const wchar_t*, va_list); | |
135 | extern "C" int wprintf(const wchar_t*, ...); | |
136 | extern "C" int wscanf(const wchar_t*, ...); | |
137 | extern "C" wint_t getwc(FILE* stream); | |
138 | extern "C" wint_t getwchar(void); | |
139 | extern "C" int mbsinit(const mbstate_t*); | |
140 | extern "C" size_t mbrlen(const char*, size_t, mbstate_t*); | |
141 | extern "C" size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*); | |
142 | extern "C" size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*); | |
143 | extern "C" size_t wcsrtombs(char*, const wchar_t **, size_t, mbstate_t*); | |
144 | extern "C" wint_t putwc(wchar_t, FILE*); | |
145 | extern "C" wint_t putwchar(wchar_t); | |
146 | extern "C" wint_t ungetwc(wint_t, FILE*); | |
147 | extern "C" size_t wcrtomb(char*, wchar_t, mbstate_t*); | |
148 | extern "C" double wcstod(const wchar_t*, wchar_t**); | |
149 | extern "C" float wcstof(const wchar_t*, wchar_t**); | |
150 | extern "C" long int wcstol(const wchar_t*, wchar_t**, int); | |
151 | extern "C" unsigned long int wcstoul(const wchar_t*, wchar_t**, int); | |
152 | extern "C" wchar_t* wcscpy(wchar_t* s1, const wchar_t*); | |
153 | extern "C" wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t); | |
154 | extern "C" wchar_t* wcscat(wchar_t*, const wchar_t*); | |
155 | extern "C" wchar_t* wcsncat(wchar_t*, const wchar_t*, size_t); | |
156 | extern "C" int wcscmp(const wchar_t*, const wchar_t*); | |
157 | extern "C" int wcscoll(const wchar_t*, const wchar_t*); | |
158 | extern "C" int wcsncmp(const wchar_t*, const wchar_t*, size_t); | |
159 | extern "C" size_t wcsxfrm(wchar_t*, const wchar_t*, size_t); | |
92c3688a SW |
160 | extern "C" const wchar_t* wcschr(const wchar_t*, wchar_t); |
161 | inline wchar_t* | |
162 | wcschr(wchar_t* __p, wchar_t __c) | |
163 | { | |
164 | return const_cast<wchar_t*>(wcschr(const_cast<const wchar_t*>(__p), __c)); | |
165 | } | |
98e6e789 BK |
166 | extern "C" size_t wcscspn(const wchar_t*, const wchar_t*); |
167 | extern "C" size_t wcslen(const wchar_t*); | |
92c3688a SW |
168 | extern "C" const wchar_t* wcspbrk(const wchar_t*, const wchar_t*); |
169 | inline wchar_t* | |
170 | wcspbrk(wchar_t* __s1, wchar_t* __s2) | |
171 | { | |
172 | return const_cast<wchar_t*>(wcspbrk(const_cast<const wchar_t*>(__s1), __s2)); | |
173 | } | |
174 | extern "C" const wchar_t* wcsrchr(const wchar_t*, wchar_t); | |
175 | inline wchar_t* | |
176 | wcsrchr(wchar_t* __p, wchar_t __c) | |
177 | { | |
178 | return const_cast<wchar_t*>(wcsrchr(const_cast<const wchar_t*>(__p), __c)); | |
179 | } | |
98e6e789 | 180 | extern "C" size_t wcsspn(const wchar_t*, const wchar_t*); |
92c3688a SW |
181 | extern "C" const wchar_t* wcsstr(const wchar_t*, const wchar_t*); |
182 | inline wchar_t* | |
183 | wcsstr(wchar_t* __s1, wchar_t* __s2) | |
184 | { | |
185 | return const_cast<wchar_t*>(wcsstr(const_cast<const wchar_t*>(__s1), __s2)); | |
186 | } | |
98e6e789 | 187 | extern "C" wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**); |
92c3688a SW |
188 | extern "C" const wchar_t* wmemchr(const wchar_t*, wchar_t, size_t); |
189 | inline wchar_t* | |
190 | wmemchr(wchar_t* __p, wchar_t __c, size_t __n) | |
191 | { | |
192 | return const_cast<wchar_t*>(wmemchr(const_cast<const wchar_t*>(__p), __c, __n)); | |
193 | } | |
98e6e789 BK |
194 | extern "C" int wmemcmp(const wchar_t*, const wchar_t*, size_t); |
195 | //extern "C" int wmemcmp(wchar_t*, const wchar_t*, size_t); | |
196 | extern "C" wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t); | |
197 | extern "C" wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t); | |
198 | extern "C" wchar_t* wmemset(wchar_t*, wchar_t, size_t); | |
199 | extern "C" size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*); | |
22aef514 BK |
200 | |
201 | #if 0 | |
98e6e789 BK |
202 | // Full C99 listing |
203 | extern "C" long double wcstold(const wchar_t*, wchar_t**); | |
204 | extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int); | |
205 | extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int); | |
22aef514 | 206 | #endif |
98e6e789 | 207 | } |
98e6e789 BK |
208 | #endif //_GLIBCPP_USE_WCHAR_T |
209 | ||
98e6e789 | 210 | #endif |