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
4b67531b
Commit
4b67531b
authored
Nov 29, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added mbrtowc implementation.
parent
00658a4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
mbcs.c
dlls/msvcrt/mbcs.c
+48
-1
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
No files found.
dlls/msvcrt/mbcs.c
View file @
4b67531b
...
...
@@ -1995,7 +1995,7 @@ int CDECL MSVCRT_mbtowc_l(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n,
/* return the number of bytes from src that have been used */
if
(
!*
str
)
return
0
;
if
(
n
>=
2
&&
MSVCRT__isleadbyte_l
(
*
str
,
locale
)
&&
str
[
1
])
if
(
n
>=
2
&&
MSVCRT__isleadbyte_l
(
(
unsigned
char
)
*
str
,
locale
)
&&
str
[
1
])
return
2
;
return
1
;
}
...
...
@@ -2009,6 +2009,53 @@ int CDECL MSVCRT_mbtowc(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n)
}
/*********************************************************************
* mbrtowc(MSVCRT.@)
*/
MSVCRT_size_t
CDECL
MSVCRT_mbrtowc
(
MSVCRT_wchar_t
*
dst
,
const
char
*
str
,
MSVCRT_size_t
n
,
MSVCRT_mbstate_t
*
state
)
{
MSVCRT_pthreadlocinfo
locinfo
=
get_locinfo
();
MSVCRT_mbstate_t
s
=
(
state
?
*
state
:
0
);
char
tmpstr
[
2
];
int
len
=
0
;
if
(
dst
)
*
dst
=
0
;
if
(
!
n
||
!
str
||
!*
str
)
return
0
;
if
(
locinfo
->
mb_cur_max
==
1
)
{
tmpstr
[
len
++
]
=
*
str
;
}
else
if
(
!
s
&&
MSVCRT_isleadbyte
((
unsigned
char
)
*
str
))
{
if
(
n
==
1
)
{
s
=
(
unsigned
char
)
*
str
;
len
=
-
2
;
}
else
{
tmpstr
[
0
]
=
str
[
0
];
tmpstr
[
1
]
=
str
[
1
];
len
=
2
;
}
}
else
if
(
!
s
)
{
tmpstr
[
len
++
]
=
*
str
;
}
else
{
tmpstr
[
0
]
=
s
;
tmpstr
[
1
]
=
*
str
;
len
=
2
;
s
=
0
;
}
if
(
len
>
0
)
{
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
0
,
tmpstr
,
len
,
dst
,
dst
?
1
:
0
))
len
=
-
1
;
}
if
(
state
)
*
state
=
s
;
return
len
;
}
/*********************************************************************
* _mbstowcs_l(MSVCRT.@)
*/
MSVCRT_size_t
CDECL
MSVCRT__mbstowcs_l
(
MSVCRT_wchar_t
*
wcstr
,
const
char
*
mbstr
,
...
...
dlls/msvcrt/msvcrt.spec
View file @
4b67531b
...
...
@@ -1329,7 +1329,7 @@
@ cdecl malloc(long) MSVCRT_malloc
@ cdecl mblen(ptr long) MSVCRT_mblen
@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen
# stub mbrtowc(ptr str long ptr)
@ cdecl mbrtowc(ptr str long ptr) MSVCRT_mbrtowc
# stub mbsdup_dbg(wstr long ptr long)
# stub mbsrtowcs(ptr ptr long ptr)
# stub mbsrtowcs_s(ptr ptr long ptr long ptr)
...
...
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