FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
drv_intl_getweekdayname.c
Go to the documentation of this file.
1
/* get localized weekday name */
2
3
#include "../fb.h"
4
#include "
fb_private_intl.h
"
5
6
FBSTRING
*
fb_DrvIntlGetWeekdayName
(
int
weekday,
int
short_names )
7
{
8
FBSTRING
*result =
NULL
;
9
size_t
i;
10
DOS_COUNTRY_INFO_GENERAL
Info;
11
12
if
( !
fb_hIntlGetInfo
( &Info ) )
13
return
NULL
;
14
15
for
( i=0; i!=
__fb_locale_info_count
; ++i) {
16
const
FB_LOCALE_INFOS
*info =
__fb_locale_infos
+ i;
17
if
( info->
country_code
==Info.
country_id
) {
18
const
char
*
name
= ( short_names ? info->
apszNamesWeekdayShort
[weekday-1] : info->
apszNamesWeekdayLong
[weekday-1] );
19
result =
fb_StrAllocTempDescZ
( name );
20
break
;
21
}
22
}
23
24
return
result;
25
}
rtlib
dos
drv_intl_getweekdayname.c
Generated on Thu Jan 23 2014 19:40:08 for FreeBASIC by
1.8.4