diff options
Diffstat (limited to 'contrib/tsearch/query.h')
-rw-r--r-- | contrib/tsearch/query.h | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/contrib/tsearch/query.h b/contrib/tsearch/query.h index 96117e78c8..a5f8d7deb8 100644 --- a/contrib/tsearch/query.h +++ b/contrib/tsearch/query.h @@ -9,41 +9,43 @@ * item in polish notation with back link * to left operand */ -typedef struct ITEM { - int2 type; - int2 left; - int4 val; +typedef struct ITEM +{ + int2 type; + int2 left; + int4 val; /* user-friendly value */ - uint16 distance; - uint16 length; -} ITEM; + uint16 distance; + uint16 length; +} ITEM; /* *Storage: * (len)(size)(array of ITEM)(array of operand in user-friendly form) */ -typedef struct { - int4 len; - int4 size; - char data[1]; -} QUERYTYPE; +typedef struct +{ + int4 len; + int4 size; + char data[1]; +} QUERYTYPE; #define HDRSIZEQT ( 2*sizeof(int4) ) #define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + size * sizeof(ITEM) + lenofoperand ) #define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT ) -#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((QUERYTYPE*)x)->size * sizeof(ITEM) ) +#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((QUERYTYPE*)x)->size * sizeof(ITEM) ) #define ISOPERATOR(x) ( (x)=='!' || (x)=='&' || (x)=='|' || (x)=='(' || (x)==')' ) -#define END 0 -#define ERR 1 -#define VAL 2 -#define OPR 3 -#define OPEN 4 -#define CLOSE 5 -#define VALTRUE 6 /* for stop words */ -#define VALFALSE 7 +#define END 0 +#define ERR 1 +#define VAL 2 +#define OPR 3 +#define OPEN 4 +#define CLOSE 5 +#define VALTRUE 6 /* for stop words */ +#define VALFALSE 7 -bool execute( ITEM* curitem, void *checkval, - bool calcnot, bool (*chkcond)(void *checkval, ITEM* val )); +bool execute(ITEM * curitem, void *checkval, + bool calcnot, bool (*chkcond) (void *checkval, ITEM * val)); #endif |