From: Adam Dickmeiss Date: Tue, 3 Aug 2010 11:10:58 +0000 (+0200) Subject: Rename struct attrvalues to yaz_facet_attr X-Git-Tag: v4.0.12~9^2~8 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=79e871ca9f4d35a123a8a0dddb60b4a8c8b62dbd;p=yaz-moved-to-github.git Rename struct attrvalues to yaz_facet_attr This structure is facet specific and not a generic attribute container. --- diff --git a/client/client.c b/client/client.c index 2331307..4b6ad19 100644 --- a/client/client.c +++ b/client/client.c @@ -1649,7 +1649,7 @@ static void display_queryExpression(const char *lead, Z_QueryExpression *qe) 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; diff --git a/include/yaz/facet.h b/include/yaz/facet.h index cd34496..56dd17a 100644 --- a/include/yaz/facet.h +++ b/include/yaz/facet.h @@ -47,11 +47,11 @@ YAZ_BEGIN_CDECL * */ -/* 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 */ @@ -63,23 +63,23 @@ struct attrvalues { }; 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); diff --git a/src/facet.c b/src/facet.c index 385a195..bf1904b 100644 --- a/src/facet.c +++ b/src/facet.c @@ -23,7 +23,7 @@ /* 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; @@ -45,7 +45,7 @@ const char *stringattr( Z_ComplexAttribute *c ) { /* 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 ) { @@ -71,7 +71,7 @@ void useattr ( Z_AttributeElement *ae, /* 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 ) @@ -94,7 +94,7 @@ void relationattr ( Z_AttributeElement *ae, } /* 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 ) { @@ -117,7 +117,7 @@ void limitattr ( Z_AttributeElement *ae, */ void facetattrs( Z_AttributeList *attributes, - struct attrvalues *av ) + struct yaz_facet_attr *av ) { int i; Z_AttributeElement *ae; diff --git a/src/zoom-c.c b/src/zoom-c.c index b483fd9..aa94b8e 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -2695,7 +2695,7 @@ static char *get_term_cstr(ODR odr, Z_Term *term) { 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); diff --git a/ztest/ztest.c b/ztest/ztest.c index 2277398..c786d89 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -251,7 +251,7 @@ Z_OtherInformation *build_facet_response(ODR odr, Z_FacetList *facet_list) { 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);