ack/lang/cem/libcc.ansi/headers/time.h

69 lines
1.7 KiB
C
Raw Normal View History

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)
#define CLOCKS_PER_SEC 1000000 /* ticks per second */
1989-05-16 13:13:53 +00:00
#else
1989-09-29 15:46:33 +00:00
#define CLOCKS_PER_SEC 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
#if _EM_WSIZE == _EM_PSIZE
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
#else
typedef unsigned long size_t; /* type returned by sizeof */
#endif
#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] */
int tm_hour; /* hours since midnight - [0, 28] */
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);
1989-09-29 15:46:33 +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);
#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 */