diff options
Diffstat (limited to 'contrib/tsearch2/gistidx.h')
-rw-r--r-- | contrib/tsearch2/gistidx.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/contrib/tsearch2/gistidx.h b/contrib/tsearch2/gistidx.h deleted file mode 100644 index 5362584b807..00000000000 --- a/contrib/tsearch2/gistidx.h +++ /dev/null @@ -1,62 +0,0 @@ -/* $PostgreSQL: pgsql/contrib/tsearch2/gistidx.h,v 1.8 2007/02/28 22:44:38 tgl Exp $ */ - -#ifndef __GISTIDX_H__ -#define __GISTIDX_H__ - -/* -#define GISTIDX_DEBUG -*/ - -/* - * signature defines - */ - -#define SIGLENINT 63 /* >121 => key will toast, so it will not work - * !!! */ -#define SIGLEN ( sizeof(int4) * SIGLENINT ) -#define SIGLENBIT (SIGLEN * BITS_PER_BYTE) - -typedef char BITVEC[SIGLEN]; -typedef char *BITVECP; - -#define LOOPBYTE(a) \ - for(i=0;i<SIGLEN;i++) {\ - a;\ - } - -#define GETBYTE(x,i) ( *( (BITVECP)(x) + (int)( (i) / BITS_PER_BYTE ) ) ) -#define GETBITBYTE(x,i) ( ((char)(x)) >> (i) & 0x01 ) -#define CLRBIT(x,i) GETBYTE(x,i) &= ~( 0x01 << ( (i) % BITS_PER_BYTE ) ) -#define SETBIT(x,i) GETBYTE(x,i) |= ( 0x01 << ( (i) % BITS_PER_BYTE ) ) -#define GETBIT(x,i) ( (GETBYTE(x,i) >> ( (i) % BITS_PER_BYTE )) & 0x01 ) - -#define HASHVAL(val) (((unsigned int)(val)) % SIGLENBIT) -#define HASH(sign, val) SETBIT((sign), HASHVAL(val)) - - -/* - * type of index key - */ -typedef struct -{ - int32 vl_len_; /* varlena header (do not touch directly!) */ - int4 flag; - char data[1]; -} GISTTYPE; - -#define ARRKEY 0x01 -#define SIGNKEY 0x02 -#define ALLISTRUE 0x04 - -#define ISARRKEY(x) ( ((GISTTYPE*)(x))->flag & ARRKEY ) -#define ISSIGNKEY(x) ( ((GISTTYPE*)(x))->flag & SIGNKEY ) -#define ISALLTRUE(x) ( ((GISTTYPE*)(x))->flag & ALLISTRUE ) - -#define GTHDRSIZE ( VARHDRSZ + sizeof(int4) ) -#define CALCGTSIZE(flag, len) ( GTHDRSIZE + ( ( (flag) & ARRKEY ) ? ((len)*sizeof(int4)) : (((flag) & ALLISTRUE) ? 0 : SIGLEN) ) ) - -#define GETSIGN(x) ( (BITVECP)( (char*)(x)+GTHDRSIZE ) ) -#define GETARR(x) ( (int4*)( (char*)(x)+GTHDRSIZE ) ) -#define ARRNELEM(x) ( ( VARSIZE(x) - GTHDRSIZE )/sizeof(int4) ) - -#endif |