/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/**
if (cp)
cp++;
}
- if (!cp)
+ if (!cp || !*cp)
cp = "Default";
nmem_strsplit(odr_getmem(odr), "+", cp, &databaseNames, num);
return databaseNames;
c->tproxy = xstrdup(val);
}
-
xfree(c->charset);
c->charset = 0;
val = ZOOM_options_get(c->options, "charset");
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;
}
}
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);
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)
}
ZOOM_API(const char**)
- ZOOM_resultset_facet_names(ZOOM_resultset r)
+ ZOOM_resultset_facets_names(ZOOM_resultset r)
{
return (const char **) r->facets_names;
}