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
99579ca4
Commit
99579ca4
authored
Oct 12, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added _mbtowc_l implementation.
parent
0f53100a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
23 deletions
+37
-23
mbcs.c
dlls/msvcrt/mbcs.c
+35
-22
msvcrt.h
dlls/msvcrt/msvcrt.h
+1
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
No files found.
dlls/msvcrt/mbcs.c
View file @
99579ca4
...
...
@@ -1009,28 +1009,6 @@ unsigned char* CDECL _mbstok(unsigned char *str, const unsigned char *delim)
}
/*********************************************************************
* mbtowc(MSVCRT.@)
*/
int
CDECL
MSVCRT_mbtowc
(
MSVCRT_wchar_t
*
dst
,
const
char
*
str
,
MSVCRT_size_t
n
)
{
/* temp var needed because MultiByteToWideChar wants non NULL destination */
MSVCRT_wchar_t
tmpdst
=
'\0'
;
if
(
n
<=
0
||
!
str
)
return
0
;
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
n
,
&
tmpdst
,
1
))
return
-
1
;
if
(
dst
)
*
dst
=
tmpdst
;
/* return the number of bytes from src that have been used */
if
(
!*
str
)
return
0
;
if
(
n
>=
2
&&
MSVCRT_isleadbyte
(
*
str
)
&&
str
[
1
])
return
2
;
return
1
;
}
/*********************************************************************
* _mbbtombc(MSVCRT.@)
*/
unsigned
int
CDECL
_mbbtombc
(
unsigned
int
c
)
...
...
@@ -1869,6 +1847,41 @@ MSVCRT_size_t CDECL _mbstrlen(const char* str)
}
/*********************************************************************
* _mbtowc_l(MSVCRT.@)
*/
int
CDECL
MSVCRT_mbtowc_l
(
MSVCRT_wchar_t
*
dst
,
const
char
*
str
,
MSVCRT_size_t
n
,
MSVCRT__locale_t
locale
)
{
MSVCRT_pthreadlocinfo
locinfo
;
MSVCRT_wchar_t
tmpdst
=
'\0'
;
if
(
!
locale
)
locinfo
=
get_locinfo
();
else
locinfo
=
locale
->
locinfo
;
if
(
n
<=
0
||
!
str
)
return
0
;
if
(
!
MultiByteToWideChar
(
locinfo
->
lc_codepage
,
0
,
str
,
n
,
&
tmpdst
,
1
))
return
-
1
;
if
(
dst
)
*
dst
=
tmpdst
;
/* 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
])
return
2
;
return
1
;
}
/*********************************************************************
* mbtowc(MSVCRT.@)
*/
int
CDECL
MSVCRT_mbtowc
(
MSVCRT_wchar_t
*
dst
,
const
char
*
str
,
MSVCRT_size_t
n
)
{
return
MSVCRT_mbtowc_l
(
dst
,
str
,
n
,
NULL
);
}
/*********************************************************************
* _mbstowcs_l(MSVCRT.@)
*/
MSVCRT_size_t
CDECL
MSVCRT__mbstowcs_l
(
MSVCRT_wchar_t
*
wcstr
,
const
char
*
mbstr
,
...
...
dlls/msvcrt/msvcrt.h
View file @
99579ca4
...
...
@@ -850,6 +850,7 @@ int __cdecl MSVCRT_iswalpha(MSVCRT_wint_t);
int
__cdecl
MSVCRT_iswspace
(
MSVCRT_wint_t
);
int
__cdecl
MSVCRT_iswdigit
(
MSVCRT_wint_t
);
int
__cdecl
MSVCRT_isleadbyte
(
int
);
int
__cdecl
MSVCRT__isleadbyte_l
(
int
,
MSVCRT__locale_t
);
void
__cdecl
MSVCRT__lock_file
(
MSVCRT_FILE
*
);
void
__cdecl
MSVCRT__unlock_file
(
MSVCRT_FILE
*
);
...
...
dlls/msvcrt/msvcrt.spec
View file @
99579ca4
...
...
@@ -792,7 +792,7 @@
# stub _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
# stub _mbsupr_s_l(str long ptr)
# stub _mbtowc_l(ptr str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr) MSVCRT_mbtowc_l
@ cdecl _memccpy(ptr ptr long long) ntdll._memccpy
@ cdecl _memicmp(str str long) ntdll._memicmp
# stub _memicmp_l(str str 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