Commit e38cbd82 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Add wcsftime_l.

Based on Daniel Lehman's patch. Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1505684a
......@@ -54,7 +54,7 @@
@ cdecl _utime64(str ptr) ucrtbase._utime64
@ cdecl _wasctime(ptr) ucrtbase._wasctime
@ cdecl _wasctime_s(ptr long ptr) ucrtbase._wasctime_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) ucrtbase._wcsftime_l
@ cdecl _wctime32(ptr) ucrtbase._wctime32
@ cdecl _wctime32_s(ptr long ptr) ucrtbase._wctime32_s
@ cdecl _wctime64(ptr) ucrtbase._wctime64
......
......@@ -1491,7 +1491,7 @@
@ cdecl _wcsdup(wstr) MSVCRT__wcsdup
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
......@@ -1849,7 +1849,7 @@
@ cdecl _wcsdup(wstr) MSVCRT__wcsdup
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
......@@ -1867,7 +1867,7 @@
@ cdecl _wcsdup(wstr) MSVCRT__wcsdup
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
......@@ -1560,7 +1560,7 @@
@ cdecl _wcsdup(wstr) msvcr120._wcsdup
@ cdecl _wcserror(long) msvcr120._wcserror
@ cdecl _wcserror_s(ptr long long) msvcr120._wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) msvcr120._wcsftime_l
@ cdecl _wcsicmp(wstr wstr) msvcr120._wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) msvcr120._wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) msvcr120._wcsicoll
......
......@@ -1170,7 +1170,7 @@
@ cdecl _wcsdup(wstr) MSVCRT__wcsdup
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
......@@ -1146,7 +1146,7 @@
@ cdecl _wcsdup(wstr) MSVCRT__wcsdup
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
......@@ -1051,7 +1051,9 @@ int __cdecl _ismbclegal(unsigned int c);
int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str);
int __cdecl MSVCRT_mbtowc(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
MSVCRT_size_t __cdecl MSVCRT_mbstowcs(MSVCRT_wchar_t*,const char*,MSVCRT_size_t);
MSVCRT_size_t __cdecl MSVCRT__mbstowcs_l(MSVCRT_wchar_t*, const char*, MSVCRT_size_t, MSVCRT__locale_t);
MSVCRT_size_t __cdecl MSVCRT_wcstombs(char*,const MSVCRT_wchar_t*,MSVCRT_size_t);
MSVCRT_size_t __cdecl MSVCRT__wcstombs_l(char*, const MSVCRT_wchar_t*, MSVCRT_size_t, MSVCRT__locale_t);
MSVCRT_intptr_t __cdecl MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
MSVCRT_intptr_t __cdecl MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *);
MSVCRT_intptr_t __cdecl MSVCRT__wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *);
......
......@@ -1101,7 +1101,7 @@
# stub _wcsdup_dbg(wstr long str long)
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
# stub _wcsftime_l(ptr long wstr ptr ptr)
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
......@@ -1264,24 +1264,24 @@ MSVCRT_size_t CDECL MSVCRT_strftime( char *str, MSVCRT_size_t max, const char *f
}
/*********************************************************************
* wcsftime (MSVCRT.@)
* _wcsftime_l (MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm )
MSVCRT_size_t CDECL MSVCRT__wcsftime_l( MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm, MSVCRT__locale_t loc )
{
char *s, *fmt;
MSVCRT_size_t len;
TRACE("%p %ld %s %p\n", str, max, debugstr_w(format), mstm );
TRACE("%p %ld %s %p %p\n", str, max, debugstr_w(format), mstm, loc);
len = MSVCRT_wcstombs( NULL, format, 0 ) + 1;
len = MSVCRT__wcstombs_l( NULL, format, 0, loc ) + 1;
if (!(fmt = MSVCRT_malloc( len ))) return 0;
MSVCRT_wcstombs(fmt, format, len);
MSVCRT__wcstombs_l(fmt, format, len, loc);
if ((s = MSVCRT_malloc( max*4 )))
{
if (!MSVCRT_strftime( s, max*4, fmt, mstm )) s[0] = 0;
len = MSVCRT_mbstowcs( str, s, max );
if (!MSVCRT__strftime_l( s, max*4, fmt, mstm, loc )) s[0] = 0;
len = MSVCRT__mbstowcs_l( str, s, max, loc );
MSVCRT_free( s );
}
else len = 0;
......@@ -1290,6 +1290,15 @@ MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max,
return len;
}
/*********************************************************************
* wcsftime (MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm )
{
return MSVCRT__wcsftime_l(str, max, format, mstm, NULL);
}
static char* asctime_buf(char *buf, const struct MSVCRT_tm *mstm)
{
static const char wday[7][4] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
......
......@@ -2016,7 +2016,7 @@
@ cdecl _wcsdup(wstr) MSVCRT__wcsdup
@ cdecl _wcserror(long) MSVCRT__wcserror
@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s
@ stub _wcsftime_l
@ cdecl _wcsftime_l(ptr long wstr ptr ptr) MSVCRT__wcsftime_l
@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp
@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l
@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment