FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
time_weekdayname.c
Go to the documentation of this file.
1
/* returns the weekday name */
2
3
#include "
fb.h
"
4
5
/*:::::*/
6
FBCALL
FBSTRING
*
fb_WeekdayName
(
int
weekday,
int
abbreviation,
int
first_day_of_week )
7
{
8
FBSTRING
*res;
9
10
if
( weekday < 1 || weekday > 7 || first_day_of_week < 0 || first_day_of_week > 7 ) {
11
fb_ErrorSetNum
(
FB_RTERROR_ILLEGALFUNCTIONCALL
);
12
return
&
__fb_ctx
.
null_desc
;
13
}
14
15
fb_ErrorSetNum
(
FB_RTERROR_OK
);
16
17
if
( first_day_of_week==
FB_WEEK_DAY_SYSTEM
) {
18
/* FIXME: Add query of system default */
19
first_day_of_week =
FB_WEEK_DAY_DEFAULT
;
20
}
21
22
weekday += first_day_of_week - 1;
23
if
( weekday > 7 )
24
weekday -= 7;
25
26
res =
fb_IntlGetWeekdayName
( weekday, abbreviation,
FALSE
);
27
if
( res==
NULL
) {
28
fb_ErrorSetNum
(
FB_RTERROR_ILLEGALFUNCTIONCALL
);
29
res = &
__fb_ctx
.
null_desc
;
30
}
31
32
return
res;
33
}
rtlib
time_weekdayname.c
Generated on Thu Jan 23 2014 19:40:14 for FreeBASIC by
1.8.4