Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 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 |
||
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 | char * asctime(const struct tm *_tptr); |
||
49 | clock_t clock(void); |
||
50 | char * ctime(const time_t *_cal); |
||
51 | double difftime(time_t _t1, time_t _t0); |
||
52 | struct tm * gmtime(const time_t *_tod); |
||
53 | struct tm * localtime(const time_t *_tod); |
||
54 | time_t mktime(struct tm *_tptr); |
||
55 | size_t strftime(char *_s, size_t _n, const char *_format, const struct tm *_tptr); |
||
56 | time_t time(time_t *_tod); |
||
57 | |||
58 | #ifndef __STRICT_ANSI__ |
||
59 | |||
60 | #define CLK_TCK CLOCKS_PER_SEC |
||
61 | |||
62 | extern char *tzname[2]; |
||
63 | |||
64 | void tzset(void); |
||
65 | |||
66 | #ifndef _POSIX_SOURCE |
||
67 | |||
68 | #define tm_zone __tm_zone |
||
69 | #define tm_gmtoff __tm_gmtoff |
||
70 | |||
71 | struct timeval { |
||
72 | time_t tv_sec; |
||
73 | long tv_usec; |
||
74 | }; |
||
75 | |||
76 | struct timezone { |
||
77 | int tz_minuteswest; |
||
78 | int tz_dsttime; |
||
79 | }; |
||
80 | |||
81 | #include |
||
82 | |||
83 | typedef long long uclock_t; |
||
84 | #define UCLOCKS_PER_SEC 1193180 |
||
85 | |||
86 | int gettimeofday(struct timeval *_tp, struct timezone *_tzp); |
||
87 | unsigned long rawclock(void); |
||
88 | int select(int _nfds, fd_set *_readfds, fd_set *_writefds, fd_set *_exceptfds, struct timeval *_timeout); |
||
89 | int settimeofday(struct timeval *_tp, ...); |
||
90 | void tzsetwall(void); |
||
91 | uclock_t uclock(void); |
||
92 | |||
93 | #endif /* !_POSIX_SOURCE */ |
||
94 | #endif /* !__STRICT_ANSI__ */ |
||
95 | #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |
||
96 | |||
97 | #ifndef __dj_ENFORCE_FUNCTION_CALLS |
||
98 | #endif /* !__dj_ENFORCE_FUNCTION_CALLS */ |
||
99 | |||
100 | #ifdef __cplusplus |
||
101 | } |
||
102 | #endif |
||
103 | |||
104 | #endif /* !__dj_include_time_h_ */ |