
publically implemented:

BOOL jdate_from_double_jd(double, struct julian_date *)
void jdate_to_str(struct julian_date, char *)
BOOL jdate_from_greg_date(struct greg_date, struct julian_date *)
BOOL jdate_from_long_count(struct long_count, struct julian_date *)
BOOL jdate_from_tm(struct tm, struct julian_date *)

BOOL greg_date_from_jdate(struct julian_date, struct greg_date *)
void greg_date_to_str(struct greg_date, char *)

BOOL haab_date_from_jdate(struct julian_date, struct haab_date *)
BOOL haab_month_to_str(int, char *)
BOOL haab_date_to_str(int, char *)

BOOL tzolkin_month_to_str(int, char *)
BOOL tzolkin_date_to_str(int, char *)
BOOL tzolkin_date_from_jdate(struct julian_date, struct tzolkin_date *)

void long_count_to_str(struct long_count, char *)
BOOL long_count_from_jdate(struct julian_date, struct long_count *)

BOOL is_valid_jdate(double)
BOOL is_valid_greg_date(struct greg_date)

#define JD_CORRELATION 584285.0L
typedef double julian_date;

typedef struct long_date {
	int bak, kat, tun, uin, kin;
} long_count;

typedef struct greg_date {
	int day, month, year;
} greg_date;

typedef struct haab_date {
	int month, day;
} haab_date;

typedef struct tzolkin_date {
	int month, day;
} tzolkin_date;




internal:

static double my_mod(double,double)
static int gregorian_leap_year(int)

#define AMOD(x,y) (1 + (((x) - 1) % (y)))

publically unimplemented:

BOOL jdate_from_time_t(struct time_t, struct julian_date *)

BOOL is_valid_struct_tm(struct tm)
BOOL is_valid_long_count(struct long_count)

BOOL tm_from_jdate(struct julian_date, struct tm *)
BOOL time_t_from_jdate(struct julian_date, struct time_t *)
