williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
|
williamr@2
|
3 |
*
|
williamr@2
|
4 |
* Copyright (c) 1999
|
williamr@2
|
5 |
* Boris Fomitchev
|
williamr@2
|
6 |
*
|
williamr@2
|
7 |
* This material is provided "as is", with absolutely no warranty expressed
|
williamr@2
|
8 |
* or implied. Any use is at your own risk.
|
williamr@2
|
9 |
*
|
williamr@2
|
10 |
* Permission to use or copy this software for any purpose is hereby granted
|
williamr@2
|
11 |
* without fee, provided the above notices are retained on all copies.
|
williamr@2
|
12 |
* Permission to modify the code and to distribute modified code is granted,
|
williamr@2
|
13 |
* provided the above notices are retained, and a notice that the code was
|
williamr@2
|
14 |
* modified is included with the above copyright notice.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef _STLP_CWCHAR
|
williamr@2
|
19 |
# define _STLP_CWCHAR
|
williamr@2
|
20 |
|
williamr@2
|
21 |
# ifndef _STLP_OUTERMOST_HEADER_ID
|
williamr@2
|
22 |
# define _STLP_OUTERMOST_HEADER_ID 0x120
|
williamr@2
|
23 |
# include <stl/_prolog.h>
|
williamr@2
|
24 |
# endif
|
williamr@2
|
25 |
|
williamr@2
|
26 |
# ifdef __GNUC__
|
williamr@2
|
27 |
# include <cstddef>
|
williamr@2
|
28 |
# endif
|
williamr@2
|
29 |
|
williamr@2
|
30 |
# if ! defined (_STLP_WINCE)
|
williamr@2
|
31 |
|
williamr@2
|
32 |
# if defined (__BORLANDC__) && (__BORLANDC__ >= 0x530 ) && ! defined (_STLP_OWN_IOSTREAMS)
|
williamr@2
|
33 |
/* Borland defines this stuff here */
|
williamr@2
|
34 |
# include <iosfwd>
|
williamr@2
|
35 |
# endif
|
williamr@2
|
36 |
|
williamr@2
|
37 |
# if ! defined (_STLP_NO_CWCHAR) && defined (_STLP_USE_NEW_C_HEADERS)
|
williamr@2
|
38 |
# include _STLP_NATIVE_CPP_C_HEADER(cwchar)
|
williamr@2
|
39 |
|
williamr@2
|
40 |
# elif defined (__MRC__) || (defined (__SC__) && !defined (__DMC__)) || defined (__BORLANDC__) || defined(__FreeBSD__) || (defined (__GNUC__) && defined (__APPLE__) || defined( __Lynx__ )) || defined (__SYMBIAN32__) || defined (__WINS__) || defined (_STLP_NO_WCHAR_T)
|
williamr@2
|
41 |
|
williamr@2
|
42 |
#ifdef __SYMBIAN32__
|
williamr@2
|
43 |
# include <stddef.h>
|
williamr@2
|
44 |
#else
|
williamr@2
|
45 |
# include _STLP_NATIVE_C_HEADER(stddef.h)
|
williamr@2
|
46 |
#endif
|
williamr@2
|
47 |
|
williamr@2
|
48 |
# if defined (__FreeBSD__) || defined (__Lynx__) || defined (__WINS__) || defined (__SYMBIAN32__)
|
williamr@2
|
49 |
# ifndef _WINT_T
|
williamr@2
|
50 |
#ifdef __SYMBIAN32__
|
williamr@2
|
51 |
# include <wchar.h>
|
williamr@2
|
52 |
#else
|
williamr@2
|
53 |
# include _STLP_NATIVE_C_HEADER(wchar.h)
|
williamr@2
|
54 |
#endif
|
williamr@2
|
55 |
# define _WINT_T
|
williamr@2
|
56 |
# endif /* _WINT_T */
|
williamr@2
|
57 |
# endif
|
williamr@2
|
58 |
|
williamr@2
|
59 |
# else
|
williamr@2
|
60 |
# include _STLP_NATIVE_C_HEADER(wchar.h)
|
williamr@2
|
61 |
|
williamr@2
|
62 |
# if defined(__sun) && (defined(_XOPEN_SOURCE) || (_XOPEN_VERSION - 0 == 4))
|
williamr@2
|
63 |
extern wint_t btowc();
|
williamr@2
|
64 |
extern int fwprintf();
|
williamr@2
|
65 |
extern int fwscanf();
|
williamr@2
|
66 |
extern int fwide();
|
williamr@2
|
67 |
extern int mbsinit();
|
williamr@2
|
68 |
extern size_t mbrlen();
|
williamr@2
|
69 |
extern size_t mbrtowc();
|
williamr@2
|
70 |
extern size_t mbsrtowcs();
|
williamr@2
|
71 |
extern int swprintf();
|
williamr@2
|
72 |
extern int swscanf();
|
williamr@2
|
73 |
extern int vfwprintf();
|
williamr@2
|
74 |
extern int vwprintf();
|
williamr@2
|
75 |
extern int vswprintf();
|
williamr@2
|
76 |
extern size_t wcrtomb();
|
williamr@2
|
77 |
extern size_t wcsrtombs();
|
williamr@2
|
78 |
extern wchar_t *wcsstr();
|
williamr@2
|
79 |
extern int wctob();
|
williamr@2
|
80 |
extern wchar_t *wmemchr();
|
williamr@2
|
81 |
extern int wmemcmp();
|
williamr@2
|
82 |
extern wchar_t *wmemcpy();
|
williamr@2
|
83 |
extern wchar_t *wmemmove();
|
williamr@2
|
84 |
extern wchar_t *wmemset();
|
williamr@2
|
85 |
extern int wprintf();
|
williamr@2
|
86 |
extern int wscanf();
|
williamr@2
|
87 |
# endif
|
williamr@2
|
88 |
# endif
|
williamr@2
|
89 |
|
williamr@2
|
90 |
#if defined(__MSL__) && __MSL__ <= 0x51FF /* dwa 2/28/99 - not yet implemented by MSL */
|
williamr@2
|
91 |
# define _STLP_WCHAR_MSL_EXCLUDE 1
|
williamr@2
|
92 |
namespace std
|
williamr@2
|
93 |
{
|
williamr@2
|
94 |
extern "C" size_t wcsftime(wchar_t * str, size_t max_size, const wchar_t * format_str, const struct tm * timeptr);
|
williamr@2
|
95 |
}
|
williamr@2
|
96 |
# define _STLP_NO_MBSTATE_T 1
|
williamr@2
|
97 |
#elif defined (__BORLANDC__)
|
williamr@2
|
98 |
# ifdef _STLP_OWN_IOSTREAMS
|
williamr@2
|
99 |
# define _STLP_NO_NATIVE_MBSTATE_T
|
williamr@2
|
100 |
# endif
|
williamr@2
|
101 |
# define _STLP_WCHAR_BORLAND_EXCLUDE 1
|
williamr@2
|
102 |
# if (__BORLANDC__ < 0x540 )
|
williamr@2
|
103 |
# define _STLP_NO_MBSTATE_T 1
|
williamr@2
|
104 |
# define _STLP_WCHAR_SUNPRO_EXCLUDE
|
williamr@2
|
105 |
# endif
|
williamr@2
|
106 |
#endif
|
williamr@2
|
107 |
|
williamr@2
|
108 |
#ifndef _STLP_CWCHAR_H
|
williamr@2
|
109 |
# include <stl/_cwchar.h>
|
williamr@2
|
110 |
#endif
|
williamr@2
|
111 |
|
williamr@2
|
112 |
# ifdef _STLP_IMPORT_VENDOR_CSTD
|
williamr@2
|
113 |
|
williamr@2
|
114 |
#if defined (__SUNPRO_CC) && defined (_STLP_NO_OWN_IOSTREAMS) && !defined (_STLP_HAS_NO_NEW_C_HEADERS)
|
williamr@2
|
115 |
using _STLP_VENDOR_CSTD::wint_t;
|
williamr@2
|
116 |
#endif
|
williamr@2
|
117 |
|
williamr@2
|
118 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
119 |
# ifdef _STLP_NO_WCHAR_T
|
williamr@2
|
120 |
typedef int wint_t;
|
williamr@2
|
121 |
# else
|
williamr@2
|
122 |
// gcc 3.0 has a glitch : wint_t only sucked into the global namespace if _GLIBCPP_USE_WCHAR_T is defined
|
williamr@2
|
123 |
# if defined (__GNUC__) && ! defined (_GLIBCPP_USE_WCHAR_T)
|
williamr@2
|
124 |
using ::wint_t;
|
williamr@2
|
125 |
# else
|
williamr@2
|
126 |
using _STLP_VENDOR_CSTD::wint_t;
|
williamr@2
|
127 |
# endif
|
williamr@2
|
128 |
# endif
|
williamr@2
|
129 |
|
williamr@2
|
130 |
|
williamr@2
|
131 |
using _STLP_VENDOR_CSTD::size_t;
|
williamr@2
|
132 |
|
williamr@2
|
133 |
# if !defined (_STLP_NO_NATIVE_MBSTATE_T) && ! defined (_STLP_USE_OWN_MBSTATE_T)
|
williamr@2
|
134 |
using _STLP_VENDOR_MB_NAMESPACE::mbstate_t;
|
williamr@2
|
135 |
|
williamr@2
|
136 |
# if !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS) && !defined(_STLP_WCHAR_BORLAND_EXCLUDE) \
|
williamr@2
|
137 |
&& (!defined(__MSL__) || __MSL__ > 0x6001)
|
williamr@2
|
138 |
# if ! (defined (__KCC) || defined (__GNUC__))
|
williamr@2
|
139 |
using _STLP_VENDOR_MB_NAMESPACE::btowc;
|
williamr@2
|
140 |
# if (!defined(__MSL__) || __MSL__ > 0x7001)
|
williamr@2
|
141 |
using _STLP_VENDOR_MB_NAMESPACE::mbsinit;
|
williamr@2
|
142 |
# endif
|
williamr@2
|
143 |
# endif
|
williamr@2
|
144 |
# if ! defined (__GNUC__)
|
williamr@2
|
145 |
using _STLP_VENDOR_MB_NAMESPACE::mbrlen;
|
williamr@2
|
146 |
using _STLP_VENDOR_MB_NAMESPACE::mbrtowc;
|
williamr@2
|
147 |
using _STLP_VENDOR_MB_NAMESPACE::mbsrtowcs;
|
williamr@2
|
148 |
using _STLP_VENDOR_MB_NAMESPACE::wcrtomb;
|
williamr@2
|
149 |
using _STLP_VENDOR_MB_NAMESPACE::wcsrtombs;
|
williamr@2
|
150 |
# endif
|
williamr@2
|
151 |
# endif /* BORLAND && !__MSL__ || __MSL__ > 0x6001 */
|
williamr@2
|
152 |
|
williamr@2
|
153 |
# endif /* _STLP_NO_NATIVE_MBSTATE_T */
|
williamr@2
|
154 |
|
williamr@2
|
155 |
# if !defined (_STLP_NO_NATIVE_WIDE_FUNCTIONS) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
|
williamr@2
|
156 |
|
williamr@2
|
157 |
# if !defined (_STLP_WCHAR_BORLAND_EXCLUDE) && ! defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
|
williamr@2
|
158 |
using _STLP_VENDOR_CSTD::fgetwc;
|
williamr@2
|
159 |
using _STLP_VENDOR_CSTD::fgetws;
|
williamr@2
|
160 |
using _STLP_VENDOR_CSTD::fputwc;
|
williamr@2
|
161 |
using _STLP_VENDOR_CSTD::fputws;
|
williamr@2
|
162 |
# endif
|
williamr@2
|
163 |
|
williamr@2
|
164 |
# if !( defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE) \
|
williamr@2
|
165 |
|| defined(_STLP_WCHAR_HPACC_EXCLUDE) )
|
williamr@2
|
166 |
# ifndef __DECCXX
|
williamr@2
|
167 |
using _STLP_VENDOR_CSTD::fwide;
|
williamr@2
|
168 |
# endif
|
williamr@2
|
169 |
using _STLP_VENDOR_CSTD::fwprintf;
|
williamr@2
|
170 |
using _STLP_VENDOR_CSTD::fwscanf;
|
williamr@2
|
171 |
using _STLP_VENDOR_CSTD::getwchar;
|
williamr@2
|
172 |
# endif
|
williamr@2
|
173 |
|
williamr@2
|
174 |
# ifndef _STLP_WCHAR_BORLAND_EXCLUDE
|
williamr@2
|
175 |
using _STLP_VENDOR_CSTD::getwc;
|
williamr@2
|
176 |
using _STLP_VENDOR_CSTD::ungetwc;
|
williamr@2
|
177 |
|
williamr@2
|
178 |
using _STLP_VENDOR_CSTD::putwc;
|
williamr@2
|
179 |
using _STLP_VENDOR_CSTD::putwchar;
|
williamr@2
|
180 |
# endif
|
williamr@2
|
181 |
|
williamr@2
|
182 |
# if !( defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined (_STLP_WCHAR_BORLAND_EXCLUDE)\
|
williamr@2
|
183 |
|| defined(_STLP_WCHAR_HPACC_EXCLUDE) )
|
williamr@2
|
184 |
using _STLP_VENDOR_CSTD::swprintf;
|
williamr@2
|
185 |
using _STLP_VENDOR_CSTD::swscanf;
|
williamr@2
|
186 |
using _STLP_VENDOR_CSTD::vfwprintf;
|
williamr@2
|
187 |
using _STLP_VENDOR_CSTD::vwprintf;
|
williamr@2
|
188 |
using _STLP_VENDOR_CSTD::vswprintf;
|
williamr@2
|
189 |
|
williamr@2
|
190 |
# if !defined(__MSL__) || __MSL__ > 0x7001
|
williamr@2
|
191 |
using _STLP_VENDOR_CSTD::wcsftime;
|
williamr@2
|
192 |
# endif
|
williamr@2
|
193 |
using _STLP_VENDOR_CSTD::wcstok;
|
williamr@2
|
194 |
|
williamr@2
|
195 |
# endif
|
williamr@2
|
196 |
|
williamr@2
|
197 |
# if !(defined (__BORLANDC__) && (__BORLANDC__ < 0x540))
|
williamr@2
|
198 |
using _STLP_VENDOR_CSTD::wcscat;
|
williamr@2
|
199 |
using _STLP_VENDOR_CSTD::wcsrchr;
|
williamr@2
|
200 |
using _STLP_VENDOR_CSTD::wcscmp;
|
williamr@2
|
201 |
using _STLP_VENDOR_CSTD::wcscoll;
|
williamr@2
|
202 |
|
williamr@2
|
203 |
using _STLP_VENDOR_CSTD::wcscpy;
|
williamr@2
|
204 |
using _STLP_VENDOR_CSTD::wcscspn;
|
williamr@2
|
205 |
|
williamr@2
|
206 |
using _STLP_VENDOR_CSTD::wcslen;
|
williamr@2
|
207 |
using _STLP_VENDOR_CSTD::wcsncat;
|
williamr@2
|
208 |
using _STLP_VENDOR_CSTD::wcsncmp;
|
williamr@2
|
209 |
using _STLP_VENDOR_CSTD::wcsncpy;
|
williamr@2
|
210 |
using _STLP_VENDOR_CSTD::wcspbrk;
|
williamr@2
|
211 |
using _STLP_VENDOR_CSTD::wcschr;
|
williamr@2
|
212 |
|
williamr@2
|
213 |
using _STLP_VENDOR_CSTD::wcsspn;
|
williamr@2
|
214 |
using _STLP_VENDOR_CSTD::wcsxfrm;
|
williamr@2
|
215 |
|
williamr@2
|
216 |
# endif
|
williamr@2
|
217 |
|
williamr@2
|
218 |
# if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
|
williamr@2
|
219 |
|
williamr@2
|
220 |
using _STLP_VENDOR_CSTD::wcstod;
|
williamr@2
|
221 |
using _STLP_VENDOR_CSTD::wcstol;
|
williamr@2
|
222 |
|
williamr@2
|
223 |
# endif
|
williamr@2
|
224 |
|
williamr@2
|
225 |
#ifdef __SYMBIAN32__
|
williamr@2
|
226 |
|
williamr@2
|
227 |
using _STLP_VENDOR_CSTD::wcstoul;
|
williamr@2
|
228 |
|
williamr@2
|
229 |
#endif //__SYMBIAN32__
|
williamr@2
|
230 |
|
williamr@2
|
231 |
# if !( defined (_STLP_WCHAR_SUNPRO_EXCLUDE) || defined(_STLP_WCHAR_HPACC_EXCLUDE) )
|
williamr@2
|
232 |
|
williamr@2
|
233 |
using _STLP_VENDOR_CSTD::wcsstr;
|
williamr@2
|
234 |
using _STLP_VENDOR_CSTD::wmemchr;
|
williamr@2
|
235 |
|
williamr@2
|
236 |
# if !defined (_STLP_WCHAR_BORLAND_EXCLUDE)
|
williamr@2
|
237 |
|
williamr@2
|
238 |
#ifndef __DMC__
|
williamr@2
|
239 |
using _STLP_VENDOR_CSTD::wctob;
|
williamr@2
|
240 |
using _STLP_VENDOR_CSTD::wmemcmp;
|
williamr@2
|
241 |
#endif
|
williamr@2
|
242 |
using _STLP_VENDOR_CSTD::wmemmove;
|
williamr@2
|
243 |
using _STLP_VENDOR_CSTD::wprintf;
|
williamr@2
|
244 |
using _STLP_VENDOR_CSTD::wscanf;
|
williamr@2
|
245 |
|
williamr@2
|
246 |
# endif
|
williamr@2
|
247 |
|
williamr@2
|
248 |
using _STLP_VENDOR_CSTD::wmemcpy;
|
williamr@2
|
249 |
using _STLP_VENDOR_CSTD::wmemset;
|
williamr@2
|
250 |
# endif
|
williamr@2
|
251 |
|
williamr@2
|
252 |
# endif /* _STLP_NO_NATIVE_WIDE_FUNCTIONS */
|
williamr@2
|
253 |
_STLP_END_NAMESPACE
|
williamr@2
|
254 |
# endif /* _STLP_IMPORT_VENDOR_CSTD */
|
williamr@2
|
255 |
|
williamr@2
|
256 |
# undef _STLP_WCHAR_SUNPRO_EXCLUDE
|
williamr@2
|
257 |
# undef _STLP_WCHAR_MSL_EXCLUDE
|
williamr@2
|
258 |
|
williamr@2
|
259 |
# endif /* WINCE */
|
williamr@2
|
260 |
|
williamr@2
|
261 |
# if (_STLP_OUTERMOST_HEADER_ID == 0x120)
|
williamr@2
|
262 |
# include <stl/_epilog.h>
|
williamr@2
|
263 |
# undef _STLP_OUTERMOST_HEADER_ID
|
williamr@2
|
264 |
# endif
|
williamr@2
|
265 |
|
williamr@2
|
266 |
#endif /* _STLP_CWCHAR */
|
williamr@2
|
267 |
|