From 52a8e4ae2cfc936ba26db4557ee22ecee35cb161 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 20 Aug 2004 19:38:31 +0000 Subject: [PATCH] Added initial support for areas to the indexer. Merging not restricted yet, but propagation of area ID's works. --- lib/config.h | 12 ++++++++++++ lib/index.h | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/config.h b/lib/config.h index 4a6b34d5..0f7179d1 100644 --- a/lib/config.h +++ b/lib/config.h @@ -76,6 +76,18 @@ typedef s32 sh_off_t; #define PUT_P(p,x) PUT_U32(p,x) #endif +/* Data type for area ID's */ + +#ifdef CONFIG_AREAS +typedef u32 area_t; +#define AREA_NONE 0 +#define AREA_ANY ~0U +#else +typedef struct { } area_t; +#define AREA_NONE (area_t){} +#define AREA_ANY (area_t){} +#endif + /* Misc */ #ifdef __GNUC__ diff --git a/lib/index.h b/lib/index.h index 57cfc147..34eaf7ce 100644 --- a/lib/index.h +++ b/lib/index.h @@ -25,7 +25,7 @@ #define MAX_WORD_LEN 64 /* a multiple of 4 */ -/* Word and string types are defined in lib/custom.h */ +/* Word and string types are defined in custom/lib/custom.h */ /* Types used for storing contexts */ @@ -61,6 +61,7 @@ struct card_attr { #ifdef CONFIG_SITES u32 site_id; #endif + area_t area; CUSTOM_CARD_ATTRS /* Include all custom attributes */ byte weight; byte flags; @@ -131,12 +132,20 @@ byte *ext_lang_parse(u32 *dest, byte *value, uns intval); #define LANG_ATTRS #endif +#ifdef CONFIG_AREAS +#define CA_GET_AREA(a) ((a)->area) +#define SPLIT_ATTRS INT_ATTR(area, AREA, CA_GET_AREA, ext_area_parse) +byte *ext_area_parse(u32 *dest, byte *value, uns intval); +#else +#define SPLIT_ATTRS +#endif + /* * A list of all extended attributes: custom attributes and also some * built-in attributes treated in the same way. */ -#define EXTENDED_ATTRS CUSTOM_ATTRS FILETYPE_ATTRS LANG_ATTRS +#define EXTENDED_ATTRS CUSTOM_ATTRS FILETYPE_ATTRS LANG_ATTRS SPLIT_ATTRS /* * A list of all statistics collectors, also composed of custom parts -- 2.39.2