# include "external.h"

# ifndef CONVERT_H
# define CONVERT_H

/*** values for time formats */
enum {TIME_NONE, TIME_JD, TIME_MJD, TIME_DATE, TIME_DAYS, TIME_HOURS, TIME_MINUTES, TIME_SECONDS};

/*** conversion functions ***/
time_t        TimeRef               PROTO((double time, time_t TimeReference, int TimeFormat));
double        TimeValue             PROTO((time_t time, time_t TimeReference, int TimeFormat));
int           chk_time              PROTO((char *line));
time_t        date_to_sec           PROTO((char *date));
int           dms_to_ddd            PROTO((double *Value, char *string));
time_t        jd_to_sec             PROTO((double jd));
time_t        mjd_to_sec            PROTO((double mjd));
char         *sec_to_date           PROTO((time_t second));
double        sec_to_jd             PROTO((time_t second));
double        sec_to_mjd            PROTO((time_t second));
int           str_to_dtime          PROTO((char *line, double *second));
int           str_to_radec          PROTO((double *ra, double *dec, char *str1, char *str2));
int           str_to_time           PROTO((char *line, time_t *second));
int           hh_hms                PROTO((double hh, int *hr, int *mn, double *sc));
int           dd_dms                PROTO((double dd, int *dg, int *mn, double *sc));
int           hms_format            PROTO((char *line, double value));
int           dms_format            PROTO((char *line, double value));
int           hh_hm                 PROTO((double hh, int *hr, double *mn));

char         *meade_deg_to_str      PROTO((double deg));
char         *meade_ra_to_str       PROTO((double deg));
char         *meade_dec_to_str      PROTO((double deg));
int           hstgsc_hms_to_deg     PROTO((double *h0, double *h1, double *d0, double *d1, char *string));

# endif
