2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: attribute.c,v $
7 * Revision 1.11 1999-11-30 13:48:03 adam
8 * Improved installation. Updated for inclusion of YAZ header files.
10 * Revision 1.10 1999/02/02 14:50:49 adam
11 * Updated WIN32 code specific sections. Changed header.
13 * Revision 1.9 1998/05/20 10:12:14 adam
14 * Implemented automatic EXPLAIN database maintenance.
15 * Modified Zebra to work with ASN.1 compiled version of YAZ.
17 * Revision 1.8 1998/03/05 08:45:11 adam
18 * New result set model and modular ranking system. Moved towards
19 * descent server API. System information stored as "SGML" records.
21 * Revision 1.7 1997/10/29 12:05:01 adam
22 * Server produces diagnostic "Unsupported Attribute Set" when appropriate.
24 * Revision 1.6 1997/09/17 12:19:11 adam
25 * Zebra version corresponds to YAZ version 1.4.
26 * Changed Zebra server so that it doesn't depend on global common_resource.
28 * Revision 1.5 1997/09/05 15:30:08 adam
29 * Changed prototype for chr_map_input - added const.
30 * Added support for C++, headers uses extern "C" for public definitions.
32 * Revision 1.4 1996/10/29 14:06:48 adam
33 * Include zebrautl.h instead of alexutil.h.
35 * Revision 1.3 1996/05/09 07:28:54 quinn
36 * Work towards phrases and multiple registers
38 * Revision 1.2 1995/11/15 19:13:07 adam
39 * Work on record management.
42 * This interface is used by other modules (the Z-server in particular)
43 * to normalize the attributes given in queries.
53 static data1_att *getatt(data1_attset *p, int att)
56 data1_attset_child *c;
59 for (a = p->atts; a; a = a->next)
62 /* scan included sets */
63 for (c = p->children; c; c = c->next)
64 if ((a = getatt(c->child, att)))
69 int att_getentbyatt(ZebraHandle zi, attent *res, oid_value set, int att)
74 if (!(p = data1_attset_search_id (zi->dh, set)))
76 zebraExplain_loadAttsets (zi->dh, zi->res);
77 p = data1_attset_search_id (zi->dh, set);
81 if (!(r = getatt(p, att)))
83 res->attset_ordinal = r->parent->reference;
84 res->local_attributes = r->locals;