From: Martin Mares Date: Fri, 5 Oct 2001 16:33:24 +0000 (+0000) Subject: Moved all customizable parts of configuration and index format X-Git-Tag: holmes-import~1465 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=13bc5e1c30abb77c6e1120b2e0bf50cd0ab94a6a;p=libucw.git Moved all customizable parts of configuration and index format (i.e., those depending on user attributes or word types, not on our compilation environment) to a new file. Custom configurations (indexing of objects generated from a database and similar cases) should require only modifications of cf/sherlock and lib/custom.h since now. --- diff --git a/lib/config.h b/lib/config.h index de3e0a62..114f2735 100644 --- a/lib/config.h +++ b/lib/config.h @@ -1,21 +1,19 @@ /* - * Sherlock Library -- Configuration-Dependent Definitions + * Sherlock -- Configuration-Dependent Definitions * - * (c) 1997--2000 Martin Mares + * (c) 1997--2001 Martin Mares */ #ifndef _SHERLOCK_CONFIG_H #define _SHERLOCK_CONFIG_H -/* Version */ +/* Custom configuration */ -#define SHER_VER "2.0" +#include "lib/custom.h" -/* Features */ +/* Version */ -#define SHERLOCK_CONFIG_LARGE_DB /* Support for DB files >4GB */ -#define SHERLOCK_CONFIG_LFS /* Large files on 32-bit systems */ -#define SHERLOCK_CONFIG_LFS_LIBC /* LFS supported directly by libc */ +#define SHER_VER "2.0" SHER_SUFFIX /* CPU characteristics */ diff --git a/lib/custom.h b/lib/custom.h new file mode 100644 index 00000000..2244dd84 --- /dev/null +++ b/lib/custom.h @@ -0,0 +1,86 @@ +/* + * Sherlock: Custom Parts of Configuration + * + * (c) 2001 Martin Mares + */ + +/* Name of this customization (version suffix) */ + +#define SHER_SUFFIX "" + +/* Features */ + +#define SHERLOCK_CONFIG_LARGE_DB /* Support for DB files >4GB */ +#define SHERLOCK_CONFIG_LFS /* Large files on 32-bit systems */ +#define SHERLOCK_CONFIG_LFS_LIBC /* LFS supported directly by libc */ + +/* Word types */ + +enum word_type { + WT_RESERVED, /* Reserved word type */ + WT_TEXT, /* Ordinary text */ + WT_EMPH, /* Emphasized text */ + WT_SMALL, /* Small font */ + WT_TITLE, /* Document title */ + WT_SMALL_HEADING, /* Heading */ + WT_BIG_HEADING, /* Larger heading */ + WT_KEYWORD, /* Explicitly marked keyword */ + WT_META, /* Various meta-information */ + WT_ALT, /* Alternate texts for graphical elements */ + WT_URL1, /* Word extracted from document URL (low and high weight) */ + WT_URL2, + WT_MAX +}; + +/* Descriptive names used for user output */ +#define WORD_TYPE_USER_NAMES \ + "reserved", "text", "emph", "small", "title", "hdr1", "hdr2", "keywd", \ + "meta", "alt", "urlword1", "urlword2", "type12", "type13", "type14", "type15" + +/* Keywords for word type names */ +#define WORD_TYPE_NAMES \ + T(WORD, ~0) \ + T(TEXT, 1 << WT_TEXT) \ + T(EMPH, 1 << WT_EMPH) \ + T(SMALL, 1 << WT_SMALL) \ + T(TITLE, 1 << WT_TITLE) \ + T(HDR, (1 << WT_SMALL_HEADING) | (1 << WT_BIG_HEADING)) \ + T(HDR1, 1 << WT_SMALL_HEADING) \ + T(HDR2, 1 << WT_BIG_HEADING) \ + T(KEYWD, 1 << WT_KEYWORD) \ + T(META, 1 << WT_META) \ + T(ALT, 1 << WT_ALT) \ + T(URLWORD, (1 << WT_URL1) | (1 << WT_URL2)) + +/* These types are not shown in document contexts */ +#define WORD_TYPES_HIDDEN ((1 << WT_URL1) | (1 << WT_URL2)) + +/* These types are always matched without accents if accent mode is set to "auto" */ +#define WORD_TYPES_NO_AUTO_ACCENT ((1 << WT_URL1) | (1 << WT_URL2)) + +/* String types */ + +enum string_type { + ST_RESERVED, /* Reserved string type */ + ST_URL, /* URL of the document */ + ST_HOST, /* Host name */ + ST_DOMAIN, /* Domain name */ + ST_REF, /* URL reference */ + ST_BACKREF, /* Back-reference (frame or redirect source) */ + ST_MAX +}; + +#define STRING_TYPE_USER_NAMES \ + "URL", "host", "domain", "ref", "backref", "type5", "type6", "type7", \ + "type8", "type9", "type10", "type11", "type12", "type13", "type14", "type15" + +#define STRING_TYPE_NAMES \ + T(URL, 1 << ST_URL) \ + T(HOST, 1 << ST_HOST) \ + T(DOMAIN, 1 << ST_DOMAIN) \ + T(REF, 1 << ST_REF) \ + T(BACKREF, 1 << ST_BACKREF) + +#define STRING_TYPES_URL ((1 << ST_URL) | (1 << ST_REF) | (1 << ST_BACKREF)) +/* These must be indexed in lowercase form */ +#define STRING_TYPES_CASE_INSENSITIVE ((1 << ST_HOST) | (1 << ST_DOMAIN)) diff --git a/lib/index.h b/lib/index.h index c102be10..0bd9a635 100644 --- a/lib/index.h +++ b/lib/index.h @@ -1,5 +1,5 @@ /* - * Sherlock Gatherer: Data structures used in indices + * Sherlock: Data structures used in indices * * (c) 2001 Martin Mares */ @@ -8,76 +8,7 @@ #define MAX_WORD_LEN 64 -/* Word types */ - -enum word_type { - WT_RESERVED, /* Reserved word type */ - WT_TEXT, /* Ordinary text */ - WT_EMPH, /* Emphasized text */ - WT_SMALL, /* Small font */ - WT_TITLE, /* Document title */ - WT_SMALL_HEADING, /* Heading */ - WT_BIG_HEADING, /* Larger heading */ - WT_KEYWORD, /* Explicitly marked keyword */ - WT_META, /* Various meta-information */ - WT_ALT, /* Alternate texts for graphical elements */ - WT_URL1, /* Word extracted from document URL (low and high weight) */ - WT_URL2, - WT_MAX -}; - -/* Descriptive names used for user output */ -#define WORD_TYPE_USER_NAMES \ - "reserved", "text", "emph", "small", "title", "hdr1", "hdr2", "keywd", \ - "meta", "alt", "urlword1", "urlword2", "type12", "type13", "type14", "type15" - -/* Keywords for word type names */ -#define WORD_TYPE_NAMES \ - T(WORD, ~0) \ - T(TEXT, 1 << WT_TEXT) \ - T(EMPH, 1 << WT_EMPH) \ - T(SMALL, 1 << WT_SMALL) \ - T(TITLE, 1 << WT_TITLE) \ - T(HDR, (1 << WT_SMALL_HEADING) | (1 << WT_BIG_HEADING)) \ - T(HDR1, 1 << WT_SMALL_HEADING) \ - T(HDR2, 1 << WT_BIG_HEADING) \ - T(KEYWD, 1 << WT_KEYWORD) \ - T(META, 1 << WT_META) \ - T(ALT, 1 << WT_ALT) \ - T(URLWORD, (1 << WT_URL1) | (1 << WT_URL2)) - -/* These types are not shown in document contexts */ -#define WORD_TYPES_HIDDEN ((1 << WT_URL1) | (1 << WT_URL2)) - -/* These types are always matched without accents if accent mode is set to "auto" */ -#define WORD_TYPES_NO_AUTO_ACCENT ((1 << WT_URL1) | (1 << WT_URL2)) - -/* String types */ - -enum string_type { - ST_RESERVED, /* Reserved string type */ - ST_URL, /* URL of the document */ - ST_HOST, /* Host name */ - ST_DOMAIN, /* Domain name */ - ST_REF, /* URL reference */ - ST_BACKREF, /* Back-reference (frame or redirect source) */ - ST_MAX -}; - -#define STRING_TYPE_USER_NAMES \ - "URL", "host", "domain", "ref", "backref", "type5", "type6", "type7", \ - "type8", "type9", "type10", "type11", "type12", "type13", "type14", "type15" - -#define STRING_TYPE_NAMES \ - T(URL, 1 << ST_URL) \ - T(HOST, 1 << ST_HOST) \ - T(DOMAIN, 1 << ST_DOMAIN) \ - T(REF, 1 << ST_REF) \ - T(BACKREF, 1 << ST_BACKREF) - -#define STRING_TYPES_URL ((1 << ST_URL) | (1 << ST_REF) | (1 << ST_BACKREF)) -/* These must be indexed in lowercase form */ -#define STRING_TYPES_CASE_INSENSITIVE ((1 << ST_HOST) | (1 << ST_DOMAIN)) +/* Word and string types are defined in lib/custom.h */ /* Index card attributes */