2 * This interface is used by other modules (the Z-server in particular)
3 * to normalize the attributes given in queries.
12 #include "d1_attset.h"
14 #include "attribute.h"
16 static int initialized = 0;
18 static data1_attset *registered_sets = 0;
20 static void att_loadset(const char *n, const char *name)
24 if (!(new = data1_read_attset((char*) name)))
26 logf(LOG_WARN|LOG_ERRNO, "%s", name);
29 new->next = registered_sets;
30 registered_sets = new;
34 static void load_atts()
36 res_trav(common_resource, "attset", att_loadset);
39 static data1_att *getatt(data1_attset *p, int att)
43 for (; p; p = p->next)
46 for (a = p->atts; a; a = a->next)
49 /* scan included sets */
50 if (p->children && (a = getatt(p->children, att)))
56 attent *att_getentbyatt(oid_value set, int att)
67 for (p = registered_sets; p; p = p->next)
68 if (p->reference == set && (r = getatt(p, att)))
72 res.attset_ordinal = r->parent->ordinal;
73 res.local_attribute = r->local;