X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fzoom-c.c;h=2e3e1fecf7312916916ba23a103ee6665afc7e43;hp=e763918ec08f2a07c2a41d3f442114190f9a5144;hb=0face583d9eded63ad552038b3cbae607866f646;hpb=09db2ad24d6ba8693290d4a5dbc0a741fff74c91 diff --git a/src/zoom-c.c b/src/zoom-c.c index e763918..2e3e1fe 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,20 +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 = xstrdup(remainder); - /*printf("# reset hp='%s'\n", remainder);*/ + c->host_port = remainder; } } @@ -533,9 +534,9 @@ ZOOM_API(void) c->password = xstrdup(val); c->maximum_record_size = - ZOOM_options_get_int(c->options, "maximumRecordSize", 1024*1024); + ZOOM_options_get_int(c->options, "maximumRecordSize", 64*1024*1024); c->preferred_message_size = - ZOOM_options_get_int(c->options, "preferredMessageSize", 1024*1024); + ZOOM_options_get_int(c->options, "preferredMessageSize", 64*1024*1024); c->async = ZOOM_options_get_bool(c->options, "async", 0); @@ -1020,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) @@ -1028,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; }