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
6457163b
Commit
6457163b
authored
Jul 25, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 27, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add _wctomb_s_l implementation.
parent
029aec19
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
106 additions
and
32 deletions
+106
-32
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+3
-3
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+3
-3
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+3
-3
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+3
-3
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+3
-3
string.c
dlls/msvcrt/tests/string.c
+1
-1
wcs.c
dlls/msvcrt/wcs.c
+90
-16
No files found.
dlls/msvcr100/msvcr100.spec
View file @
6457163b
...
...
@@ -1520,8 +1520,8 @@
@ stub _wctime32_s
@ cdecl _wctime64(ptr) msvcrt._wctime64
@ stub _wctime64_s
@
stub
_wctomb_l
@
stub
_wctomb_s_l
@
cdecl _wctomb_l(ptr long ptr) msvcrt.
_wctomb_l
@
cdecl _wctomb_s_l(ptr ptr long long ptr) msvcrt.
_wctomb_s_l
# extern _wctype
@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s
@ extern _wenviron msvcrt._wenviron
...
...
@@ -1877,7 +1877,7 @@
@ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm
@ cdecl wctob(long) msvcrt.wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@
stub
wctomb_s
@
cdecl wctomb_s(ptr ptr long long) msvcrt.
wctomb_s
@ cdecl wmemcpy_s(ptr long ptr long)
@ cdecl wmemmove_s(ptr long ptr long)
@ varargs wprintf(wstr) msvcrt.wprintf
...
...
dlls/msvcr110/msvcr110.spec
View file @
6457163b
...
...
@@ -1883,8 +1883,8 @@
@ stub _wctime32_s
@ cdecl _wctime64(ptr) msvcrt._wctime64
@ stub _wctime64_s
@
stub
_wctomb_l
@
stub
_wctomb_s_l
@
cdecl _wctomb_l(ptr long ptr) msvcrt.
_wctomb_l
@
cdecl _wctomb_s_l(ptr ptr long long ptr) msvcrt.
_wctomb_s_l
# extern _wctype
@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s
@ extern _wenviron msvcrt._wenviron
...
...
@@ -2240,7 +2240,7 @@
@ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm
@ cdecl wctob(long) msvcrt.wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@
stub
wctomb_s
@
cdecl wctomb_s(ptr ptr long long) msvcrt.
wctomb_s
@ cdecl wmemcpy_s(ptr long ptr long) msvcr100.wmemcpy_s
@ cdecl wmemmove_s(ptr long ptr long) msvcr100.wmemmove_s
@ varargs wprintf(wstr) msvcrt.wprintf
...
...
dlls/msvcr80/msvcr80.spec
View file @
6457163b
...
...
@@ -1198,8 +1198,8 @@
@ stub _wctime32_s
@ cdecl _wctime64(ptr) msvcrt._wctime64
@ stub _wctime64_s
@
stub
_wctomb_l
@
stub
_wctomb_s_l
@
cdecl _wctomb_l(ptr long ptr) msvcrt.
_wctomb_l
@
cdecl _wctomb_s_l(ptr ptr long long ptr) msvcrt.
_wctomb_s_l
# extern _wctype
@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s
@ extern _wenviron msvcrt._wenviron
...
...
@@ -1556,7 +1556,7 @@
@ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm
@ cdecl wctob(long) msvcrt.wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@
stub
wctomb_s
@
cdecl wctomb_s(ptr ptr long long) msvcrt.
wctomb_s
@ varargs wprintf(wstr) msvcrt.wprintf
@ varargs wprintf_s(wstr) msvcrt.wprintf_s
@ varargs wscanf(wstr) msvcrt.wscanf
...
...
dlls/msvcr90/msvcr90.spec
View file @
6457163b
...
...
@@ -1174,8 +1174,8 @@
@ stub _wctime32_s
@ cdecl _wctime64(ptr) msvcrt._wctime64
@ stub _wctime64_s
@
stub
_wctomb_l
@
stub
_wctomb_s_l
@
cdecl _wctomb_l(ptr long ptr) msvcrt.
_wctomb_l
@
cdecl _wctomb_s_l(ptr ptr long long ptr) msvcrt.
_wctomb_s_l
# extern _wctype
@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s
@ extern _wenviron msvcrt._wenviron
...
...
@@ -1529,7 +1529,7 @@
@ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm
@ cdecl wctob(long) msvcrt.wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@
stub
wctomb_s
@
cdecl wctomb_s(ptr ptr long long) msvcrt.
wctomb_s
@ varargs wprintf(wstr) msvcrt.wprintf
@ varargs wprintf_s(wstr) msvcrt.wprintf_s
@ varargs wscanf(wstr) msvcrt.wscanf
...
...
dlls/msvcrt/msvcrt.spec
View file @
6457163b
...
...
@@ -1139,8 +1139,8 @@
# stub _wctime32_s(ptr long ptr)
@ cdecl _wctime64(ptr) MSVCRT__wctime64
# stub _wctime64_s(ptr long ptr)
# stub _wctomb_l(ptr long ptr)
# stub _wctomb_s_l(ptr ptr long long ptr)
@ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l
@ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l
# extern _wctype
@ extern _wenviron MSVCRT__wenviron
@ varargs _wexecl(wstr wstr)
...
...
@@ -1510,7 +1510,7 @@
@ stub wcsxfrm(ptr wstr long)
@ cdecl wctob(long) MSVCRT_wctob
@ cdecl wctomb(ptr long) MSVCRT_wctomb
# stub wctomb_s(ptr ptr long long)
@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s
@ varargs wprintf(wstr) MSVCRT_wprintf
@ varargs wprintf_s(wstr) MSVCRT_wprintf_s
@ varargs wscanf(wstr) MSVCRT_wscanf
...
...
dlls/msvcrt/tests/string.c
View file @
6457163b
...
...
@@ -2356,7 +2356,7 @@ static void test_wctomb(void)
ret
=
p_wcrtomb
((
char
*
)
dst
,
0xffff
,
NULL
);
ok
(
ret
==
-
1
,
"wcrtomb did not return -1
\n
"
);
ok
(
dst
[
0
]
==
0x3f
,
"dst[0] = %x, expected 0x
20
\n
"
,
dst
[
0
]);
ok
(
dst
[
0
]
==
0x3f
,
"dst[0] = %x, expected 0x
3f
\n
"
,
dst
[
0
]);
setlocale
(
LC_ALL
,
"C"
);
}
...
...
dlls/msvcrt/wcs.c
View file @
6457163b
...
...
@@ -1146,6 +1146,96 @@ MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t
}
/*********************************************************************
* _wctomb_s_l (MSVCRT.@)
*/
int
CDECL
MSVCRT__wctomb_s_l
(
int
*
len
,
char
*
mbchar
,
MSVCRT_size_t
size
,
MSVCRT_wchar_t
wch
,
MSVCRT__locale_t
locale
)
{
MSVCRT_pthreadlocinfo
locinfo
;
BOOL
error
;
int
mblen
;
if
(
!
mbchar
&&
size
>
0
)
{
if
(
len
)
*
len
=
0
;
return
0
;
}
if
(
len
)
*
len
=
-
1
;
if
(
!
MSVCRT_CHECK_PMT
(
size
<=
INT_MAX
))
return
MSVCRT_EINVAL
;
if
(
!
locale
)
locinfo
=
get_locinfo
();
else
locinfo
=
locale
->
locinfo
;
if
(
!
locinfo
->
lc_codepage
)
{
if
(
wch
>
0xff
)
{
if
(
mbchar
&&
size
>
0
)
memset
(
mbchar
,
0
,
size
);
*
MSVCRT__errno
()
=
MSVCRT_EILSEQ
;
return
MSVCRT_EILSEQ
;
}
if
(
!
MSVCRT_CHECK_PMT_ERR
(
size
>=
1
,
MSVCRT_ERANGE
))
return
MSVCRT_ERANGE
;
*
mbchar
=
wch
;
if
(
len
)
*
len
=
1
;
return
0
;
}
mblen
=
WideCharToMultiByte
(
locinfo
->
lc_codepage
,
0
,
&
wch
,
1
,
mbchar
,
size
,
NULL
,
&
error
);
if
(
!
mblen
||
error
)
{
if
(
!
mblen
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
)
{
if
(
mbchar
&&
size
>
0
)
memset
(
mbchar
,
0
,
size
);
MSVCRT_INVALID_PMT
(
"insufficient buffer size"
,
MSVCRT_ERANGE
);
return
MSVCRT_ERANGE
;
}
*
MSVCRT__errno
()
=
MSVCRT_EILSEQ
;
return
MSVCRT_EILSEQ
;
}
if
(
len
)
*
len
=
mblen
;
return
0
;
}
/*********************************************************************
* wctomb_s (MSVCRT.@)
*/
int
CDECL
MSVCRT_wctomb_s
(
int
*
len
,
char
*
mbchar
,
MSVCRT_size_t
size
,
MSVCRT_wchar_t
wch
)
{
return
MSVCRT__wctomb_s_l
(
len
,
mbchar
,
size
,
wch
,
NULL
);
}
/*********************************************************************
* _wctomb_l (MSVCRT.@)
*/
int
CDECL
MSVCRT__wctomb_l
(
char
*
dst
,
MSVCRT_wchar_t
ch
,
MSVCRT__locale_t
locale
)
{
int
len
;
MSVCRT__wctomb_s_l
(
&
len
,
dst
,
dst
?
6
:
0
,
ch
,
locale
);
return
len
;
}
/*********************************************************************
* wctomb (MSVCRT.@)
*/
INT
CDECL
MSVCRT_wctomb
(
char
*
dst
,
MSVCRT_wchar_t
ch
)
{
return
MSVCRT__wctomb_l
(
dst
,
ch
,
NULL
);
}
/*********************************************************************
* wctob (MSVCRT.@)
*/
INT
CDECL
MSVCRT_wctob
(
MSVCRT_wint_t
wchar
)
...
...
@@ -1165,22 +1255,6 @@ INT CDECL MSVCRT_wctob( MSVCRT_wint_t wchar )
}
/*********************************************************************
* wctomb (MSVCRT.@)
*/
INT
CDECL
MSVCRT_wctomb
(
char
*
dst
,
MSVCRT_wchar_t
ch
)
{
BOOL
error
;
INT
size
;
size
=
WideCharToMultiByte
(
get_locinfo
()
->
lc_codepage
,
0
,
&
ch
,
1
,
dst
,
dst
?
6
:
0
,
NULL
,
&
error
);
if
(
!
size
||
error
)
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EOF
;
}
return
size
;
}
/*********************************************************************
* wcrtomb (MSVCRT.@)
*/
MSVCRT_size_t
CDECL
MSVCRT_wcrtomb
(
char
*
dst
,
MSVCRT_wchar_t
ch
,
MSVCRT_mbstate_t
*
s
)
...
...
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