1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Declarations common to wx char/wchar_t usage (wide chars)
8 // Copyright: (c) wxWindows copyright
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "wxchar.h"
19 // only do SBCS or _UNICODE
21 // It may be OK anyway.
22 // # error "MBCS is not supported by wxChar"
25 // ----------------------------------------------------------------------------
26 // first deal with Unicode setting
27 // ----------------------------------------------------------------------------
29 // set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined
30 #if defined(_UNICODE) || defined(UNICODE)
32 # define wxUSE_UNICODE 1
34 # ifndef wxUSE_UNICODE
35 # define wxUSE_UNICODE 0
39 // and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1...
49 // Unicode support requires wchar_t
52 # define wxUSE_WCHAR_T 1
55 // Required for wxPrintf() etc
58 // ----------------------------------------------------------------------------
59 // define wxHAVE_TCHAR_FUNCTIONS for the compilers which support the
60 // wide-character functions
61 // ----------------------------------------------------------------------------
63 // VC++ and BC++ starting with 5.2 have TCHAR support
65 #define wxHAVE_TCHAR_FUNCTIONS
66 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)
67 #define wxHAVE_TCHAR_FUNCTIONS
68 #elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 )
69 #define wxHAVE_TCHAR_FUNCTIONS
73 #elif defined(__CYGWIN__)
76 #endif // !HAVE_WCSLEN
79 #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
80 // VisualAge 4.0+ supports TCHAR
81 #define wxHAVE_TCHAR_FUNCTIONS
83 // but not stdio.h nor time nor conversion functions
84 #define wxNO_TCHAR_STDIO
85 #define wxNO_TCHAR_STDLIB
86 #define wxNO_TCHAR_TIME
87 #define wxNO_TCHAR_LOCALE
89 // supplemental VA V4 defs so at least we know what these are
90 // just define to standard defs
96 // locale.h functons -- not defined in tchar.h
97 #define wxSetlocale setlocale
98 // some stdio functions are defined others are not
100 #define wxFgetchar fgetchar
101 #define wxFopen fopen
102 #define wxFputchar fputchar
103 #define wxFreopen freopen
105 #define wxPerror perror
107 #define wxRemove remove
108 #define wxRename rename
109 #define wxTmpnam tmpnam
110 #define wxUngetc ungetc
111 #define wxVsscanf vsscanf
112 // stdlib not defined in VA V4
118 #define wxGetenv getenv
119 #define wxSystem system
120 // time.h functions -- none defined in tchar.h
121 #define wxAsctime asctime
122 #define wxCtime ctime
123 #elif defined(__MWERKS__)
128 #endif // compilers with (good) TCHAR support
130 #ifdef wxHAVE_TCHAR_FUNCTIONS
131 # define HAVE_WCSLEN 1
135 # if wxUSE_UNICODE // temporary - preserve binary compatibility
136 #if defined(__GNUWIN32__)
138 #define _TSCHAR TCHAR
139 #define _TUCHAR TCHAR
142 typedef _TCHAR wxChar
;
143 typedef _TSCHAR wxSChar
;
144 typedef _TUCHAR wxUChar
;
147 # define wxSChar signed char
148 # define wxUChar unsigned char
151 // wchar_t is available
152 #ifndef wxUSE_WCHAR_T
153 #define wxUSE_WCHAR_T 1
154 #endif // !defined(wxUSE_WCHAR_T)
157 #ifndef wxNO_TCHAR_CTYPE
161 # define wxIsalnum _istalnum
162 # define wxIsalpha _istalpha
163 # define wxIsctrl _istctrl
164 # define wxIsdigit _istdigit
165 # define wxIsgraph _istgraph
166 # define wxIslower _istlower
167 # define wxIsprint _istprint
168 # define wxIspunct _istpunct
169 # define wxIsspace _istspace
170 # define wxIsupper _istupper
171 # define wxIsxdigit _istxdigit
172 # define wxTolower _totlower
173 # define wxToupper _totupper
174 #endif // wxNO_TCHAR_CTYPE
177 #ifndef wxNO_TCHAR_LOCALE
178 # define wxSetlocale _tsetlocale
179 #endif // wxNO_TCHAR_LOCALE
181 // string.h functions
182 #ifndef wxNO_TCHAR_STRING
183 # define wxStrcat _tcscat
184 # define wxStrchr _tcschr
185 # define wxStrcmp _tcscmp
186 # define wxStrcoll _tcscoll
187 # define wxStrcpy _tcscpy
188 # define wxStrcspn _tcscspn
189 # define wxStrftime _tcsftime
190 # define wxStricmp _tcsicmp
191 # define wxStrnicmp _tcsnicmp
192 # define wxStrlen_ _tcslen // used in wxStrlen inline function
193 # define wxStrncat _tcsncat
194 # define wxStrncmp _tcsncmp
195 # define wxStrncpy _tcsncpy
196 # define wxStrpbrk _tcspbrk
197 # define wxStrrchr _tcsrchr
198 # define wxStrspn _tcsspn
199 # define wxStrstr _tcsstr
200 # define wxStrtod _tcstod
201 # define wxStrtol _tcstol
202 # define wxStrtoul _tcstoul
203 # define wxStrxfrm _tcsxfrm
204 #endif // wxNO_TCHAR_STRING
207 #ifndef wxNO_TCHAR_STDIO
208 # if wxUSE_UNICODE_MSLU
209 # define wxRemove wxMSLU__tremove
210 # define wxRename wxMSLU__trename
212 # define wxRemove _tremove
213 # define wxRename _trename
215 # define wxFgetc _fgettc
216 # define wxFgetchar _fgettchar
217 # define wxFgets _fgetts
218 # define wxFopen _tfopen
219 # define wxFputc _fputtc
220 # define wxFputchar _fputtchar
221 # define wxFprintf _ftprintf
222 # define wxFreopen _tfreopen
223 # define wxFscanf _ftscanf
224 # define wxGetc _gettc
225 # define wxGetchar _gettchar
226 # define wxGets _getts
227 # define wxPerror _tperror
228 # define wxPrintf _tprintf
229 # define wxPutc _puttc
230 # define wxPutchar _puttchar
231 # define wxPuts _putts
232 # define wxScanf _tscanf
233 # define wxSprintf _stprintf
234 # define wxSscanf _stscanf
235 # define wxTmpnam _ttmpnam
236 # define wxUngetc _tungetc
237 # define wxVfprint _vftprintf
238 # define wxVprintf _vtprintf
239 # define wxVsscanf _vstscanf
240 # define wxVsprintf _vstprintf
241 #elif defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
242 // it has some stdio.h functions, apparently
243 # define wxFgetc _fgettc
244 # define wxFgets _fgetts
245 # define wxFputc _fputtc
246 # define wxFprintf _ftprintf
247 # define wxFscanf _ftscanf
248 # define wxGetc _gettc
249 # define wxGetchar _gettchar
250 # define wxPrintf _tprintf
251 # define wxPutc _puttc
252 # define wxPutchar _puttchar
253 # define wxScanf _tscanf
254 # define wxSprintf _stprintf
255 # define wxSscanf _stscanf
256 # define wxVfprint _vftprintf
257 # define wxVprintf _vtprintf
258 # define wxVsprintf _vstprintf
259 #endif // wxNO_TCHAR_STDIO
261 // stdlib.h functions
262 #ifndef wxNO_TCHAR_STDLIB
266 # define wxAtoi _ttoi
267 # define wxAtol _ttol
268 # define wxGetenv _tgetenv
269 # define wxSystem _tsystem
270 #endif // wxNO_TCHAR_STDLIB
273 #ifndef wxNO_TCHAR_TIME
274 # define wxAsctime _tasctime
275 # define wxCtime _tctime
276 #endif // wxNO_TCHAR_TIME
278 #else // !TCHAR-aware compilers
280 // check whether we should include wchar.h or equivalent
281 # if !defined(wxUSE_WCHAR_T)
282 # if defined(__VISUALC__) && (__VISUALC__ < 900)
283 # define wxUSE_WCHAR_T 0 // wchar_t is not available for MSVC++ 1.5
284 # elif defined(__UNIX__)
285 # if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__)
286 # define wxUSE_WCHAR_T 1
288 # define wxUSE_WCHAR_T 0
290 # elif defined(__GNUWIN32__) && !defined(__MINGW32__) // Cygwin (not Mingw32) doesn't have wcslen.h, needed in buffer.h
291 # define wxUSE_WCHAR_T 0
292 # elif defined(__BORLANDC__) // WIN16 BC++
293 # define wxUSE_WCHAR_T 0
294 # elif defined(__WATCOMC__)
295 # define wxUSE_WCHAR_T 0
296 # elif defined(__VISAGECPP__) && (__IBMCPP__ < 400)
297 # define wxUSE_WCHAR_T 0
299 // add additional compiler checks if this fails
300 # define wxUSE_WCHAR_T 1
302 # endif // !defined(wxUSE_WCHAR_T)
306 // include wchar.h to get wcslen() declaration used by wx/buffer.h
307 // stddef.h is needed for Cygwin
310 # elif defined(HAVE_WCSTR_H)
311 // old compilers have wcslen() here
313 # elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__)
314 // include stdlib.h for wchar_t, wcslen is provided in wxchar.cpp
316 size_t WXDLLEXPORT
wcslen(const wchar_t *s
);
317 # endif // HAVE_WCHAR_H
318 # endif // wxUSE_WCHAR_T
320 // check whether we are doing Unicode
325 // this is probably glibc-specific
326 # if defined(__WCHAR_TYPE__)
328 // VS: wxWindows used to define wxChar as __WCHAR_TYPE__ here. However, this doesn't
329 // work with new GCC 3.x compilers because wchar_t is C++'s builtin type in the new
330 // standard. OTOH, old compilers (GCC 2.x) won't accept new definition
331 // of wx{S,U}Char, therefore we have to define wxChar conditionally depending on
332 // detected compiler & compiler version.
333 // The most complicated case is the infamous so-called "gcc-2.96" which does not
334 // accept new definition of wxSChar but doesn't work with old definition of wxChar.
335 #if defined(__GNUC__) && (__GNUC__ >= 3)
336 // modern C++ compiler
337 typedef wchar_t wxChar
;
338 typedef signed wchar_t wxSChar
;
339 typedef unsigned wchar_t wxUChar
;
341 #if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 96)
342 typedef wchar_t wxChar
;
344 typedef __WCHAR_TYPE__ wxChar
;
346 typedef signed __WCHAR_TYPE__ wxSChar
;
347 typedef unsigned __WCHAR_TYPE__ wxUChar
;
352 // ctype.h functions (wctype.h)
353 # define wxIsalnum iswalnum
354 # define wxIsalpha iswalpha
355 # define wxIsctrl iswcntrl
356 # define wxIsdigit iswdigit
357 # define wxIsgraph iswgraph
358 # define wxIslower iswlower
359 # define wxIsprint iswprint
360 # define wxIspunct iswpunct
361 # define wxIsspace iswspace
362 # define wxIsupper iswupper
363 # define wxIsxdigit iswxdigit
365 # if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
366 // /usr/include/wctype.h incorrectly declares translations tables which
367 // provokes tons of compile-time warnings - try to correct this
368 # define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower)
369 # define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper)
371 # define wxTolower towlower
372 # define wxToupper towupper
375 // string.h functions (wchar.h)
376 # define wxStrcat wcscat
377 # define wxStrchr wcschr
378 # define wxStrcmp wcscmp
379 # define wxStrcoll wcscoll
380 # define wxStrcpy wcscpy
381 # define wxStrcspn wcscspn
382 # define wxStrlen_ wcslen // used in wxStrlen inline function
383 # define wxStrncat wcsncat
384 # define wxStrncmp wcsncmp
385 # define wxStrncpy wcsncpy
386 # define wxStrpbrk wcspbrk
387 # define wxStrrchr wcsrchr
388 # define wxStrspn wcsspn
389 # define wxStrstr wcsstr
390 # define wxStrtod wcstod
391 # define wxStrtok wcstok
392 # define wxStrtol wcstol
393 # define wxStrtoul wcstoul
394 # define wxStrxfrm wcsxfrm
396 # define wxFgetc fgetwc
397 # define wxFgetchar fgetwchar
398 # define wxFgets fgetws
399 # define wxFputc fputwc
400 # define wxFputchar fputwchar
401 # define wxGetc getwc
402 # define wxGetchar getwchar
403 # define wxGets getws
404 # define wxPutc wputc
405 # define wxPutchar wputchar
406 # define wxPuts putws
407 # define wxUngetc ungetwc
409 // we need %s to %ls conversion for printf and scanf etc
410 # define wxNEED_PRINTF_CONVERSION
411 # define wxHAS_VSNPRINTF
412 # define wxHAS_SNPRINTF
414 // glibc doesn't have wc equivalents of the other stuff
415 # define wxNEED_WX_STDIO_H
416 # define wxNEED_WX_STDLIB_H
417 # define wxNEED_WX_TIME_H
420 # error "Please define your compiler's Unicode conventions in wxChar.h"
428 typedef signed char wxSChar
;
429 typedef unsigned char wxUChar
;
431 # if defined(__FreeBSD__) || defined(__DARWIN__)
435 # if !defined(__MINGW32__) || !defined(_T)
440 # define wxIsalnum isalnum
441 # define wxIsalpha isalpha
442 # define wxIsctrl isctrl
443 # define wxIsdigit isdigit
444 # define wxIsgraph isgraph
445 # define wxIslower islower
446 # define wxIsprint isprint
447 # define wxIspunct ispunct
448 # define wxIsspace isspace
449 # define wxIsupper isupper
450 # define wxIsxdigit isxdigit
451 # define wxTolower tolower
452 # define wxToupper toupper
455 # define wxSetlocale setlocale
457 // string.h functions
458 // #define wxStricmp strcasecmp
459 // wxStricmp is defined below!!
462 #define wxStrtok(str, sep, last) strtok_r(str, sep, last)
464 #define wxStrtok(str, sep, last) strtok(str, sep)
467 // leave the rest to defaults below
468 # define wxNEED_WX_STRING_H
469 # define wxNEED_WX_STDIO_H
470 # define wxNEED_WX_STDLIB_H
471 # define wxNEED_WX_TIME_H
474 #endif//TCHAR-aware compilers
476 // define wxStricmp for various compilers without Unicode possibilities
477 #if !defined(wxStricmp) && !wxUSE_UNICODE
478 # if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__) || defined(__DJGPP__)
479 # define wxStricmp stricmp
480 # define wxStrnicmp strnicmp
481 # elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
482 # define wxStricmp _stricmp
483 # define wxStrnicmp _strnicmp
484 # elif defined(__UNIX__) || defined(__GNUWIN32__)
485 # define wxStricmp strcasecmp
486 # define wxStrnicmp strncasecmp
487 # elif defined(__MWERKS__) && !defined(__INTEL__)
488 // use wxWindows' implementation
490 // if you leave wxStricmp undefined, wxWindows' implementation will be used
491 # error "Please define string case-insensitive compare for your OS/compiler"
495 // if we need to define for standard headers, and we're not using Unicode,
496 // just define to standard C library routines
498 # ifdef wxNEED_WX_STRING_H
499 # define wxStrcat strcat
500 # define wxStrchr strchr
501 # define wxStrcmp strcmp
502 # define wxStrcoll strcoll
503 # define wxStrcpy strcpy
504 # define wxStrcspn strcspn
505 #if !defined(__MWERKS__) || !defined(__WXMAC__)
506 # define wxStrdup strdup
508 # define wxStrlen_ strlen // used in wxStrlen inline function
509 # define wxStrncat strncat
510 # define wxStrncmp strncmp
511 # define wxStrncpy strncpy
512 # define wxStrpbrk strpbrk
513 # define wxStrrchr strrchr
514 # define wxStrspn strspn
515 # define wxStrstr strstr
516 # define wxStrtod strtod
517 # define wxStrtol strtol
518 # define wxStrtoul strtoul
519 # define wxStrxfrm strxfrm
520 # undef wxNEED_WX_STRING_H
523 # ifdef wxNEED_WX_STDIO_H
524 # define wxFopen fopen
525 # define wxFreopen freopen
526 # define wxPerror perror
527 # define wxRemove remove
528 # define wxRename rename
529 # define wxTmpnam tmpnam
531 # define wxFgetc fgetc
532 # define wxFgetchar fgetchar
533 # define wxFgets fgets
534 # define wxFputc fputc
535 # define wxFputchar fputchar
536 # define wxFprintf fprintf
537 # define wxFscanf fscanf
539 # define wxGetchar getchar
541 # define wxPrintf printf
543 # define wxPutchar putchar
545 # define wxScanf scanf
546 # define wxSprintf sprintf
547 # define wxSscanf sscanf
548 # define wxUngetc ungetc
549 # define wxVfprint vfprintf
550 # define wxVprintf vprintf
551 # define wxVsscanf vsscanf
552 # define wxVsprintf vsprintf
553 # undef wxNEED_WX_STDIO_H
557 # ifdef wxNEED_WX_STDLIB_H
561 # define wxGetenv getenv
562 # define wxSystem system
563 # undef wxNEED_WX_STDLIB_H
566 # ifdef wxNEED_WX_TIME_H
567 # define wxAsctime asctime
568 # define wxCtime ctime
569 # define wxStrftime strftime
570 # undef wxNEED_WX_TIME_H
574 // checks whether the passed in pointer is NULL and if the string is empty
575 inline bool wxIsEmpty(const wxChar
*p
) { return !p
|| !*p
; }
577 #ifndef wxNEED_WX_STRING_H
578 // safe version of strlen() (returns 0 if passed NULL pointer)
579 inline size_t wxStrlen(const wxChar
*psz
)
580 { return psz
? wxStrlen_(psz
) : 0; }
584 // multibyte<->widechar conversion
585 WXDLLEXPORT
size_t wxMB2WC(wchar_t *buf
, const char *psz
, size_t n
);
586 WXDLLEXPORT
size_t wxWC2MB(char *buf
, const wchar_t *psz
, size_t n
);
588 # define wxMB2WX wxMB2WC
589 # define wxWX2MB wxWC2MB
590 # define wxWC2WX wxStrncpy
591 # define wxWX2WC wxStrncpy
593 # define wxMB2WX wxStrncpy
594 # define wxWX2MB wxStrncpy
595 # define wxWC2WX wxWC2MB
596 # define wxWX2WC wxMB2WC
599 // No wxUSE_WCHAR_T: we have to do something (JACS)
600 # define wxMB2WC wxStrncpy
601 # define wxWC2MB wxStrncpy
602 # define wxMB2WX wxStrncpy
603 # define wxWX2MB wxStrncpy
604 # define wxWC2WX wxWC2MB
605 # define wxWX2WC wxMB2WC
608 WXDLLEXPORT
bool wxOKlibc(); // for internal use
610 // We need conversion from %s to %ls in Unicode mode under Unix
611 #ifdef wxNEED_PRINTF_CONVERSION
612 int wxScanf( const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_2
;
613 int wxSscanf( const wxChar
*str
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_3
;
614 int wxFscanf( FILE *stream
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_3
;
615 int wxVsscanf( const wxChar
*str
, const wxChar
*format
, va_list ap
);
616 int wxPrintf( const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_2
;
617 int wxSnprintf( wxChar
*str
, size_t size
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_4
;
618 int wxSprintf( wxChar
*str
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_3
;
619 int wxFprintf( FILE *stream
, const wxChar
*format
, ... ) ATTRIBUTE_PRINTF_3
;
620 int wxVfprint( const wxChar
*format
, va_list ap
);
621 int wxVprintf( const wxChar
*format
, va_list ap
);
622 int wxVsnprintf( wxChar
*str
, size_t size
, const wxChar
*format
, va_list ap
);
623 int wxVsprintf( wxChar
*str
, const wxChar
*format
, va_list ap
);
626 #if !defined(wxSnprintf) && !defined(wxHAS_SNPRINTF)
627 // wxSnprintf() is like snprintf() if it's available and sprintf() (always
628 // available, but dangerous!) if not.
629 WXDLLEXPORT
int wxSnprintf(wxChar
*buf
, size_t len
,
630 const wxChar
*format
,
631 ...) ATTRIBUTE_PRINTF_3
;
634 #if !defined(wxVsnprintf) && !defined(wxHAS_VSNPRINTF)
635 // and wxVsnprintf() is like vsnprintf() or vsprintf()
636 WXDLLEXPORT
int wxVsnprintf(wxChar
*buf
, size_t len
,
637 const wxChar
*format
,
641 // if libc versions are not available, use replacements defined in wxchar.cpp
643 WXDLLEXPORT wxChar
* wxStrdup(const wxChar
*psz
);
647 WXDLLEXPORT
int wxStricmp(const wxChar
*psz1
, const wxChar
*psz2
);
651 WXDLLEXPORT
int wxStrnicmp(const wxChar
*psz1
, const wxChar
*psz2
, size_t len
);
655 WXDLLEXPORT wxChar
* wxStrtok(wxChar
*psz
, const wxChar
*delim
, wxChar
**save_ptr
);
660 WXDLLEXPORT wxWCharBuffer
wxSetlocale(int category
, const wxChar
*locale
);
663 #ifdef wxNEED_WX_CTYPE_H
664 WXDLLEXPORT
int wxIsalnum(wxChar ch
);
665 WXDLLEXPORT
int wxIsalpha(wxChar ch
);
666 WXDLLEXPORT
int wxIsctrl(wxChar ch
);
667 WXDLLEXPORT
int wxIsdigit(wxChar ch
);
668 WXDLLEXPORT
int wxIsgraph(wxChar ch
);
669 WXDLLEXPORT
int wxIslower(wxChar ch
);
670 WXDLLEXPORT
int wxIsprint(wxChar ch
);
671 WXDLLEXPORT
int wxIspunct(wxChar ch
);
672 WXDLLEXPORT
int wxIsspace(wxChar ch
);
673 WXDLLEXPORT
int wxIsupper(wxChar ch
);
674 WXDLLEXPORT
int wxIsxdigit(wxChar ch
);
675 WXDLLEXPORT
int wxTolower(wxChar ch
);
676 WXDLLEXPORT
int wxToupper(wxChar ch
);
679 #ifdef wxNEED_WX_STRING_H
680 WXDLLEXPORT wxChar
* wxStrcat(wxChar
*dest
, const wxChar
*src
);
681 WXDLLEXPORT
const wxChar
* wxStrchr(const wxChar
*s
, wxChar c
);
682 WXDLLEXPORT wxChar
* wxStrchr(wxChar
*s
, wxChar c
)
683 { return (wxChar
*)wxStrchr((const wxChar
*)s
, c
); }
684 WXDLLEXPORT
int wxStrcmp(const wxChar
*s1
, const wxChar
*s2
);
685 WXDLLEXPORT
int wxStrcoll(const wxChar
*s1
, const wxChar
*s2
);
686 WXDLLEXPORT wxChar
* wxStrcpy(wxChar
*dest
, const wxChar
*src
);
687 WXDLLEXPORT
size_t wxStrcspn(const wxChar
*s
, const wxChar
*reject
);
688 WXDLLEXPORT
size_t wxStrlen(const wxChar
*s
);
689 WXDLLEXPORT wxChar
* wxStrncat(wxChar
*dest
, const wxChar
*src
, size_t n
);
690 WXDLLEXPORT
int wxStrncmp(const wxChar
*s1
, const wxChar
*s2
, size_t n
);
691 WXDLLEXPORT wxChar
* wxStrncpy(wxChar
*dest
, const wxChar
*src
, size_t n
);
692 WXDLLEXPORT
const wxChar
* wxStrpbrk(const wxChar
*s
, const wxChar
*accept
);
693 WXDLLEXPORT wxChar
* wxStrpbrk(wxChar
*s
, const wxChar
*accept
)
694 { return (wxChar
*)wxStrpbrk((const wxChar
*)s
, accept
); }
695 WXDLLEXPORT
const wxChar
* wxStrrchr(const wxChar
*s
, wxChar c
);
696 WXDLLEXPORT wxChar
* wxStrrchr(wxChar
*s
, wxChar c
)
697 { return (wxChar
*)wxStrrchr((const wxChar
*)s
, c
); }
698 WXDLLEXPORT
size_t wxStrspn(const wxChar
*s
, const wxChar
*accept
);
699 WXDLLEXPORT
const wxChar
* wxStrstr(const wxChar
*haystack
, const wxChar
*needle
);
700 WXDLLEXPORT wxChar
*wxStrstr(wxChar
*haystack
, const wxChar
*needle
)
701 { return (wxChar
*)wxStrstr((const wxChar
*)haystack
, needle
); }
702 WXDLLEXPORT
double wxStrtod(const wxChar
*nptr
, wxChar
**endptr
);
703 WXDLLEXPORT
long int wxStrtol(const wxChar
*nptr
, wxChar
**endptr
, int base
);
704 WXDLLEXPORT
unsigned long int wxStrtoul(const wxChar
*nptr
, wxChar
**endptr
, int base
);
705 WXDLLEXPORT
size_t wxStrxfrm(wxChar
*dest
, const wxChar
*src
, size_t n
);
708 #ifdef wxNEED_WX_STDIO_H
711 WXDLLEXPORT
FILE * wxFopen(const wxChar
*path
, const wxChar
*mode
);
712 WXDLLEXPORT
FILE * wxFreopen(const wxChar
*path
, const wxChar
*mode
, FILE *stream
);
713 WXDLLEXPORT
int wxRemove(const wxChar
*path
);
714 WXDLLEXPORT
int wxRename(const wxChar
*oldpath
, const wxChar
*newpath
);
718 WXDLLEXPORT
double wxAtof(const wxChar
*psz
);
721 #ifdef wxNEED_WX_STDLIB_H
722 WXDLLEXPORT
int wxAtoi(const wxChar
*psz
);
723 WXDLLEXPORT
long wxAtol(const wxChar
*psz
);
724 WXDLLEXPORT wxChar
* wxGetenv(const wxChar
*name
);
725 WXDLLEXPORT
int wxSystem(const wxChar
*psz
);
728 #ifdef wxNEED_WX_TIME_H
729 WXDLLEXPORT
size_t wxStrftime(wxChar
*s
, size_t max
, const wxChar
*fmt
, const struct tm
*tm
);
732 // under VC++ 6.0 isspace() returns 1 for 8 bit chars which completely breaks
733 // the file parsing - this may be true for 5.0 as well, update #ifdef then
734 #if defined(__VISUALC__) && (__VISUALC__ >= 1200) && !wxUSE_UNICODE
736 #define wxIsspace(c) ((((unsigned)c) < 128) && isspace(c))
739 // ----------------------------------------------------------------------------
740 // common macros which are always defined
741 // ----------------------------------------------------------------------------
743 // although global macros with such names are really bad, we want to have
744 // another name for _T() which should be used to avoid confusion between _T()
745 // and _() in wxWindows sources
748 // Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs
750 #define __XFILE__(x) wxT(x)
751 #define __TFILE__ __XFILE__(__FILE__)
755 #define __XDATE__(x) wxT(x)
756 #define __TDATE__ __XDATE__(__DATE__)
760 #define __XTIME__(x) wxT(x)
761 #define __TTIME__ __XTIME__(__TIME__)