X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fidzebra%2Fdata1.h;h=75c35cb6947b5a222e7670d38c2ba9f50aa87f9e;hb=95272ce88b72b42a81b82d5eab2dff68855d42df;hp=81c579aee3fd5600131c50012789efd9c1ef31dc;hpb=22963c0b23a178529bc71e5879c7e4f9c3c9b7f9;p=idzebra-moved-to-github.git diff --git a/include/idzebra/data1.h b/include/idzebra/data1.h index 81c579a..75c35cb 100644 --- a/include/idzebra/data1.h +++ b/include/idzebra/data1.h @@ -1,4 +1,4 @@ -/* $Id: data1.h,v 1.1 2004-09-28 10:15:03 adam Exp $ +/* $Id: data1.h,v 1.3 2004-10-04 09:19:16 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -30,8 +30,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#include -#include #include #include @@ -44,6 +42,90 @@ YAZ_BEGIN_CDECL #define DATA1_MAX_SYMBOL 31 +/* + * This structure describes a attset, perhaps made up by inclusion + * (supersetting) of other attribute sets. When indexing and searching, + * we perform a normalisation, where we associate a given tag with + * the set that originally defined it, rather than the superset. This + * allows the most flexible access. Eg, the tags common to GILS and BIB-1 + * should be searchable by both names. + */ + +struct data1_attset; + +typedef struct data1_local_attribute +{ + int local; + struct data1_local_attribute *next; +} data1_local_attribute; + +typedef struct data1_attset data1_attset; +typedef struct data1_att data1_att; +typedef struct data1_attset_child data1_attset_child; + +struct data1_att +{ + data1_attset *parent; /* attribute set */ + char *name; /* symbolic name of this attribute */ + int value; /* attribute value */ + data1_local_attribute *locals; /* local index values */ + data1_att *next; +}; + +struct data1_attset_child { + data1_attset *child; + data1_attset_child *next; +}; + +struct data1_attset +{ + char *name; /* symbolic name */ + oid_value reference; /* external ID of attset */ + data1_att *atts; /* attributes */ + data1_attset_child *children; /* included attset */ + data1_attset *next; /* next in cache */ +}; + +typedef struct data1_handle_info *data1_handle; + +YAZ_EXPORT data1_att *data1_getattbyname(data1_handle dh, data1_attset *s, + char *name); +YAZ_EXPORT data1_attset *data1_read_attset(data1_handle dh, const char *file); + +YAZ_EXPORT data1_attset *data1_empty_attset(data1_handle dh); + +typedef struct data1_maptag +{ + int new_field; + int type; +#define D1_MAPTAG_numeric 1 +#define D1_MAPTAG_string 2 + int which; + union + { + int numeric; + char *string; + } value; + struct data1_maptag *next; +} data1_maptag; + +typedef struct data1_mapunit +{ + int no_data; + char *source_element_name; + data1_maptag *target_path; + struct data1_mapunit *next; +} data1_mapunit; + +typedef struct data1_maptab +{ + char *name; + oid_value target_absyn_ref; + char *target_absyn_name; + data1_mapunit *map; + struct data1_maptab *next; +} data1_maptab; + typedef struct data1_name { char *name; @@ -182,6 +264,7 @@ typedef struct data1_element char *sub_name; struct data1_element *children; struct data1_element *next; + struct data1_hash *hash; } data1_element; typedef struct data1_sub_elements {