Menu

[424828]: / src / rtlib / intl_getweekdayname.c  Maximize  Restore  History

Download this file

47 lines (40 with data), 926 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* get weekday name */
#include "fb.h"
static const char *pszWeekdayNamesLong[7] = {
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
static const char *pszWeekdayNamesShort[7] = {
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
};
/*:::::*/
FBSTRING *fb_IntlGetWeekdayName( int weekday, int short_names, int disallow_localized )
{
FBSTRING *res;
if( weekday < 1 || weekday > 7 )
return NULL;
if( fb_I18nGet() && !disallow_localized ) {
res = fb_DrvIntlGetWeekdayName( weekday, short_names );
if( res!=NULL )
return res;
}
if( short_names ) {
res = fb_StrAllocTempDescZ( pszWeekdayNamesShort[weekday-1] );
} else {
res = fb_StrAllocTempDescZ( pszWeekdayNamesLong[weekday-1] );
}
if( res==&__fb_ctx.null_desc )
return NULL;
return res;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.