Skip to content
Snippets Groups Projects
Commit 22c2ac72 authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Implemented inline version of the iswxxx functions.

parent e2c477b2
No related branches found
No related tags found
No related merge requests found
......@@ -268,7 +268,7 @@ INT MSVCRT_wctomb( char *dst, WCHAR ch )
*/
INT MSVCRT_iswalnum( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
return isalnumW( wc );
}
/*********************************************************************
......@@ -276,7 +276,7 @@ INT MSVCRT_iswalnum( WCHAR wc )
*/
INT MSVCRT_iswalpha( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
return isalphaW( wc );
}
/*********************************************************************
......@@ -284,7 +284,7 @@ INT MSVCRT_iswalpha( WCHAR wc )
*/
INT MSVCRT_iswcntrl( WCHAR wc )
{
return get_char_typeW(wc) & C1_CNTRL;
return iscntrlW( wc );
}
/*********************************************************************
......@@ -292,7 +292,7 @@ INT MSVCRT_iswcntrl( WCHAR wc )
*/
INT MSVCRT_iswdigit( WCHAR wc )
{
return get_char_typeW(wc) & C1_DIGIT;
return isdigitW( wc );
}
/*********************************************************************
......@@ -300,7 +300,7 @@ INT MSVCRT_iswdigit( WCHAR wc )
*/
INT MSVCRT_iswgraph( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
return isgraphW( wc );
}
/*********************************************************************
......@@ -308,7 +308,7 @@ INT MSVCRT_iswgraph( WCHAR wc )
*/
INT MSVCRT_iswlower( WCHAR wc )
{
return get_char_typeW(wc) & C1_LOWER;
return islowerW( wc );
}
/*********************************************************************
......@@ -316,7 +316,7 @@ INT MSVCRT_iswlower( WCHAR wc )
*/
INT MSVCRT_iswprint( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
return isprintW( wc );
}
/*********************************************************************
......@@ -324,7 +324,7 @@ INT MSVCRT_iswprint( WCHAR wc )
*/
INT MSVCRT_iswpunct( WCHAR wc )
{
return get_char_typeW(wc) & C1_PUNCT;
return ispunctW( wc );
}
/*********************************************************************
......@@ -332,7 +332,7 @@ INT MSVCRT_iswpunct( WCHAR wc )
*/
INT MSVCRT_iswspace( WCHAR wc )
{
return get_char_typeW(wc) & C1_SPACE;
return isspaceW( wc );
}
/*********************************************************************
......@@ -340,7 +340,7 @@ INT MSVCRT_iswspace( WCHAR wc )
*/
INT MSVCRT_iswupper( WCHAR wc )
{
return get_char_typeW(wc) & C1_UPPER;
return isupperW( wc );
}
/*********************************************************************
......@@ -348,7 +348,7 @@ INT MSVCRT_iswupper( WCHAR wc )
*/
INT MSVCRT_iswxdigit( WCHAR wc )
{
return get_char_typeW(wc) & C1_XDIGIT;
return isxdigitW( wc );
}
/*********************************************************************
......
......@@ -88,7 +88,7 @@ static BOOL URL_NeedEscapeA(CHAR ch, DWORD dwFlags)
static BOOL URL_NeedEscapeW(WCHAR ch, DWORD dwFlags)
{
if (iswalnum(ch))
if (isalnumW(ch))
return FALSE;
if(dwFlags & URL_ESCAPE_SPACES_ONLY) {
......@@ -136,7 +136,7 @@ static BOOL URL_JustLocation(LPCWSTR str)
if (*str) {
while (*str && ((*str == L'-') ||
(*str == L'.') ||
iswalnum(*str))) str++;
isalnumW(*str))) str++;
if (*str == L'/') return FALSE;
}
return TRUE;
......@@ -233,9 +233,9 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
while (*wk1) {
switch (state) {
case 0:
if (!iswalnum(*wk1)) {state = 3; break;}
if (!isalnumW(*wk1)) {state = 3; break;}
*wk2++ = *wk1++;
if (!iswalnum(*wk1)) {state = 3; break;}
if (!isalnumW(*wk1)) {state = 3; break;}
*wk2++ = *wk1++;
state = 1;
break;
......@@ -256,8 +256,8 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
wk2 += strlenW(wk2);
break;
case 4:
if (!iswalnum(*wk1) && (*wk1 != L'-')) {state = 3; break;}
while(iswalnum(*wk1) || (*wk1 == L'-')) *wk2++ = *wk1++;
if (!isalnumW(*wk1) && (*wk1 != L'-')) {state = 3; break;}
while(isalnumW(*wk1) || (*wk1 == L'-')) *wk2++ = *wk1++;
state = 5;
break;
case 5:
......@@ -946,7 +946,7 @@ HRESULT WINAPI UrlUnescapeW(
(*src == L'#' || *src == L'?')) {
stop_unescapping = TRUE;
next = *src;
} else if(*src == L'%' && iswxdigit(*(src + 1)) && iswxdigit(*(src + 2))
} else if(*src == L'%' && isxdigitW(*(src + 1)) && isxdigitW(*(src + 2))
&& stop_unescapping == FALSE) {
INT ih;
WCHAR buf[3];
......
......@@ -8,6 +8,7 @@
#define __WINE_UNICODE_H
#include "windef.h"
#include "winnls.h"
/* code page info common to SBCS and DBCS */
struct cp_info
......@@ -81,6 +82,61 @@ static inline unsigned short get_char_typeW( WCHAR ch )
return wctype_table[wctype_table[ch >> 8] + (ch & 0xff)];
}
inline static int iscntrlW( WCHAR wc )
{
return get_char_typeW(wc) & C1_CNTRL;
}
inline static int ispunctW( WCHAR wc )
{
return get_char_typeW(wc) & C1_PUNCT;
}
inline static int isspaceW( WCHAR wc )
{
return get_char_typeW(wc) & C1_SPACE;
}
inline static int isdigitW( WCHAR wc )
{
return get_char_typeW(wc) & C1_DIGIT;
}
inline static int isxdigitW( WCHAR wc )
{
return get_char_typeW(wc) & C1_XDIGIT;
}
inline static int islowerW( WCHAR wc )
{
return get_char_typeW(wc) & C1_LOWER;
}
inline static int isupperW( WCHAR wc )
{
return get_char_typeW(wc) & C1_UPPER;
}
inline static int isalnumW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
}
inline static int isalphaW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
}
inline static int isgraphW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
}
inline static int isprintW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
}
/* some useful string manipulation routines */
static inline unsigned int strlenW( const WCHAR *str )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment