2004-02-07 12:51:44 +00:00
|
|
|
|
/*
|
|
|
|
|
* Name: wx/wxchar.h
|
|
|
|
|
* Purpose: Declarations common to wx char/wchar_t usage (wide chars)
|
|
|
|
|
* Author: Joel Farley, Ove K<EFBFBD>ven
|
2004-03-05 17:40:38 +00:00
|
|
|
|
* Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee
|
2004-02-07 12:51:44 +00:00
|
|
|
|
* Created: 1998/06/12
|
|
|
|
|
* RCS-ID: $Id$
|
2004-05-23 14:56:36 +00:00
|
|
|
|
* Copyright: (c) 1998-2002 wxWidgets dev team
|
2004-05-23 20:53:33 +00:00
|
|
|
|
* Licence: wxWindows licence
|
2004-02-07 12:51:44 +00:00
|
|
|
|
*/
|
2003-12-17 19:30:31 +00:00
|
|
|
|
|
|
|
|
|
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
|
1999-01-27 10:00:02 +00:00
|
|
|
|
|
|
|
|
|
#ifndef _WX_WXCHAR_H_
|
|
|
|
|
#define _WX_WXCHAR_H_
|
|
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1999-12-13 15:51:01 +00:00
|
|
|
|
#pragma interface "wxchar.h"
|
|
|
|
|
#endif
|
1999-01-27 10:00:02 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#include "wx/defs.h" /* for wxUSE_UNICODE */
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* check whether we have wchar_t and which size it is if we do */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if !defined(wxUSE_WCHAR_T)
|
2004-03-28 13:10:14 +00:00
|
|
|
|
#if defined(__UNIX__)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__)
|
|
|
|
|
#define wxUSE_WCHAR_T 1
|
|
|
|
|
#else
|
|
|
|
|
#define wxUSE_WCHAR_T 0
|
|
|
|
|
#endif
|
2002-09-10 11:54:47 +00:00
|
|
|
|
#elif defined(__GNUWIN32__) && !defined(__MINGW32__)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxUSE_WCHAR_T 0
|
|
|
|
|
#elif defined(__WATCOMC__)
|
|
|
|
|
#define wxUSE_WCHAR_T 0
|
|
|
|
|
#elif defined(__VISAGECPP__) && (__IBMCPP__ < 400)
|
|
|
|
|
#define wxUSE_WCHAR_T 0
|
|
|
|
|
#else
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* add additional compiler checks if this fails */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxUSE_WCHAR_T 1
|
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* !defined(wxUSE_WCHAR_T) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* Unicode support requires wchar_t */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if wxUSE_UNICODE && !wxUSE_WCHAR_T
|
|
|
|
|
#error "wchar_t must be available in Unicode build"
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* Unicode */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Standard headers we need here.
|
1999-04-19 16:07:51 +00:00
|
|
|
|
|
2004-05-23 14:56:36 +00:00
|
|
|
|
NB: don't include any wxWidgets headers here because almost of them include
|
2004-02-07 12:51:44 +00:00
|
|
|
|
this one!
|
|
|
|
|
*/
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* Required for wxPrintf() etc */
|
2002-08-17 12:09:48 +00:00
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* Almost all compiler have strdup(), but not quite all: CodeWarrior under Mac */
|
|
|
|
|
/* and VC++ for Windows CE don't provide it */
|
2002-12-10 00:43:28 +00:00
|
|
|
|
#if !(defined(__MWERKS__) && defined(__WXMAC__)) && !defined(__WXWINCE__)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* use #define, not inline wrapper, as it is tested with #ifndef below */
|
2002-12-10 00:43:28 +00:00
|
|
|
|
#define wxStrdupA strdup
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/*
|
|
|
|
|
non Unix compilers which do have wchar.h (but not tchar.h which is included
|
|
|
|
|
below and which includes wchar.h anyhow).
|
|
|
|
|
|
|
|
|
|
Actually MinGW has tchar.h, but it does not include wchar.h
|
|
|
|
|
*/
|
2004-01-08 07:41:36 +00:00
|
|
|
|
#if defined(__MWERKS__) || defined(__VISAGECPP__) || defined(__MINGW32__) || defined(__WATCOMC__)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifndef HAVE_WCHAR_H
|
|
|
|
|
#define HAVE_WCHAR_H
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2004-02-21 16:39:22 +00:00
|
|
|
|
#if defined(__MWERKS__) && !defined(__MACH__)
|
2004-09-24 14:32:35 +00:00
|
|
|
|
#ifndef HAVE_WCSLEN
|
|
|
|
|
#define HAVE_WCSLEN
|
|
|
|
|
#endif
|
2004-02-21 16:39:22 +00:00
|
|
|
|
#endif
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
|
|
|
|
#if wxUSE_WCHAR_T
|
|
|
|
|
#ifdef HAVE_WCHAR_H
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* the current (as of Nov 2002) version of cygwin has a bug in its */
|
|
|
|
|
/* wchar.h -- there is no extern "C" around the declarations in it and */
|
|
|
|
|
/* this results in linking errors later; also, at least on some */
|
|
|
|
|
/* Cygwin versions, wchar.h requires sys/types.h */
|
2002-12-04 14:11:26 +00:00
|
|
|
|
#ifdef __CYGWIN__
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
extern "C" {
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* Cygwin */
|
2002-12-04 14:11:26 +00:00
|
|
|
|
#include <wchar.h>
|
|
|
|
|
#ifdef __CYGWIN__
|
|
|
|
|
}
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* Cygwin */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#elif defined(HAVE_WCSTR_H)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* old compilers have relevant declarations here */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#include <wcstr.h>
|
|
|
|
|
#elif defined(__FreeBSD__) || defined(__DARWIN__) || defined(__EMX__)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* include stdlib.h for wchar_t */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#include <stdlib.h>
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* HAVE_WCHAR_H */
|
|
|
|
|
#endif /* wxUSE_WCHAR_T */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
|
|
|
|
/* define wxHAVE_TCHAR_SUPPORT for the compilers which support the TCHAR type */
|
|
|
|
|
/* mapped to either char or wchar_t depending on the ASCII/Unicode mode and have */
|
|
|
|
|
/* the function mapping _tfoo() -> foo() or wfoo() */
|
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
1999-12-13 15:51:01 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* VC++ and BC++ starting with 5.2 have TCHAR support */
|
2002-08-08 09:35:25 +00:00
|
|
|
|
#ifdef __VISUALC__
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxHAVE_TCHAR_SUPPORT
|
2002-08-08 09:35:25 +00:00
|
|
|
|
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxHAVE_TCHAR_SUPPORT
|
|
|
|
|
#include <ctype.h>
|
2003-09-18 14:03:09 +00:00
|
|
|
|
#elif defined(__WATCOMC__)
|
|
|
|
|
#define wxHAVE_TCHAR_SUPPORT
|
2004-02-07 15:07:08 +00:00
|
|
|
|
#elif defined(__DMC__)
|
|
|
|
|
#define wxHAVE_TCHAR_SUPPORT
|
2002-08-08 09:35:25 +00:00
|
|
|
|
#elif defined(__MINGW32__) && wxCHECK_W32API_VERSION( 1, 0 )
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxHAVE_TCHAR_SUPPORT
|
2002-08-08 09:35:25 +00:00
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <ctype.h>
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#elif 0 && defined(__VISAGECPP__) && (__IBMCPP__ >= 400)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* VZ: the old VisualAge definitions were completely wrong and had no */
|
|
|
|
|
/* chance at all to work in Unicode build anyhow so let's pretend that */
|
|
|
|
|
/* VisualAge does _not_ support TCHAR for the moment (as indicated by */
|
|
|
|
|
/* "0 &&" above) until someone really has time to delve into Unicode */
|
|
|
|
|
/* issues under OS/2 */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* VisualAge 4.0+ supports TCHAR */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxHAVE_TCHAR_SUPPORT
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* compilers with (good) TCHAR support */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2003-03-29 15:44:56 +00:00
|
|
|
|
#ifdef __MWERKS__
|
|
|
|
|
#define HAVE_WPRINTF
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifdef wxHAVE_TCHAR_SUPPORT
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* get TCHAR definition if we've got it */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#include <tchar.h>
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* we surely do have wchar_t if we have TCHAR */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifndef wxUSE_WCHAR_T
|
|
|
|
|
#define wxUSE_WCHAR_T 1
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* !defined(wxUSE_WCHAR_T) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* and we also do have wcslen() */
|
2002-08-08 09:35:25 +00:00
|
|
|
|
#ifndef HAVE_WCSLEN
|
|
|
|
|
#define HAVE_WCSLEN
|
2001-10-20 08:07:47 +00:00
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxHAVE_TCHAR_SUPPORT */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
|
|
|
|
/* define wxChar type */
|
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* TODO: define wxCharInt to be equal to either int or wint_t? */
|
1999-01-27 10:00:02 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if !wxUSE_UNICODE
|
|
|
|
|
typedef char wxChar;
|
|
|
|
|
typedef signed char wxSChar;
|
|
|
|
|
typedef unsigned char wxUChar;
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* Unicode */
|
|
|
|
|
/* VZ: note that VC++ defines _T[SU]CHAR simply as wchar_t and not as */
|
|
|
|
|
/* signed/unsigned version of it which (a) makes sense to me (unlike */
|
|
|
|
|
/* char wchar_t is always unsigned) and (b) was how the previous */
|
|
|
|
|
/* definitions worked so keep it like this */
|
|
|
|
|
|
|
|
|
|
/* GNU libc has __WCHAR_TYPE__ which requires special treatment, see */
|
|
|
|
|
/* comment below */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if !defined(__WCHAR_TYPE__) || \
|
|
|
|
|
(!defined(__GNUC__) || wxCHECK_GCC_VERSION(2, 96))
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* standard case */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
typedef wchar_t wxChar;
|
|
|
|
|
typedef wchar_t wxSChar;
|
|
|
|
|
typedef wchar_t wxUChar;
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* __WCHAR_TYPE__ and gcc < 2.96 */
|
2004-05-23 14:56:36 +00:00
|
|
|
|
/* VS: wxWidgets used to define wxChar as __WCHAR_TYPE__ here. However, */
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* this doesn't work with new GCC 3.x compilers because wchar_t is */
|
|
|
|
|
/* C++'s builtin type in the new standard. OTOH, old compilers (GCC */
|
|
|
|
|
/* 2.x) won't accept new definition of wx{S,U}Char, therefore we */
|
|
|
|
|
/* have to define wxChar conditionally depending on detected */
|
|
|
|
|
/* compiler & compiler version. */
|
|
|
|
|
/* with old definition of wxChar. */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
typedef __WCHAR_TYPE__ wxChar;
|
|
|
|
|
typedef __WCHAR_TYPE__ wxSChar;
|
|
|
|
|
typedef __WCHAR_TYPE__ wxUChar;
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* __WCHAR_TYPE__ */
|
|
|
|
|
#endif /* ASCII/Unicode */
|
1999-05-13 21:21:04 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
|
|
|
|
/* define _T() and related macros */
|
|
|
|
|
/* ---------------------------------------------------------------------------- */
|
1999-10-04 22:55:10 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* BSD systems define _T() to be something different in ctype.h, override it */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if defined(__FreeBSD__) || defined(__DARWIN__)
|
2002-08-25 18:20:46 +00:00
|
|
|
|
#include <ctype.h>
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#undef _T
|
2001-06-03 02:58:56 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* could already be defined by tchar.h (it's quasi standard) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifndef _T
|
|
|
|
|
#if !wxUSE_UNICODE
|
|
|
|
|
#define _T(x) x
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* Unicode */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define _T(x) L ## x
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* ASCII/Unicode */
|
|
|
|
|
#endif /* !defined(_T) */
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* although global macros with such names are normally bad, we want to have */
|
|
|
|
|
/* another name for _T() which should be used to avoid confusion between _T() */
|
2004-05-23 14:56:36 +00:00
|
|
|
|
/* and _() in wxWidgets sources */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxT(x) _T(x)
|
1999-01-27 10:00:02 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifndef __TFILE__
|
|
|
|
|
#define __XFILE__(x) wxT(x)
|
|
|
|
|
#define __TFILE__ __XFILE__(__FILE__)
|
2000-01-03 02:19:07 +00:00
|
|
|
|
#endif
|
1999-12-08 07:54:58 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifndef __TDATE__
|
|
|
|
|
#define __XDATE__(x) wxT(x)
|
|
|
|
|
#define __TDATE__ __XDATE__(__DATE__)
|
|
|
|
|
#endif
|
1999-04-08 23:38:47 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifndef __TTIME__
|
|
|
|
|
#define __XTIME__(x) wxT(x)
|
|
|
|
|
#define __TTIME__ __XTIME__(__TIME__)
|
2002-08-12 11:10:39 +00:00
|
|
|
|
#endif
|
1999-04-08 23:38:47 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/*
|
|
|
|
|
define wxFoo() function for each standard foo() function whose signature
|
|
|
|
|
(exceptionally including the return type) includes any mention of char:
|
|
|
|
|
wxFoo() is going to be a Unicode-friendly version of foo(), i.e. will have
|
|
|
|
|
the same signature but with char replaced by wxChar which allows us to use
|
|
|
|
|
it in Unicode build as well
|
|
|
|
|
*/
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
|
|
|
|
#ifdef wxHAVE_TCHAR_SUPPORT
|
2002-09-05 14:56:34 +00:00
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ctype.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxIsalnum _istalnum
|
|
|
|
|
#define wxIsalpha _istalpha
|
2004-02-07 12:46:14 +00:00
|
|
|
|
#define wxIscntrl _istcntrl
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxIsdigit _istdigit
|
|
|
|
|
#define wxIsgraph _istgraph
|
|
|
|
|
#define wxIslower _istlower
|
|
|
|
|
#define wxIsprint _istprint
|
|
|
|
|
#define wxIspunct _istpunct
|
|
|
|
|
#define wxIsspace _istspace
|
|
|
|
|
#define wxIsupper _istupper
|
|
|
|
|
#define wxIsxdigit _istxdigit
|
2004-07-01 22:52:39 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
There is a bug in VC6 C RTL: toxxx() functions dosn't do anything with
|
|
|
|
|
signed chars < 0, so "fix" it here.
|
|
|
|
|
*/
|
|
|
|
|
#define wxTolower(c) _totlower((wxUChar)(c))
|
|
|
|
|
#define wxToupper(c) _totupper((wxUChar)(c))
|
1999-10-04 20:15:38 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* locale.h functons */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxSetlocale _tsetlocale
|
1999-10-04 20:15:38 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* string.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrcat _tcscat
|
|
|
|
|
#define wxStrchr _tcschr
|
|
|
|
|
#define wxStrcmp _tcscmp
|
|
|
|
|
#define wxStrcoll _tcscoll
|
|
|
|
|
#define wxStrcpy _tcscpy
|
|
|
|
|
#define wxStrcspn _tcscspn
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#define wxStrdupW _wcsdup /* notice the 'W'! */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrftime _tcsftime
|
|
|
|
|
#define wxStricmp _tcsicmp
|
|
|
|
|
#define wxStrnicmp _tcsnicmp
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#define wxStrlen_ _tcslen /* used in wxStrlen inline function */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrncat _tcsncat
|
|
|
|
|
#define wxStrncmp _tcsncmp
|
|
|
|
|
#define wxStrncpy _tcsncpy
|
|
|
|
|
#define wxStrpbrk _tcspbrk
|
|
|
|
|
#define wxStrrchr _tcsrchr
|
|
|
|
|
#define wxStrspn _tcsspn
|
|
|
|
|
#define wxStrstr _tcsstr
|
|
|
|
|
#define wxStrtod _tcstod
|
|
|
|
|
#define wxStrtol _tcstol
|
|
|
|
|
#define wxStrtoul _tcstoul
|
|
|
|
|
#define wxStrxfrm _tcsxfrm
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdio.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxFgetc _fgettc
|
|
|
|
|
#define wxFgetchar _fgettchar
|
|
|
|
|
#define wxFgets _fgetts
|
|
|
|
|
#define wxFopen _tfopen
|
|
|
|
|
#define wxFputc _fputtc
|
|
|
|
|
#define wxFputchar _fputtchar
|
|
|
|
|
#define wxFprintf _ftprintf
|
|
|
|
|
#define wxFputs _fputts
|
|
|
|
|
#define wxFreopen _tfreopen
|
|
|
|
|
#define wxFscanf _ftscanf
|
|
|
|
|
#define wxGetc _gettc
|
|
|
|
|
#define wxGetchar _gettchar
|
|
|
|
|
#define wxGets _getts
|
|
|
|
|
#define wxPerror _tperror
|
|
|
|
|
#define wxPrintf _tprintf
|
|
|
|
|
#define wxPutc _puttc
|
|
|
|
|
#define wxPutchar _puttchar
|
|
|
|
|
#define wxPuts _putts
|
|
|
|
|
#define wxScanf _tscanf
|
2004-02-07 15:07:08 +00:00
|
|
|
|
#if defined(__DMC__)
|
2004-02-10 15:04:30 +00:00
|
|
|
|
#if wxUSE_UNICODE
|
2004-02-11 14:34:22 +00:00
|
|
|
|
/* Digital Mars adds count to _stprintf (C99) so prototype conversion see wxchar.cpp */
|
|
|
|
|
int wxSprintf (wchar_t * __RESTRICT s, const wchar_t * __RESTRICT format, ... ) ;
|
2004-02-07 15:07:08 +00:00
|
|
|
|
#else
|
2004-02-11 14:34:22 +00:00
|
|
|
|
/* and there is a bug in D Mars tchar.h prior to 8.39.4n, so define as sprintf */
|
2004-02-10 15:04:30 +00:00
|
|
|
|
#define wxSprintf sprintf
|
2004-02-07 15:07:08 +00:00
|
|
|
|
#endif
|
|
|
|
|
#else
|
2004-02-10 15:04:30 +00:00
|
|
|
|
#define wxSprintf _stprintf
|
2004-02-07 15:07:08 +00:00
|
|
|
|
#endif
|
2004-02-10 15:04:30 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxSscanf _stscanf
|
|
|
|
|
#define wxTmpnam _ttmpnam
|
|
|
|
|
#define wxUngetc _tungetc
|
|
|
|
|
#define wxVfprintf _vftprintf
|
|
|
|
|
#define wxVprintf _vtprintf
|
|
|
|
|
#define wxVsscanf _vstscanf
|
|
|
|
|
#define wxVsprintf _vstprintf
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* special case: not all TCHAR-aware compilers have those */
|
2002-09-04 15:06:46 +00:00
|
|
|
|
#if defined(__VISUALC__) || \
|
|
|
|
|
(defined(__BORLANDC__) && __BORLANDC__ >= 0x540)
|
|
|
|
|
#define wxVsnprintf_ _vsntprintf
|
|
|
|
|
#define wxSnprintf_ _sntprintf
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* special case: these functions are missing under Win9x with Unicows so we */
|
|
|
|
|
/* have to implement them ourselves */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if wxUSE_UNICODE_MSLU
|
|
|
|
|
#define wxRemove wxMSLU__tremove
|
|
|
|
|
#define wxRename wxMSLU__trename
|
1999-10-04 20:15:38 +00:00
|
|
|
|
#else
|
2003-07-11 11:15:59 +00:00
|
|
|
|
#ifdef __WXWINCE__
|
|
|
|
|
#define wxRemove DeleteFile
|
|
|
|
|
#else
|
|
|
|
|
#define wxRemove _tremove
|
|
|
|
|
#define wxRename _trename
|
|
|
|
|
#endif
|
1999-10-04 20:15:38 +00:00
|
|
|
|
#endif
|
1999-07-28 03:38:12 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdlib.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxAtoi _ttoi
|
|
|
|
|
#define wxAtol _ttol
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* #define wxAtof _tttof -- notice that there is no such thing (why?) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxGetenv _tgetenv
|
|
|
|
|
#define wxSystem _tsystem
|
1999-07-28 03:38:12 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* time.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxAsctime _tasctime
|
|
|
|
|
#define wxCtime _tctime
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* !TCHAR-aware compilers */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if wxUSE_UNICODE
|
|
|
|
|
#include <wctype.h>
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* this is probably glibc-specific */
|
2004-02-08 06:18:44 +00:00
|
|
|
|
#if defined(__WCHAR_TYPE__) && !defined(__MWERKS__)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ctype.h functions (wctype.h) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxIsalnum iswalnum
|
|
|
|
|
#define wxIsalpha iswalpha
|
2004-02-07 12:46:14 +00:00
|
|
|
|
#define wxIscntrl iswcntrl
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxIsdigit iswdigit
|
|
|
|
|
#define wxIsgraph iswgraph
|
|
|
|
|
#define wxIslower iswlower
|
|
|
|
|
#define wxIsprint iswprint
|
|
|
|
|
#define wxIspunct iswpunct
|
|
|
|
|
#define wxIsspace iswspace
|
|
|
|
|
#define wxIsupper iswupper
|
|
|
|
|
#define wxIsxdigit iswxdigit
|
|
|
|
|
|
|
|
|
|
#if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* /usr/include/wctype.h incorrectly declares translations */
|
|
|
|
|
/* tables which provokes tons of compile-time warnings -- try */
|
|
|
|
|
/* to correct this */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxTolower(wc) towctrans((wc), (wctrans_t)__ctype_tolower)
|
|
|
|
|
#define wxToupper(wc) towctrans((wc), (wctrans_t)__ctype_toupper)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* !glibc 2.0 */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxTolower towlower
|
|
|
|
|
#define wxToupper towupper
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* gcc/!gcc */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* string.h functions (wchar.h) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrcat wcscat
|
|
|
|
|
#define wxStrchr wcschr
|
|
|
|
|
#define wxStrcmp wcscmp
|
|
|
|
|
#define wxStrcoll wcscoll
|
|
|
|
|
#define wxStrcpy wcscpy
|
|
|
|
|
#define wxStrcspn wcscspn
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#define wxStrlen_ wxWcslen /* wxStrlen_() is used in wxStrlen() */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrncat wcsncat
|
|
|
|
|
#define wxStrncmp wcsncmp
|
|
|
|
|
#define wxStrncpy wcsncpy
|
|
|
|
|
#define wxStrpbrk wcspbrk
|
|
|
|
|
#define wxStrrchr wcsrchr
|
|
|
|
|
#define wxStrspn wcsspn
|
|
|
|
|
#define wxStrstr wcsstr
|
|
|
|
|
#define wxStrtod wcstod
|
|
|
|
|
#define wxStrtol wcstol
|
|
|
|
|
#define wxStrtoul wcstoul
|
|
|
|
|
#define wxStrxfrm wcsxfrm
|
|
|
|
|
|
|
|
|
|
#define wxFgetc fgetwc
|
|
|
|
|
#define wxFgetchar fgetwchar
|
|
|
|
|
#define wxFgets fgetws
|
|
|
|
|
#define wxFputc fputwc
|
|
|
|
|
#define wxFputchar fputwchar
|
|
|
|
|
#define wxGetc getwc
|
|
|
|
|
#define wxGetchar getwchar
|
|
|
|
|
#define wxGets getws
|
|
|
|
|
#define wxUngetc ungetwc
|
|
|
|
|
|
2004-06-20 17:18:50 +00:00
|
|
|
|
#ifdef HAVE_FPUTWS
|
|
|
|
|
#define wxFputs fputws
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#else
|
2004-06-20 17:18:50 +00:00
|
|
|
|
#define wxNEED_FPUTS
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
int wxFputs(const wxChar *ch, FILE *stream);
|
2004-06-20 17:18:50 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_WPUTC
|
|
|
|
|
#define wxPutc wputc
|
|
|
|
|
#else
|
|
|
|
|
#define wxNEED_PUTC
|
|
|
|
|
#include <stdio.h>
|
2002-08-25 17:13:44 +00:00
|
|
|
|
int wxPutc(wxChar ch, FILE *stream);
|
2004-06-20 17:18:50 +00:00
|
|
|
|
#endif
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-06-20 17:18:50 +00:00
|
|
|
|
#ifdef HAVE_WPUTCHAR
|
|
|
|
|
#define wxPutchar wputchar
|
|
|
|
|
#else
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxPutchar(wch) wxPutc(wch, stdout)
|
|
|
|
|
#endif
|
2004-09-24 14:32:35 +00:00
|
|
|
|
|
2004-06-20 17:18:50 +00:00
|
|
|
|
#ifdef HAVE_PUTWS
|
|
|
|
|
#define wxPuts putws
|
|
|
|
|
#else
|
|
|
|
|
#define wxPuts(ws) wxFputs(ws, stdout)
|
|
|
|
|
#endif
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* we need %s to %ls conversion for printf and scanf etc */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxNEED_PRINTF_CONVERSION
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* glibc doesn't have wide char equivalents of the other stuff so */
|
|
|
|
|
/* use our own versions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxNEED_WX_STDIO_H
|
|
|
|
|
#define wxNEED_WX_STDLIB_H
|
|
|
|
|
#define wxNEED_WX_TIME_H
|
2004-04-18 06:40:18 +00:00
|
|
|
|
#elif defined(__MWERKS__) && ( defined(__MSL__) || defined(__MACH__) )
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ctype.h functions (wctype.h) */
|
2003-03-27 20:14:39 +00:00
|
|
|
|
#define wxIsalnum iswalnum
|
|
|
|
|
#define wxIsalpha iswalpha
|
2004-02-07 12:46:14 +00:00
|
|
|
|
#define wxIscntrl iswcntrl
|
2003-03-27 20:14:39 +00:00
|
|
|
|
#define wxIsdigit iswdigit
|
|
|
|
|
#define wxIsgraph iswgraph
|
|
|
|
|
#define wxIslower iswlower
|
|
|
|
|
#define wxIsprint iswprint
|
|
|
|
|
#define wxIspunct iswpunct
|
|
|
|
|
#define wxIsspace iswspace
|
|
|
|
|
#define wxIsupper iswupper
|
|
|
|
|
#define wxIsxdigit iswxdigit
|
|
|
|
|
#define wxTolower towlower
|
|
|
|
|
#define wxToupper towupper
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* string.h functions (wchar.h) */
|
2003-03-27 20:14:39 +00:00
|
|
|
|
#define wxStrcat wcscat
|
|
|
|
|
#define wxStrchr wcschr
|
|
|
|
|
#define wxStrcmp wcscmp
|
|
|
|
|
#define wxStrcoll wcscoll
|
|
|
|
|
#define wxStrcpy wcscpy
|
|
|
|
|
#define wxStrcspn wcscspn
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#define wxStrlen_ wxWcslen /* wxStrlen_() is used in wxStrlen() */
|
2003-03-27 20:14:39 +00:00
|
|
|
|
#define wxStrncat wcsncat
|
|
|
|
|
#define wxStrncmp wcsncmp
|
|
|
|
|
#define wxStrncpy wcsncpy
|
|
|
|
|
#define wxStrpbrk wcspbrk
|
|
|
|
|
#define wxStrrchr wcsrchr
|
|
|
|
|
#define wxStrspn wcsspn
|
|
|
|
|
#define wxStrstr wcsstr
|
|
|
|
|
#define wxStrtod wcstod
|
|
|
|
|
#define wxStrtol wcstol
|
|
|
|
|
#define wxStrtoul wcstoul
|
|
|
|
|
#define wxStrxfrm wcsxfrm
|
|
|
|
|
|
|
|
|
|
#define wxFgetc fgetwc
|
|
|
|
|
#define wxFgetchar fgetwchar
|
|
|
|
|
#define wxFgets fgetws
|
|
|
|
|
#define wxFputc fputwc
|
|
|
|
|
#define wxFputchar fputwchar
|
|
|
|
|
#define wxGetc getwc
|
|
|
|
|
#define wxGetchar getwchar
|
|
|
|
|
#define wxGets getws
|
|
|
|
|
#define wxUngetc ungetwc
|
|
|
|
|
|
2003-03-29 15:44:56 +00:00
|
|
|
|
#define wxNEED_PRINTF_CONVERSION
|
|
|
|
|
|
|
|
|
|
#define wxPutc putwc
|
|
|
|
|
#define wxPutchar putwchar
|
|
|
|
|
#define wxFputs fputws
|
2004-02-07 12:51:44 +00:00
|
|
|
|
|
|
|
|
|
/* stdio.h functions */
|
|
|
|
|
|
2004-02-07 12:41:39 +00:00
|
|
|
|
#define wxNEED_WX_STDIO_H
|
2003-03-29 15:44:56 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdlib.h functions */
|
2004-05-13 18:23:38 +00:00
|
|
|
|
#ifdef __MACH__
|
|
|
|
|
#define wxNEED_WX_STDLIB_H
|
|
|
|
|
#else
|
2003-03-29 15:44:56 +00:00
|
|
|
|
#define wxAtof watof
|
|
|
|
|
#define wxAtoi watoi
|
|
|
|
|
#define wxAtol watol
|
|
|
|
|
#define wxGetenv(a) ((wxChar*)NULL)
|
|
|
|
|
#define wxSystem(a) ((int)NULL)
|
2004-05-13 18:23:38 +00:00
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* time.h functions */
|
2003-03-29 15:44:56 +00:00
|
|
|
|
#define wxAsctime wasciitime
|
|
|
|
|
#define wxCtime wctime
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* #define wxStrftime wcsftime */
|
2003-03-29 15:44:56 +00:00
|
|
|
|
|
2003-09-09 15:34:15 +00:00
|
|
|
|
#define wxNEED_WX_TIME_H
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* !metrowerks for apple */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#error "Please define wide character functions for your environment"
|
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* ASCII */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* ctype.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxIsalnum isalnum
|
|
|
|
|
#define wxIsalpha isalpha
|
2004-02-07 12:46:14 +00:00
|
|
|
|
#define wxIscntrl iscntrl
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxIsdigit isdigit
|
|
|
|
|
#define wxIsgraph isgraph
|
|
|
|
|
#define wxIslower islower
|
|
|
|
|
#define wxIsprint isprint
|
|
|
|
|
#define wxIspunct ispunct
|
|
|
|
|
#define wxIsspace isspace
|
|
|
|
|
#define wxIsupper isupper
|
|
|
|
|
#define wxIsxdigit isxdigit
|
|
|
|
|
#define wxTolower tolower
|
|
|
|
|
#define wxToupper toupper
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* locale.h functons */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxSetlocale setlocale
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* string.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrcat strcat
|
|
|
|
|
#define wxStrchr strchr
|
|
|
|
|
#define wxStrcmp strcmp
|
|
|
|
|
#define wxStrcoll strcoll
|
|
|
|
|
#define wxStrcpy strcpy
|
|
|
|
|
#define wxStrcspn strcspn
|
2002-12-10 00:43:28 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* wxStricmp and wxStrnicmp are defined below */
|
|
|
|
|
#define wxStrlen_ strlen /* used in wxStrlen inline function */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxStrncat strncat
|
|
|
|
|
#define wxStrncmp strncmp
|
|
|
|
|
#define wxStrncpy strncpy
|
|
|
|
|
#define wxStrpbrk strpbrk
|
|
|
|
|
#define wxStrrchr strrchr
|
|
|
|
|
#define wxStrspn strspn
|
|
|
|
|
#define wxStrstr strstr
|
|
|
|
|
#define wxStrtod strtod
|
|
|
|
|
#ifdef HAVE_STRTOK_R
|
|
|
|
|
#define wxStrtok(str, sep, last) strtok_r(str, sep, last)
|
|
|
|
|
#endif
|
|
|
|
|
#define wxStrtol strtol
|
|
|
|
|
#define wxStrtoul strtoul
|
|
|
|
|
#define wxStrxfrm strxfrm
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdio.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxFopen fopen
|
|
|
|
|
#define wxFreopen freopen
|
|
|
|
|
#define wxRemove remove
|
|
|
|
|
#define wxRename rename
|
2003-09-14 18:40:43 +00:00
|
|
|
|
|
2003-07-04 19:46:44 +00:00
|
|
|
|
#define wxPerror perror
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxTmpnam tmpnam
|
|
|
|
|
|
|
|
|
|
#define wxFgetc fgetc
|
|
|
|
|
#define wxFgetchar fgetchar
|
|
|
|
|
#define wxFgets fgets
|
|
|
|
|
#define wxFputc fputc
|
2003-09-19 10:59:14 +00:00
|
|
|
|
#define wxFputs fputs
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxFputchar fputchar
|
|
|
|
|
#define wxFprintf fprintf
|
|
|
|
|
#define wxFscanf fscanf
|
|
|
|
|
#define wxGetc getc
|
|
|
|
|
#define wxGetchar getchar
|
|
|
|
|
#define wxGets gets
|
|
|
|
|
#define wxPrintf printf
|
|
|
|
|
#define wxPutc putc
|
|
|
|
|
#define wxPutchar putchar
|
|
|
|
|
#define wxPuts puts
|
|
|
|
|
#define wxScanf scanf
|
|
|
|
|
#define wxSprintf sprintf
|
|
|
|
|
#define wxSscanf sscanf
|
|
|
|
|
#define wxUngetc ungetc
|
|
|
|
|
#define wxVfprintf vfprintf
|
|
|
|
|
#define wxVprintf vprintf
|
|
|
|
|
#define wxVsscanf vsscanf
|
|
|
|
|
#define wxVsprintf vsprintf
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdlib.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxAtof atof
|
|
|
|
|
#define wxAtoi atoi
|
|
|
|
|
#define wxAtol atol
|
|
|
|
|
#define wxGetenv getenv
|
|
|
|
|
#define wxSystem system
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* time.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxAsctime asctime
|
|
|
|
|
#define wxCtime ctime
|
|
|
|
|
#define wxStrftime strftime
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* Unicode/ASCII */
|
|
|
|
|
#endif /* TCHAR-aware compilers/the others */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
various special cases
|
|
|
|
|
*/
|
1999-04-19 16:07:51 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* define wxStricmp and wxStrnicmp for various compilers */
|
1999-04-19 16:07:51 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* note that in Unicode mode we definitely are going to need our own version */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if !defined(wxStricmp) && !wxUSE_UNICODE
|
|
|
|
|
#if defined(__BORLANDC__) || defined(__WATCOMC__) || \
|
|
|
|
|
defined(__SALFORDC__) || defined(__VISAGECPP__) || \
|
|
|
|
|
defined(__EMX__) || defined(__DJGPP__)
|
|
|
|
|
#define wxStricmp stricmp
|
|
|
|
|
#define wxStrnicmp strnicmp
|
2003-05-02 11:30:18 +00:00
|
|
|
|
#elif defined(__SYMANTEC__) || defined(__VISUALC__) || \
|
2002-08-25 17:13:44 +00:00
|
|
|
|
(defined(__MWERKS__) && defined(__INTEL__))
|
|
|
|
|
#define wxStricmp _stricmp
|
|
|
|
|
#define wxStrnicmp _strnicmp
|
|
|
|
|
#elif defined(__UNIX__) || defined(__GNUWIN32__)
|
|
|
|
|
#define wxStricmp strcasecmp
|
|
|
|
|
#define wxStrnicmp strncasecmp
|
2004-05-23 14:56:36 +00:00
|
|
|
|
/* #else -- use wxWidgets implementation */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* !defined(wxStricmp) */
|
1999-01-27 10:00:02 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* define wxWcslen() which should be always available if wxUSE_WCHAR_T == 1 (as */
|
|
|
|
|
/* it's used in wx/buffer.h -- and also might be used just below by wxStrlen() */
|
|
|
|
|
/* when wxStrlen_() is #define'd as wxWcslen so do it before defining wxStrlen) */
|
1999-04-20 11:00:06 +00:00
|
|
|
|
#if wxUSE_WCHAR_T
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifdef HAVE_WCSLEN
|
|
|
|
|
#define wxWcslen wcslen
|
|
|
|
|
#else
|
2004-09-24 14:32:35 +00:00
|
|
|
|
#if defined( __WXMAC_XCODE__ ) && !defined( __cplusplus )
|
|
|
|
|
/* xcode native targets are giving multiply defined symbols on regex */
|
|
|
|
|
static
|
|
|
|
|
#endif
|
2004-04-27 17:15:02 +00:00
|
|
|
|
inline size_t wxWcslen(const wchar_t *s)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
{
|
|
|
|
|
size_t n = 0;
|
|
|
|
|
while ( *s++ )
|
|
|
|
|
n++;
|
|
|
|
|
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxUSE_WCHAR_T */
|
1999-05-09 14:49:40 +00:00
|
|
|
|
|
2003-12-17 19:30:31 +00:00
|
|
|
|
#ifdef __cplusplus
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* checks whether the passed in pointer is NULL and if the string is empty */
|
2002-09-11 23:29:22 +00:00
|
|
|
|
inline bool wxIsEmpty(const wxChar *p) { return !p || !*p; }
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* safe version of strlen() (returns 0 if passed NULL pointer) */
|
2002-09-11 23:29:22 +00:00
|
|
|
|
inline size_t wxStrlen(const wxChar *psz) { return psz ? wxStrlen_(psz) : 0; }
|
2003-12-17 19:30:31 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/*
|
|
|
|
|
each of strdup() and wcsdup() may or may not be available but we need both
|
|
|
|
|
of them anyhow for wx/buffer.h so we define the missing one(s) in
|
|
|
|
|
wxchar.cpp and so we should always have both wxStrdupA and wxStrdupW
|
|
|
|
|
defined -- if this is somehow not the case in some situations, please
|
|
|
|
|
correct that and not the lines here
|
|
|
|
|
*/
|
2002-12-10 00:43:28 +00:00
|
|
|
|
#if wxUSE_UNICODE
|
|
|
|
|
#define wxStrdup wxStrdupW
|
|
|
|
|
#else
|
|
|
|
|
#define wxStrdup wxStrdupA
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-12-17 19:30:31 +00:00
|
|
|
|
#ifdef __cplusplus
|
2004-02-07 12:51:44 +00:00
|
|
|
|
WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */
|
2003-12-17 19:30:31 +00:00
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
|
|
|
|
|
/* printf() family saga */
|
2002-08-23 19:53:25 +00:00
|
|
|
|
|
2003-01-18 02:33:13 +00:00
|
|
|
|
/*
|
|
|
|
|
For some systems vsnprintf() exists in the system libraries but not in the
|
|
|
|
|
headers, so we need to declare it ourselves to be able to use it.
|
|
|
|
|
*/
|
2003-02-01 19:54:11 +00:00
|
|
|
|
#if defined(HAVE_VSNPRINTF) && !defined(HAVE_VSNPRINTF_DECL)
|
2003-01-18 02:33:13 +00:00
|
|
|
|
extern "C"
|
|
|
|
|
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* !HAVE_VSNPRINTF_DECL */
|
2003-01-18 02:33:13 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
/*
|
|
|
|
|
First of all, we always want to define safe snprintf() function to be used
|
|
|
|
|
instead of sprintf(). Some compilers already have it (or rather vsnprintf()
|
|
|
|
|
which we really need...), otherwise we implement it using our own printf()
|
|
|
|
|
code.
|
|
|
|
|
|
|
|
|
|
We define function with a trailing underscore here because the real one is a
|
|
|
|
|
wrapper around it as explained below
|
|
|
|
|
*/
|
2002-09-04 15:06:46 +00:00
|
|
|
|
#ifndef wxVsnprintf_
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if wxUSE_UNICODE
|
2003-03-28 20:55:23 +00:00
|
|
|
|
#if defined(__MWERKS__)
|
|
|
|
|
#define HAVE_WCSRTOMBS 1
|
|
|
|
|
#define HAVE_VSWPRINTF 1
|
|
|
|
|
#endif
|
2004-01-08 07:41:36 +00:00
|
|
|
|
#if defined(__WATCOMC__)
|
|
|
|
|
#define wxVsnprintf_ _vsnwprintf
|
|
|
|
|
#define wxSnprintf_ _snwprintf
|
|
|
|
|
#endif
|
2002-09-13 20:23:36 +00:00
|
|
|
|
#if defined(HAVE__VSNWPRINTF)
|
|
|
|
|
#define wxVsnprintf_ _vsnwprintf
|
|
|
|
|
/* MinGW?MSVCRT has the wrong vswprintf */
|
|
|
|
|
#elif defined(HAVE_VSWPRINTF) && !defined(__MINGW32__)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxVsnprintf_ vswprintf
|
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* ASCII */
|
2004-05-23 14:56:36 +00:00
|
|
|
|
/* all versions of CodeWarrior supported by wxWidgets apparently have */
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* vsnprintf() */
|
2004-01-08 07:41:36 +00:00
|
|
|
|
#if defined(HAVE_VSNPRINTF) || defined(__MWERKS__) || defined(__WATCOMC__)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* assume we have snprintf() too if we have vsnprintf() */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxVsnprintf_ vsnprintf
|
|
|
|
|
#define wxSnprintf_ snprintf
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxVsnprintf_ not defined yet */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2002-09-13 23:22:30 +00:00
|
|
|
|
#ifndef wxSnprintf_
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* no [v]snprintf(), cook our own */
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxSnprintf_(wxChar *buf, size_t len, const wxChar *format,
|
2002-08-25 17:13:44 +00:00
|
|
|
|
...) ATTRIBUTE_PRINTF_3;
|
2002-09-13 23:22:30 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef wxVsnprintf_
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxVsnprintf_(wxChar *buf, size_t len, const wxChar *format,
|
2002-08-25 17:13:44 +00:00
|
|
|
|
va_list argptr);
|
|
|
|
|
#endif
|
2002-08-23 19:53:25 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
/*
|
|
|
|
|
In Unicode mode we need to have all standard functions such as wprintf() and
|
|
|
|
|
so on but not all systems have them so use our own implementations in this
|
|
|
|
|
case.
|
|
|
|
|
*/
|
|
|
|
|
#if wxUSE_UNICODE && !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_WPRINTF)
|
|
|
|
|
#define wxNEED_WPRINTF
|
|
|
|
|
#endif
|
2002-08-23 19:53:25 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
/*
|
|
|
|
|
More Unicode complications: although both ANSI C and C++ define a number of
|
|
|
|
|
wide character functions such as wprintf(), not all environments have them.
|
|
|
|
|
Worse, those which do have different behaviours: under Windows, %s format
|
|
|
|
|
specifier changes its meaning in Unicode build and expects a Unicode string
|
|
|
|
|
while under Unix/POSIX it still means an ASCII string even for wprintf() and
|
|
|
|
|
%ls has to be used for wide strings.
|
|
|
|
|
|
|
|
|
|
We choose to always emulate Windows behaviour as more useful for us so even
|
|
|
|
|
if we have wprintf() we still must wrap it in a non trivial wxPrintf().
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if defined(wxNEED_PRINTF_CONVERSION) || defined(wxNEED_WPRINTF)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/*
|
|
|
|
|
we need to implement all wide character printf and scanf functions
|
|
|
|
|
either because we don't have them at all or because they don't have the
|
|
|
|
|
semantics we need
|
|
|
|
|
*/
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#include <stdio.h> /* for FILE */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2002-09-10 12:55:25 +00:00
|
|
|
|
int wxScanf( const wxChar *format, ... ) ATTRIBUTE_PRINTF_1;
|
|
|
|
|
int wxSscanf( const wxChar *str, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2;
|
|
|
|
|
int wxFscanf( FILE *stream, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2;
|
2002-08-25 17:13:44 +00:00
|
|
|
|
int wxVsscanf( const wxChar *str, const wxChar *format, va_list ap );
|
2002-09-10 12:55:25 +00:00
|
|
|
|
int wxPrintf( const wxChar *format, ... ) ATTRIBUTE_PRINTF_1;
|
|
|
|
|
int wxSprintf( wxChar *str, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2;
|
|
|
|
|
int wxFprintf( FILE *stream, const wxChar *format, ... ) ATTRIBUTE_PRINTF_2;
|
2002-08-25 17:13:44 +00:00
|
|
|
|
int wxVfprintf( FILE *stream, const wxChar *format, va_list ap );
|
|
|
|
|
int wxVprintf( const wxChar *format, va_list ap );
|
|
|
|
|
int wxVsprintf( wxChar *str, const wxChar *format, va_list ap );
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxNEED_PRINTF_CONVERSION */
|
2002-08-17 12:09:48 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* these 2 can be simply mapped to the versions with underscore at the end */
|
|
|
|
|
/* if we don't have to do the conversion */
|
2004-03-30 01:50:58 +00:00
|
|
|
|
/*
|
|
|
|
|
However, if we don't have any vswprintf() at all we don't need to redefine
|
|
|
|
|
anything as our own wxVsnprintf_() already behaves as needed.
|
|
|
|
|
*/
|
|
|
|
|
#if defined(wxNEED_PRINTF_CONVERSION) && defined(wxVsnprintf_)
|
2002-09-10 12:55:25 +00:00
|
|
|
|
int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... ) ATTRIBUTE_PRINTF_3;
|
2002-08-25 19:03:06 +00:00
|
|
|
|
int wxVsnprintf( wxChar *str, size_t size, const wxChar *format, va_list ap );
|
|
|
|
|
#else
|
|
|
|
|
#define wxSnprintf wxSnprintf_
|
|
|
|
|
#define wxVsnprintf wxVsnprintf_
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/*
|
|
|
|
|
various functions which might not be available in libc and for which we
|
|
|
|
|
provide our own replacements in wxchar.cpp
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* ctype.h functions */
|
2002-08-17 12:09:48 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* VZ: note that this is never defined currently */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifdef wxNEED_WX_CTYPE_H
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxIsalnum(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIsalpha(wxChar ch);
|
2004-02-07 12:46:14 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxIscntrl(wxChar ch);
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxIsdigit(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIsgraph(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIslower(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIsprint(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIspunct(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIsspace(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIsupper(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxIsxdigit(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxTolower(wxChar ch);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxToupper(wxChar ch);
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxNEED_WX_CTYPE_H */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* under VC++ 6.0 isspace() returns 1 for 8 bit chars which completely breaks */
|
|
|
|
|
/* the file parsing -- this may be true for 5.0 as well, update #ifdef then */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if defined(__VISUALC__) && (__VISUALC__ >= 1200) && !wxUSE_UNICODE
|
|
|
|
|
#undef wxIsspace
|
|
|
|
|
#define wxIsspace(c) ((((unsigned)c) < 128) && isspace(c))
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* VC++ */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-10-05 21:57:40 +00:00
|
|
|
|
/*
|
|
|
|
|
a few compilers don't have the (non standard but common) isascii function,
|
|
|
|
|
define it ourselves for them
|
|
|
|
|
*/
|
|
|
|
|
#ifndef isascii
|
|
|
|
|
#if defined(__MWERKS__)
|
|
|
|
|
#define wxNEED_ISASCII
|
|
|
|
|
#elif defined(_WIN32_WCE)
|
|
|
|
|
#if _WIN32_WCE <= 211
|
|
|
|
|
#define wxNEED_ISASCII
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* isascii */
|
|
|
|
|
|
|
|
|
|
#ifdef wxNEED_ISASCII
|
|
|
|
|
inline int isascii(int c) { return (unsigned)c < 0x80; }
|
2004-10-02 23:17:23 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-10-05 21:57:40 +00:00
|
|
|
|
#ifdef _WIN32_WCE
|
|
|
|
|
#if _WIN32_WCE <= 211
|
|
|
|
|
#define isspace(c) ((c) == _T(' ') || (c) == _T('\t'))
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* _WIN32_WCE */
|
|
|
|
|
|
2004-02-07 12:46:14 +00:00
|
|
|
|
/*
|
2004-10-02 23:17:23 +00:00
|
|
|
|
we had goofed and defined wxIsctrl() instead of (correct) wxIscntrl() in the
|
2004-02-07 12:46:14 +00:00
|
|
|
|
initial versions of this header -- now it is too late to remove it so
|
|
|
|
|
although we fixed the function/macro name above, still provide the
|
|
|
|
|
backwards-compatible synonym.
|
|
|
|
|
*/
|
|
|
|
|
#define wxIsctrl wxIscntrl
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* string.h functions */
|
|
|
|
|
|
2004-10-05 21:57:40 +00:00
|
|
|
|
#ifndef strdup
|
|
|
|
|
#if defined(__MWERKS__) && !defined(__MACH__) && (__MSL__ < 0x00008000)
|
|
|
|
|
#define wxNEED_STRDUP
|
|
|
|
|
#elif defined(__WXWINCE__)
|
|
|
|
|
#if _WIN32_WCE <= 211
|
|
|
|
|
#define wxNEED_STRDUP
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* strdup */
|
|
|
|
|
|
|
|
|
|
#ifdef wxNEED_STRDUP
|
|
|
|
|
WXDLLIMPEXP_BASE char *strdup(const char* s);
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* VZ: this is never defined neither currently */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifdef wxNEED_WX_STRING_H
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrcat(wxChar *dest, const wxChar *src);
|
|
|
|
|
WXDLLIMPEXP_BASE const wxChar * wxStrchr(const wxChar *s, wxChar c);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrchr(wxChar *s, wxChar c)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
{ return (wxChar *)wxStrchr((const wxChar *)s, c); }
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxStrcmp(const wxChar *s1, const wxChar *s2);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxStrcoll(const wxChar *s1, const wxChar *s2);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrcpy(wxChar *dest, const wxChar *src);
|
|
|
|
|
WXDLLIMPEXP_BASE size_t wxStrcspn(const wxChar *s, const wxChar *reject);
|
|
|
|
|
WXDLLIMPEXP_BASE size_t wxStrlen(const wxChar *s);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrncat(wxChar *dest, const wxChar *src, size_t n);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxStrncmp(const wxChar *s1, const wxChar *s2, size_t n);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrncpy(wxChar *dest, const wxChar *src, size_t n);
|
|
|
|
|
WXDLLIMPEXP_BASE const wxChar * wxStrpbrk(const wxChar *s, const wxChar *accept);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrpbrk(wxChar *s, const wxChar *accept)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
{ return (wxChar *)wxStrpbrk((const wxChar *)s, accept); }
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE const wxChar * wxStrrchr(const wxChar *s, wxChar c);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrrchr(wxChar *s, wxChar c)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
{ return (wxChar *)wxStrrchr((const wxChar *)s, c); }
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE size_t wxStrspn(const wxChar *s, const wxChar *accept);
|
|
|
|
|
WXDLLIMPEXP_BASE const wxChar * wxStrstr(const wxChar *haystack, const wxChar *needle);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar *wxStrstr(wxChar *haystack, const wxChar *needle)
|
2002-08-25 17:13:44 +00:00
|
|
|
|
{ return (wxChar *)wxStrstr((const wxChar *)haystack, needle); }
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE double wxStrtod(const wxChar *nptr, wxChar **endptr);
|
|
|
|
|
WXDLLIMPEXP_BASE long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base);
|
|
|
|
|
WXDLLIMPEXP_BASE unsigned long int wxStrtoul(const wxChar *nptr, wxChar **endptr, int base);
|
|
|
|
|
WXDLLIMPEXP_BASE size_t wxStrxfrm(wxChar *dest, const wxChar *src, size_t n);
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxNEED_WX_STRING_H */
|
2002-08-17 12:09:48 +00:00
|
|
|
|
|
2002-12-10 00:43:28 +00:00
|
|
|
|
#ifndef wxStrdupA
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE char *wxStrdupA(const char *psz);
|
2002-12-10 00:43:28 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef wxStrdupW
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE wchar_t *wxStrdupW(const wchar_t *pwz);
|
1999-04-12 20:01:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1999-04-19 16:11:22 +00:00
|
|
|
|
#ifndef wxStricmp
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxStricmp(const wxChar *psz1, const wxChar *psz2);
|
1999-04-19 16:11:22 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2001-07-04 20:11:26 +00:00
|
|
|
|
#ifndef wxStrnicmp
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxStrnicmp(const wxChar *psz1, const wxChar *psz2, size_t len);
|
2001-07-04 20:11:26 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1999-04-12 20:01:51 +00:00
|
|
|
|
#ifndef wxStrtok
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr);
|
1999-04-12 20:01:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2003-12-24 12:42:57 +00:00
|
|
|
|
#ifdef __cplusplus
|
1999-04-12 20:01:51 +00:00
|
|
|
|
#ifndef wxSetlocale
|
2003-07-02 01:59:24 +00:00
|
|
|
|
class WXDLLIMPEXP_BASE wxWCharBuffer;
|
|
|
|
|
WXDLLIMPEXP_BASE wxWCharBuffer wxSetlocale(int category, const wxChar *locale);
|
1999-04-12 20:01:51 +00:00
|
|
|
|
#endif
|
2003-12-24 12:42:57 +00:00
|
|
|
|
#endif
|
1999-04-19 16:07:51 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdio.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifdef wxNEED_WX_STDIO_H
|
|
|
|
|
#include <stdio.h>
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE FILE * wxFopen(const wxChar *path, const wxChar *mode);
|
|
|
|
|
WXDLLIMPEXP_BASE FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxRemove(const wxChar *path);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxRename(const wxChar *oldpath, const wxChar *newpath);
|
1999-05-07 18:36:06 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* *printf() family is handled separately */
|
|
|
|
|
#endif /* wxNEED_WX_STDIO_H */
|
1999-04-19 16:07:51 +00:00
|
|
|
|
|
1999-04-12 20:01:51 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* stdlib.h functions */
|
1999-04-13 06:53:41 +00:00
|
|
|
|
#ifndef wxAtof
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE double wxAtof(const wxChar *psz);
|
1999-04-13 06:53:41 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef wxNEED_WX_STDLIB_H
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE int wxAtoi(const wxChar *psz);
|
|
|
|
|
WXDLLIMPEXP_BASE long wxAtol(const wxChar *psz);
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar * wxGetenv(const wxChar *name);
|
|
|
|
|
WXDLLIMPEXP_BASE int wxSystem(const wxChar *psz);
|
1999-04-10 14:15:15 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
1999-07-23 09:36:38 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* time.h functions */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#ifdef wxNEED_WX_TIME_H
|
2003-03-27 20:14:39 +00:00
|
|
|
|
#if defined(__MWERKS__) && defined(macintosh)
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#include <time.h>
|
2003-03-27 20:14:39 +00:00
|
|
|
|
#endif
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE size_t wxStrftime(wxChar *s, size_t max,
|
2002-08-25 17:13:44 +00:00
|
|
|
|
const wxChar *fmt, const struct tm *tm);
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#endif /* wxNEED_WX_TIME_H */
|
2001-05-19 01:01:21 +00:00
|
|
|
|
|
2004-03-05 17:40:38 +00:00
|
|
|
|
#ifndef wxCtime
|
|
|
|
|
#include <time.h>
|
|
|
|
|
WXDLLIMPEXP_BASE wxChar *wxCtime(const time_t *timep);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* missing functions in some WinCE versions */
|
2003-11-15 10:26:46 +00:00
|
|
|
|
#ifdef _WIN32_WCE
|
|
|
|
|
#if (_WIN32_WCE < 300)
|
2003-07-15 13:46:39 +00:00
|
|
|
|
WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
|
2003-11-15 10:26:46 +00:00
|
|
|
|
#endif
|
2004-10-05 21:57:40 +00:00
|
|
|
|
#endif /* _WIN32_WCE */
|
2003-07-15 13:46:39 +00:00
|
|
|
|
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* multibyte to wide char conversion functions and macros */
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#if wxUSE_WCHAR_T
|
2004-02-07 12:51:44 +00:00
|
|
|
|
/* multibyte<->widechar conversion */
|
2003-07-02 01:59:24 +00:00
|
|
|
|
WXDLLIMPEXP_BASE size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n);
|
|
|
|
|
WXDLLIMPEXP_BASE size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n);
|
2002-08-25 17:13:44 +00:00
|
|
|
|
|
|
|
|
|
#if wxUSE_UNICODE
|
|
|
|
|
#define wxMB2WX wxMB2WC
|
|
|
|
|
#define wxWX2MB wxWC2MB
|
|
|
|
|
#define wxWC2WX wxStrncpy
|
|
|
|
|
#define wxWX2WC wxStrncpy
|
|
|
|
|
#else
|
|
|
|
|
#define wxMB2WX wxStrncpy
|
|
|
|
|
#define wxWX2MB wxStrncpy
|
|
|
|
|
#define wxWC2WX wxWC2MB
|
|
|
|
|
#define wxWX2WC wxMB2WC
|
|
|
|
|
#endif
|
2004-02-07 12:51:44 +00:00
|
|
|
|
#else /* !wxUSE_UNICODE */
|
|
|
|
|
/* No wxUSE_WCHAR_T: we have to do something (JACS) */
|
2002-08-25 17:13:44 +00:00
|
|
|
|
#define wxMB2WC wxStrncpy
|
|
|
|
|
#define wxWC2MB wxStrncpy
|
|
|
|
|
#define wxMB2WX wxStrncpy
|
|
|
|
|
#define wxWX2MB wxStrncpy
|
|
|
|
|
#define wxWC2WX wxWC2MB
|
|
|
|
|
#define wxWX2WC wxMB2WC
|
2001-12-17 01:05:37 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2003-12-17 19:30:31 +00:00
|
|
|
|
#endif /* _WX_WXCHAR_H_ */
|
1999-07-28 03:38:12 +00:00
|
|
|
|
|