home *** CD-ROM | disk | FTP | other *** search
- #ifndef calendar_H
- #define calendar_H
-
- /*
- * C header file for Calendar
- * written by DefMod (Sep 18 2003) on Tue Sep 23 05:23:51 2003
- * © Erik Groenhuis
- */
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef Calendar_JDayToDate
- #define Calendar_JDayToDate 0x55F80
- #undef XCalendar_JDayToDate
- #define XCalendar_JDayToDate 0x75F80
- #undef Calendar_DateToJDay
- #define Calendar_DateToJDay 0x55F81
- #undef XCalendar_DateToJDay
- #define XCalendar_DateToJDay 0x75F81
-
- /************************
- * Constant definitions *
- ************************/
- #define error_CALENDAR 0x55F80
- #define error_CALENDAR_TYPE 0x55F81
- #define error_CALENDAR_NIY 0x55F82
- #define error_CALENDAR_SWI 0x55F83
- /*Calendar types*/
- #define calendar_JULIAN 1
- #define calendar_GREGORIAN 2
- #define calendar_HEBREW 3
- #define calendar_ISLAMIC 4
- #define calendar_REVOLUTION10 5
- #define calendar_REVOLUTION7 6
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* ------------------------------------------------------------------------
- * Function: calendar_jday_to_date()
- *
- * Description: Convert Julian Day number to date
- *
- * Input: type - value of R0 on entry
- * jday - value of R1 on entry
- *
- * Output: year - value of R2 on exit
- * month - value of R3 on exit
- * day - value of R4 on exit
- *
- * Other notes: Calls SWI 0x55F80.
- */
-
- extern os_error *xcalendar_jday_to_date (int type,
- int jday,
- int *year,
- int *month,
- int *day);
- extern void calendar_jday_to_date (int type,
- int jday,
- int *year,
- int *month,
- int *day);
-
- /* ------------------------------------------------------------------------
- * Function: calendar_date_to_jday()
- *
- * Description: Convert date to Julian Day number
- *
- * Input: type - value of R0 on entry
- * year - value of R2 on entry
- * month - value of R3 on entry
- * day - value of R4 on entry
- *
- * Output: jday - value of R1 on exit (X version only)
- *
- * Returns: R1 (non-X version only)
- *
- * Other notes: Calls SWI 0x55F81.
- */
-
- extern os_error *xcalendar_date_to_jday (int type,
- int year,
- int month,
- int day,
- int *jday);
- extern int calendar_date_to_jday (int type,
- int year,
- int month,
- int day);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-