Commit | Line | Data |
e4451f11 |
1 | #ifndef TIME_H |
2 | #define TIME_H 1 |
3 | |
4 | #include <celib_defs.h> |
5 | #include <sys/types.h> |
6 | |
7 | #ifdef __cplusplus |
8 | extern "C" { |
9 | #endif |
10 | |
11 | extern long _timezone; |
12 | extern int _daylight; |
13 | extern long _dstbias; |
14 | extern char *_tzname[]; |
15 | extern const char __dnames[]; |
16 | extern const char __mnames[]; |
17 | extern int _days[]; |
18 | extern int _lpdays[]; |
19 | |
20 | #define _DAY_SEC (24L * 60L * 60L) /* secs in a day */ |
21 | #define _YEAR_SEC (365L * _DAY_SEC) /* secs in a year */ |
22 | #define _FOUR_YEAR_SEC (1461L * _DAY_SEC) /* secs in a 4 year interval */ |
23 | #define _DEC_SEC 315532800L /* secs in 1970-1979 */ |
24 | #define _BASE_YEAR 70L /* 1970 is the base year */ |
25 | #define _BASE_DOW 4 /* 01-01-70 was a Thursday */ |
26 | #define _LEAP_YEAR_ADJUST 17L /* Leap years 1900 - 1970 */ |
27 | #define _MAX_YEAR 138L /* 2038 is the max year */ |
28 | |
29 | struct tm { |
30 | int tm_sec; /* seconds after the minute - [0,59] */ |
31 | int tm_min; /* minutes after the hour - [0,59] */ |
32 | int tm_hour; /* hours since midnight - [0,23] */ |
33 | int tm_mday; /* day of the month - [1,31] */ |
34 | int tm_mon; /* months since January - [0,11] */ |
35 | int tm_year; /* years since 1900 */ |
36 | int tm_wday; /* days since Sunday - [0,6] */ |
37 | int tm_yday; /* days since January 1 - [0,365] */ |
38 | int tm_isdst; /* daylight savings time flag */ |
39 | }; |
40 | |
41 | XCE_EXPORT struct tm * xcegmtime(const time_t *timp); |
42 | XCE_EXPORT struct tm *xcelocaltime (const time_t *ptime); |
43 | XCE_EXPORT char *xceasctime (const struct tm *tb); |
44 | XCE_EXPORT int xceutime (const char *fname, struct _utimbuf *times); |
45 | XCE_EXPORT int xcefutime (int fh, struct _utimbuf *times); |
46 | XCE_EXPORT void xceftime (struct _timeb *tp); |
47 | XCE_EXPORT void xcegettimeofday (struct timeval *tv, struct timezone *tz); |
48 | XCE_EXPORT char *xcectime(const time_t *timp); |
49 | XCE_EXPORT void xceftime (struct _timeb *tp); |
50 | XCE_EXPORT time_t xcemktime (struct tm *tb); |
51 | XCE_EXPORT time_t xcetime (time_t *timeptr); |
52 | XCE_EXPORT void _xcetzset(void); |
53 | |
54 | #ifdef __cplusplus |
55 | }; |
56 | #endif |
57 | |
58 | #endif |