X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/830efc9b0cb87eae22d4435af7858175017522ab..7a21e692d22ec16a5de7dbbb73761d4c4456edaa:/src/regex/regc_locale.c diff --git a/src/regex/regc_locale.c b/src/regex/regc_locale.c index 4e13b8488b..664611c6b5 100644 --- a/src/regex/regc_locale.c +++ b/src/regex/regc_locale.c @@ -53,10 +53,39 @@ int char_and_wchar_strncmp (const char* cp, const wx_wchar* wp, size_t nNum) { while(*cp++ == (const char)*wp++ && --nNum){} - return nNum; } +int wx_isdigit(wx_wchar c) {return wxIsdigit(c);} +int wx_isalpha(wx_wchar c) {return wxIsalpha(c);} +int wx_isalnum(wx_wchar c) {return wxIsalnum(c);} +int wx_isupper(wx_wchar c) {return wxIsupper(c);} +int wx_islower(wx_wchar c) {return wxIslower(c);} +int wx_isgraph(wx_wchar c) {return wxIsgraph(c);} +int wx_ispunct(wx_wchar c) {return wxIspunct(c);} +int wx_isspace(wx_wchar c) {return wxIsspace(c);} + +wx_wchar wx_toupper(wx_wchar c) +{ + return wxToupper(c); +} + +wx_wchar wx_tolower(wx_wchar c) +{ + return wxTolower(c); +} + +int wx_strlen(const wx_wchar* szString) +{ + /* + Generic -- note that some clib functions also test for eol character '^Z' + + int nLength = 0; + for (; *(szString + nLength) != '\0'; nLength++); + return nLength; + */ + return szString == NULL ? 0 : wxStrlen_(szString); +} /* ASCII character-name table */ static struct cname @@ -356,73 +385,6 @@ static struct cname } }; -/* - * some ctype functions with non-ascii-char guard - */ -static int -wx_isdigit(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && isdigit((unsigned char) c)); -} - -static int -wx_isalpha(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && isalpha((unsigned char) c)); -} - -static int -wx_isalnum(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && isalnum((unsigned char) c)); -} - -static int -wx_isupper(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && isupper((unsigned char) c)); -} - -static int -wx_islower(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && islower((unsigned char) c)); -} - -static int -wx_isgraph(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && isgraph((unsigned char) c)); -} - -static int -wx_ispunct(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && ispunct((unsigned char) c)); -} - -static int -wx_isspace(wx_wchar c) -{ - return (c >= 0 && c <= UCHAR_MAX && isspace((unsigned char) c)); -} - -static wx_wchar -wx_toupper(wx_wchar c) -{ - if (c >= 0 && c <= UCHAR_MAX) - return toupper((unsigned char) c); - return c; -} - -static wx_wchar -wx_tolower(wx_wchar c) -{ - if (c >= 0 && c <= UCHAR_MAX) - return tolower((unsigned char) c); - return c; -} - /* * nmcces - how many distinct MCCEs are there?