msvcrt: Added _Getmonths implementation.
This commit is contained in:
parent
7a43f0cb8f
commit
d82dd2a4db
|
@ -451,14 +451,35 @@ char* CDECL _Getdays(void)
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _Getmonths (MSVCRT.@)
|
* _Getmonths (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
const char* CDECL _Getmonths(void)
|
char* CDECL _Getmonths(void)
|
||||||
{
|
{
|
||||||
static const char MSVCRT_months[] = ":Jan:January:Feb:February:Mar:March:Apr:"
|
static const int months_offset = 14;
|
||||||
"April:May:May:Jun:June:Jul:July:Aug:August:Sep:September:Oct:"
|
|
||||||
"October:Nov:November:Dec:December";
|
MSVCRT___lc_time_data *cur = get_locinfo()->lc_time_curr;
|
||||||
/* FIXME: Use locale */
|
int i, len, size;
|
||||||
TRACE("(void) semi-stub\n");
|
char *out;
|
||||||
return MSVCRT_months;
|
|
||||||
|
TRACE("\n");
|
||||||
|
|
||||||
|
size = cur->str[months_offset+2*12]-cur->str[months_offset];
|
||||||
|
out = MSVCRT_malloc(size+1);
|
||||||
|
if(!out)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
for(i=0; i<12; i++) {
|
||||||
|
out[size++] = ':';
|
||||||
|
len = strlen(cur->str[months_offset+i]);
|
||||||
|
memcpy(&out[size], cur->str[months_offset+i], len);
|
||||||
|
size += len;
|
||||||
|
|
||||||
|
out[size++] = ':';
|
||||||
|
len = strlen(cur->str[months_offset+12+i]);
|
||||||
|
memcpy(&out[size], cur->str[months_offset+12+i], len);
|
||||||
|
size += len;
|
||||||
|
}
|
||||||
|
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue