/************************************************************************/
/* $Header: /usr/tiburon/.cvsroot/vw/h/usrTime.h,v 1.1.1.1 1997/05/16 22:33:02 pean Exp $                */
/* Summary  : Unix-compatible Time Definitions and Declarations         */
/* Filename : usrTime.h                                                 */
/* Author   : Bob Herlien (rah)                                         */
/* Project  : ROV 1.5                                                   */
/* $Revision: 1.1.1.1 $                                                     */
/* Created  : 02/28/91                                                  */
/************************************************************************/
/* Modification History:                                                */
/* $Log: usrTime.h,v $
 * Revision 1.1.1.1  1997/05/16 22:33:02  pean
 * Initial check in after software freeze.
 *
 * Revision 1.1  91/09/06  16:05:01  16:05:01  hebo (Bob Herlien 408-647-3748)
 * Various minor fixes, found while porting ntp
 *
 * Revision 1.0  91/08/09  11:10:57  11:10:57  hebo (Bob Herlien 408-647-3748)
 * Initial revision
 *      */
/* 28feb91 rah, Ported from HP-UX <sys/time.h> and vxWorks <systime.h>  */
/************************************************************************/
/* Note that, with all the conditionals below, we're trying not to      */
/* conflict with: vxWorks utime.h, systime.h, types.h; HP-UX time.h or  */
/* sys/types.h; or SUN types.h.  We may or may not have succeeded.      */
/************************************************************************/

#if !defined(INCusrtimeh) && !defined(_SYS_TIME_INCLUDED)
#define INCusrtimeh     1

#ifndef NULL
#define NULL (char *)0
#endif

#define SECS_PER_DAY    86400L          /* Seconds per day                  */
#define SECS_PER_HOUR   3600            /* Seconds per hour                 */
#define USECS_PER_SEC   1000000L        /* Microseconds per second          */
#define DAYS_PER_WEEK   7
#define MONTHS_PER_YEAR 12

#define YEAR0           70              /* Unix Epoch year (1970)           */
#define DAY0            4               /* 1jan1970 was a Thursday          */

#if !defined(_TYPES_) && !defined(__sys_types_h) && !defined(_TIME_T) && \
    !defined(__INCvxTypesh)
typedef long time_t;
#endif

#if !defined(__INCtimeh)                /* pean 11/29/94 time.h conflict    */

struct tm                               /* Structure returned by gmtime()   */
{                                       /*   localtime() calls              */
    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

#if !defined(INCtimeh) && !defined(__INCtimesh)
#define _TIME_                          /* Prevent conflict with sys/times.h*/
struct timeval                          /* Struct returned by gettimeofday()*/
{                                       /*    system call                   */
    long        tv_sec;                 /* seconds                          */
    long        tv_usec;                /* microseconds                     */
};

struct timezone
{
    int tz_minuteswest;                 /* minutes west of Greenwich        */
    int tz_dsttime;                     /* type of dst correction           */
};                                      /* dst not implemented (always 0)   */
#endif /* INCtimeh */


#  ifdef __STDC__
STATUS usrTimeInit( Void );
extern time_t     time(time_t *);
extern int        stime(long *);
extern char      *asctime(const struct tm *);
extern char      *ctime(const time_t *);
extern struct tm *gmtime(const time_t *);
extern struct tm *localtime(const time_t *);
extern int        gettimeofday( struct timeval *tp, struct timezone *tzp );
extern int        settimeofday(struct timeval *, struct timezone *);
#  else /* __STDC__ */
extern time_t     time();
extern int        stime();
extern char      *asctime();
extern char      *ctime();
extern struct tm *gmtime();
extern struct tm *localtime();
extern int        gettimeofday();
extern int        settimeofday();
#  endif /* __STDC__ */

extern long timezone;
extern Int32 daylight;

#endif /* INCusrtimeh || _SYS_TIME_INCLUDED */



