#include "Calendar.h"

#define wildHour -1
#define wildMinute -1
#define wildSecond -1
#define wildDays 127 /* 2^7 - 1 */
#define wildDates 2147483647 /* 2^31 - 1 */
#define wildMonths 4095 /* 2^12 - 1 */
#define wildYear 0
#define DESCMAX 2000 /* max chars in event description */

typedef struct _CalTime
{
  int hour, minute, second;
} CalTime;

typedef struct _date
{
  CalTime starttime, endtime;
  int days; /* bitmap of days of week */
  int dates; /* bitmap of dates (just fits in 32!) (prob a nono) */
  int months; /* bitmap of months */
  int year; /* not a bitmap :) */
  struct _date *more; /* in case the spec won't fit */
} date;

typedef struct _desc
{
  char *desc; /* description */
  int activity; /* activity level (reminder level) */
  int scheduled; /* boolean; shows up on appointments? */
  int daylike; /* boolean; birthday, holiday, etc */
} desc;

typedef struct _event
{
  date *when; /* time specifier */
  desc *info;
  struct _event *next;
} event;

typedef struct _simpleEvent
{
  CalTime starttime, endtime;
  desc *info;
  struct _simpleEvent *next;
} simpleEvent;

extern int ampm;
extern int assume_day;
extern simpleEvent *cvtEventToSimple();
extern int addFileToEvents();
extern void freeEvents();
extern void timeToStr();
extern void strToTime();
extern void getTimeNum();
