#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

struct FilterSpec
{
	char *keyword;
	ULONG id;
	APTR data;
};

struct FilterHookPacket
{
	ULONG uid;
	APTR  udata;
	ULONG mask;
	ULONG match;
	ULONG set;
	ULONG clear;
	ULONG action;
 	char *data;
};

#define FIL_ACTION_BITS   0
#define FIL_ACTION_EQUAL  1
#define FIL_ACTION_LOWER  2

#define FIL_ERROR_OK              0
#define FIL_ERROR_OUTOFMEMORY     1
#define FIL_ERROR_TOODEEP         2
#define FIL_ERROR_UNKNOWNACTION   3
#define FIL_ERROR_EMPTYEXPRESSION 4
#define FIL_ERROR_UNMATCHEDBRACES 5
#define FIL_ERROR_UNKNOWNKEYWORD  6
#define FIL_ERROR_INVALIDRELATION 7
#define FIL_ERROR_MISC            8

/*
** Thats the last bit that UMS supports. The more bits,
** the more brace levels are available.
*/

#define FIL_LASTBIT (1<<15)

LONG FilterExpression(struct Hook *bithook,struct FilterSpec *spec,char *str,APTR data,ULONG mask,ULONG match,ULONG setbit);
