]>
Commit | Line | Data |
---|---|---|
e35d0039 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wxchar.h | |
3 | // Purpose: Declarations common to wx char/wchar_t usage (wide chars) | |
4 | // Author: Joel Farley | |
5 | // Modified by: | |
6 | // Created: 1998/06/12 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) wxWindows copyright | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_WXCHAR_H_ | |
13 | #define _WX_WXCHAR_H_ | |
14 | ||
88ac883a VZ |
15 | //#ifdef __GNUG__ |
16 | //#pragma interface "wxchar.h" | |
17 | //#endif | |
e35d0039 JS |
18 | |
19 | // only do SBCS or _UNICODE | |
20 | #if defined (_MBCS ) | |
1777b9bb | 21 | # error "MBCS is not supported by wxChar" |
e35d0039 JS |
22 | #endif |
23 | ||
853d7d3d OK |
24 | // set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined |
25 | #if defined(_UNICODE) || defined(UNICODE) | |
1777b9bb DW |
26 | # undef wxUSE_UNICODE |
27 | # define wxUSE_UNICODE 1 | |
853d7d3d | 28 | #else |
1777b9bb DW |
29 | # ifndef wxUSE_UNICODE |
30 | # define wxUSE_UNICODE 0 | |
31 | # endif | |
853d7d3d OK |
32 | #endif |
33 | ||
34 | // and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1... | |
35 | #if wxUSE_UNICODE | |
1777b9bb DW |
36 | # ifndef _UNICODE |
37 | # define _UNICODE | |
38 | # endif | |
39 | # ifndef UNICODE | |
40 | # define UNICODE | |
41 | # endif | |
853d7d3d OK |
42 | #endif |
43 | ||
34f9227c | 44 | // Windows (VC++) has broad TCHAR support |
3f4a0c5b | 45 | #if defined(__VISUALC__) && defined(__WIN32__) |
e35d0039 | 46 | |
1777b9bb | 47 | # define HAVE_WCSLEN 1 |
a23fd0e1 | 48 | |
1777b9bb | 49 | # include <tchar.h> |
73974df1 | 50 | |
1777b9bb | 51 | # if wxUSE_UNICODE // temporary - preserve binary compatibility |
e35d0039 | 52 | typedef _TCHAR wxChar; |
3f4a0c5b | 53 | typedef _TSCHAR wxSChar; |
e35d0039 | 54 | typedef _TUCHAR wxUChar; |
1777b9bb DW |
55 | # else |
56 | # define wxChar char | |
57 | # define wxSChar signed char | |
58 | # define wxUChar unsigned char | |
59 | # endif | |
81d425f6 | 60 | // wchar_t is available |
1777b9bb DW |
61 | # undef wxUSE_WCHAR_T |
62 | # define wxUSE_WCHAR_T 1 | |
e35d0039 JS |
63 | |
64 | // ctype.h functions | |
1777b9bb DW |
65 | # define wxIsalnum _istalnum |
66 | # define wxIsalpha _istalpha | |
67 | # define wxIsctrl _istctrl | |
68 | # define wxIsdigit _istdigit | |
69 | # define wxIsgraph _istgraph | |
70 | # define wxIslower _istlower | |
71 | # define wxIsprint _istprint | |
72 | # define wxIspunct _istpunct | |
73 | # define wxIsspace _istspace | |
74 | # define wxIsupper _istupper | |
75 | # define wxIsxdigit _istxdigit | |
76 | # define wxTolower _totlower | |
77 | # define wxToupper _totupper | |
e35d0039 JS |
78 | |
79 | // locale.h functons | |
1777b9bb | 80 | # define wxSetlocale _tsetlocale |
e35d0039 JS |
81 | |
82 | // string.h functions | |
1777b9bb DW |
83 | # define wxStrcat _tcscat |
84 | # define wxStrchr _tcschr | |
85 | # define wxStrcmp _tcscmp | |
86 | # define wxStrcoll _tcscoll | |
87 | # define wxStrcpy _tcscpy | |
88 | # define wxStrcspn _tcscspn | |
89 | # define wxStrftime _tcsftime | |
90 | # define wxStricmp _tcsicmp | |
91 | # define wxStrlen_ _tcslen // used in wxStrlen inline function | |
92 | # define wxStrncat _tcsncat | |
93 | # define wxStrncmp _tcsncmp | |
94 | # define wxStrncpy _tcsncpy | |
95 | # define wxStrpbrk _tcspbrk | |
96 | # define wxStrrchr _tcsrchr | |
97 | # define wxStrspn _tcsspn | |
98 | # define wxStrstr _tcsstr | |
99 | # define wxStrtod _tcstod | |
e97a90f0 | 100 | // is there a _tcstok[_r] ? |
1777b9bb DW |
101 | # define wxStrtol _tcstol |
102 | # define wxStrtoul _tcstoul | |
103 | # define wxStrxfrm _tcsxfrm | |
e35d0039 JS |
104 | |
105 | // stdio.h functions | |
1777b9bb DW |
106 | # define wxFgetc _fgettc |
107 | # define wxFgetchar _fgettchar | |
108 | # define wxFgets _fgetts | |
109 | # define wxFopen _tfopen | |
110 | # define wxFputc _fputtc | |
111 | # define wxFputchar _fputtchar | |
112 | # define wxFprintf _ftprintf | |
113 | # define wxFreopen _tfreopen | |
114 | # define wxFscanf _ftscanf | |
115 | # define wxGetc _gettc | |
116 | # define wxGetchar _gettchar | |
117 | # define wxGets _getts | |
118 | # define wxPerror _tperror | |
119 | # define wxPrintf _tprintf | |
120 | # define wxPutc _puttc | |
121 | # define wxPutchar _puttchar | |
122 | # define wxPuts _putts | |
123 | # define wxRemove _tremove | |
124 | # define wxRename _trename | |
125 | # define wxScanf _tscanf | |
126 | # define wxSprintf _stprintf | |
127 | # define wxSscanf _stscanf | |
128 | # define wxTmpnam _ttmpnam | |
129 | # define wxUngetc _tungetc | |
130 | # define wxVfprint _vftprintf | |
131 | # define wxVprintf _vtprintf | |
132 | # define wxVsscanf _vstscanf | |
133 | # define wxVsprintf _vstprintf | |
e35d0039 JS |
134 | |
135 | // stdlib.h functions | |
1777b9bb DW |
136 | # if !wxUSE_UNICODE |
137 | # define wxAtof atof | |
138 | # endif | |
139 | # define wxAtoi _ttoi | |
140 | # define wxAtol _ttol | |
141 | # define wxGetenv _tgetenv | |
142 | # define wxSystem _tsystem | |
e35d0039 JS |
143 | |
144 | // time.h functions | |
1777b9bb DW |
145 | # define wxAsctime _tasctime |
146 | # define wxCtime _tctime | |
e35d0039 JS |
147 | |
148 | // #elif defined(XXX) | |
149 | // #include XXX-specific files here | |
150 | // typeddef YYY wxChar; | |
151 | ||
152 | // translate wxZZZ names | |
153 | ||
853d7d3d OK |
154 | #elif defined(__BORLANDC__) && defined(__WIN32__) |
155 | ||
156 | // Borland C++ 4.52 doesn't have much tchar support | |
157 | // maybe Borland C++ 5.02 has, can't check right now | |
158 | // but I'll use the Win32 API instead here | |
159 | ||
1777b9bb DW |
160 | # include <tchar.h> |
161 | # if wxUSE_UNICODE // temporary - preserve binary compatibility | |
853d7d3d OK |
162 | typedef _TCHAR wxChar; |
163 | typedef _TSCHAR wxSChar; | |
164 | typedef _TUCHAR wxUChar; | |
1777b9bb DW |
165 | # else |
166 | # define wxChar char | |
167 | # define wxSChar signed char | |
168 | # define wxUChar unsigned char | |
169 | # endif | |
81d425f6 | 170 | // wchar_t is available |
1777b9bb DW |
171 | # undef wxUSE_WCHAR_T |
172 | # define wxUSE_WCHAR_T 1 | |
853d7d3d | 173 | |
1777b9bb | 174 | # define wxNEED_WX_CTYPE_H |
853d7d3d | 175 | // #define wxStrtok strtok_r // Borland C++ 4.52 doesn't have strtok_r |
1777b9bb DW |
176 | # define wxNEED_WX_STRING_H |
177 | # define wxNEED_WX_STDIO_H | |
178 | # define wxNEED_WX_STDLIB_H | |
179 | # define wxNEED_WX_TIME_H | |
180 | # define wxNEED_WCSLEN | |
853d7d3d | 181 | |
81d425f6 | 182 | #else//!TCHAR-aware compilers |
34f9227c | 183 | |
81d425f6 | 184 | // check whether we should include wchar.h or equivalent |
1777b9bb DW |
185 | # if wxUSE_UNICODE |
186 | # undef wxUSE_WCHAR_T | |
187 | # define wxUSE_WCHAR_T 1 // wchar_t *must* be available in Unicode mode | |
188 | # elif !defined(wxUSE_WCHAR_T) | |
189 | # if defined(__VISUALC__) && (__VISUALC__ < 900) | |
190 | # define wxUSE_WCHAR_T 0 // wchar_t is not available for MSVC++ 1.5 | |
191 | # elif defined(__UNIX__) | |
192 | # if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) | |
193 | # define wxUSE_WCHAR_T 1 | |
194 | # else | |
195 | # define wxUSE_WCHAR_T 0 | |
196 | # endif | |
197 | # elif defined(__GNUWIN32__) && !defined(__MINGW32__) // Cygwin (not Mingw32) doesn't have wcslen.h, needed in buffer.h | |
198 | # define wxUSE_WCHAR_T 0 | |
199 | # elif defined(__BORLANDC__) // WIN16 BC++ | |
200 | # define wxUSE_WCHAR_T 0 | |
201 | # elif defined(__WATCOMC__) | |
202 | # define wxUSE_WCHAR_T 0 | |
203 | # else | |
a89ae1e4 | 204 | // add additional compiler checks if this fails |
1777b9bb DW |
205 | # define wxUSE_WCHAR_T 1 |
206 | # endif | |
207 | # endif//wxUSE_UNICODE | |
208 | ||
209 | # if wxUSE_WCHAR_T | |
210 | # ifdef HAVE_WCSTR_H | |
211 | # include <wcstr.h> | |
212 | # else | |
213 | # ifndef __FreeBSD__ | |
214 | # include <wchar.h> | |
215 | # else | |
216 | # include <stdlib.h> | |
217 | # define wxNEED_WCSLEN | |
218 | # endif | |
219 | # endif | |
220 | # endif | |
65d77246 | 221 | |
34f9227c | 222 | // check whether we are doing Unicode |
1777b9bb | 223 | # if wxUSE_UNICODE |
34f9227c | 224 | |
1777b9bb | 225 | # include <wctype.h> |
34f9227c OK |
226 | |
227 | // this is probably glibc-specific | |
1777b9bb | 228 | # if defined(__WCHAR_TYPE__) |
34f9227c OK |
229 | |
230 | typedef __WCHAR_TYPE__ wxChar; | |
231 | typedef signed __WCHAR_TYPE__ wxSChar; | |
232 | typedef unsigned __WCHAR_TYPE__ wxUChar; | |
233 | ||
cdb51680 | 234 | # define _T(x) L##x |
1777b9bb DW |
235 | |
236 | // ctype.h functions (wctype.h) | |
237 | # define wxIsalnum iswalnum | |
238 | # define wxIsalpha iswalpha | |
239 | # define wxIsctrl iswcntrl | |
240 | # define wxIsdigit iswdigit | |
241 | # define wxIsgraph iswgraph | |
242 | # define wxIslower iswlower | |
243 | # define wxIsprint iswprint | |
244 | # define wxIspunct iswpunct | |
245 | # define wxIsspace iswspace | |
246 | # define wxIsupper iswupper | |
247 | # define wxIsxdigit iswxdigit | |
248 | ||
249 | # if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) | |
250 | // /usr/include/wctype.h incorrectly declares translations tables which | |
251 | // provokes tons of compile-time warnings - try to correct this | |
252 | # define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower) | |
253 | # define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper) | |
254 | # else | |
255 | # define wxTolower towlower | |
256 | # define wxToupper towupper | |
257 | # endif // gcc/!gcc | |
258 | ||
259 | // string.h functions (wchar.h) | |
260 | # define wxStrcat wcscat | |
261 | # define wxStrchr wcschr | |
262 | # define wxStrcmp wcscmp | |
263 | # define wxStrcoll wcscoll | |
264 | # define wxStrcpy wcscpy | |
265 | # define wxStrcspn wcscspn | |
266 | # define wxStrlen_ wcslen // used in wxStrlen inline function | |
267 | # define wxStrncat wcsncat | |
268 | # define wxStrncmp wcsncmp | |
269 | # define wxStrncpy wcsncpy | |
270 | # define wxStrpbrk wcspbrk | |
271 | # define wxStrrchr wcsrchr | |
272 | # define wxStrspn wcsspn | |
273 | # define wxStrstr wcsstr | |
274 | # define wxStrtod wcstod | |
275 | # define wxStrtok wcstok | |
276 | # define wxStrtol wcstol | |
277 | # define wxStrtoul wcstoul | |
278 | # define wxStrxfrm wcsxfrm | |
e35d0039 | 279 | |
34f9227c | 280 | // glibc doesn't have wc equivalents of the other stuff |
1777b9bb DW |
281 | # define wxNEED_WX_STDIO_H |
282 | # define wxNEED_WX_STDLIB_H | |
283 | # define wxNEED_WX_TIME_H | |
34f9227c | 284 | |
1777b9bb DW |
285 | # else//!glibc |
286 | # error "Please define your compiler's Unicode conventions in wxChar.h" | |
287 | # endif | |
288 | # else//!Unicode | |
e35d0039 | 289 | |
1777b9bb DW |
290 | # include <ctype.h> |
291 | # include <string.h> | |
e97a90f0 | 292 | |
e90c1d2a VZ |
293 | # if 0 // temporary - preserve binary compatibilty |
294 | typedef char wxChar; | |
295 | typedef signed char wxSChar; | |
296 | typedef unsigned char wxUChar; | |
297 | # else | |
298 | # define wxChar char | |
299 | # define wxSChar signed char | |
300 | # define wxUChar unsigned char | |
301 | # endif | |
302 | ||
303 | # ifdef __FreeBSD__ | |
cdb51680 | 304 | # undef _T |
e90c1d2a | 305 | # endif |
cdb51680 | 306 | # define _T(x) x |
1777b9bb DW |
307 | |
308 | // ctype.h functions | |
e90c1d2a VZ |
309 | # define wxIsalnum isalnum |
310 | # define wxIsalpha isalpha | |
311 | # define wxIsctrl isctrl | |
312 | # define wxIsdigit isdigit | |
313 | # define wxIsgraph isgraph | |
314 | # define wxIslower islower | |
315 | # define wxIsprint isprint | |
316 | # define wxIspunct ispunct | |
317 | # define wxIsspace isspace | |
318 | # define wxIsupper isupper | |
319 | # define wxIsxdigit isxdigit | |
320 | # define wxTolower tolower | |
321 | # define wxToupper toupper | |
322 | ||
323 | // locale.h functons | |
324 | # define wxSetlocale setlocale | |
325 | ||
326 | // string.h functions | |
327 | // #define wxStricmp strcasecmp | |
328 | // wxStricmp is defined below!! | |
329 | ||
330 | #ifdef HAVE_STRTOK_R | |
331 | #define wxStrtok(str, sep, last) strtok_r(str, sep, last) | |
332 | #else | |
333 | #define wxStrtok(str, sep, last) strtok(str, sep) | |
334 | #endif | |
1777b9bb DW |
335 | |
336 | // leave the rest to defaults below | |
e90c1d2a VZ |
337 | # define wxNEED_WX_STRING_H |
338 | # define wxNEED_WX_STDIO_H | |
339 | # define wxNEED_WX_STDLIB_H | |
340 | # define wxNEED_WX_TIME_H | |
1777b9bb DW |
341 | |
342 | # endif//Unicode | |
853d7d3d OK |
343 | #endif//TCHAR-aware compilers |
344 | ||
345 | // define wxStricmp for various compilers without Unicode possibilities | |
346 | #if !defined(wxStricmp) && !wxUSE_UNICODE | |
fd9811b1 | 347 | # if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__) |
1777b9bb | 348 | # define wxStricmp stricmp |
585ae8cb | 349 | # elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__)) |
1777b9bb DW |
350 | # define wxStricmp _stricmp |
351 | # elif defined(__UNIX__) || defined(__GNUWIN32__) | |
352 | # define wxStricmp strcasecmp | |
353 | # elif defined(__MWERKS__) && !defined(__INTEL__) | |
354 | // use wxWindows' implementation | |
355 | # else | |
356 | // if you leave wxStricmp undefined, wxWindows' implementation will be used | |
357 | # error "Please define string case-insensitive compare for your OS/compiler" | |
358 | # endif | |
853d7d3d OK |
359 | #endif |
360 | ||
361 | // if we need to define for standard headers, and we're not using Unicode, | |
362 | // just define to standard C library routines | |
363 | #if !wxUSE_UNICODE | |
1777b9bb DW |
364 | # ifdef wxNEED_WX_STRING_H |
365 | # define wxStrcat strcat | |
366 | # define wxStrchr strchr | |
367 | # define wxStrcmp strcmp | |
368 | # define wxStrcoll strcoll | |
369 | # define wxStrcpy strcpy | |
370 | # define wxStrcspn strcspn | |
371 | # define wxStrdup strdup | |
372 | # define wxStrlen_ strlen // used in wxStrlen inline function | |
373 | # define wxStrncat strncat | |
374 | # define wxStrncmp strncmp | |
375 | # define wxStrncpy strncpy | |
376 | # define wxStrpbrk strpbrk | |
377 | # define wxStrrchr strrchr | |
378 | # define wxStrspn strspn | |
379 | # define wxStrstr strstr | |
380 | # define wxStrtod strtod | |
381 | # define wxStrtol strtol | |
382 | # define wxStrtoul strtoul | |
383 | # define wxStrxfrm strxfrm | |
384 | # undef wxNEED_WX_STRING_H | |
385 | # endif | |
386 | ||
387 | # ifdef wxNEED_WX_STDIO_H | |
388 | # define wxFgetc fgetc | |
389 | # define wxFgetchar fgetchar | |
390 | # define wxFgets fgets | |
391 | # define wxFopen fopen | |
392 | # define wxFputc fputc | |
393 | # define wxFputchar fputchar | |
394 | # define wxFprintf fprintf | |
395 | # define wxFreopen freopen | |
396 | # define wxFscanf fscanf | |
397 | # define wxGetc getc | |
398 | # define wxGetchar getchar | |
399 | # define wxGets gets | |
400 | # define wxPerror perror | |
401 | # define wxPrintf printf | |
402 | # define wxPutc putc | |
403 | # define wxPutchar putchar | |
404 | # define wxPuts puts | |
405 | # define wxRemove remove | |
406 | # define wxRename rename | |
407 | # define wxScanf scanf | |
408 | # define wxSprintf sprintf | |
409 | # define wxSscanf sscanf | |
410 | # define wxTmpnam tmpnam | |
411 | # define wxUngetc ungetc | |
412 | # define wxVfprint vfprintf | |
413 | # define wxVprintf vprintf | |
414 | # define wxVsscanf vsscanf | |
415 | # define wxVsprintf vsprintf | |
416 | # undef wxNEED_WX_STDIO_H | |
417 | # endif | |
418 | ||
419 | # ifdef wxNEED_WX_STDLIB_H | |
420 | # define wxAtof atof | |
421 | # define wxAtoi atoi | |
422 | # define wxAtol atol | |
423 | # define wxGetenv getenv | |
424 | # define wxSystem system | |
425 | # undef wxNEED_WX_STDLIB_H | |
426 | # endif | |
427 | ||
428 | # ifdef wxNEED_WX_TIME_H | |
429 | # define wxAsctime asctime | |
430 | # define wxCtime ctime | |
431 | # define wxStrftime strftime | |
432 | # undef wxNEED_WX_TIME_H | |
433 | # endif | |
853d7d3d | 434 | #endif //!Unicode |
e35d0039 | 435 | |
853d7d3d | 436 | #if defined(wxNEED_WCSLEN) && wxUSE_UNICODE |
1777b9bb DW |
437 | # define wcslen wxStrlen |
438 | # undef wxNEED_WCSLEN | |
853d7d3d | 439 | #endif |
e35d0039 JS |
440 | |
441 | /// checks whether the passed in pointer is NULL and if the string is empty | |
49828363 | 442 | WXDLLEXPORT inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; } |
e35d0039 | 443 | |
853d7d3d | 444 | #ifndef wxNEED_WX_STRING_H |
e35d0039 | 445 | /// safe version of strlen() (returns 0 if passed NULL pointer) |
49828363 | 446 | WXDLLEXPORT inline size_t wxStrlen(const wxChar *psz) |
853d7d3d | 447 | { return psz ? wxStrlen_(psz) : 0; } |
34f9227c | 448 | #endif |
e35d0039 | 449 | |
81d425f6 | 450 | #if wxUSE_WCHAR_T |
e97a90f0 | 451 | // multibyte<->widechar conversion |
49828363 RD |
452 | WXDLLEXPORT size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n); |
453 | WXDLLEXPORT size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n); | |
1777b9bb DW |
454 | # if wxUSE_UNICODE |
455 | # define wxMB2WX wxMB2WC | |
456 | # define wxWX2MB wxWC2MB | |
457 | # define wxWC2WX wxStrncpy | |
458 | # define wxWX2WC wxStrncpy | |
459 | # else | |
460 | # define wxMB2WX wxStrncpy | |
461 | # define wxWX2MB wxStrncpy | |
462 | # define wxWC2WX wxWC2MB | |
463 | # define wxWX2WC wxMB2WC | |
464 | # endif | |
0f3e3e0c JS |
465 | #else |
466 | // No wxUSE_WCHAR_T: we have to do something (JACS) | |
1777b9bb DW |
467 | # define wxMB2WC wxStrncpy |
468 | # define wxWC2MB wxStrncpy | |
469 | # define wxMB2WX wxStrncpy | |
470 | # define wxWX2MB wxStrncpy | |
471 | # define wxWC2WX wxWC2MB | |
472 | # define wxWX2WC wxMB2WC | |
81d425f6 | 473 | #endif |
0f3e3e0c | 474 | |
49828363 | 475 | WXDLLEXPORT bool wxOKlibc(); // for internal use |
e97a90f0 OK |
476 | |
477 | // if libc versions are not available, use replacements defined in wxchar.cpp | |
478 | #ifndef wxStrdup | |
49828363 | 479 | WXDLLEXPORT wxChar * wxStrdup(const wxChar *psz); |
e97a90f0 OK |
480 | #endif |
481 | ||
0841bffa | 482 | #ifndef wxStricmp |
49828363 | 483 | WXDLLEXPORT int wxStricmp(const wxChar *psz1, const wxChar *psz2); |
0841bffa OK |
484 | #endif |
485 | ||
e97a90f0 | 486 | #ifndef wxStrtok |
49828363 | 487 | WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr); |
e97a90f0 OK |
488 | #endif |
489 | ||
490 | #ifndef wxSetlocale | |
49828363 | 491 | WXDLLEXPORT wxChar * wxSetlocale(int category, const wxChar *locale); |
e97a90f0 OK |
492 | #endif |
493 | ||
853d7d3d | 494 | #ifdef wxNEED_WCSLEN // for use in buffer.h |
49828363 | 495 | WXDLLEXPORT size_t wcslen(const wchar_t *s); |
853d7d3d OK |
496 | #endif |
497 | ||
57f6da0d | 498 | #ifdef wxNEED_WX_CTYPE_H |
49828363 RD |
499 | WXDLLEXPORT int wxIsalnum(wxChar ch); |
500 | WXDLLEXPORT int wxIsalpha(wxChar ch); | |
501 | WXDLLEXPORT int wxIsctrl(wxChar ch); | |
502 | WXDLLEXPORT int wxIsdigit(wxChar ch); | |
503 | WXDLLEXPORT int wxIsgraph(wxChar ch); | |
504 | WXDLLEXPORT int wxIslower(wxChar ch); | |
505 | WXDLLEXPORT int wxIsprint(wxChar ch); | |
506 | WXDLLEXPORT int wxIspunct(wxChar ch); | |
507 | WXDLLEXPORT int wxIsspace(wxChar ch); | |
508 | WXDLLEXPORT int wxIsupper(wxChar ch); | |
509 | WXDLLEXPORT int wxIsxdigit(wxChar ch); | |
510 | WXDLLEXPORT int wxTolower(wxChar ch); | |
511 | WXDLLEXPORT int wxToupper(wxChar ch); | |
57f6da0d OK |
512 | #endif |
513 | ||
853d7d3d | 514 | #ifdef wxNEED_WX_STRING_H |
49828363 RD |
515 | WXDLLEXPORT wxChar * wxStrcat(wxChar *dest, const wxChar *src); |
516 | WXDLLEXPORT wxChar * wxStrchr(const wxChar *s, wxChar c); | |
517 | WXDLLEXPORT int wxStrcmp(const wxChar *s1, const wxChar *s2); | |
518 | WXDLLEXPORT int wxStrcoll(const wxChar *s1, const wxChar *s2); | |
519 | WXDLLEXPORT wxChar * wxStrcpy(wxChar *dest, const wxChar *src); | |
520 | WXDLLEXPORT size_t wxStrcspn(const wxChar *s, const wxChar *reject); | |
521 | WXDLLEXPORT size_t wxStrlen(const wxChar *s); | |
522 | WXDLLEXPORT wxChar * wxStrncat(wxChar *dest, const wxChar *src, size_t n); | |
523 | WXDLLEXPORT int wxStrncmp(const wxChar *s1, const wxChar *s2, size_t n); | |
524 | WXDLLEXPORT wxChar * wxStrncpy(wxChar *dest, const wxChar *src, size_t n); | |
525 | WXDLLEXPORT wxChar * wxStrpbrk(const wxChar *s, const wxChar *accept); | |
526 | WXDLLEXPORT wxChar * wxStrrchr(const wxChar *s, wxChar c); | |
527 | WXDLLEXPORT size_t wxStrspn(const wxChar *s, const wxChar *accept); | |
528 | WXDLLEXPORT wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle); | |
529 | WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr); | |
530 | WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base); | |
531 | WXDLLEXPORT unsigned long int wxStrtoul(const wxChar *nptr, wxChar **endptr, int base); | |
532 | WXDLLEXPORT size_t wxStrxfrm(wxChar *dest, const wxChar *src, size_t n); | |
853d7d3d OK |
533 | #endif |
534 | ||
e97a90f0 | 535 | #ifdef wxNEED_WX_STDIO_H |
1777b9bb DW |
536 | # include <stdio.h> |
537 | # include <stdarg.h> | |
e385b3ff OK |
538 | WXDLLEXPORT FILE * wxFopen(const wxChar *path, const wxChar *mode); |
539 | WXDLLEXPORT FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream); | |
49828363 RD |
540 | WXDLLEXPORT int wxPrintf(const wxChar *fmt, ...); |
541 | WXDLLEXPORT int wxVprintf(const wxChar *fmt, va_list argptr); | |
542 | WXDLLEXPORT int wxFprintf(FILE *stream, const wxChar *fmt, ...); | |
543 | WXDLLEXPORT int wxVfprintf(FILE *stream, const wxChar *fmt, va_list argptr); | |
544 | WXDLLEXPORT int wxSprintf(wxChar *buf, const wxChar *fmt, ...); | |
545 | WXDLLEXPORT int wxVsprintf(wxChar *buf, const wxChar *fmt, va_list argptr); | |
546 | WXDLLEXPORT int wxSscanf(const wxChar *buf, const wxChar *fmt, ...); | |
547 | WXDLLEXPORT int wxVsscanf(const wxChar *buf, const wxChar *fmt, va_list argptr); | |
e97a90f0 OK |
548 | #endif |
549 | ||
a982ddd2 | 550 | #ifndef wxAtof |
49828363 | 551 | WXDLLEXPORT double wxAtof(const wxChar *psz); |
a982ddd2 OK |
552 | #endif |
553 | ||
554 | #ifdef wxNEED_WX_STDLIB_H | |
49828363 RD |
555 | WXDLLEXPORT int wxAtoi(const wxChar *psz); |
556 | WXDLLEXPORT long wxAtol(const wxChar *psz); | |
557 | WXDLLEXPORT wxChar * wxGetenv(const wxChar *name); | |
558 | WXDLLEXPORT int wxSystem(const wxChar *psz); | |
639a9fb5 OK |
559 | #endif |
560 | ||
e385b3ff OK |
561 | #ifdef wxNEED_WX_TIME_H |
562 | WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm); | |
563 | #endif | |
564 | ||
cdb51680 VZ |
565 | // although global macros with such names are really bad, we want to have |
566 | // another name for _T() which should be used to avoid confusion between _T() | |
567 | // and _() in wxWindows sources | |
568 | #define T(x) _T(x) | |
569 | ||
e90c1d2a VZ |
570 | // a Unicode-friendly __FILE__ analog |
571 | #ifndef __TFILE__ | |
572 | #define __XFILE__(x) T(x) | |
573 | #define __TFILE__ __XFILE__(__FILE__) | |
574 | #endif | |
575 | ||
e35d0039 JS |
576 | #endif |
577 | //_WX_WXCHAR_H_ | |
1777b9bb | 578 |