From 51f1a3a3ef95b75ce626c388c0e5e3310e2f0b1c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 30 Jan 2014 13:32:26 +0100 Subject: [PATCH] ZOOM: change names of some facet var to denote response as opposed to request. --- src/zoom-c.c | 16 ++++++++-------- src/zoom-p.h | 4 ++-- src/zoom-z3950.c | 15 ++++++++++----- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/zoom-c.c b/src/zoom-c.c index 28eb798..d302c32 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -686,8 +686,8 @@ ZOOM_resultset ZOOM_resultset_create(void) r->connection = 0; r->databaseNames = 0; r->num_databaseNames = 0; - r->facets = 0; - r->num_facets = 0; + r->res_facets = 0; + r->num_res_facets = 0; r->facets_names = 0; r->mutex = 0; yaz_mutex_create(&r->mutex); @@ -980,14 +980,14 @@ ZOOM_API(void) ZOOM_API(size_t) ZOOM_resultset_facets_size(ZOOM_resultset r) { - return r->num_facets; + return r->num_res_facets; } ZOOM_API(ZOOM_facet_field) ZOOM_resultset_get_facet_field(ZOOM_resultset r, const char *name) { - int num = r->num_facets; - ZOOM_facet_field *facets = r->facets; + int num = r->num_res_facets; + ZOOM_facet_field *facets = r->res_facets; int i; for (i = 0; i < num; i++) if (!strcmp(facets[i]->facet_name, name)) @@ -998,8 +998,8 @@ ZOOM_API(ZOOM_facet_field) ZOOM_API(ZOOM_facet_field) ZOOM_resultset_get_facet_field_by_index(ZOOM_resultset r, int idx) { - int num = r->num_facets; - ZOOM_facet_field *facets = r->facets; + int num = r->num_res_facets; + ZOOM_facet_field *facets = r->res_facets; if (idx >= 0 && idx < num) return facets[idx]; return 0; @@ -1008,7 +1008,7 @@ ZOOM_API(ZOOM_facet_field) ZOOM_API(ZOOM_facet_field *) ZOOM_resultset_facets(ZOOM_resultset r) { - return r->facets; + return r->res_facets; } ZOOM_API(const char**) diff --git a/src/zoom-p.h b/src/zoom-p.h index bad6acf..d09c54f 100644 --- a/src/zoom-p.h +++ b/src/zoom-p.h @@ -139,8 +139,8 @@ struct ZOOM_resultset_p { struct WRBUF_shptr *record_wrbuf; #endif ZOOM_resultset next; - ZOOM_facet_field *facets; - int num_facets; + ZOOM_facet_field *res_facets; + int num_res_facets; char **facets_names; /* redundant. For ZOOM_resultset_facets_names only */ WRBUF mc_key; int live_set; /* 0=no hit count, 1=cached hit, 2=hits + real set */ diff --git a/src/zoom-z3950.c b/src/zoom-z3950.c index e39ff8a..824488e 100644 --- a/src/zoom-z3950.c +++ b/src/zoom-z3950.c @@ -1121,16 +1121,21 @@ static ZOOM_facet_field get_zoom_facet_field(ODR odr, Z_FacetField *facet) void ZOOM_handle_facet_list(ZOOM_resultset r, Z_FacetList *fl) { int j; - r->num_facets = fl->num; + r->num_res_facets = fl->num; yaz_log(YLOG_DEBUG, "Facets found: %d", fl->num); - r->facets = odr_malloc(r->odr, fl->num * sizeof(*r->facets)); + r->res_facets = odr_malloc(r->odr, fl->num * sizeof(*r->res_facets)); r->facets_names = odr_malloc(r->odr, fl->num * sizeof(*r->facets_names)); for (j = 0; j < fl->num; j++) { - r->facets[j] = get_zoom_facet_field(r->odr, fl->elements[j]); - if (!r->facets[j]) + r->res_facets[j] = get_zoom_facet_field(r->odr, fl->elements[j]); + if (!r->res_facets[j]) + { + r->facets_names[j] = 0; yaz_log(YLOG_DEBUG, "Facet field missing on index %d !", j); - r->facets_names[j] = (char *) ZOOM_facet_field_name(r->facets[j]); + } + else + r->facets_names[j] = (char *) + ZOOM_facet_field_name(r->res_facets[j]); } } -- 1.7.10.4