1989-05-16 13:13:53 +00:00
|
|
|
/*
|
|
|
|
* time.h - date and time
|
|
|
|
*/
|
|
|
|
/* $Header$ */
|
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#if !defined(_TIME_H)
|
|
|
|
#define _TIME_H
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#define NULL ((void *)0)
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1989-09-29 15:46:33 +00:00
|
|
|
#if defined(__BSD4_2)
|
1991-06-11 09:25:32 +00:00
|
|
|
#define CLK_TCK 1000000 /* ticks per second */
|
1989-05-16 13:13:53 +00:00
|
|
|
#else
|
1991-06-11 09:25:32 +00:00
|
|
|
#define CLK_TCK 60
|
1989-05-16 13:13:53 +00:00
|
|
|
#endif /* __BSD4_2 */
|
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#if !defined(_SIZE_T)
|
|
|
|
#define _SIZE_T
|
1989-05-16 13:13:53 +00:00
|
|
|
typedef unsigned int size_t; /* type returned by sizeof */
|
1989-12-18 14:00:32 +00:00
|
|
|
#endif /* _SIZE_T */
|
1989-05-16 13:13:53 +00:00
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#if !defined(_TIME_T)
|
|
|
|
#define _TIME_T
|
1989-09-29 15:46:33 +00:00
|
|
|
typedef unsigned long time_t; /* type returned by TOD clock */
|
1989-12-18 14:00:32 +00:00
|
|
|
#endif /* _TIME_T */
|
|
|
|
|
1989-09-29 15:46:33 +00:00
|
|
|
typedef unsigned long clock_t; /* type returned by real time clock */
|
1989-05-16 13:13:53 +00:00
|
|
|
|
|
|
|
struct tm {
|
|
|
|
int tm_sec; /* seconds after the minute - [0, 59] */
|
|
|
|
int tm_min; /* minutes after the hour - [0, 59] */
|
1990-01-04 11:33:10 +00:00
|
|
|
int tm_hour; /* hours since midnight - [0, 23] */
|
1989-05-16 13:13:53 +00:00
|
|
|
int tm_mday; /* day of the month - [1, 31] */
|
|
|
|
int tm_mon; /* months since January - [0, 11] */
|
|
|
|
int tm_year; /* years since 1900 */
|
|
|
|
int tm_wday; /* days since Sunday - [0, 6] */
|
|
|
|
int tm_yday; /* days since January 1 - [0, 365] */
|
|
|
|
int tm_isdst; /* Daylight Saving Time flag */
|
|
|
|
};
|
|
|
|
|
|
|
|
clock_t clock(void);
|
1990-01-29 10:09:00 +00:00
|
|
|
double difftime(time_t _time1, time_t _time0);
|
|
|
|
time_t mktime(struct tm *_timeptr);
|
|
|
|
time_t time(time_t *_timeptr);
|
|
|
|
char *asctime(const struct tm *_timeptr);
|
|
|
|
char *ctime(const time_t *_timer);
|
|
|
|
struct tm *gmtime(const time_t *_timer);
|
|
|
|
struct tm *localtime(const time_t *_timer);
|
|
|
|
size_t strftime(char *_s, size_t _maxsize,
|
|
|
|
const char *_format,
|
|
|
|
const struct tm *_timeptr);
|
1989-09-29 15:46:33 +00:00
|
|
|
|
|
|
|
#if defined(__USG) || defined(_POSIX_SOURCE)
|
1989-12-18 14:00:32 +00:00
|
|
|
|
1989-09-29 15:46:33 +00:00
|
|
|
void tzset(void);
|
1989-12-18 14:00:32 +00:00
|
|
|
|
|
|
|
#if defined(__USG)
|
|
|
|
extern long timezone;
|
|
|
|
extern int daylight;
|
|
|
|
extern char *tzname[2];
|
|
|
|
#endif
|
1989-09-29 15:46:33 +00:00
|
|
|
#endif /* __USG || _POSIX_SOURCE */
|
|
|
|
|
1989-12-18 14:00:32 +00:00
|
|
|
#endif /* _TIME_H */
|