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
c59a856c
Commit
c59a856c
authored
Nov 02, 2023
by
Bartosz Kosiorek
Committed by
Alexandre Julliard
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add _mbsbtype_l implementation.
parent
4e2d8b13
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
30 deletions
+52
-30
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+1
-1
msvcr120.spec
dlls/msvcr120/msvcr120.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
mbcs.c
dlls/msvcrt/mbcs.c
+43
-22
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/tests/string.c
+1
-0
ucrtbase.spec
dlls/ucrtbase/ucrtbase.spec
+2
-2
No files found.
dlls/msvcr100/msvcr100.spec
View file @
c59a856c
...
...
@@ -1096,7 +1096,7 @@
@ extern _mbctype MSVCRT_mbctype
@ stub _mblen_l
@ cdecl _mbsbtype(str long)
@
stub _mbsbtype_l
@
cdecl _mbsbtype_l(str long ptr)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
@ cdecl _mbschr(str long)
...
...
dlls/msvcr110/msvcr110.spec
View file @
c59a856c
...
...
@@ -1453,7 +1453,7 @@
@ extern _mbctype MSVCRT_mbctype
@ stub _mblen_l
@ cdecl _mbsbtype(str long)
@
stub _mbsbtype_l
@
cdecl _mbsbtype_l(str long ptr)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
@ cdecl _mbschr(str long)
...
...
dlls/msvcr120/msvcr120.spec
View file @
c59a856c
...
...
@@ -1464,7 +1464,7 @@
@ extern _mbctype MSVCRT_mbctype
@ stub _mblen_l
@ cdecl _mbsbtype(str long)
@
stub _mbsbtype_l
@
cdecl _mbsbtype_l(str long ptr)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
@ cdecl _mbschr(str long)
...
...
dlls/msvcr80/msvcr80.spec
View file @
c59a856c
...
...
@@ -768,7 +768,7 @@
@ extern _mbctype MSVCRT_mbctype
@ stub _mblen_l
@ cdecl _mbsbtype(str long)
@
stub _mbsbtype_l
@
cdecl _mbsbtype_l(str long ptr)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
@ cdecl _mbschr(str long)
...
...
dlls/msvcr90/msvcr90.spec
View file @
c59a856c
...
...
@@ -746,7 +746,7 @@
@ extern _mbctype MSVCRT_mbctype
@ stub _mblen_l
@ cdecl _mbsbtype(str long)
@
stub _mbsbtype_l
@
cdecl _mbsbtype_l(str long ptr)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
@ cdecl _mbschr(str long)
...
...
dlls/msvcrt/mbcs.c
View file @
c59a856c
...
...
@@ -2028,34 +2028,55 @@ int CDECL _mbbtype(unsigned char c, int type)
}
/*********************************************************************
* _mbsbtype (MSVCRT.@)
* _mbsbtype
_l
(MSVCRT.@)
*/
int
CDECL
_mbsbtype
(
const
unsigned
char
*
str
,
size_t
count
)
int
CDECL
_mbsbtype
_l
(
const
unsigned
char
*
str
,
size_t
count
,
_locale_t
locale
)
{
int
lead
=
0
;
const
unsigned
char
*
end
=
str
+
count
;
int
lead
=
0
;
pthreadmbcinfo
mbcinfo
;
const
unsigned
char
*
end
=
str
+
count
;
/* 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
=
get_mbcinfo
()
->
ismbcodepage
&&
!
lead
&&
_ismbblead
(
*
str
);
str
++
;
}
if
(
!
MSVCRT_CHECK_PMT
(
str
))
return
_MBC_ILLEGAL
;
if
(
lead
)
if
(
_ismbbtrail
(
*
str
))
return
_MBC_TRAIL
;
if
(
locale
)
mbcinfo
=
locale
->
mbcinfo
;
else
return
_MBC_ILLEGAL
;
else
if
(
_ismbblead
(
*
str
))
return
_MBC_LEAD
;
mbcinfo
=
get_mbcinfo
();
/* 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
=
mbcinfo
->
ismbcodepage
&&
!
lead
&&
_ismbblead_l
(
*
str
,
locale
);
str
++
;
}
if
(
lead
)
{
if
(
_ismbbtrail_l
(
*
str
,
locale
))
return
_MBC_TRAIL
;
else
return
_MBC_ILLEGAL
;
}
else
return
_MBC_SINGLE
;
{
if
(
_ismbblead_l
(
*
str
,
locale
))
return
_MBC_LEAD
;
else
return
_MBC_SINGLE
;
}
}
/*********************************************************************
* _mbsbtype (MSVCRT.@)
*/
int
CDECL
_mbsbtype
(
const
unsigned
char
*
str
,
size_t
count
)
{
return
_mbsbtype_l
(
str
,
count
,
NULL
);
}
/*********************************************************************
...
...
dlls/msvcrt/msvcrt.spec
View file @
c59a856c
...
...
@@ -713,7 +713,7 @@
@ extern _mbctype MSVCRT_mbctype
# stub _mblen_l(str long ptr)
@ cdecl _mbsbtype(str long)
# stub
_mbsbtype_l(str long ptr)
@ cdecl
_mbsbtype_l(str long ptr)
@ cdecl _mbscat(str str)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
...
...
dlls/msvcrt/tests/string.c
View file @
c59a856c
...
...
@@ -335,6 +335,7 @@ static void test_mbcp(void)
expect_eq
(
_ismbstrail
(
mbsonlylead
,
&
mbsonlylead
[
5
]),
FALSE
,
int
,
"%d"
);
/* _mbsbtype */
expect_eq
(
_mbsbtype
(
NULL
,
0
),
_MBC_ILLEGAL
,
int
,
"%d"
);
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"
);
...
...
dlls/ucrtbase/ucrtbase.spec
View file @
c59a856c
...
...
@@ -611,7 +611,7 @@
@ cdecl _mbctoupper_l(long ptr)
@ stub _mblen_l
@ cdecl _mbsbtype(str long)
@
stub _mbsbtype_l
@
cdecl _mbsbtype_l(str long ptr)
@ cdecl _mbscat_s(ptr long str)
@ cdecl _mbscat_s_l(ptr long str ptr)
@ cdecl _mbschr(str long)
...
...
@@ -1181,7 +1181,7 @@
@ cdecl _o__mbctoupper_l(long ptr) _mbctoupper_l
@ stub _o__mblen_l
@ cdecl _o__mbsbtype(str long) _mbsbtype
@
stub _o_
_mbsbtype_l
@
cdecl _o__mbsbtype_l(str long ptr)
_mbsbtype_l
@ cdecl _o__mbscat_s(ptr long str) _mbscat_s
@ cdecl _o__mbscat_s_l(ptr long str ptr) _mbscat_s_l
@ cdecl _o__mbschr(str long) _mbschr
...
...
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