home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntinc25.zoo / time.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  2KB  |  90 lines

  1. /*
  2.  *    TIME.H        Date/Time related definitions
  3.  *     ansi draft sec  4.12
  4.  */
  5.  
  6. #ifndef    _TIME_H
  7. #define    _TIME_H
  8.  
  9. #ifndef _COMPILER_H
  10. #include <compiler.h>
  11. #endif
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16.  
  17. #define CLOCKS_PER_SEC  ((clock_t) 200)           /* clock ticks per second */
  18. #define CLK_TCK         CLOCKS_PER_SEC            /* old name for this */
  19.  
  20. #ifndef NULL
  21. #define NULL __NULL
  22. #endif
  23.  
  24. #ifndef _TIME_T
  25. #define _TIME_T long
  26. typedef _TIME_T        time_t;
  27. #endif
  28.  
  29. #ifndef _SIZE_T
  30. #define _SIZE_T __SIZE_TYPEDEF__
  31. typedef _SIZE_T        size_t;
  32. #endif
  33.  
  34. typedef unsigned long    clock_t;
  35.  
  36. struct tm
  37. {
  38.     int    tm_sec;        /* seconds (0..59) */
  39.     int    tm_min;        /* minutes (0..59) */
  40.     int    tm_hour;    /* hours (0..23) */
  41.     int    tm_mday;    /* day of month (1..31) */
  42.     int    tm_mon;        /* month (0..11) */
  43.     int    tm_year;    /* year - 1900 */
  44.     int    tm_wday;    /* day of week (0=Sun..6=Sat) */
  45.     int    tm_yday;    /* day of year (0..365) */
  46.     int    tm_isdst;    /* daylight saving?  */
  47. };
  48.  
  49.  
  50. #ifndef __STRICT_ANSI__
  51. struct timeval {
  52.     long    tv_sec;        /* seconds */
  53.     long    tv_usec;    /* microseconds */
  54. };
  55.  
  56. struct timezone {
  57.     int    tz_minuteswest;    /* minues west of GMT */
  58.     int    tz_dsttime;    /* daylight savings time correction */
  59. };
  60. #endif
  61.  
  62. __EXTERN clock_t    clock     __PROTO((void));
  63. __EXTERN double        difftime __PROTO((time_t, time_t));
  64. __EXTERN time_t        mktime     __PROTO((const struct tm *));
  65. __EXTERN time_t        time     __PROTO((time_t *));
  66. __EXTERN char *     asctime     __PROTO((const struct tm *));
  67. __EXTERN char *        ctime     __PROTO((const time_t *));
  68. __EXTERN struct tm *    gmtime   __PROTO((const time_t *));
  69. __EXTERN struct tm *    localtime __PROTO((const time_t *));
  70. __EXTERN __SIZE_TYPEDEF__ strftime __PROTO((
  71.     char *s, size_t maxsize, const char *format, const struct tm *timeptr));
  72.  
  73. /* violation of ANSI standard, but POSIX wants it... sigh */
  74. __EXTERN void        tzset    __PROTO((void));
  75.  
  76. #ifndef __STRICT_ANSI__
  77. __EXTERN int    gettimeofday __PROTO((struct timeval *, struct timezone *));
  78. __EXTERN int    settimeofday __PROTO((struct timeval *, struct timezone *));
  79.  
  80. #define timercmp(tva, tvb, op) \
  81.     ((tva)->tv_sec op (tvb)->tv_sec || \
  82.      ((tva)->tv_sec == (tvb)->tv_sec && (tva)->tv_usec op (tvb)->tv_usec))
  83. #endif
  84.  
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88.  
  89. #endif /* _TIME_H */
  90.