home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / pdksh-4.9-src.tgz / tar.out / contrib / pdksh / std / stdc / time.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  1KB  |  48 lines

  1. /* time, time/date conversion */
  2. /* $Id: time.h,v 1.3 93/05/05 21:19:00 sjg Exp $ */
  3.  
  4. #if ! _TIME_H
  5. #define    _TIME_H 1
  6.  
  7. #include <stddef.h>        /* need size_t */
  8.  
  9. #ifndef HAVE_SYS_STDTYPES
  10. #ifndef _TIME_T
  11. typedef long time_t;
  12. #endif
  13. typedef long clock_t;        /* seconds/CLK_TCK */
  14. #endif
  15.  
  16. #if _V7 || _SYSV
  17. #define    CLK_TCK    60        /* todo: get from <sys/param.h> */
  18. #endif
  19.  
  20. #if _BSD
  21. #define    CLK_TCK    100
  22. #endif
  23.  
  24. #if _ST
  25. #define    CLK_TCK    200        /* ST system clock */
  26. #endif
  27.  
  28. struct tm {
  29.     int    tm_sec, tm_min, tm_hour;
  30.     int    tm_mday, tm_mon, tm_year, tm_wday, tm_yday;
  31.     int    tm_isdst;
  32.     long    tm_gmtoff;    /* BSD */
  33.     char   *tm_zone;    /* BSD */
  34. };
  35.  
  36. clock_t    clock ARGS((void));
  37. time_t    time ARGS((time_t *tp));
  38. #define    difftime(t1, t2)    (double)((t2)-(t1))
  39. time_t    mktime ARGS((struct tm *tmp));
  40. char   *asctime ARGS((const struct tm *tmp));
  41. char   *ctime ARGS((const time_t *tp));
  42. struct tm *gmtime ARGS((const time_t *tp));
  43. struct tm *localtime ARGS((const time_t *tp));
  44. size_t    strftime ARGS((char *buf, size_t len, const char *fmt, const struct tm *tmp));
  45.  
  46. #endif
  47.  
  48.