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