Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c7c8016b
Commit
c7c8016b
authored
Dec 09, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Directly use the wctype table for the IsChar* functions.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1b46da5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
91 deletions
+140
-91
locale.c
dlls/kernelbase/locale.c
+140
-0
string.c
dlls/kernelbase/string.c
+0
-91
No files found.
dlls/kernelbase/locale.c
View file @
c7c8016b
...
...
@@ -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
)
...
...
dlls/kernelbase/string.c
View file @
c7c8016b
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment