msvcrt: Implement _get_tzname.
This commit is contained in:
parent
c4c091d4b7
commit
7b8ac6a255
|
@ -690,7 +690,7 @@
|
||||||
@ stub _get_purecall_handler
|
@ stub _get_purecall_handler
|
||||||
@ stub _get_terminate
|
@ stub _get_terminate
|
||||||
@ stub _get_timezone
|
@ stub _get_timezone
|
||||||
@ stub _get_tzname
|
@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname
|
||||||
@ stub _get_unexpected
|
@ stub _get_unexpected
|
||||||
@ stub _get_wpgmptr
|
@ stub _get_wpgmptr
|
||||||
@ stub _getc_nolock
|
@ stub _getc_nolock
|
||||||
|
|
|
@ -535,7 +535,7 @@
|
||||||
@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold
|
@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold
|
||||||
@ stub _get_terminate
|
@ stub _get_terminate
|
||||||
@ stub _get_timezone
|
@ stub _get_timezone
|
||||||
@ stub _get_tzname
|
@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname
|
||||||
@ stub _get_unexpected
|
@ stub _get_unexpected
|
||||||
@ stub _get_winmajor
|
@ stub _get_winmajor
|
||||||
@ stub _get_winminor
|
@ stub _get_winminor
|
||||||
|
|
|
@ -525,7 +525,7 @@
|
||||||
@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold
|
@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold
|
||||||
@ stub _get_terminate
|
@ stub _get_terminate
|
||||||
@ stub _get_timezone
|
@ stub _get_timezone
|
||||||
@ stub _get_tzname
|
@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname
|
||||||
@ stub _get_unexpected
|
@ stub _get_unexpected
|
||||||
@ stub _get_wpgmptr
|
@ stub _get_wpgmptr
|
||||||
@ stub _getc_nolock
|
@ stub _getc_nolock
|
||||||
|
|
|
@ -483,6 +483,7 @@
|
||||||
# stub _get_winver
|
# stub _get_winver
|
||||||
# stub _get_wpgmptr
|
# stub _get_wpgmptr
|
||||||
@ stub _get_terminate
|
@ stub _get_terminate
|
||||||
|
@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname
|
||||||
@ stub _get_unexpected
|
@ stub _get_unexpected
|
||||||
@ cdecl _getch()
|
@ cdecl _getch()
|
||||||
@ cdecl _getche()
|
@ cdecl _getche()
|
||||||
|
|
|
@ -719,10 +719,44 @@ MSVCRT_long * CDECL MSVCRT___p__timezone(void)
|
||||||
* must be large enough. The size is picked based on observation of
|
* must be large enough. The size is picked based on observation of
|
||||||
* Windows XP.
|
* Windows XP.
|
||||||
*/
|
*/
|
||||||
static char tzname_std[64] = "";
|
static char tzname_std[64] = "PST";
|
||||||
static char tzname_dst[64] = "";
|
static char tzname_dst[64] = "PDT";
|
||||||
char *MSVCRT__tzname[2] = { tzname_std, tzname_dst };
|
char *MSVCRT__tzname[2] = { tzname_std, tzname_dst };
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _get_tzname (MSVCRT.@)
|
||||||
|
*/
|
||||||
|
int CDECL MSVCRT__get_tzname(MSVCRT_size_t *ret, char *buf, MSVCRT_size_t bufsize, int index)
|
||||||
|
{
|
||||||
|
char *timezone;
|
||||||
|
|
||||||
|
switch(index)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
timezone = tzname_std;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
timezone = tzname_dst;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||||
|
return MSVCRT_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ret || (!buf && bufsize > 0) || (buf && !bufsize))
|
||||||
|
{
|
||||||
|
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||||
|
return MSVCRT_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
*ret = strlen(timezone)+1;
|
||||||
|
if(!buf && !bufsize)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
strcpy(buf, timezone);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* __p_tzname (MSVCRT.@)
|
* __p_tzname (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue