xref: /original-bsd/include/time.h (revision 37071c60)
1 /*
2  * Copyright (c) 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)time.h	8.2 (Berkeley) 01/04/94
8  */
9 
10 #ifndef _TIME_H_
11 #define	_TIME_H_
12 
13 #include <machine/ansi.h>
14 
15 #ifndef	NULL
16 #define	NULL	0
17 #endif
18 
19 #ifdef	_BSD_CLOCK_T_
20 typedef	_BSD_CLOCK_T_	clock_t;
21 #undef	_BSD_CLOCK_T_
22 #endif
23 
24 #ifdef	_BSD_TIME_T_
25 typedef	_BSD_TIME_T_	time_t;
26 #undef	_BSD_TIME_T_
27 #endif
28 
29 #ifdef	_BSD_SIZE_T_
30 typedef	_BSD_SIZE_T_	size_t;
31 #undef	_BSD_SIZE_T_
32 #endif
33 
34 struct tm {
35 	int	tm_sec;		/* seconds after the minute [0-60] */
36 	int	tm_min;		/* minutes after the hour [0-59] */
37 	int	tm_hour;	/* hours since midnight [0-23] */
38 	int	tm_mday;	/* day of the month [1-31] */
39 	int	tm_mon;		/* months since January [0-11] */
40 	int	tm_year;	/* years since 1900 */
41 	int	tm_wday;	/* days since Sunday [0-6] */
42 	int	tm_yday;	/* days since January 1 [0-365] */
43 	int	tm_isdst;	/* Daylight Savings Time flag */
44 	long	tm_gmtoff;	/* offset from CUT in seconds */
45 	char	*tm_zone;	/* timezone abbreviation */
46 };
47 
48 #include <machine/limits.h>	/* Include file containing CLK_TCK. */
49 
50 #include <sys/cdefs.h>
51 
52 __BEGIN_DECLS
53 char *asctime __P((const struct tm *));
54 clock_t clock __P((void));
55 char *ctime __P((const time_t *));
56 double difftime __P((time_t, time_t));
57 struct tm *gmtime __P((const time_t *));
58 struct tm *localtime __P((const time_t *));
59 time_t mktime __P((struct tm *));
60 size_t strftime __P((char *, size_t, const char *, const struct tm *));
61 time_t time __P((time_t *));
62 
63 #ifndef _ANSI_SOURCE
64 void tzset __P((void));
65 #endif /* not ANSI */
66 
67 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
68 char *timezone __P((int, int));
69 void tzsetwall __P((void));
70 #endif /* neither ANSI nor POSIX */
71 __END_DECLS
72 
73 #endif /* !_TIME_H_ */
74