Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
758539c8
Commit
758539c8
authored
Aug 23, 2007
by
Mikolaj Zalewski
Committed by
Alexandre Julliard
Aug 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement and test _mbsbtype.
parent
884d718c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
mbcs.c
dlls/msvcrt/mbcs.c
+32
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/tests/string.c
+18
-0
No files found.
dlls/msvcrt/mbcs.c
View file @
758539c8
...
...
@@ -1089,6 +1089,38 @@ int CDECL _ismbstrail(const unsigned char* start, const unsigned char* str)
}
/*********************************************************************
* _mbsbtype (MSVCRT.@)
*/
int
CDECL
_mbsbtype
(
const
unsigned
char
*
str
,
MSVCRT_size_t
count
)
{
int
lead
=
0
;
const
unsigned
char
*
end
=
str
+
count
;
int
mbcp
=
g_mbcp_is_multibyte
;
/* Lead bytes can also be trail bytes so we need to analyse the string.
* Also we must return _MBC_ILLEGAL for chars past the end of the string
*/
while
(
str
<
end
)
/* Note: we skip the last byte - will check after the loop */
{
if
(
!*
str
)
return
_MBC_ILLEGAL
;
lead
=
mbcp
&&
!
lead
&&
_ismbblead
(
*
str
);
str
++
;
}
if
(
lead
)
if
(
_ismbbtrail
(
*
str
))
return
_MBC_TRAIL
;
else
return
_MBC_ILLEGAL
;
else
if
(
_ismbblead
(
*
str
))
return
_MBC_LEAD
;
else
return
_MBC_SINGLE
;
}
/*********************************************************************
* _mbsset(MSVCRT.@)
*/
unsigned
char
*
CDECL
_mbsset
(
unsigned
char
*
str
,
unsigned
int
c
)
...
...
dlls/msvcrt/msvcrt.spec
View file @
758539c8
...
...
@@ -355,7 +355,7 @@
@ stub _mbctombb #(long)
@ cdecl _mbctoupper(long)
@ extern _mbctype MSVCRT_mbctype
@
stub _mbsbtype #
(str long)
@
cdecl _mbsbtype
(str long)
@ cdecl _mbscat(str str)
@ cdecl _mbschr(str long)
@ cdecl _mbscmp(str str)
...
...
dlls/msvcrt/tests/string.c
View file @
758539c8
...
...
@@ -239,6 +239,24 @@ static void test_mbcp(void)
expect_eq
(
_ismbstrail
(
mbsonlylead
,
&
mbsonlylead
[
4
]),
FALSE
,
int
,
"%d"
);
expect_eq
(
_ismbstrail
(
mbsonlylead
,
&
mbsonlylead
[
5
]),
FALSE
,
int
,
"%d"
);
/* _mbsbtype */
expect_eq
(
_mbsbtype
(
mbstring
,
0
),
_MBC_LEAD
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
1
),
_MBC_TRAIL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
2
),
_MBC_LEAD
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
3
),
_MBC_ILLEGAL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
4
),
_MBC_LEAD
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
5
),
_MBC_TRAIL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
6
),
_MBC_SINGLE
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
7
),
_MBC_LEAD
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbstring
,
8
),
_MBC_ILLEGAL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbsonlylead
,
0
),
_MBC_LEAD
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbsonlylead
,
1
),
_MBC_ILLEGAL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbsonlylead
,
2
),
_MBC_ILLEGAL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbsonlylead
,
3
),
_MBC_ILLEGAL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbsonlylead
,
4
),
_MBC_ILLEGAL
,
int
,
"%d"
);
expect_eq
(
_mbsbtype
(
mbsonlylead
,
5
),
_MBC_ILLEGAL
,
int
,
"%d"
);
/* _mbsnextc */
expect_eq
(
_mbsnextc
(
mbstring
),
0xb0b1
,
int
,
"%x"
);
expect_eq
(
_mbsnextc
(
&
mbstring
[
2
]),
0xb220
,
int
,
"%x"
);
/* lead + invalid tail */
...
...
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