xref: /csrg-svn/include/time.h (revision 65762)
130583Sbostic /*
261070Sbostic  * Copyright (c) 1989, 1993
361070Sbostic  *	The Regents of the University of California.  All rights reserved.
4*65762Sbostic  * (c) UNIX System Laboratories, Inc.
5*65762Sbostic  * All or some portions of this file are derived from material licensed
6*65762Sbostic  * to the University of California by American Telephone and Telegraph
7*65762Sbostic  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8*65762Sbostic  * the permission of UNIX System Laboratories, Inc.
930583Sbostic  *
1042617Sbostic  * %sccs.include.redist.c%
1137102Sbostic  *
12*65762Sbostic  *	@(#)time.h	8.3 (Berkeley) 01/21/94
1330583Sbostic  */
1418330Smckusick 
1546281Sbostic #ifndef _TIME_H_
1646281Sbostic #define	_TIME_H_
1746281Sbostic 
1847181Sbostic #include <machine/ansi.h>
1940486Smckusick 
2043492Sbostic #ifndef	NULL
2143492Sbostic #define	NULL	0
2243492Sbostic #endif
2343492Sbostic 
2454254Sbostic #ifdef	_BSD_CLOCK_T_
2554254Sbostic typedef	_BSD_CLOCK_T_	clock_t;
2654254Sbostic #undef	_BSD_CLOCK_T_
2743492Sbostic #endif
2843492Sbostic 
2954254Sbostic #ifdef	_BSD_TIME_T_
3054254Sbostic typedef	_BSD_TIME_T_	time_t;
3154254Sbostic #undef	_BSD_TIME_T_
3243492Sbostic #endif
3343492Sbostic 
3454254Sbostic #ifdef	_BSD_SIZE_T_
3554254Sbostic typedef	_BSD_SIZE_T_	size_t;
3654254Sbostic #undef	_BSD_SIZE_T_
3743492Sbostic #endif
3843492Sbostic 
3918330Smckusick struct tm {
4037102Sbostic 	int	tm_sec;		/* seconds after the minute [0-60] */
4137102Sbostic 	int	tm_min;		/* minutes after the hour [0-59] */
4237102Sbostic 	int	tm_hour;	/* hours since midnight [0-23] */
4337102Sbostic 	int	tm_mday;	/* day of the month [1-31] */
4437102Sbostic 	int	tm_mon;		/* months since January [0-11] */
4537102Sbostic 	int	tm_year;	/* years since 1900 */
4637102Sbostic 	int	tm_wday;	/* days since Sunday [0-6] */
4737102Sbostic 	int	tm_yday;	/* days since January 1 [0-365] */
4837102Sbostic 	int	tm_isdst;	/* Daylight Savings Time flag */
4937102Sbostic 	long	tm_gmtoff;	/* offset from CUT in seconds */
5037102Sbostic 	char	*tm_zone;	/* timezone abbreviation */
5118330Smckusick };
5218330Smckusick 
5365398Sbostic #include <machine/limits.h>	/* Include file containing CLK_TCK. */
5465398Sbostic 
5546281Sbostic #include <sys/cdefs.h>
5646281Sbostic 
5746281Sbostic __BEGIN_DECLS
5846515Sdonn char *asctime __P((const struct tm *));
5946515Sdonn clock_t clock __P((void));
6046515Sdonn char *ctime __P((const time_t *));
6146560Sdonn double difftime __P((time_t, time_t));
6246281Sbostic struct tm *gmtime __P((const time_t *));
6346281Sbostic struct tm *localtime __P((const time_t *));
6446560Sdonn time_t mktime __P((struct tm *));
6546515Sdonn size_t strftime __P((char *, size_t, const char *, const struct tm *));
6646281Sbostic time_t time __P((time_t *));
6746515Sdonn 
6846515Sdonn #ifndef _ANSI_SOURCE
6946281Sbostic void tzset __P((void));
7046515Sdonn #endif /* not ANSI */
7146515Sdonn 
7246515Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
7346515Sdonn char *timezone __P((int, int));
7446281Sbostic void tzsetwall __P((void));
7546515Sdonn #endif /* neither ANSI nor POSIX */
7646281Sbostic __END_DECLS
7746281Sbostic 
7846281Sbostic #endif /* !_TIME_H_ */
79