static	char	RuleLockInternal_h[] = "$Header: internal.h,v 1.1 89/02/20 16:27:24 hirohama Exp $";

/*
 * Definitions to be used when handling the "internal" representation
 * of locks..
 */

#define MyAlloc malloc
#define MyFree free

/*
 * RuleLockEndMask = used to set the 8th bit of a the "locktype" field of the
 * struct "RuleLockData" of the last lock of a rule pack, or the
 * 8th bit of the "ruletype" attribute of the last "RuleLockHeader"
 * of the last rule-pack of a lock field...
 */
#define RuleLockEndMask      0x80
#define RuleLockEarlyMask    0x40
#define RuleLockRuleTypeMask 0x7
#define RuleLockLockTypeMask 0x3

typedef struct RuleLockHeader{
    ObjectId ruleid;
    char priority;
    char ruletype;
} RuleLockHeader;

typedef struct RuleLockBody{
    char locktype;
    unsigned long attrno;
    unsigned long planno;
}RuleLockBody;

typedef struct RuleLockParseStatus{
    bool end_of_scan_reached;
    char *pointer;
    bool points_to_header;
    struct RuleLockHeader current_header;
} RuleLockParseStatus;


RuleLockParseStatus	* RuleLockBeginScan();
int			RuleLockGetNextLock();
void			RuleLockEndScan();
