Added charmap facility to delete leading articles
[idzebra-moved-to-github.git] / include / d1_attset.h
1 /* $Id: d1_attset.h,v 1.2 2002-10-22 13:19:50 adam Exp $
2    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
3    Index Data Aps
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra.  If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
21 */
22
23 #ifndef D1_ATTSET_H
24 #define D1_ATTSET_H
25
26 #include <yaz/oid.h>
27
28 YAZ_BEGIN_CDECL
29
30 /*
31  * This structure describes a attset, perhaps made up by inclusion
32  * (supersetting) of other attribute sets. When indexing and searching,
33  * we perform a normalisation, where we associate a given tag with
34  * the set that originally defined it, rather than the superset. This
35  * allows the most flexible access. Eg, the tags common to GILS and BIB-1
36  * should be searchable by both names.
37  */
38
39 struct data1_attset;
40
41 typedef struct data1_local_attribute
42 {
43     int local;
44     struct data1_local_attribute *next;
45 } data1_local_attribute;
46
47 typedef struct data1_attset data1_attset;    
48 typedef struct data1_att data1_att;
49 typedef struct data1_attset_child data1_attset_child;
50
51 struct data1_att
52 {
53     data1_attset *parent;          /* attribute set */
54     char *name;                    /* symbolic name of this attribute */
55     int value;                     /* attribute value */
56     data1_local_attribute *locals; /* local index values */
57     data1_att *next;
58 };
59
60 struct data1_attset_child {
61     data1_attset *child;
62     data1_attset_child *next;
63 };
64
65 struct data1_attset
66 {
67     char *name;          /* symbolic name */
68     oid_value reference;   /* external ID of attset */
69     data1_att *atts;          /* attributes */
70     data1_attset_child *children;  /* included attset */
71     data1_attset *next;       /* next in cache */
72 };
73
74 typedef struct data1_handle_info *data1_handle;
75
76 YAZ_EXPORT data1_att *data1_getattbyname(data1_handle dh, data1_attset *s,
77                                          char *name);
78 YAZ_EXPORT data1_attset *data1_read_attset(data1_handle dh, const char *file);
79
80 YAZ_EXPORT data1_attset *data1_empty_attset(data1_handle dh);
81
82 YAZ_END_CDECL
83
84 #endif