/* Constants for both Reminder and ReminderCheck */

/* $Id: Constants.h,v 1.11 1993/04/09 15:17:26 Matti_Rintala Exp $ */

#ifndef CONSTANTS_H
#define CONSTANTS_H

#include <time.h>
#include <exec/nodes.h>

/* Tooltype (or command line arg) which tells the database name */
#define FILETYPE "FILE"
/* Default filename for database */
#define DEFAULTFILE "S:Reminder.data"

/* Tooltype (or command line arg) which tells the minimum interval
   (in hours) between two checks */
#define INTRVLTYPE "INTERVAL"
#define DEFAULTINTRVL 0

/* Tooltype (or command line arg) which tells not to use ReqTools.library */
#define NOREQTOOLSTYPE "NOREQTOOLS"

/* Tooltype (or command line arg) which tells not to use ARexx */
#define NOAREXXTYPE "NOAREXX"

/* Minimum and maximum years */
#define MINYEAR 1993
#define MAXYEAR 2099

/* Maximum number of days before which the reminding starts */
#define MAXBEFORE 365
/* Same for after event */
#define MAXAFTER MAXBEFORE

/* Maximum length of entered text */
#define TEXTLEN 90

/* Maximun length of one entry in Eventlist gadget */
#define ENTRYLEN 40

/* Length of arexxcom field */
#define AREXXCOMLEN 28

/* Length of arexxport field */
#define AREXXPORTLEN 10

/* EventNode structure, holding all events in the database */
struct EventNode {
  struct Node node;

  char mode;			/* ARexx mode + 'D' if deleted */
  char arexxcom[AREXXCOMLEN+1];	/* ARexx command */
  char arexxport[AREXXPORTLEN+1]; /* ARexx port */
  char text[TEXTLEN+1];		/* Text of the event */
  short wday, day, month, year;	/* Date of event */
  short after, before;		/* Reminding limits */
  BOOL autodelete;		/* autodeletion flag */
  short aday, amonth, ayear;	/* acknowledgement date */

  time_t next_date;		/* Next occurrence of event */
  char entry[ENTRYLEN+1];	/* Text in the Eventlist gadget */
};

/* Address range of EventNode to be saved */
#define SAVEADDR(x) (&(x)->mode)
#define SAVELEN(x) ((char *)&(x)->next_date - (char *)&(x)->mode)

/* Character in mode, if entry is deleted */
#define DELETEDMODE 'D'

/* Character in mode, if ARexx is not used */
#define AREXXNMODE 0

/* Character in mode, if ARexx script name is in arexx field */
#define AREXXSMODE 1

/* Character in mode, if ARexx command + port is in arexx field */
#define AREXXCMODE 2

#endif
