Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

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