1 | /* time.h (emx+gcc) */
|
---|
2 |
|
---|
3 | #ifndef _EMXTIME_H
|
---|
4 | #define _EMXTIME_H
|
---|
5 |
|
---|
6 | #ifndef CRTWRAP
|
---|
7 | #define CRTWRAP(a) emx_##a
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | #if defined (__cplusplus)
|
---|
11 | extern "C" {
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | #if !defined (_SIZE_T)
|
---|
15 | #define _SIZE_T
|
---|
16 | typedef unsigned long size_t;
|
---|
17 | #endif
|
---|
18 |
|
---|
19 | #if !defined (NULL)
|
---|
20 | #if defined (__cplusplus)
|
---|
21 | #define NULL 0
|
---|
22 | #else
|
---|
23 | #define NULL ((void *)0)
|
---|
24 | #endif
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | #if !defined (_TIME_T)
|
---|
28 | #define _TIME_T
|
---|
29 | #ifdef _SQUID_TIME_
|
---|
30 | typedef signed long time_t;
|
---|
31 | #else
|
---|
32 | typedef unsigned long time_t;
|
---|
33 | #endif
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | #if !defined (_CLOCK_T)
|
---|
37 | #define _CLOCK_T
|
---|
38 | typedef long clock_t;
|
---|
39 | #endif
|
---|
40 |
|
---|
41 | #if !defined (_TM)
|
---|
42 | #define _TM
|
---|
43 | struct tm /* cf. <emx/thread.h> */
|
---|
44 | {
|
---|
45 | int tm_sec; /* 0..59 */
|
---|
46 | int tm_min; /* 0..59 */
|
---|
47 | int tm_hour; /* 0..23 */
|
---|
48 | int tm_mday; /* 1..31 */
|
---|
49 | int tm_mon; /* 0..11 */
|
---|
50 | int tm_year; /* 0(:=1900).. */
|
---|
51 | int tm_wday; /* 0..6 */
|
---|
52 | int tm_yday; /* 0..365 */
|
---|
53 | int tm_isdst; /* 0 */
|
---|
54 | };
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | #if !defined (CLOCKS_PER_SEC)
|
---|
58 | #define CLOCKS_PER_SEC 100
|
---|
59 | #endif
|
---|
60 |
|
---|
61 | #define asctime CRTWRAP(asctime)
|
---|
62 | #define ctime CRTWRAP(ctime)
|
---|
63 | #define clock CRTWRAP(clock)
|
---|
64 | #define difftime CRTWRAP(difftime)
|
---|
65 | #define gmtime CRTWRAP(gmtime)
|
---|
66 | #define localtime CRTWRAP(localtime)
|
---|
67 | #define mktime CRTWRAP(mktime)
|
---|
68 | #define strftime CRTWRAP(strftime)
|
---|
69 | #define time CRTWRAP(time)
|
---|
70 |
|
---|
71 | char *asctime (__const__ struct tm *);
|
---|
72 | char *ctime (__const__ time_t *);
|
---|
73 | clock_t clock (void);
|
---|
74 | double difftime (time_t, time_t);
|
---|
75 | struct tm *gmtime (__const__ time_t *);
|
---|
76 | struct tm *localtime (__const__ time_t *);
|
---|
77 | time_t mktime (struct tm *);
|
---|
78 | size_t strftime (char *, size_t, __const__ char *, __const__ struct tm *);
|
---|
79 | time_t time (time_t *);
|
---|
80 |
|
---|
81 |
|
---|
82 | #if !defined (__STRICT_ANSI__)
|
---|
83 |
|
---|
84 | /* POSIX.1 */
|
---|
85 | #define tzset CRTWRAP(tzset)
|
---|
86 |
|
---|
87 | void tzset (void);
|
---|
88 |
|
---|
89 | #endif
|
---|
90 |
|
---|
91 |
|
---|
92 | #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
|
---|
93 |
|
---|
94 | #if !defined (CLK_TCK)
|
---|
95 | #define CLK_TCK 100
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | #define daylight CRTWRAP(daylight)
|
---|
99 | #define timezone CRTWRAP(timezone)
|
---|
100 | #define tzname CRTWRAP(tzname)
|
---|
101 | #define strptime CRTWRAP(strptime)
|
---|
102 |
|
---|
103 | extern int daylight;
|
---|
104 | extern long timezone;
|
---|
105 | extern char *tzname[2];
|
---|
106 |
|
---|
107 | char *strptime (__const__ char *, __const__ char *, struct tm *);
|
---|
108 |
|
---|
109 | #endif
|
---|
110 |
|
---|
111 |
|
---|
112 | #if (!defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)) \
|
---|
113 | || defined (_WITH_UNDERSCORE)
|
---|
114 |
|
---|
115 | #define _daylight CRTWRAP(_daylight)
|
---|
116 | #define _timezone CRTWRAP(_timezone)
|
---|
117 | #define _tzname CRTWRAP(_tzname)
|
---|
118 | #define _strptime CRTWRAP(_strptime)
|
---|
119 | #define _tzset CRTWRAP(_tzset)
|
---|
120 |
|
---|
121 | extern int _daylight;
|
---|
122 | extern long _timezone;
|
---|
123 | extern char *_tzname[2];
|
---|
124 |
|
---|
125 | char *_strptime (__const__ char *, __const__ char *, struct tm *);
|
---|
126 | void _tzset (void);
|
---|
127 |
|
---|
128 | #endif
|
---|
129 |
|
---|
130 |
|
---|
131 | #if defined (__cplusplus)
|
---|
132 | }
|
---|
133 | #endif
|
---|
134 |
|
---|
135 | #endif /* not _TIME_H */
|
---|