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