#ifndef _TIME_H
#define _TIME_H

/*
 *			< t i m e . h>
 *
 *	This header file contains the definitions need by the time
 *	related routines.
 *
 *	AMENDMENT HISTORY
 *	~~~~~~~~~~~~~~~~~
 *	30 Aug 93	DJW   - Added entries for strftime(), difftime() and tzset().
 *					  - Added entries for internal library variables for
 *						routines based on Ralf Wenk's POSIX compatible set.
 *
 *	02 Jan 94	DJW   - Removed the #define that truncated the 'localtime'
 *						name to 8 characters.  Reported by Jim Gilmour
 *
 *	03 Sep 94	DJW   - Removed call to sys/times.h, and defined time_t in
 *						this file but protected incase sys/types.h already
 *						included previously.
 *					  - Added name hiding definitions for routines that are
 *						called internally within libraries.
 *
 *	13 Sep 94	DJW   - Changed parameter types for ctime() and time() to be
 *						'time_t *' instead of 'long *'.
 *						(Problem reported by David Gilham).
 *
 *	02 Jan 94	DJW   - Added 'const' keyword where it was missing in some
 *						of the prototypes.
 */

#ifndef NULL
#define NULL ((void *)0)
#endif

#ifndef _SYS_TYPES_H
#include <sys/types.h>
#endif

/*
 *	ANSI mandated constants
 */
#define CLOCKS_PER_SEC 50		/* Not really relevant as CLOCKS not supported */

#ifndef _TM_STRUC
#define _TM_STRUCT
/**
*
* This structure contains the unpacked time as returned by "gmtime".
*
*/
struct tm 
		{
		int tm_sec;
		int tm_min;
		int tm_hour;
		int tm_mday;
		int tm_mon;
		int tm_year;
		int tm_wday;
		int tm_yday;
		int tm_isdst;
};
#endif /* _TM_STRUCT */

extern char *tzname[];			   /* timezone name */

/**
*
* External functions
*
*/

#ifdef __STDC__
#define _P_(params) params
#else
#define _P_(params) ()
#endif

/*	Name hiding definitions */
#define asctime _Asctime
#define time	_Time
/*	Prototypes */
char *		asctime 	_P_((const struct tm *));
clock_t 	clock		_P_((void));
char *		ctime		_P_((const time_t *));
double		difftime	_P_((time_t, time_t));
time_t		mktime		_P_((struct tm *));
size_t		strftime	_P_((char *, size_t, const char *, const struct tm *));
time_t		time		_P_((time_t *));
void		tzset		_P_((void));
struct tm * gmtime		_P_((const time_t *));
struct tm * localtime	_P_((const time_t *));

/*
 *	Definitions internal to time functions in library
 *
 *	NOTE	should not be used by average programmer as subject
 *			to change without notice).
 */
#ifdef _LIBRARY_SOURCE
#undef __LIBRARY__
#define __LIBRARY__
#endif
#ifdef __LIBRARY__
extern char * __week_day[]; 	   /* Table of text for days of week */
extern char * __month[];		   /* Table of text for months of year */
extern int	  __days_per_month[];  /* Table of days per month */
extern int	  __local_clock;	   /* set if system clock is local time */
extern time_t __lt_offset;		   /* offset between GMT and local tz */
extern time_t __dst_offset; 	   /* offset between dst and local tz */
extern time_t __dst_switch; 	   /* when do we switch to dst */
extern time_t __back_switch;	   /* and when do we switch back */
extern int	  __n_hemi; 		   /* set if we are in the northern hemisphere */
#endif /* __LIBRARY__ */

#undef _P_

#endif	/* _TIME_H */
