]> mj.ucw.cz Git - libucw.git/blobdiff - lib/index.h
Mainline is now v3.3.
[libucw.git] / lib / index.h
index c997731e58d4cb46c7804a6a87571bd85927f1d3..bab49b952dcaca54ecbcb43058eecfb494f91e09 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Sherlock: Data structures used in indices
  *
- *     (c) 2001--2003 Martin Mares <mj@ucw.cz>
+ *     (c) 2001--2004 Martin Mares <mj@ucw.cz>
  */
 
 #ifndef _SHERLOCK_INDEX_H
@@ -9,7 +9,7 @@
 
 #include "custom/lib/custom.h"
 
-#define INDEX_VERSION (0x32260100+sizeof(struct card_attr))    /* Increase with each incompatible change in index format */
+#define INDEX_VERSION (0x32260200+sizeof(struct card_attr))    /* Increase with each incompatible change in index format */
 
 /*
  *  Words
@@ -79,7 +79,7 @@ enum card_flag {
   CARD_FLAG_MERGED = 8,                        /* Destination of a merge [merger] */
   CARD_FLAG_IMAGE = 16,                        /* Is an image object [scanner] */
   CARD_FLAG_FRAMESET = 32,             /* Contains a frameset to be ignored [scanner] */
-  CARD_FLAG_GIANT_CLASS = 64,          /* Belongs to a very large class, subject to penalties [merger] */
+  CARD_FLAG_OVERRIDEN = 64,            /* Overriden by another index [sherlockd] */
 };
 
 #define CARD_POS_SHIFT 5               /* Card positions are shifted this # of bits to the right */
@@ -100,6 +100,7 @@ enum card_flag {
 #define CA_GET_FILE_LANG(a) ((a)->type_flags & 0x80 ? 0 : CA_GET_FILE_INFO(a))
 #define FILETYPE_ATTRS SMALL_SET_ATTR(ftype, FILETYPE, CA_GET_FILE_TYPE, ext_ft_parse)
 #define MAX_FILE_TYPES 8
+#define FILETYPE_IS_TEXT(f) ((f) < 4)
 byte *ext_ft_parse(u32 *dest, byte *value, uns intval);
 extern byte *custom_file_type_names[MAX_FILE_TYPES];
 #else
@@ -127,10 +128,16 @@ void fingerprint(byte *string, struct fingerprint *fp);
 static inline u32
 fp_hash(struct fingerprint *fp)
 {
-  /* This hash is expected to be monotonic wrt. fpsort's order by fprecog */
   return (fp->hash[0] << 24) | (fp->hash[1] << 16) | (fp->hash[2] << 8) | fp->hash[3];
 }
 
+/* The card fingerprints */
+
+struct card_print {
+  struct fingerprint fp;
+  u32 cardid;
+};
+
 /* URL keys */
 
 #define URL_KEY_BUF_SIZE (3*MAX_URL_SIZE)