]> mj.ucw.cz Git - libucw.git/commitdiff
Added initial support for areas to the indexer. Merging not restricted yet,
authorMartin Mares <mj@ucw.cz>
Fri, 20 Aug 2004 19:38:31 +0000 (19:38 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 20 Aug 2004 19:38:31 +0000 (19:38 +0000)
but propagation of area ID's works.

lib/config.h
lib/index.h

index 4a6b34d526aae9953473cce0b5dc9eda2b20b99d..0f7179d1fd3b15d934500ffab9e2dcb3ce42b58b 100644 (file)
@@ -76,6 +76,18 @@ typedef s32 sh_off_t;
 #define PUT_P(p,x) PUT_U32(p,x)
 #endif
 
 #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__
 /* Misc */
 
 #ifdef __GNUC__
index 57cfc147ccedb5085c9693cc6d1c54e0cb05de78..34eaf7ced82576c3b2897d57d6e8019c83d20063 100644 (file)
@@ -25,7 +25,7 @@
 
 #define MAX_WORD_LEN           64      /* a multiple of 4 */
 
 
 #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 */
 
 
 /* Types used for storing contexts */
 
@@ -61,6 +61,7 @@ struct card_attr {
 #ifdef CONFIG_SITES
   u32 site_id;
 #endif
 #ifdef CONFIG_SITES
   u32 site_id;
 #endif
+  area_t area;
   CUSTOM_CARD_ATTRS                    /* Include all custom attributes */
   byte weight;
   byte flags;
   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
 
 #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.
  */
 
 /*
  * 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
 
 /*
  * A list of all statistics collectors, also composed of custom parts