mtime 1.3.0
|
Singleton Calendar connecting all supported calendar types. More...
Go to the source code of this file.
Enumerations | |
enum | compare_return_val { equal_to = 0 , greater_than = 1 , less_than = -1 , compare_error = -128 } |
enum | calendarType { CALENDAR_NOT_SET = 0 , PROLEPTIC_GREGORIAN = 1 , YEAR_OF_365_DAYS = 2 , YEAR_OF_360_DAYS = 3 } |
enum calendarType lists the calendarTypes supported. The values are used for selecting calendars. More... | |
Functions | |
void | initCalendar (calendarType ct) |
To initialize a new calendar. | |
void | freeCalendar (void) |
called to discard the selected calendar type. | |
calendarType | getCalendarType (void) |
To query the current calendar type. | |
char * | calendarToString (char *calendar) |
convert the calendar identifier into a human readable string. | |
Variables | |
const int | NO_OF_SEC_IN_A_DAY |
const int | NO_OF_SEC_IN_A_HOUR |
const int | NO_OF_SEC_IN_A_MINUTE |
const int | NO_OF_MS_IN_A_DAY |
const int | NO_OF_MS_IN_HALF_DAY |
const int | NO_OF_MS_IN_A_HOUR |
const int | NO_OF_MS_IN_A_MINUTE |
const int | NO_OF_MS_IN_A_SECOND |
const char | initDummyTDString [] |
const char | initDummyDString [] |
const char | initDummyDTString [] |
const int | nofDaysAfterARGMonthsInLeapYear [13] |
const int | nofDaysAfterARGMonthsInNonLeapYear [13] |
const int | nofDaysInARGMonthInLeapYear [] |
const int | nofDaysInARGMonthIn365DayYear [] |
const int | nofDaysInARGMonthIn360DayYear [] |
const int | monthSpecificDeltaInMonthsLeapyear [12][13] |
const int | monthSpecificDeltaInMonths365 [12][13] |
const int | monthSpecificDeltaInMonths360 [12][13] |
struct _julianday *(* | date2julian )(struct _datetime *date, struct _julianday *julian) |
Function pointer connecting the Calendar to Julian routine. The pointed-to Function depends on the selected Calendar type. | |
struct _datetime *(* | julian2date )(struct _julianday *julian, struct _datetime *date) |
Function pointer connecting Julian to Calendar routine. The pointed to Function depends on the selected Calendar type. | |
Singleton Calendar connecting all supported calendar types.
Three calendar types are provided:
To use this library, a call to initCalendar() with the respective selector (enum calendarType) must be done first. The implementation is based on a singleton concept meaning that only one calendar can be active at a time. To release a calendar a call to freeCalendar() has to be done.