projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Decode SRU 2.0 responses
[yaz-moved-to-github.git]
/
src
/
zoom-c.c
diff --git
a/src/zoom-c.c
b/src/zoom-c.c
index
92154a7
..
e597e24
100644
(file)
--- a/
src/zoom-c.c
+++ b/
src/zoom-c.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* 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.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-337,7
+337,7
@@
char **ZOOM_connection_get_databases(ZOOM_connection con, ZOOM_options options,
if (cp)
cp++;
}
if (cp)
cp++;
}
- if (!cp)
+ if (!cp || !*cp)
cp = "Default";
nmem_strsplit(odr_getmem(odr), "+", cp, &databaseNames, num);
return databaseNames;
cp = "Default";
nmem_strsplit(odr_getmem(odr), "+", cp, &databaseNames, num);
return databaseNames;
@@
-419,7
+419,6
@@
ZOOM_API(void)
c->tproxy = xstrdup(val);
}
c->tproxy = xstrdup(val);
}
-
xfree(c->charset);
c->charset = 0;
val = ZOOM_options_get(c->options, "charset");
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 &&
char *pcomma;
char *pequals;
while ((pcomma = strchr(remainder, ',')) != 0 &&
- (pcolon == 0 || pcomma < pcolon)) {
+ (pcolon == 0 || pcomma < pcolon))
+ {
*pcomma = '\0';
*pcomma = '\0';
- if ((pequals = strchr(remainder, '=')) != 0) {
+ if ((pequals = strchr(remainder, '=')) != 0)
+ {
*pequals = '\0';
*pequals = '\0';
- /*printf("# setting '%s'='%s'\n", remainder, pequals+1);*/
ZOOM_connection_option_set(c, remainder, pequals+1);
}
remainder = pcomma+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);
xfree(c->host_port);
- c->host_port = xstrdup(remainder);
- /*printf("# reset hp='%s'\n", remainder);*/
+ c->host_port = remainder;
}
}
}
}
@@
-1020,6
+1021,15
@@
ZOOM_API(ZOOM_facet_field)
return 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(ZOOM_facet_field *)
ZOOM_resultset_facets(ZOOM_resultset r)
@@
-1028,7
+1038,7
@@
ZOOM_API(ZOOM_facet_field *)
}
ZOOM_API(const char**)
}
ZOOM_API(const char**)
- ZOOM_resultset_facet_names(ZOOM_resultset r)
+ ZOOM_resultset_facets_names(ZOOM_resultset r)
{
return (const char **) r->facets_names;
}
{
return (const char **) r->facets_names;
}