/*****************************************************************************
*                                                                            *
*      COMMON OCEANOGRAPHIC DATA ACCESS SYSTEM (CODAS)                       *
*                                                                            *
*      WRITTEN BY:  RAMON CABRERA, ERIC FIRING, and JULIE RANADA             *
*                   JOINT INSTITUTE FOR MARINE AND ATMOSPHERIC RESEARCH      *
*                   1000 POPE ROAD  MSB 404                                  *
*                   HONOLULU, HI 96822                                       *
*                                                                            *
*      VERSION:     3.00                                                     *
*                                                                            *
*      DATE:        APRIL 1989                                               *
*                                                                            *
*****************************************************************************/
/*-----------------------------------------------------------------------------

       FILE:  time_.h

              TIME CONVERSION FUNCTIONS

*/
#include <stdio.h>    /* FILE */
#ifndef time__included
#define time__included
#ifndef dbhost_included
#include "dbhost.h"          /* PROTOTYPE_ALLOWED */
#endif
#ifndef dbext_included
#include "dbext.h"           /* YMDHMS_TIME_TYPE, ULONG, etc. */
#endif

extern int CUM_MONTH_DAYS[];

#if PROTOTYPE_ALLOWED
int invalid_time(YMDHMS_TIME_TYPE *t);
ULONG TIMMIN(YMDHMS_TIME_TYPE *t);
void MINTIM(YMDHMS_TIME_TYPE *t, LONG *m);
LONG TIMDIF(YMDHMS_TIME_TYPE *t1, YMDHMS_TIME_TYPE *t2);
LONG HTIMDIF(YMDHMS_TIME_TYPE *t1, YMDHMS_TIME_TYPE *t2);
void DIFTIM(YMDHMS_TIME_TYPE *t1, YMDHMS_TIME_TYPE *t2, LONG *s);
void HDIFTIM(YMDHMS_TIME_TYPE *t1, YMDHMS_TIME_TYPE *t2, LONG *hs);
LONG TIMCMP(YMDHMS_TIME_TYPE *t1, YMDHMS_TIME_TYPE *t2);
ULONG PCKTIM(YMDHMS_TIME_TYPE *t);
void UPCKTIM(YMDHMS_TIME_TYPE *t, ULONG *block_time);
double year_day(YMDHMS_TIME_TYPE *t, int year_base);
void yd_to_ymdhms_time(double yd, int year_base, YMDHMS_TIME_TYPE *t);
void yd_to_ymdhmh_time(double yd, int year_base, YMDHMS_TIME_TYPE *t);
int get_ymdhms_time(FILE *fp, YMDHMS_TIME_TYPE *t);
USHORT set_hs(double hs);
#else
int invalid_time();
ULONG TIMMIN();
void MINTIM();
LONG TIMDIF();
LONG HTIMDIF();
void DIFTIM();
void HDIFTIM();
LONG TIMCMP();
ULONG PCKTIM();
void UPCKTIM();
double year_day();
void yd_to_ymdhms_time();
void yd_to_ymdhmh_time();
int get_ymdhms_time();
USHORT set_hs();
#endif
#endif /* ifndef time__included */

