static void display_facet(Z_FacetField *facet) {
if (facet->attributes) {
Z_AttributeList *al = facet->attributes;
- struct attrvalues attr_values;
+ struct yaz_facet_attr attr_values;
attr_values.errcode = 0;
attr_values.limit = -1;
attr_values.useattr = 0;
*
*/
-/* A helper structure to extract all the attribute stuff
- from one Z_AttributesList. The pointers will all be to
+/** A helper structure to extract all the attribute stuff
+ from one Z_AttributesList for facets. The pointers will all be to
the Z-structures, or to constants, so there is no need to
worry about freeing them */
-struct attrvalues {
+struct yaz_facet_attr {
int errcode; /* set in case of errors */
char *errstring; /* opt */
const char *useattr; /* @attr 1, from a string attr */
};
YAZ_EXPORT
-void facet_struct_init(struct attrvalues *attr_values);
+void facet_struct_init(struct yaz_facet_attr *attr_values);
/* Use attribute, @attr1, can be numeric or string */
YAZ_EXPORT
-void useattr ( Z_AttributeElement *ae, struct attrvalues *av );
+void useattr ( Z_AttributeElement *ae, struct yaz_facet_attr *av );
YAZ_EXPORT
-void relationattr ( Z_AttributeElement *ae, struct attrvalues *av );
+void relationattr ( Z_AttributeElement *ae, struct yaz_facet_attr *av );
YAZ_EXPORT
-void limitattr ( Z_AttributeElement *ae, struct attrvalues *av );
+void limitattr ( Z_AttributeElement *ae, struct yaz_facet_attr *av );
YAZ_EXPORT
-void limitattr ( Z_AttributeElement *ae, struct attrvalues *av );
+void limitattr ( Z_AttributeElement *ae, struct yaz_facet_attr *av );
YAZ_EXPORT
-void facetattrs( Z_AttributeList *attributes, struct attrvalues *av );
+void facetattrs( 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 attrvalues *attr_values) {
+void facet_struct_init(struct yaz_facet_attr *attr_values) {
attr_values->errcode = 0;
attr_values->errstring = 0;
attr_values->relation = 0;
/* Use attribute, @attr1, can be numeric or string */
void useattr ( Z_AttributeElement *ae,
- struct attrvalues *av )
+ 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 attrvalues *av )
+ struct yaz_facet_attr *av )
{
if ( ae->which == Z_AttributeValue_numeric ) {
if ( *ae->value.numeric == 0 )
} /* relationattr */
void limitattr ( Z_AttributeElement *ae,
- struct attrvalues *av )
+ struct yaz_facet_attr *av )
{
/* TODO - check numeric first, then value! */
if ( ae->which == Z_AttributeValue_numeric ) {
*/
void facetattrs( Z_AttributeList *attributes,
- struct attrvalues *av )
+ struct yaz_facet_attr *av )
{
int i;
Z_AttributeElement *ae;
static ZOOM_facet_field get_zoom_facet_field(ODR odr, Z_FacetField *facet) {
int term_index;
- struct attrvalues attr_values;
+ 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);
Z_FacetList *new_list = facet_list_create(odr, facet_list->num);
for (index = 0; index < facet_list->num; index++) {
- struct attrvalues attrvalues;
+ struct yaz_facet_attr attrvalues;
facet_struct_init(&attrvalues);
attrvalues.limit = 10;
facetattrs(facet_list->elements[index]->attributes, &attrvalues);