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