]> mj.ucw.cz Git - libucw.git/blobdiff - lib/index.h
Mainline is now v3.3.
[libucw.git] / lib / index.h
index b3489683e3bdf55bc42f5d70568bce52c3289d7b..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 (0x32300100+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,6 +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_OVERRIDEN = 64,            /* Overriden by another index [sherlockd] */
 };
 
 #define CARD_POS_SHIFT 5               /* Card positions are shifted this # of bits to the right */
@@ -99,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
@@ -126,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)