]> git.saurik.com Git - wxWidgets.git/blob - include/wx/wxchar.h
fixed Julian-introduced typo
[wxWidgets.git] / include / wx / wxchar.h
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
15 #ifdef __GNUG__
16 #pragma interface "wxchar.h"
17 #endif
18
19 // only do SBCS or _UNICODE
20 #if defined (_MBCS )
21 // It may be OK anyway.
22 // # error "MBCS is not supported by wxChar"
23 #endif
24
25 // ----------------------------------------------------------------------------
26 // first deal with Unicode setting
27 // ----------------------------------------------------------------------------
28
29 // set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined
30 #if defined(_UNICODE) || defined(UNICODE)
31 # undef wxUSE_UNICODE
32 # define wxUSE_UNICODE 1
33 #else
34 # ifndef wxUSE_UNICODE
35 # define wxUSE_UNICODE 0
36 # endif
37 #endif // Unicode
38
39 // and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1...
40 #if wxUSE_UNICODE
41 # ifndef _UNICODE
42 # define _UNICODE
43 # endif
44 # ifndef UNICODE
45 # define UNICODE
46 # endif
47 #endif // Unicode
48
49 // Unicode support requires wchar_t
50 #if wxUSE_UNICODE
51 # undef wxUSE_WCHAR_T
52 # define wxUSE_WCHAR_T 1
53 #endif // Unicode
54
55 // ----------------------------------------------------------------------------
56 // define wxHAVE_TCHAR_FUNCTIONS for the compilers which support the
57 // wide-character functions
58 // ----------------------------------------------------------------------------
59
60 // VC++ and BC++ starting with 5.2 have TCHAR support
61 #ifdef __VISUALC__
62 #define wxHAVE_TCHAR_FUNCTIONS
63 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)
64 #define wxHAVE_TCHAR_FUNCTIONS
65 #elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 )
66 #define wxHAVE_TCHAR_FUNCTIONS
67 #include <stddef.h>
68 #include <string.h>
69 #include <ctype.h>
70 #elif defined(__CYGWIN__)
71 #ifndef HAVE_WCSLEN
72 #define HAVE_WCSLEN
73 #endif // !HAVE_WCSLEN
74 #include <stddef.h>
75 #include <wchar.h>
76 #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
77 // VisualAge 4.0+ supports TCHAR
78 #define wxHAVE_TCHAR_FUNCTIONS
79
80 // but not stdio.h nor time nor conversion functions
81 #define wxNO_TCHAR_STDIO
82 #define wxNO_TCHAR_STDLIB
83 #define wxNO_TCHAR_TIME
84 #define wxNO_TCHAR_LOCALE
85 //
86 // supplemental VA V4 defs so at least we know what these are
87 // just define to standard defs
88 //
89
90 // for wcslen
91 #include <wchar.h>
92
93 // locale.h functons -- not defined in tchar.h
94 #define wxSetlocale setlocale
95 // some stdio functions are defined others are not
96 // these are not
97 #define wxFgetchar fgetchar
98 #define wxFopen fopen
99 #define wxFputchar fputchar
100 #define wxFreopen freopen
101 #define wxGets gets
102 #define wxPerror perror
103 #define wxPuts puts
104 #define wxRemove remove
105 #define wxRename rename
106 #define wxTmpnam tmpnam
107 #define wxUngetc ungetc
108 #define wxVsscanf vsscanf
109 // stdlib not defined in VA V4
110 #if !wxUSE_UNICODE
111 # define wxAtof atof
112 #endif
113 #define wxAtoi atoi
114 #define wxAtol atol
115 #define wxGetenv getenv
116 #define wxSystem system
117 // time.h functions -- none defined in tchar.h
118 #define wxAsctime asctime
119 #define wxCtime ctime
120 #elif defined(__MWERKS__)
121 // for wcslen
122 #if wxUSE_WCHAR_T
123 #include <wchar.h>
124 #endif
125 #endif // compilers with (good) TCHAR support
126
127 #ifdef wxHAVE_TCHAR_FUNCTIONS
128 # define HAVE_WCSLEN 1
129
130 # include <tchar.h>
131
132 # if wxUSE_UNICODE // temporary - preserve binary compatibility
133 #if defined(__GNUWIN32__)
134 #define _TCHAR TCHAR
135 #define _TSCHAR TCHAR
136 #define _TUCHAR TCHAR
137 #endif
138
139 typedef _TCHAR wxChar;
140 typedef _TSCHAR wxSChar;
141 typedef _TUCHAR wxUChar;
142 # else
143 # define wxChar char
144 # define wxSChar signed char
145 # define wxUChar unsigned char
146 # endif
147
148 // wchar_t is available
149 #ifndef wxUSE_WCHAR_T
150 #define wxUSE_WCHAR_T 1
151 #endif // !defined(wxUSE_WCHAR_T)
152
153 // ctype.h functions
154 #ifndef wxNO_TCHAR_CTYPE
155 #ifdef __BORLANDC__
156 # include <ctype.h>
157 #endif
158 # define wxIsalnum _istalnum
159 # define wxIsalpha _istalpha
160 # define wxIsctrl _istctrl
161 # define wxIsdigit _istdigit
162 # define wxIsgraph _istgraph
163 # define wxIslower _istlower
164 # define wxIsprint _istprint
165 # define wxIspunct _istpunct
166 # define wxIsspace _istspace
167 # define wxIsupper _istupper
168 # define wxIsxdigit _istxdigit
169 # define wxTolower _totlower
170 # define wxToupper _totupper
171 #endif // wxNO_TCHAR_CTYPE
172
173 // locale.h functons
174 #ifndef wxNO_TCHAR_LOCALE
175 # define wxSetlocale _tsetlocale
176 #endif // wxNO_TCHAR_LOCALE
177
178 // string.h functions
179 #ifndef wxNO_TCHAR_STRING
180 # define wxStrcat _tcscat
181 # define wxStrchr _tcschr
182 # define wxStrcmp _tcscmp
183 # define wxStrcoll _tcscoll
184 # define wxStrcpy _tcscpy
185 # define wxStrcspn _tcscspn
186 # define wxStrftime _tcsftime
187 # define wxStricmp _tcsicmp
188 # define wxStrnicmp _tcsnicmp
189 # define wxStrlen_ _tcslen // used in wxStrlen inline function
190 # define wxStrncat _tcsncat
191 # define wxStrncmp _tcsncmp
192 # define wxStrncpy _tcsncpy
193 # define wxStrpbrk _tcspbrk
194 # define wxStrrchr _tcsrchr
195 # define wxStrspn _tcsspn
196 # define wxStrstr _tcsstr
197 # define wxStrtod _tcstod
198 # define wxStrtol _tcstol
199 # define wxStrtoul _tcstoul
200 # define wxStrxfrm _tcsxfrm
201 #endif // wxNO_TCHAR_STRING
202
203 // stdio.h functions
204 #ifndef wxNO_TCHAR_STDIO
205 # if wxUSE_UNICODE_MSLU
206 # define wxRemove wxMSLU__tremove
207 # define wxRename wxMSLU__trename
208 # else
209 # define wxRemove _tremove
210 # define wxRename _trename
211 # endif
212 # define wxFgetc _fgettc
213 # define wxFgetchar _fgettchar
214 # define wxFgets _fgetts
215 # define wxFopen _tfopen
216 # define wxFputc _fputtc
217 # define wxFputchar _fputtchar
218 # define wxFprintf _ftprintf
219 # define wxFreopen _tfreopen
220 # define wxFscanf _ftscanf
221 # define wxGetc _gettc
222 # define wxGetchar _gettchar
223 # define wxGets _getts
224 # define wxPerror _tperror
225 # define wxPrintf _tprintf
226 # define wxPutc _puttc
227 # define wxPutchar _puttchar
228 # define wxPuts _putts
229 # define wxScanf _tscanf
230 # define wxSprintf _stprintf
231 # define wxSscanf _stscanf
232 # define wxTmpnam _ttmpnam
233 # define wxUngetc _tungetc
234 # define wxVfprint _vftprintf
235 # define wxVprintf _vtprintf
236 # define wxVsscanf _vstscanf
237 # define wxVsprintf _vstprintf
238 #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
239 // it has some stdio.h functions, apparently
240 # define wxFgetc _fgettc
241 # define wxFgets _fgetts
242 # define wxFputc _fputtc
243 # define wxFprintf _ftprintf
244 # define wxFscanf _ftscanf
245 # define wxGetc _gettc
246 # define wxGetchar _gettchar
247 # define wxPrintf _tprintf
248 # define wxPutc _puttc
249 # define wxPutchar _puttchar
250 # define wxScanf _tscanf
251 # define wxSprintf _stprintf
252 # define wxSscanf _stscanf
253 # define wxVfprint _vftprintf
254 # define wxVprintf _vtprintf
255 # define wxVsprintf _vstprintf
256 #endif // wxNO_TCHAR_STDIO
257
258 // stdlib.h functions
259 #ifndef wxNO_TCHAR_STDLIB
260 # if !wxUSE_UNICODE
261 # define wxAtof atof
262 # endif
263 # define wxAtoi _ttoi
264 # define wxAtol _ttol
265 # define wxGetenv _tgetenv
266 # define wxSystem _tsystem
267 #endif // wxNO_TCHAR_STDLIB
268
269 // time.h functions
270 #ifndef wxNO_TCHAR_TIME
271 # define wxAsctime _tasctime
272 # define wxCtime _tctime
273 #endif // wxNO_TCHAR_TIME
274
275 #else // !TCHAR-aware compilers
276
277 // check whether we should include wchar.h or equivalent
278 # if !defined(wxUSE_WCHAR_T)
279 # if defined(__VISUALC__) && (__VISUALC__ < 900)
280 # define wxUSE_WCHAR_T 0 // wchar_t is not available for MSVC++ 1.5
281 # elif defined(__UNIX__)
282 # if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__)
283 # define wxUSE_WCHAR_T 1
284 # else
285 # define wxUSE_WCHAR_T 0
286 # endif
287 # elif defined(__GNUWIN32__) && !defined(__MINGW32__) // Cygwin (not Mingw32) doesn't have wcslen.h, needed in buffer.h
288 # define wxUSE_WCHAR_T 0
289 # elif defined(__BORLANDC__) // WIN16 BC++
290 # define wxUSE_WCHAR_T 0
291 # elif defined(__WATCOMC__)
292 # define wxUSE_WCHAR_T 0
293 # elif defined(__VISAGECPP__) && (__IBMCPP__ < 400)
294 # define wxUSE_WCHAR_T 0
295 # else
296 // add additional compiler checks if this fails
297 # define wxUSE_WCHAR_T 1
298 # endif
299 # endif // !defined(wxUSE_WCHAR_T)
300
301 # if wxUSE_WCHAR_T
302 # ifdef HAVE_WCHAR_H
303 // include wchar.h to get wcslen() declaration used by wx/buffer.h
304 // stddef.h is needed for Cygwin
305 # include <stddef.h>
306 # include <wchar.h>
307 # elif defined(HAVE_WCSTR_H)
308 // old compilers have wcslen() here
309 # include <wcstr.h>
310 # elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__)
311 // include stdlib.h for wchar_t, wcslen is provided in wxchar.cpp
312 # include <stdlib.h>
313 size_t WXDLLEXPORT wcslen(const wchar_t *s);
314 # endif // HAVE_WCHAR_H
315 # endif // wxUSE_WCHAR_T
316
317 // check whether we are doing Unicode
318 # if wxUSE_UNICODE
319
320 # include <wctype.h>
321
322 // this is probably glibc-specific
323 # if defined(__WCHAR_TYPE__)
324
325 typedef __WCHAR_TYPE__ wxChar;
326 typedef signed __WCHAR_TYPE__ wxSChar;
327 typedef unsigned __WCHAR_TYPE__ wxUChar;
328
329 # define _T(x) L##x
330
331 // ctype.h functions (wctype.h)
332 # define wxIsalnum iswalnum
333 # define wxIsalpha iswalpha
334 # define wxIsctrl iswcntrl
335 # define wxIsdigit iswdigit
336 # define wxIsgraph iswgraph
337 # define wxIslower iswlower
338 # define wxIsprint iswprint
339 # define wxIspunct iswpunct
340 # define wxIsspace iswspace
341 # define wxIsupper iswupper
342 # define wxIsxdigit iswxdigit
343
344 # if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
345 // /usr/include/wctype.h incorrectly declares translations tables which
346 // provokes tons of compile-time warnings - try to correct this
347 # define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower)
348 # define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper)
349 # else
350 # define wxTolower towlower
351 # define wxToupper towupper
352 # endif // gcc/!gcc
353
354 // string.h functions (wchar.h)
355 # define wxStrcat wcscat
356 # define wxStrchr wcschr
357 # define wxStrcmp wcscmp
358 # define wxStrcoll wcscoll
359 # define wxStrcpy wcscpy
360 # define wxStrcspn wcscspn
361 # define wxStrlen_ wcslen // used in wxStrlen inline function
362 # define wxStrncat wcsncat
363 # define wxStrncmp wcsncmp
364 # define wxStrncpy wcsncpy
365 # define wxStrpbrk wcspbrk
366 # define wxStrrchr wcsrchr
367 # define wxStrspn wcsspn
368 # define wxStrstr wcsstr
369 # define wxStrtod wcstod
370 # define wxStrtok wcstok
371 # define wxStrtol wcstol
372 # define wxStrtoul wcstoul
373 # define wxStrxfrm wcsxfrm
374
375 # define wxFgetc fgetwc
376 # define wxFgetchar fgetwchar
377 # define wxFgets fgetws
378 # define wxFputc fputwc
379 # define wxFputchar fputwchar
380 # define wxFprintf fwprintf
381 # define wxFscanf fwscanf
382 # define wxGetc getwc
383 # define wxGetchar getwchar
384 # define wxGets getws
385 # define wxPrintf wprintf
386 # define wxPutc wputc
387 # define wxPutchar wputchar
388 # define wxPuts putws
389 # define wxScanf wscanf
390 # define wxSnprintf swprintf
391 # define wxSscanf swscanf
392 # define wxUngetc ungetwc
393 # define wxVfprint vfwprintf
394 # define wxVprintf vwprintf
395 # define wxVsscanf vswscanf
396 # define wxVsnprintf vswprintf
397
398 // glibc doesn't have wc equivalents of the other stuff
399 # define wxNEED_WX_STDIO_H
400 # define wxNEED_WX_STDLIB_H
401 # define wxNEED_WX_TIME_H
402
403 # else//!glibc
404 # error "Please define your compiler's Unicode conventions in wxChar.h"
405 # endif
406 # else//!Unicode
407
408 # include <ctype.h>
409 # include <string.h>
410
411 typedef char wxChar;
412 typedef signed char wxSChar;
413 typedef unsigned char wxUChar;
414
415 # if defined(__FreeBSD__) || defined(__DARWIN__)
416 # undef _T
417 # endif
418
419 # if !defined(__MINGW32__) || !defined(_T)
420 # define _T(x) x
421 # endif
422
423 // ctype.h functions
424 # define wxIsalnum isalnum
425 # define wxIsalpha isalpha
426 # define wxIsctrl isctrl
427 # define wxIsdigit isdigit
428 # define wxIsgraph isgraph
429 # define wxIslower islower
430 # define wxIsprint isprint
431 # define wxIspunct ispunct
432 # define wxIsspace isspace
433 # define wxIsupper isupper
434 # define wxIsxdigit isxdigit
435 # define wxTolower tolower
436 # define wxToupper toupper
437
438 // locale.h functons
439 # define wxSetlocale setlocale
440
441 // string.h functions
442 // #define wxStricmp strcasecmp
443 // wxStricmp is defined below!!
444
445 #ifdef HAVE_STRTOK_R
446 #define wxStrtok(str, sep, last) strtok_r(str, sep, last)
447 #else
448 #define wxStrtok(str, sep, last) strtok(str, sep)
449 #endif
450
451 // leave the rest to defaults below
452 # define wxNEED_WX_STRING_H
453 # define wxNEED_WX_STDIO_H
454 # define wxNEED_WX_STDLIB_H
455 # define wxNEED_WX_TIME_H
456
457 # endif//Unicode
458 #endif//TCHAR-aware compilers
459
460 // define wxStricmp for various compilers without Unicode possibilities
461 #if !defined(wxStricmp) && !wxUSE_UNICODE
462 # if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__) || defined(__DJGPP__)
463 # define wxStricmp stricmp
464 # define wxStrnicmp strnicmp
465 # elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
466 # define wxStricmp _stricmp
467 # define wxStrnicmp _strnicmp
468 # elif defined(__UNIX__) || defined(__GNUWIN32__)
469 # define wxStricmp strcasecmp
470 # define wxStrnicmp strncasecmp
471 # elif defined(__MWERKS__) && !defined(__INTEL__)
472 // use wxWindows' implementation
473 # else
474 // if you leave wxStricmp undefined, wxWindows' implementation will be used
475 # error "Please define string case-insensitive compare for your OS/compiler"
476 # endif
477 #endif
478
479 // if we need to define for standard headers, and we're not using Unicode,
480 // just define to standard C library routines
481 #if !wxUSE_UNICODE
482 # ifdef wxNEED_WX_STRING_H
483 # define wxStrcat strcat
484 # define wxStrchr strchr
485 # define wxStrcmp strcmp
486 # define wxStrcoll strcoll
487 # define wxStrcpy strcpy
488 # define wxStrcspn strcspn
489 #if !defined(__MWERKS__) || !defined(__WXMAC__)
490 # define wxStrdup strdup
491 #endif
492 # define wxStrlen_ strlen // used in wxStrlen inline function
493 # define wxStrncat strncat
494 # define wxStrncmp strncmp
495 # define wxStrncpy strncpy
496 # define wxStrpbrk strpbrk
497 # define wxStrrchr strrchr
498 # define wxStrspn strspn
499 # define wxStrstr strstr
500 # define wxStrtod strtod
501 # define wxStrtol strtol
502 # define wxStrtoul strtoul
503 # define wxStrxfrm strxfrm
504 # undef wxNEED_WX_STRING_H
505 # endif
506
507 # ifdef wxNEED_WX_STDIO_H
508 # define wxFopen fopen
509 # define wxFreopen freopen
510 # define wxPerror perror
511 # define wxRemove remove
512 # define wxRename rename
513 # define wxTmpnam tmpnam
514
515 # define wxFgetc fgetc
516 # define wxFgetchar fgetchar
517 # define wxFgets fgets
518 # define wxFputc fputc
519 # define wxFputchar fputchar
520 # define wxFprintf fprintf
521 # define wxFscanf fscanf
522 # define wxGetc getc
523 # define wxGetchar getchar
524 # define wxGets gets
525 # define wxPrintf printf
526 # define wxPutc putc
527 # define wxPutchar putchar
528 # define wxPuts puts
529 # define wxScanf scanf
530 # define wxSprintf sprintf
531 # define wxSscanf sscanf
532 # define wxUngetc ungetc
533 # define wxVfprint vfprintf
534 # define wxVprintf vprintf
535 # define wxVsscanf vsscanf
536 # define wxVsprintf vsprintf
537 # undef wxNEED_WX_STDIO_H
538 # endif
539
540
541 # ifdef wxNEED_WX_STDLIB_H
542 # define wxAtof atof
543 # define wxAtoi atoi
544 # define wxAtol atol
545 # define wxGetenv getenv
546 # define wxSystem system
547 # undef wxNEED_WX_STDLIB_H
548 # endif
549
550 # ifdef wxNEED_WX_TIME_H
551 # define wxAsctime asctime
552 # define wxCtime ctime
553 # define wxStrftime strftime
554 # undef wxNEED_WX_TIME_H
555 # endif
556 #endif //!Unicode
557
558 // checks whether the passed in pointer is NULL and if the string is empty
559 inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; }
560
561 #ifndef wxNEED_WX_STRING_H
562 // safe version of strlen() (returns 0 if passed NULL pointer)
563 inline size_t wxStrlen(const wxChar *psz)
564 { return psz ? wxStrlen_(psz) : 0; }
565 #endif
566
567 #if wxUSE_WCHAR_T
568 // multibyte<->widechar conversion
569 WXDLLEXPORT size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n);
570 WXDLLEXPORT size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n);
571 # if wxUSE_UNICODE
572 # define wxMB2WX wxMB2WC
573 # define wxWX2MB wxWC2MB
574 # define wxWC2WX wxStrncpy
575 # define wxWX2WC wxStrncpy
576 # else
577 # define wxMB2WX wxStrncpy
578 # define wxWX2MB wxStrncpy
579 # define wxWC2WX wxWC2MB
580 # define wxWX2WC wxMB2WC
581 # endif
582 #else
583 // No wxUSE_WCHAR_T: we have to do something (JACS)
584 # define wxMB2WC wxStrncpy
585 # define wxWC2MB wxStrncpy
586 # define wxMB2WX wxStrncpy
587 # define wxWX2MB wxStrncpy
588 # define wxWC2WX wxWC2MB
589 # define wxWX2WC wxMB2WC
590 #endif
591
592 WXDLLEXPORT bool wxOKlibc(); // for internal use
593
594 // if libc versions are not available, use replacements defined in wxchar.cpp
595 #ifndef wxStrdup
596 WXDLLEXPORT wxChar * wxStrdup(const wxChar *psz);
597 #endif
598
599 #ifndef wxStricmp
600 WXDLLEXPORT int wxStricmp(const wxChar *psz1, const wxChar *psz2);
601 #endif
602
603 #ifndef wxStrnicmp
604 WXDLLEXPORT int wxStrnicmp(const wxChar *psz1, const wxChar *psz2, size_t len);
605 #endif
606
607 #ifndef wxStrtok
608 WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr);
609 #endif
610
611 #ifndef wxSetlocale
612 class wxWCharBuffer;
613 WXDLLEXPORT wxWCharBuffer wxSetlocale(int category, const wxChar *locale);
614 #endif
615
616 #ifdef wxNEED_WX_CTYPE_H
617 WXDLLEXPORT int wxIsalnum(wxChar ch);
618 WXDLLEXPORT int wxIsalpha(wxChar ch);
619 WXDLLEXPORT int wxIsctrl(wxChar ch);
620 WXDLLEXPORT int wxIsdigit(wxChar ch);
621 WXDLLEXPORT int wxIsgraph(wxChar ch);
622 WXDLLEXPORT int wxIslower(wxChar ch);
623 WXDLLEXPORT int wxIsprint(wxChar ch);
624 WXDLLEXPORT int wxIspunct(wxChar ch);
625 WXDLLEXPORT int wxIsspace(wxChar ch);
626 WXDLLEXPORT int wxIsupper(wxChar ch);
627 WXDLLEXPORT int wxIsxdigit(wxChar ch);
628 WXDLLEXPORT int wxTolower(wxChar ch);
629 WXDLLEXPORT int wxToupper(wxChar ch);
630 #endif
631
632 #ifdef wxNEED_WX_STRING_H
633 WXDLLEXPORT wxChar * wxStrcat(wxChar *dest, const wxChar *src);
634 WXDLLEXPORT const wxChar * wxStrchr(const wxChar *s, wxChar c);
635 WXDLLEXPORT wxChar * wxStrchr(wxChar *s, wxChar c)
636 { return (wxChar *)wxStrchr((const wxChar *)s, c); }
637 WXDLLEXPORT int wxStrcmp(const wxChar *s1, const wxChar *s2);
638 WXDLLEXPORT int wxStrcoll(const wxChar *s1, const wxChar *s2);
639 WXDLLEXPORT wxChar * wxStrcpy(wxChar *dest, const wxChar *src);
640 WXDLLEXPORT size_t wxStrcspn(const wxChar *s, const wxChar *reject);
641 WXDLLEXPORT size_t wxStrlen(const wxChar *s);
642 WXDLLEXPORT wxChar * wxStrncat(wxChar *dest, const wxChar *src, size_t n);
643 WXDLLEXPORT int wxStrncmp(const wxChar *s1, const wxChar *s2, size_t n);
644 WXDLLEXPORT wxChar * wxStrncpy(wxChar *dest, const wxChar *src, size_t n);
645 WXDLLEXPORT const wxChar * wxStrpbrk(const wxChar *s, const wxChar *accept);
646 WXDLLEXPORT wxChar * wxStrpbrk(wxChar *s, const wxChar *accept)
647 { return (wxChar *)wxStrpbrk((const wxChar *)s, accept); }
648 WXDLLEXPORT const wxChar * wxStrrchr(const wxChar *s, wxChar c);
649 WXDLLEXPORT wxChar * wxStrrchr(wxChar *s, wxChar c)
650 { return (wxChar *)wxStrrchr((const wxChar *)s, c); }
651 WXDLLEXPORT size_t wxStrspn(const wxChar *s, const wxChar *accept);
652 WXDLLEXPORT const wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle);
653 WXDLLEXPORT wxChar *wxStrstr(wxChar *haystack, const wxChar *needle)
654 { return (wxChar *)wxStrstr((const wxChar *)haystack, needle); }
655 WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr);
656 WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base);
657 WXDLLEXPORT unsigned long int wxStrtoul(const wxChar *nptr, wxChar **endptr, int base);
658 WXDLLEXPORT size_t wxStrxfrm(wxChar *dest, const wxChar *src, size_t n);
659 #endif
660
661 #ifdef wxNEED_WX_STDIO_H
662 # include <stdio.h>
663 # include <stdarg.h>
664 WXDLLEXPORT FILE * wxFopen(const wxChar *path, const wxChar *mode);
665 WXDLLEXPORT FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream);
666 WXDLLEXPORT int wxRemove(const wxChar *path);
667 WXDLLEXPORT int wxRename(const wxChar *oldpath, const wxChar *newpath);
668 #endif
669
670 #ifndef wxAtof
671 WXDLLEXPORT double wxAtof(const wxChar *psz);
672 #endif
673
674 #ifdef wxNEED_WX_STDLIB_H
675 WXDLLEXPORT int wxAtoi(const wxChar *psz);
676 WXDLLEXPORT long wxAtol(const wxChar *psz);
677 WXDLLEXPORT wxChar * wxGetenv(const wxChar *name);
678 WXDLLEXPORT int wxSystem(const wxChar *psz);
679 #endif
680
681 #ifdef wxNEED_WX_TIME_H
682 WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm);
683 #endif
684
685 // under VC++ 6.0 isspace() returns 1 for 8 bit chars which completely breaks
686 // the file parsing - this may be true for 5.0 as well, update #ifdef then
687 #if defined(__VISUALC__) && (__VISUALC__ >= 1200) && !wxUSE_UNICODE
688 #undef wxIsspace
689 #define wxIsspace(c) ((((unsigned)c) < 128) && isspace(c))
690 #endif // VC++
691
692 // ----------------------------------------------------------------------------
693 // common macros which are always defined
694 // ----------------------------------------------------------------------------
695
696 // although global macros with such names are really bad, we want to have
697 // another name for _T() which should be used to avoid confusion between _T()
698 // and _() in wxWindows sources
699 #define wxT(x) _T(x)
700
701 // Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs
702 #ifndef __TFILE__
703 #define __XFILE__(x) wxT(x)
704 #define __TFILE__ __XFILE__(__FILE__)
705 #endif
706
707 #ifndef __TDATE__
708 #define __XDATE__(x) wxT(x)
709 #define __TDATE__ __XDATE__(__DATE__)
710 #endif
711
712 #ifndef __TTIME__
713 #define __XTIME__(x) wxT(x)
714 #define __TTIME__ __XTIME__(__TIME__)
715 #endif
716
717 #endif
718 //_WX_WXCHAR_H_
719