xref: /original-bsd/include/time.h (revision 6ab384a1)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)time.h	5.7 (Berkeley) 08/27/90
8  */
9 
10 #include <machine/machtypes.h>
11 
12 #ifndef	NULL
13 #define	NULL	0
14 #endif
15 
16 #ifdef	_CLOCK_T_
17 typedef	_CLOCK_T_	clock_t;
18 #undef	_CLOCK_T_
19 #endif
20 
21 #ifdef	_TIME_T_
22 typedef	_TIME_T_	time_t;
23 #undef	_TIME_T_
24 #endif
25 
26 #ifdef	_SIZE_T_
27 typedef	_SIZE_T_	size_t;
28 #undef	_SIZE_T_
29 #endif
30 
31 struct tm {
32 	int	tm_sec;		/* seconds after the minute [0-60] */
33 	int	tm_min;		/* minutes after the hour [0-59] */
34 	int	tm_hour;	/* hours since midnight [0-23] */
35 	int	tm_mday;	/* day of the month [1-31] */
36 	int	tm_mon;		/* months since January [0-11] */
37 	int	tm_year;	/* years since 1900 */
38 	int	tm_wday;	/* days since Sunday [0-6] */
39 	int	tm_yday;	/* days since January 1 [0-365] */
40 	int	tm_isdst;	/* Daylight Savings Time flag */
41 	long	tm_gmtoff;	/* offset from CUT in seconds */
42 	char	*tm_zone;	/* timezone abbreviation */
43 };
44 
45 #if __STDC__ || c_plusplus
46 extern struct tm *gmtime(const time_t *);
47 extern struct tm *localtime(const time_t *);
48 extern time_t mktime(const struct tm *);
49 extern time_t time(time_t *);
50 extern clock_t clock(void);
51 extern double difftime(const time_t, const time_t);
52 extern char *asctime(const struct tm *);
53 extern char *ctime(const time_t *);
54 extern char *timezone(int , int);
55 extern void tzset(void);
56 extern void tzsetwall(void);
57 #else
58 extern struct tm *gmtime();
59 extern struct tm *localtime();
60 extern clock_t clock();
61 extern time_t mktime();
62 extern time_t time();
63 extern double difftime();
64 extern char *asctime();
65 extern char *ctime();
66 extern char *timezone();
67 extern void tzset();
68 extern void tzsetwall();
69 #endif
70