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) */
24 CARD_FLAG_EMPTY = 1, /* Empty document (redirect, robot file etc.) [scanner] */
25 CARD_FLAG_ACCENTED = 2, /* Document contains accented characters [scanner] */
26 CARD_FLAG_DUP = 4, /* Removed as a duplicate [merger] */
27 CARD_FLAG_MERGED = 8, /* Destination of a merge [merger] */
30 #define CARD_POS_SHIFT 5 /* Card positions are shifted this # of bytes to the right */
32 /* String fingerprints */
38 void fingerprint(byte *string, struct fingerprint *fp);
41 fp_hash(struct fingerprint *fp)
43 return (fp->hash[0] << 24) | (fp->hash[1] << 16) | (fp->hash[2] << 8) | fp->hash[3];
46 /* Reading of tagged text (Unicode values, tags mapped to 0x80000000 and higher) */
48 #define GET_TAGGED_CHAR(p,u) do { \
63 ASSERT(*p >= 0x80 && *p <= 0xbf); \
64 u = 0x80010000 + ((u & 0x0f) << 6) + (*p++ & 0x3f); \