2 * Sherlock: Data structures used in indices
4 * (c) 2001 Martin Mares <mj@ucw.cz>
9 #define MAX_WORD_LEN 64
11 /* Word and string types are defined in lib/custom.h */
13 /* Index card attributes */
16 u32 card; /* Reference to card description (either oid or filepos) */
18 #define INT_ATTR(t,i,o,k,g,p) t i;
19 CUSTOM_ATTRS /* Include all custom attributes */
23 // byte rfu[2]; /* If no custom attributes are defined */
27 CARD_FLAG_EMPTY = 1, /* Empty document (redirect, robot file etc.) [scanner] */
28 CARD_FLAG_ACCENTED = 2, /* Document contains accented characters [scanner] */
29 CARD_FLAG_DUP = 4, /* Removed as a duplicate [merger] */
30 CARD_FLAG_MERGED = 8, /* Destination of a merge [merger] */
33 #define CARD_POS_SHIFT 5 /* Card positions are shifted this # of bytes to the right */
35 /* String fingerprints */
41 void fingerprint(byte *string, struct fingerprint *fp);
44 fp_hash(struct fingerprint *fp)
46 return (fp->hash[0] << 24) | (fp->hash[1] << 16) | (fp->hash[2] << 8) | fp->hash[3];
49 /* Reading of tagged text (Unicode values, tags mapped to 0x80000000 and higher) */
51 #define GET_TAGGED_CHAR(p,u) do { \
66 ASSERT(*p >= 0x80 && *p <= 0xbf); \
67 u = 0x80010000 + ((u & 0x0f) << 6) + (*p++ & 0x3f); \