X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fzoom-c.c;h=e597e24e8cccae711f24f9e61843b7991afe5259;hb=3e11596504862f376b7340848715d6f549864660;hp=667edb3548436024442a50b6a77c9d9497c7443e;hpb=665d20fd5ce32ae2177ed17ace8a893aec375bb1;p=yaz-moved-to-github.git diff --git a/src/zoom-c.c b/src/zoom-c.c index 667edb3..e597e24 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -419,7 +419,6 @@ ZOOM_API(void) c->tproxy = xstrdup(val); } - xfree(c->charset); c->charset = 0; val = ZOOM_options_get(c->options, "charset"); @@ -466,21 +465,22 @@ ZOOM_API(void) char *pcomma; char *pequals; while ((pcomma = strchr(remainder, ',')) != 0 && - (pcolon == 0 || pcomma < pcolon)) { + (pcolon == 0 || pcomma < pcolon)) + { *pcomma = '\0'; - if ((pequals = strchr(remainder, '=')) != 0) { + if ((pequals = strchr(remainder, '=')) != 0) + { *pequals = '\0'; - /*printf("# setting '%s'='%s'\n", remainder, pequals+1);*/ ZOOM_connection_option_set(c, remainder, pequals+1); } remainder = pcomma+1; } - if (remainder != c->host_port) { + if (remainder != c->host_port) + { remainder = xstrdup(remainder); xfree(c->host_port); c->host_port = remainder; - /*printf("# reset hp='%s'\n", remainder);*/ } } @@ -1021,6 +1021,15 @@ ZOOM_API(ZOOM_facet_field) return 0; } +ZOOM_API(ZOOM_facet_field) + ZOOM_resultset_get_facet_field_by_index(ZOOM_resultset r, int index) { + int num = r->num_facets; + ZOOM_facet_field *facets = r->facets; + if (index >= 0 && index < num) { + return facets[index]; + } + return 0; +} ZOOM_API(ZOOM_facet_field *) ZOOM_resultset_facets(ZOOM_resultset r) @@ -1029,7 +1038,7 @@ ZOOM_API(ZOOM_facet_field *) } ZOOM_API(const char**) - ZOOM_resultset_facet_names(ZOOM_resultset r) + ZOOM_resultset_facets_names(ZOOM_resultset r) { return (const char **) r->facets_names; }