home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 5 / RISCWORLD_VOL5.iso / SOFTWARE / Issue3 / FAMILY / Calendar / CalLib / h / calendar
Encoding:
Text File  |  2003-09-23  |  2.7 KB  |  103 lines

  1. #ifndef calendar_H
  2. #define calendar_H
  3.  
  4. /*
  5.  * C header file for Calendar
  6.  * written by DefMod (Sep 18 2003) on Tue Sep 23 05:23:51 2003
  7.  * © Erik Groenhuis
  8.  */
  9.  
  10. /**********************************
  11.  * SWI names and SWI reason codes *
  12.  **********************************/
  13. #undef  Calendar_JDayToDate
  14. #define Calendar_JDayToDate                     0x55F80
  15. #undef  XCalendar_JDayToDate
  16. #define XCalendar_JDayToDate                    0x75F80
  17. #undef  Calendar_DateToJDay
  18. #define Calendar_DateToJDay                     0x55F81
  19. #undef  XCalendar_DateToJDay
  20. #define XCalendar_DateToJDay                    0x75F81
  21.  
  22. /************************
  23.  * Constant definitions *
  24.  ************************/
  25. #define error_CALENDAR                          0x55F80
  26. #define error_CALENDAR_TYPE                     0x55F81
  27. #define error_CALENDAR_NIY                      0x55F82
  28. #define error_CALENDAR_SWI                      0x55F83
  29.       /*Calendar types*/
  30. #define calendar_JULIAN                         1
  31. #define calendar_GREGORIAN                      2
  32. #define calendar_HEBREW                         3
  33. #define calendar_ISLAMIC                        4
  34. #define calendar_REVOLUTION10                   5
  35. #define calendar_REVOLUTION7                    6
  36.  
  37. /*************************
  38.  * Function declarations *
  39.  *************************/
  40.  
  41. #ifdef __cplusplus
  42.    extern "C" {
  43. #endif
  44.  
  45. /* ------------------------------------------------------------------------
  46.  * Function:      calendar_jday_to_date()
  47.  *
  48.  * Description:   Convert Julian Day number to date
  49.  *
  50.  * Input:         type - value of R0 on entry
  51.  *                jday - value of R1 on entry
  52.  *
  53.  * Output:        year - value of R2 on exit
  54.  *                month - value of R3 on exit
  55.  *                day - value of R4 on exit
  56.  *
  57.  * Other notes:   Calls SWI 0x55F80.
  58.  */
  59.  
  60. extern os_error *xcalendar_jday_to_date (int type,
  61.       int jday,
  62.       int *year,
  63.       int *month,
  64.       int *day);
  65. extern void calendar_jday_to_date (int type,
  66.       int jday,
  67.       int *year,
  68.       int *month,
  69.       int *day);
  70.  
  71. /* ------------------------------------------------------------------------
  72.  * Function:      calendar_date_to_jday()
  73.  *
  74.  * Description:   Convert date to Julian Day number
  75.  *
  76.  * Input:         type - value of R0 on entry
  77.  *                year - value of R2 on entry
  78.  *                month - value of R3 on entry
  79.  *                day - value of R4 on entry
  80.  *
  81.  * Output:        jday - value of R1 on exit (X version only)
  82.  *
  83.  * Returns:       R1 (non-X version only)
  84.  *
  85.  * Other notes:   Calls SWI 0x55F81.
  86.  */
  87.  
  88. extern os_error *xcalendar_date_to_jday (int type,
  89.       int year,
  90.       int month,
  91.       int day,
  92.       int *jday);
  93. extern int calendar_date_to_jday (int type,
  94.       int year,
  95.       int month,
  96.       int day);
  97.  
  98. #ifdef __cplusplus
  99.    }
  100. #endif
  101.  
  102. #endif
  103.