#ifndef RULE_MODULE_H
#define RULE_MODULE_H
/*
**  $VER: rule_module.h 1.0 (22.7.97)
**
**  Structures and constants for a GetPayed rule extension module.
**
**  ©1997 TigerSoft
*/

/*
** Structure holding a parsed Day entry for payment calculations.
*/

struct ParsedDay {
    UWORD   Year; /* Year the day lies in */
    UWORD   YearDay; /* Daynumber in the year of this day (1==1st day of year) */
    UBYTE   Month; /* Month the day lies in (1==January) */
    UBYTE   Monthday; /* Day's index in month (month day ; 1==1st day of month) */
    UBYTE   Week; /* Week number this day lies in */
    UBYTE   Weekday; /* Index of weekday (Monday == 0 ) */

    FLOAT   Start; /* Starting time  | */
    FLOAT   Stop; /* Stoping time    |-> Time values */
    FLOAT   Pause; /* Pause duration | */
};

/*
** Error codes
*/

/* Returncodes lower than GPRULE_ERRORCODE are reserved for non-error returncodes */
#define GPRULE_ERRORCODE    10

/** Here are the returncodes **/

#define GPRULE_ERR_OK       0   /* All went well */
#define GPRULE_ERR_APPLIED  1   /* Return this from rhApplyRule() when DayHeader
                                   was applied to the payment rule - This is not
                                   an error return */
#define GPRULE_ERR_BADDATA  GPRULE_ERRORCODE       /* Bad data delivered to e.g. rhCreateRule() */
#define GPRULE_ERR_NOMEM    GPRULE_ERRORCODE + 1   /* Out of memory */
#define GPRULE_ERR_OPENEXT  GPRULE_ERRORCODE + 2   /* Couldn't open extension library
                                                      !!! Internal !!! Do *NOT* use !!! */

#endif /* RULE_MODULE_H */
