/*
 * time.h
 *
 * Struct and function declarations for dealing with time.
 */

#ifndef __TIME_H
#define __TIME_H
#include <_ansi.h>

#define __need_size_t
#define __need_NULL
#include <stddef.h>

#define CLOCKS_PER_SEC 1000000      /* POSIX requirement */

#ifndef __clock_t_defined
typedef	long clock_t;
#define __clock_t_defined
#endif

#ifndef __time_t_defined
typedef	long time_t;
#define __time_t_defined
#endif

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;
};

/* Structure for a time value.  This is like a `struct timeval' but
   has nanoseconds instead of microseconds.  */
struct timespec
{
    long int tv_sec;		/* Seconds.  */
    long int tv_nsec;		/* Nanoseconds.  */
};


#ifdef __cplusplus
extern "C" {
#endif

clock_t	   _EXFUN(clock,    (void));
double	   _EXFUN(difftime, (time_t time2, time_t time1));
time_t	   _EXFUN(mktime,   (struct tm *timeptr));
time_t	   _EXFUN(time,     (time_t *timer));
char	  *_EXFUN(asctime,  (const struct tm *tblock));
char	  *_EXFUN(ctime,    (const time_t *time));
struct tm *_EXFUN(gmtime,    (const time_t *timer));
struct tm *_EXFUN(localtime, (const time_t *timer));
size_t	   _EXFUN(strftime,  (char *s, size_t maxsize, const char *fmt, const struct tm *t));
int    _EXFUN(nanosleep, (const struct timespec *req, struct timespec *rem));



#ifdef __cplusplus
}
#endif

#endif
