/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2010 Index Data
* See the file LICENSE for details.
*/
/**
ZOOM_API(size_t)
ZOOM_resultset_size(ZOOM_resultset r)
{
- yaz_log(log_details, "ZOOM_resultset_size r=%p count=%d",
+ yaz_log(log_details, "ZOOM_resultset_size r=%p count=" ODR_INT_PRINTF,
r, r->size);
return r->size;
}
if (c->cs && c->cs->protocol == PROTO_HTTP)
{
#if YAZ_HAVE_XML2
- const char *path = 0;
+ const char *db = 0;
c->proto = PROTO_HTTP;
- cs_get_host_args(c->host_port, &path);
+ cs_get_host_args(c->host_port, &db);
xfree(c->path);
- c->path = (char*) xmalloc(strlen(path)+2);
- c->path[0] = '/';
- strcpy(c->path+1, path);
+
+ c->path = xmalloc(strlen(db) * 3 + 2);
+ yaz_encode_sru_dbpath_buf(c->path, db);
#else
set_ZOOM_error(c, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, "SRW");
do_close(c);
char *fdatabase = 0;
if (database)
- {
- fdatabase = (char *) odr_malloc(c->odr_out, strlen(database)+2);
- strcpy(fdatabase, "/");
- strcat(fdatabase, database);
- }
+ fdatabase = yaz_encode_sru_dbpath_odr(c->odr_out, database);
gdu = z_get_HTTP_Request_host_path(c->odr_out, c->host_port,
fdatabase ? fdatabase : c->path);
{
/* Use "from,to" or just "from" */
const char *cp = strchr(record_charset, ',');
- int clen = strlen(record_charset);
+ size_t clen = strlen(record_charset);
if (cp && cp[1])
{
strncpy( to, cp+1, sizeof(to)-1);
char charset[40];
char xpath[512];
const char *cp;
- int i;
+ size_t i;
Z_NamePlusRecord *npr;
if (len)
i++;
if (!strncmp(type_spec+i, "charset=", 8))
{
- int j = 0;
+ size_t j = 0;
i = i + 8; /* skip charset= */
for (j = 0; type_spec[i] && j < sizeof(charset)-1; i++, j++)
{
}
else if (!strncmp(type_spec+i, "xpath=", 6))
{
- int j = 0;
+ size_t j = 0;
i = i + 6;
for (j = 0; type_spec[i] && j < sizeof(xpath)-1; i++, j++)
xpath[j] = cp[i];
}
static void ZOOM_scanset_term_x(ZOOM_scanset scan, size_t pos,
- int *occ,
+ size_t *occ,
const char **value_term, size_t *value_len,
const char **disp_term, size_t *disp_len)
{
*disp_len = 0;
*occ = 0;
- if (pos >= noent || pos < 0)
+ if (pos >= noent)
return;
if (scan->scan_response)
{
ZOOM_API(const char *)
ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
- int *occ, int *len)
+ size_t *occ, size_t *len)
{
const char *value_term = 0;
size_t value_len = 0;
ZOOM_API(const char *)
ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos,
- int *occ, int *len)
+ size_t *occ, size_t *len)
{
const char *value_term = 0;
size_t value_len = 0;
Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;
ZOOM_options_set(c->options, "sru_version", sr->srw_version);
+ ZOOM_options_setl(c->options, "sru_extra_response_data",
+ sr->extraResponseData_buf, sr->extraResponseData_len);
if (sr->which == Z_SRW_searchRetrieve_response)
cret = handle_srw_response(c, sr->u.response);
else if (sr->which == Z_SRW_scan_response)