Commit c7c8016b authored by Alexandre Julliard's avatar Alexandre Julliard

kernelbase: Directly use the wctype table for the IsChar* functions.

parent 1b46da5c
......@@ -2902,6 +2902,146 @@ LANGID WINAPI DECLSPEC_HOTPATCH GetUserDefaultUILanguage(void)
/******************************************************************************
* IsCharAlphaA (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharAlphaA( CHAR c )
{
WCHAR wc = nls_info.AnsiTableInfo.MultiByteTable[(unsigned char)c];
return !!(get_table_entry( wctype_table, wc ) & C1_ALPHA);
}
/******************************************************************************
* IsCharAlphaW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharAlphaW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_ALPHA);
}
/******************************************************************************
* IsCharAlphaNumericA (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharAlphaNumericA( CHAR c )
{
WCHAR wc = nls_info.AnsiTableInfo.MultiByteTable[(unsigned char)c];
return !!(get_table_entry( wctype_table, wc ) & (C1_ALPHA | C1_DIGIT));
}
/******************************************************************************
* IsCharAlphaNumericW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharAlphaNumericW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & (C1_ALPHA | C1_DIGIT));
}
/******************************************************************************
* IsCharBlankW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharBlankW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_BLANK);
}
/******************************************************************************
* IsCharCntrlW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharCntrlW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_CNTRL);
}
/******************************************************************************
* IsCharDigitW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharDigitW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_DIGIT);
}
/******************************************************************************
* IsCharLowerA (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharLowerA( CHAR c )
{
WCHAR wc = nls_info.AnsiTableInfo.MultiByteTable[(unsigned char)c];
return !!(get_table_entry( wctype_table, wc ) & C1_LOWER);
}
/******************************************************************************
* IsCharLowerW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharLowerW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_LOWER);
}
/******************************************************************************
* IsCharPunctW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharPunctW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_PUNCT);
}
/******************************************************************************
* IsCharSpaceA (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharSpaceA( CHAR c )
{
WCHAR wc = nls_info.AnsiTableInfo.MultiByteTable[(unsigned char)c];
return !!(get_table_entry( wctype_table, wc ) & C1_SPACE);
}
/******************************************************************************
* IsCharSpaceW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharSpaceW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_SPACE);
}
/******************************************************************************
* IsCharUpperA (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharUpperA( CHAR c )
{
WCHAR wc = nls_info.AnsiTableInfo.MultiByteTable[(unsigned char)c];
return !!(get_table_entry( wctype_table, wc ) & C1_UPPER);
}
/******************************************************************************
* IsCharUpperW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharUpperW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_UPPER);
}
/******************************************************************************
* IsCharXDigitW (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsCharXDigitW( WCHAR wc )
{
return !!(get_table_entry( wctype_table, wc ) & C1_XDIGIT);
}
/******************************************************************************
* IsDBCSLeadByte (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH IsDBCSLeadByte( BYTE testchar )
......
......@@ -33,13 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(string);
((ch) >= 'A' && (ch) <= 'F') || \
((ch) >= 'a' && (ch) <= 'f'))
static WORD get_char_type(WCHAR ch)
{
WORD type = 0;
GetStringTypeW(CT_CTYPE1, &ch, 1, &type);
return type;
}
static BOOL char_compare(WORD ch1, WORD ch2, DWORD flags)
{
char str1[3], str2[3];
......@@ -219,90 +212,6 @@ DWORD WINAPI StrCmpNICW(const WCHAR *str, const WCHAR *cmp, DWORD len)
return StrCmpNIW(str, cmp, len);
}
BOOL WINAPI IsCharBlankW(WCHAR wc)
{
return !!(get_char_type(wc) & C1_BLANK);
}
BOOL WINAPI IsCharCntrlW(WCHAR wc)
{
return !!(get_char_type(wc) & C1_CNTRL);
}
BOOL WINAPI IsCharDigitW(WCHAR wc)
{
return !!(get_char_type(wc) & C1_DIGIT);
}
BOOL WINAPI IsCharPunctW(WCHAR wc)
{
return !!(get_char_type(wc) & C1_PUNCT);
}
BOOL WINAPI IsCharSpaceA(CHAR c)
{
WORD type;
return GetStringTypeA(GetSystemDefaultLCID(), CT_CTYPE1, &c, 1, &type) && (type & C1_SPACE);
}
BOOL WINAPI IsCharSpaceW(WCHAR wc)
{
return !!(get_char_type(wc) & C1_SPACE);
}
BOOL WINAPI IsCharXDigitW(WCHAR wc)
{
return !!(get_char_type(wc) & C1_XDIGIT);
}
BOOL WINAPI IsCharAlphaA(CHAR x)
{
WCHAR wch;
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharAlphaW(wch);
}
BOOL WINAPI IsCharAlphaW(WCHAR ch)
{
return !!(get_char_type(ch) & C1_ALPHA);
}
BOOL WINAPI IsCharLowerA(CHAR x)
{
WCHAR wch;
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharLowerW(wch);
}
BOOL WINAPI IsCharLowerW(WCHAR ch)
{
return !!(get_char_type(ch) & C1_LOWER);
}
BOOL WINAPI IsCharAlphaNumericA(CHAR x)
{
WCHAR wch;
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharAlphaNumericW(wch);
}
BOOL WINAPI IsCharAlphaNumericW(WCHAR ch)
{
return !!(get_char_type(ch) & (C1_ALPHA | C1_DIGIT));
}
BOOL WINAPI IsCharUpperA(CHAR x)
{
WCHAR wch;
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
return IsCharUpperW(wch);
}
BOOL WINAPI IsCharUpperW(WCHAR ch)
{
return !!(get_char_type(ch) & C1_UPPER);
}
char * WINAPI StrChrA(const char *str, WORD ch)
{
TRACE("%s, %#x\n", wine_dbgstr_a(str), ch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment