home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / mntinc16 / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-29  |  2.1 KB  |  82 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. #define CLOCKS_PER_SEC  ((clock_t) 200)           /* clock ticks per second */
  14. #define CLK_TCK         CLOCKS_PER_SEC            /* old name for this */
  15.  
  16. #ifndef NULL
  17. #define NULL __NULL
  18. #endif
  19.  
  20. #ifndef _TIME_T
  21. #define _TIME_T long
  22. typedef _TIME_T        time_t;
  23. #endif
  24.  
  25. #ifndef _SIZE_T
  26. #define _SIZE_T __SIZE_TYPEDEF__
  27. typedef _SIZE_T        size_t;
  28. #endif
  29.  
  30. typedef unsigned long    clock_t;
  31.  
  32. struct tm
  33. {
  34.     int    tm_sec;        /* seconds (0..59) */
  35.     int    tm_min;        /* minutes (0..59) */
  36.     int    tm_hour;    /* hours (0..23) */
  37.     int    tm_mday;    /* day of month (1..31) */
  38.     int    tm_mon;        /* month (0..11) */
  39.     int    tm_year;    /* year - 1900 */
  40.     int    tm_wday;    /* day of week (0=Sun..6=Sat) */
  41.     int    tm_yday;    /* day of year (0..365) */
  42.     int    tm_isdst;    /* daylight saving?  */
  43. };
  44.  
  45.  
  46. #ifndef __STRICT_ANSI__
  47. struct timeval {
  48.     long    tv_sec;        /* seconds */
  49.     long    tv_usec;    /* microseconds */
  50. };
  51.  
  52. struct timezone {
  53.     int    tz_minuteswest;    /* minues west of GMT */
  54.     int    tz_dsttime;    /* daylight savings time correction */
  55. };
  56. #endif
  57.  
  58. __EXTERN clock_t    clock     __PROTO((void));
  59. __EXTERN double        difftime __PROTO((time_t, time_t));
  60. __EXTERN time_t        mktime     __PROTO((const struct tm *));
  61. __EXTERN time_t        time     __PROTO((time_t *));
  62. __EXTERN char *     asctime     __PROTO((const struct tm *));
  63. __EXTERN char *        ctime     __PROTO((const time_t *));
  64. __EXTERN struct tm *    gmtime   __PROTO((const time_t *));
  65. __EXTERN struct tm *    localtime __PROTO((const time_t *));
  66. __EXTERN __SIZE_TYPEDEF__ strftime __PROTO((
  67.     char *s, size_t maxsize, const char *format, const struct tm *timeptr));
  68.  
  69. /* violation of ANSI standard, but POSIX wants it... sigh */
  70. __EXTERN void        tzset    __PROTO((void));
  71.  
  72. #ifndef __STRICT_ANSI__
  73. __EXTERN int    gettimeofday __PROTO((struct timeval *, struct timezone *));
  74. __EXTERN int    settimeofday __PROTO((struct timeval *, struct timezone *));
  75.  
  76. #define timercmp(tva, tvb, op) \
  77.     ((tva)->tv_sec op (tvb)->tv_sec || \
  78.      ((tva)->tv_sec == (tvb)->tv_sec && (tva)->tv_usec op (tvb)->tv_usec))
  79. #endif
  80.  
  81. #endif /* _TIME_H */
  82.