home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 13 / DJCRX201.ZIP / include / time.h < prev    next >
C/C++ Source or Header  |  1995-08-27  |  2KB  |  98 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_time_h_
  3. #define __dj_include_time_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. /* 65536(tics/hour) / 3600(sec/hour) * 5(scale) = 91.02
  12.    The 5 is to make it a whole number (18.2*5=91) so that
  13.    floating point ops aren't required to use it. */
  14. #define CLOCKS_PER_SEC    91
  15.  
  16. #include <sys/djtypes.h>
  17. #define NULL 0
  18. __DJ_clock_t
  19. #undef __DJ_clock_t
  20. #define __DJ_clock_t
  21. __DJ_size_t
  22. #undef __DJ_size_t
  23. #define __DJ_size_t
  24. __DJ_time_t
  25. #undef __DJ_time_t
  26. #define __DJ_time_t
  27.  
  28. struct tm {
  29.   int tm_sec;
  30.   int tm_min;
  31.   int tm_hour;
  32.   int tm_mday;
  33.   int tm_mon;
  34.   int tm_year;
  35.   int tm_wday;
  36.   int tm_yday;
  37.   int tm_isdst;
  38.   char *__tm_zone;
  39.   int __tm_gmtoff;
  40. };
  41.  
  42. char *        asctime(const struct tm *_tptr);
  43. clock_t        clock(void);
  44. char *        ctime(const time_t *_cal);
  45. double        difftime(time_t _t1, time_t _t0);
  46. struct tm *    gmtime(const time_t *_tod);
  47. struct tm *    localtime(const time_t *_tod);
  48. time_t        mktime(struct tm *_tptr);
  49. size_t        strftime(char *_s, size_t _n, const char *_format, const struct tm *_tptr);
  50. time_t        time(time_t *_tod);
  51.  
  52. #ifndef __STRICT_ANSI__
  53.  
  54. #define CLK_TCK    CLOCKS_PER_SEC
  55.  
  56. extern char *tzname[2];
  57.  
  58. void    tzset(void);
  59.  
  60. #ifndef _POSIX_SOURCE
  61.  
  62. #define tm_zone __tm_zone
  63. #define tm_gmtoff __tm_gmtoff
  64.  
  65. struct timeval {
  66.   time_t tv_sec;
  67.   long tv_usec;
  68. };
  69.  
  70. struct timezone {
  71.   int tz_minuteswest;
  72.   int tz_dsttime;
  73. };
  74.  
  75. #include <sys/types.h>
  76.  
  77. typedef long long uclock_t;
  78. #define UCLOCKS_PER_SEC 1193180
  79.  
  80. int        gettimeofday(struct timeval *_tp, struct timezone *_tzp);
  81. unsigned long    rawclock(void);
  82. int        select(int _nfds, fd_set *_readfds, fd_set *_writefds, fd_set *_exceptfds, struct timeval *_timeout);
  83. int        settimeofday(struct timeval *_tp, ...);
  84. uclock_t    uclock(void);
  85.  
  86. #endif /* !_POSIX_SOURCE */
  87. #endif /* !__STRICT_ANSI__ */
  88. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  89.  
  90. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  91. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  92.  
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96.  
  97. #endif /* !__dj_include_time_h_ */
  98.