5 #include <yaz/yconfig.h>
7 #include <yaz/z-core.h>
8 #include <yaz/z-facet-1.h>
15 * Helper function for extracting facet values from the ASN structures.
19 /* A helper structure to extract all the attribute stuff
20 from one Z_AttributesList. The pointers will all be to
21 the Z-structures, or to constants, so there is no need to
22 worry about freeing them */
24 int errcode; /* set in case of errors */
25 char *errstring; /* opt */
26 const char *useattr; /* @attr 1, from a string attr */
27 /* or number converted to a string */
28 /* defaults to 'any' */
29 char useattrbuff[30]; /* for converting numbers to strings */
30 char *relation; /* @attr 2, defaults to '=' */
31 int limit; /* for facet attributes */
35 /* Use attribute, @attr1, can be numeric or string */
37 void useattr ( Z_AttributeElement *ae, struct attrvalues *av );
40 void relationattr ( Z_AttributeElement *ae, struct attrvalues *av );
43 void limitattr ( Z_AttributeElement *ae, struct attrvalues *av );
46 void limitattr ( Z_AttributeElement *ae, struct attrvalues *av );
49 void facetattrs( Z_AttributeList *attributes, struct attrvalues *av );
52 Z_Term *term_create(ODR odr, const char *cstr);
55 Z_FacetTerm* facet_term_create(ODR odr, Z_Term *term, int freq);
58 Z_FacetField* facet_field_create(ODR odr, Z_AttributeList *attributes, int num_terms);
61 void facet_field_term_set(ODR odr, Z_FacetField *field, Z_FacetTerm *facetTerm, int index);
64 Z_FacetList* facet_list_create(ODR odr, int num_facets);
67 void facet_list_field_set(ODR odr, Z_FacetList *list, Z_FacetField *field, int index);