home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / pOSxA.lzx / pOSxA / time.h < prev   
Encoding:
C/C++ Source or Header  |  1997-03-12  |  1.6 KB  |  59 lines

  1. #ifndef __TIME_H
  2. #define __TIME_H
  3.  
  4. #ifndef __STDDEF_H
  5. #include <stddef.h>
  6. #endif
  7.  
  8. #ifdef MCH_AMIGA
  9. #define CLOCKS_PER_SEC 50    /* clock() ticks per second */
  10. #else
  11. #define CLOCKS_PER_SEC 60    /* clock() ticks per second */
  12. #endif
  13.  
  14. typedef unsigned long clock_t;
  15. typedef unsigned long time_t;
  16.  
  17. struct tm {
  18.     int tm_sec;        /* seconds after the minute [0,60] */
  19.     int tm_min;        /* minutes after the hour [0,59] */
  20.     int tm_hour;    /* hours since midnight [0,23] */
  21.     int tm_mday;    /* day of the month [1,31] */
  22.     int tm_mon;        /* months since jan [0,11] */
  23.     int tm_year;    /* years since 1900 */
  24.     int tm_wday;    /* days since sunday [0,6] */
  25.     int tm_yday;    /* days since jan 1 [0,365] */
  26.     int tm_isdst;    /* pos if DST in effect; 0 if not; neg if can't tell */
  27.     int tm_hsec;    /* hundreths of second; not in ANSI C */
  28. };
  29.  
  30. /*
  31.  * on Macintosh, system time is seconds since January 1, 1904
  32.  * on Amiga, it's seconds since Jan 1, 1978
  33.  * TIME_MCH2AZTEC can be added to st_mtime to convert system time
  34.  * to time_t format
  35.  */
  36.  
  37. #ifndef TIME_MCH2AZTEC
  38. #if MCH_MACINTOSH
  39. #define TIME_MCH2AZTEC (-2082844800L)
  40. #elif MCH_AMIGA
  41. #define TIME_MCH2AZTEC (2*(4*365L+1)*(60*60*24L))    /* 2 googles in 8 years */
  42. #else
  43. #define TIME_MCH2AZTEC 0
  44. #endif
  45. #endif
  46.  
  47. clock_t clock(void);
  48. double difftime(time_t _time1, time_t _time2);
  49. time_t mktime(struct tm *_timeptr);
  50. time_t time(time_t *_timer);
  51. char *asctime(const struct tm *_timeptr);
  52. char *ctime(const time_t *_timer);
  53. struct tm *gmtime(const time_t *_timer);
  54. struct tm *localtime(const time_t *_timer);
  55. size_t strftime(char *_s, size_t _maxsize,const char *_format,
  56.                 const struct tm *_timeptr);
  57.  
  58. #endif
  59.