]> mj.ucw.cz Git - libucw.git/commitdiff
Make sherlockd calculate per-filetype number of matched documents, including
authorMartin Mares <mj@ucw.cz>
Wed, 4 Jun 2003 19:31:10 +0000 (19:31 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 4 Jun 2003 19:31:10 +0000 (19:31 +0000)
those failing the FILETYPE filter. This breaks the nice abstraction of hiding
all filtering under EXTENDED_ATTRS, but it will allow us to get rid of lots
of STATS queries.

lib/index.h

index cb23ffd63a7b85b654432b8793cdf433e6613551..164383bc43808bae005634c9a5f43559e3678276 100644 (file)
@@ -77,8 +77,9 @@ enum card_flag {
 #define CA_GET_FILE_INFO(a) ((a)->type_flags & 0x1f)
 #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
 byte *ext_ft_parse(u32 *dest, byte *value, uns intval);
-extern byte *custom_file_type_names[8];
+extern byte *custom_file_type_names[MAX_FILE_TYPES];
 #else
 #define FILETYPE_ATTRS
 #endif
@@ -91,7 +92,7 @@ byte *ext_lang_parse(u32 *dest, byte *value, uns intval);
 #define LANG_ATTRS
 #endif
 
-#define EXTENDED_ATTRS CUSTOM_ATTRS FILETYPE_ATTRS LANG_ATTRS
+#define EXTENDED_ATTRS CUSTOM_ATTRS LANG_ATTRS         /* Beware, FILETYPE_ATTRS are handled separately */
 
 /* String fingerprints */