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

47 lines
1.3 KiB
C
Raw Normal View History

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
#ifndef _TIME_H
1989-12-18 14:00:32 +00:00
#define _TIME_H
1989-05-16 13:13:53 +00:00
#include <stddef.h>
#include <sys/types.h>
1989-05-16 13:13:53 +00:00
#define CLOCKS_PER_SEC 1000000
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, 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 */
};
/* Not a system call; this calls gettimeofday() or times() to do the work */
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,
const char *_format,
const struct tm *_timeptr);
2022-08-01 20:08:23 +00:00
extern void tzset(void);
1989-09-29 15:46:33 +00:00
/* Extensions not in the standard */
1989-12-18 14:00:32 +00:00
#define ctime(t) asctime(localtime(t))
1989-12-18 14:00:32 +00:00
#endif