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