Commit 504e68ac authored by Eryk Wieliczko's avatar Eryk Wieliczko Committed by Alexandre Julliard

msvcrt: Implement _ctime32/64_s.

parent 01ab7df6
......@@ -560,9 +560,9 @@
@ varargs _cscanf_s(str) msvcrt._cscanf_s
@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l
@ cdecl _ctime32(ptr) msvcrt._ctime32
@ stub _ctime32_s
@ cdecl _ctime32_s(str long ptr) msvcrt._ctime32_s
@ cdecl _ctime64(ptr) msvcrt._ctime64
@ stub _ctime64_s
@ cdecl _ctime64_s(str long ptr) msvcrt._ctime64_s
@ cdecl _cwait(ptr long long) msvcrt._cwait
@ varargs _cwprintf(wstr) msvcrt._cwprintf
@ stub _cwprintf_l
......
......@@ -399,9 +399,9 @@
@ varargs _cscanf_s(str) msvcrt._cscanf_s
@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l
@ cdecl _ctime32(ptr) msvcrt._ctime32
@ stub _ctime32_s
@ cdecl _ctime32_s(str ptr long) msvcrt._ctime32_s
@ cdecl _ctime64(ptr) msvcrt._ctime64
@ stub _ctime64_s
@ cdecl _ctime64_s(str ptr long) msvcrt._ctime64_s
@ cdecl _cwait(ptr long long) msvcrt._cwait
@ varargs _cwprintf(wstr) msvcrt._cwprintf
@ stub _cwprintf_l
......
......@@ -391,9 +391,9 @@
@ varargs _cscanf_s(str) msvcrt._cscanf_s
@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l
@ cdecl _ctime32(ptr) msvcrt._ctime32
@ stub _ctime32_s
@ cdecl _ctime32_s(str long ptr) msvcrt._ctime32_s
@ cdecl _ctime64(ptr) msvcrt._ctime64
@ stub _ctime64_s
@ cdecl _ctime64_s(str long ptr) msvcrt._ctime64_s
@ cdecl _cwait(ptr long long) msvcrt._cwait
@ varargs _cwprintf(wstr) msvcrt._cwprintf
@ stub _cwprintf_l
......
......@@ -356,9 +356,9 @@
@ varargs _cscanf_s(str)
@ varargs _cscanf_s_l(str ptr)
@ cdecl _ctime32(ptr) MSVCRT__ctime32
# stub _ctime32_s
@ cdecl _ctime32_s(str long ptr) MSVCRT__ctime32_s
@ cdecl _ctime64(ptr) MSVCRT__ctime64
# stub _ctime64_s
@ cdecl _ctime64_s(str long ptr) MSVCRT__ctime64_s
@ extern _ctype MSVCRT__ctype
@ cdecl _cwait(ptr long long)
@ varargs _cwprintf(wstr)
......
......@@ -902,6 +902,28 @@ char * CDECL MSVCRT__ctime64(const MSVCRT___time64_t *time)
}
/*********************************************************************
* _ctime64_s (MSVCRT.@)
*/
int CDECL MSVCRT__ctime64_s(char *res, MSVCRT_size_t len, const MSVCRT___time64_t *time)
{
struct MSVCRT_tm *t;
if( !MSVCRT_CHECK_PMT( res != NULL ) || !MSVCRT_CHECK_PMT( len >= 26 ) )
{
*MSVCRT__errno() = MSVCRT_EINVAL;
return MSVCRT_EINVAL;
}
res[0] = '\0';
if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( time > 0 ) )
{
*MSVCRT__errno() = MSVCRT_EINVAL;
return MSVCRT_EINVAL;
}
t = MSVCRT__localtime64( time );
strcpy( res, MSVCRT_asctime( t ) );
return 0;
}
/*********************************************************************
* _ctime32 (MSVCRT.@)
*/
char * CDECL MSVCRT__ctime32(const MSVCRT___time32_t *time)
......@@ -913,6 +935,28 @@ char * CDECL MSVCRT__ctime32(const MSVCRT___time32_t *time)
}
/*********************************************************************
* _ctime32_s (MSVCRT.@)
*/
int CDECL MSVCRT__ctime32_s(char *res, MSVCRT_size_t len, const MSVCRT___time32_t *time)
{
struct MSVCRT_tm *t;
if( !MSVCRT_CHECK_PMT( res != NULL ) || !MSVCRT_CHECK_PMT( len >= 26 ) )
{
*MSVCRT__errno() = MSVCRT_EINVAL;
return MSVCRT_EINVAL;
}
res[0] = '\0';
if( !MSVCRT_CHECK_PMT( time != NULL ) || !MSVCRT_CHECK_PMT( time > 0 ) )
{
*MSVCRT__errno() = MSVCRT_EINVAL;
return MSVCRT_EINVAL;
}
t = MSVCRT__localtime32( time );
strcpy( res, MSVCRT_asctime( t ) );
return 0;
}
/*********************************************************************
* ctime (MSVCRT.@)
*/
#ifdef _WIN64
......
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