1989-05-16 13:13:53 +00:00
|
|
|
/*
|
|
|
|
* time.h - date and time
|
|
|
|
*/
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#ifndef _TIME_H
|
1989-12-18 14:00:32 +00:00
|
|
|
#define _TIME_H
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#include <stddef.h>
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#define CLOCKS_PER_SEC 1000000
|
1989-05-16 13:13:53 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
typedef unsigned long time_t; /* type returned by TOD clock */
|
|
|
|
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 */
|
|
|
|
};
|
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
extern clock_t clock(void);
|
|
|
|
extern double difftime(time_t _time1, time_t _time0);
|
|
|
|
extern time_t mktime(struct tm *_timeptr);
|
|
|
|
extern time_t time(time_t *_timeptr);
|
|
|
|
extern char* asctime(const struct tm *_timeptr);
|
|
|
|
extern char* ctime(const time_t *_timer);
|
|
|
|
extern struct tm* gmtime(const time_t *_timer);
|
|
|
|
extern struct tm* localtime(const time_t *_timer);
|
|
|
|
extern size_t strftime(char *_s, size_t _maxsize,
|
1990-01-29 10:09:00 +00:00
|
|
|
const char *_format,
|
|
|
|
const struct tm *_timeptr);
|
1989-09-29 15:46:33 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
/* Extensions not in the standard */
|
1989-12-18 14:00:32 +00:00
|
|
|
|
2007-04-24 19:42:24 +00:00
|
|
|
#define ctime(t) asctime(localtime(t))
|
1989-12-18 14:00:32 +00:00
|
|
|
|
|
|
|
#endif
|