home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xdlibs / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-28  |  1.5 KB  |  58 lines

  1. /*
  2.  * @(#)time.h, xdLibs, SozobonX
  3.  *
  4.  * Date/Time related definitions
  5.  */
  6.  
  7. #ifndef    _TIME_H
  8. #define    _TIME_H
  9.  
  10. #include <types.h>
  11.  
  12. /* 
  13.  * TYPE time_t, defined in types.h is used for rawtime values.
  14.  * These are not seconds since 1970, but a encoded time value
  15.  * with DATE in highword and TIME in lowword for time comparisons
  16.  */
  17.  
  18. #define    CLK_TCK        ((clock_t) 200)        /* clock ticks per second */
  19.  
  20. struct tm
  21.     {
  22.     int    tm_sec;        /* seconds (0..61) */
  23.     int    tm_min;        /* minutes (0..59) */
  24.     int    tm_hour;    /* hours (0..23) */
  25.     int    tm_mday;    /* day of month (1..31) */
  26.     int    tm_mon;        /* month (0..11) */
  27.     int    tm_year;    /* year - 1900 */
  28.     int    tm_wday;    /* day of week (0=Sun..6=Sat) */
  29.     int    tm_yday;    /* day of year (0..365) */
  30.     int    tm_isdst;    /* daylight saving? (TRUE/FALSE/-1=unknown) */
  31. };
  32.  
  33. extern    time_t        time(time_t *rawtime);
  34.  
  35. extern    char        *asctime(struct tm *time);
  36. extern    char        *ctime(time_t *rawtime);
  37.  
  38. extern    struct tm    *gmtime(void);    /* this time always returns NULL */
  39.  
  40. extern    struct tm    *localtime(time_t *rawtime);
  41. extern    time_t        mktime(struct tm *time);
  42. extern    long        julian_date(struct tm *time);
  43.  
  44. /* missing */
  45. /* extern    double        difftime(time_t time1, time_t time2);    */
  46. /* extern    int        strftime(char *s, size_t maxsize,
  47.                     const char *format, const struct tm *timeptr);    */
  48.  
  49. extern    int        stime(time_t *rawtime);
  50. extern    int        utime(char *pathname, time_t *rawtime);
  51.  
  52. extern    clock_t        clock(void);
  53. extern    clock_t        start_timer(clock_t *);
  54. extern    clock_t        time_since(clock_t *);
  55.  
  56. #endif     /* _TIME_H    */
  57.  
  58.