attr_values.useattr = 0;
attr_values.relation = "default";
- facetattrs(al, &attr_values);
+ yaz_facet_attr_get_z_attributes(al, &attr_values);
if (!attr_values.errcode) {
int term_index;
printf(" %s (%d): \n", attr_values.useattr, /* attr_values.relation, attr_values.limit, */ facet->num_terms);
};
YAZ_EXPORT
-void facet_struct_init(struct yaz_facet_attr *attr_values);
+void yaz_facet_attr_init(struct yaz_facet_attr *attr_values);
-/* Use attribute, @attr1, can be numeric or string */
YAZ_EXPORT
-void useattr(Z_AttributeElement *ae, struct yaz_facet_attr *av);
-
-YAZ_EXPORT
-void relationattr(Z_AttributeElement *ae, struct yaz_facet_attr *av);
-
-YAZ_EXPORT
-void limitattr(Z_AttributeElement *ae, struct yaz_facet_attr *av);
-
-YAZ_EXPORT
-void limitattr(Z_AttributeElement *ae, struct yaz_facet_attr *av);
-
-YAZ_EXPORT
-void facetattrs(Z_AttributeList *attributes, struct yaz_facet_attr *av);
+void yaz_facet_attr_get_z_attributes(const Z_AttributeList *attributes,
+ struct yaz_facet_attr *av);
YAZ_EXPORT
Z_FacetList *extract_facet_request(ODR odr, Z_OtherInformation *search_input);
/* Gets the first string, there is usually only one */
/* in case of errors, returns null */
-void facet_struct_init(struct yaz_facet_attr *attr_values)
+void yaz_facet_attr_init(struct yaz_facet_attr *attr_values)
{
attr_values->errcode = 0;
attr_values->errstring = 0;
attr_values->limit = 0;
}
-const char *stringattr(Z_ComplexAttribute *c)
+static const char *stringattr(Z_ComplexAttribute *c)
{
int i;
Z_StringOrNumeric *son;
}
/* Use attribute, @attr1, can be numeric or string */
-void useattr(Z_AttributeElement *ae, struct yaz_facet_attr *av)
+static void useattr(Z_AttributeElement *ae, struct yaz_facet_attr *av)
{
const char *s;
if (ae->which == Z_AttributeValue_complex)
/* TODO rename to sortorder attr */
-void relationattr(Z_AttributeElement *ae, struct yaz_facet_attr *av)
+static void relationattr(Z_AttributeElement *ae, struct yaz_facet_attr *av)
{
if (ae->which == Z_AttributeValue_numeric)
{
}
} /* relationattr */
-void limitattr(Z_AttributeElement *ae, struct yaz_facet_attr *av)
+static void limitattr(Z_AttributeElement *ae, struct yaz_facet_attr *av)
{
if (ae->which == Z_AttributeValue_numeric)
{
so no need to free that string!
*/
-void facetattrs(Z_AttributeList *attributes, struct yaz_facet_attr *av)
+void yaz_facet_attr_get_z_attributes(const Z_AttributeList *attributes,
+ struct yaz_facet_attr *av)
{
int i;
Z_AttributeElement *ae;
int term_index;
struct yaz_facet_attr attr_values;
ZOOM_facet_field facet_field = odr_malloc(odr, sizeof(*facet_field));
- memset(&attr_values, 0, sizeof(attr_values));
- facetattrs(facet->attributes, &attr_values);
+ yaz_facet_attr_init(&attr_values);
+ yaz_facet_attr_get_z_attributes(facet->attributes, &attr_values);
facet_field->facet_name = odr_strdup(odr, attr_values.useattr);
facet_field->num_terms = facet->num_terms;
yaz_log(YLOG_DEBUG, "ZOOM_facet_field %s %d terms %d", attr_values.useattr, attr_values.limit, facet->num_terms);
for (index = 0; index < facet_list->num; index++) {
struct yaz_facet_attr attrvalues;
- facet_struct_init(&attrvalues);
+ yaz_facet_attr_init(&attrvalues);
attrvalues.limit = 10;
- facetattrs(facet_list->elements[index]->attributes, &attrvalues);
+ yaz_facet_attr_get_z_attributes(facet_list->elements[index]->attributes,
+ &attrvalues);
yaz_log(YLOG_LOG, "Attributes: %s %d ", attrvalues.useattr, attrvalues.limit);
if (attrvalues.errstring)
yaz_log(YLOG_LOG, "Error parsing attributes: %s", attrvalues.errstring);