Commit bc1eaf7a authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msvcrt: Add _W_Getdays.

parent 5ac70b2c
......@@ -864,7 +864,7 @@
@ stub -arch=win64 _SetThrowImageBase
@ cdecl _Strftime(str long str ptr ptr)
@ stub _Unlock_shared_ptr_spin_lock
@ stub _W_Getdays
@ cdecl _W_Getdays()
@ stub _W_Getmonths
@ stub _W_Gettnames
@ stub _Wcsftime
......
......@@ -846,7 +846,7 @@
@ stub -arch=win64 _SetImageBase
@ stub -arch=win64 _SetThrowImageBase
@ cdecl _Strftime(str long str ptr ptr)
@ stub _W_Getdays
@ cdecl _W_Getdays()
@ stub _W_Getmonths
@ stub _W_Gettnames
@ stub _Wcsftime
......
......@@ -842,7 +842,7 @@
@ stub -arch=win64 _SetImageBase
@ stub -arch=win64 _SetThrowImageBase
@ cdecl _Strftime(str long str ptr ptr) msvcr120._Strftime
@ stub _W_Getdays
@ cdecl _W_Getdays() msvcr120._W_Getdays
@ stub _W_Getmonths
@ stub _W_Gettnames
@ stub _Wcsftime
......
......@@ -35,6 +35,7 @@
#include "mtdll.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
......@@ -440,6 +441,39 @@ char* CDECL _Getdays(void)
}
/*********************************************************************
* _W_Getdays (MSVCRT.@)
*/
MSVCRT_wchar_t* CDECL _W_Getdays(void)
{
MSVCRT___lc_time_data *cur = get_locinfo()->lc_time_curr;
MSVCRT_wchar_t *out;
int i, len, size;
TRACE("\n");
size = cur->wstr.names.short_mon[0]-cur->wstr.names.short_wday[0];
out = MSVCRT_malloc((size+1)*sizeof(*out));
if(!out)
return NULL;
size = 0;
for(i=0; i<7; i++) {
out[size++] = ':';
len = strlenW(cur->wstr.names.short_wday[i]);
memcpy(&out[size], cur->wstr.names.short_wday[i], len*sizeof(*out));
size += len;
out[size++] = ':';
len = strlenW(cur->wstr.names.wday[i]);
memcpy(&out[size], cur->wstr.names.wday[i], len*sizeof(*out));
size += len;
}
out[size] = '\0';
return out;
}
/*********************************************************************
* _Getmonths (MSVCRT.@)
*/
char* CDECL _Getmonths(void)
......@@ -1381,7 +1415,7 @@ MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale)
}
}
for(i=0; i<sizeof(time_data)/sizeof(time_data[0]); i++) {
loc->locinfo->lc_time_curr->wstr[i] = (MSVCRT_wchar_t*)&loc->locinfo->lc_time_curr->data[ret];
loc->locinfo->lc_time_curr->wstr.wstr[i] = (MSVCRT_wchar_t*)&loc->locinfo->lc_time_curr->data[ret];
if(time_data[i]==LOCALE_SSHORTDATE && !lcid[MSVCRT_LC_TIME]) {
memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_short_dateW, sizeof(cloc_short_dateW));
ret += sizeof(cloc_short_dateW);
......
......@@ -134,7 +134,20 @@ typedef struct {
} str;
LCID lcid;
int unk[2];
MSVCRT_wchar_t *wstr[43];
union {
MSVCRT_wchar_t *wstr[43];
struct {
MSVCRT_wchar_t *short_wday[7];
MSVCRT_wchar_t *wday[7];
MSVCRT_wchar_t *short_mon[12];
MSVCRT_wchar_t *mon[12];
MSVCRT_wchar_t *am;
MSVCRT_wchar_t *pm;
MSVCRT_wchar_t *short_date;
MSVCRT_wchar_t *date;
MSVCRT_wchar_t *time;
} names;
} wstr;
char data[1];
} MSVCRT___lc_time_data;
......
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