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
Avoid reverse lookup in GFS
[yaz-moved-to-github.git]
/
src
/
zoom-c.c
diff --git
a/src/zoom-c.c
b/src/zoom-c.c
index
7e3203a
..
674f314
100644
(file)
--- a/
src/zoom-c.c
+++ b/
src/zoom-c.c
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (c) 2000-2003, Index Data
+ * Copyright (c) 2000-2004, Index Data
* See the file LICENSE for details.
*
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.12 2003-12-20 00:51:19 adam Exp $
+ * $Id: zoom-c.c,v 1.18 2004-01-12 12:10:17 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
*
* ZOOM layer for C, connections, result sets, queries.
*/
@@
-918,7
+918,7
@@
static zoom_ret ZOOM_connection_send_init (ZOOM_connection c)
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.12 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.18 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
@@
-1485,6
+1485,7
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
{
char type[40];
char charset[40];
{
char type[40];
char charset[40];
+ char xpath[512];
const char *cp;
int i;
Z_NamePlusRecord *npr;
const char *cp;
int i;
Z_NamePlusRecord *npr;
@@
-1507,7
+1508,7
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
}
type[i] = '\0';
charset[0] = '\0';
}
type[i] = '\0';
charset[0] = '\0';
- if (type_spec[i] == ';')
+ while (type_spec[i] == ';')
{
i++;
while (type_spec[i] == ' ')
{
i++;
while (type_spec[i] == ' ')
@@
-1523,8
+1524,16
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
}
charset[i] = '\0';
}
}
charset[i] = '\0';
}
- }
-
+ else if (!strncmp(type_spec+i, "xpath=", 6))
+ {
+ cp = type_spec+i+6;
+ for (i = 0; cp[i] && i < sizeof(xpath)-1; i++)
+ xpath[i] = cp[i];
+ xpath[i] = '\0';
+ }
+ while (type_spec[i] == ' ')
+ i++;
+ }
if (!strcmp (type, "database"))
{
if (len)
if (!strcmp (type, "database"))
{
if (len)
@@
-1570,7
+1579,6
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
charset);
else if (r->which == Z_External_octet)
{
charset);
else if (r->which == Z_External_octet)
{
- yaz_marc_t mt;
const char *ret_buf;
switch (ent->value)
{
const char *ret_buf;
switch (ent->value)
{
@@
-1630,7
+1638,6
@@
ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
else if (r->which == Z_External_octet)
{
const char *ret_buf;
else if (r->which == Z_External_octet)
{
const char *ret_buf;
- yaz_marc_t mt;
int marc_decode_type = YAZ_MARC_MARCXML;
if (!strcmp(type, "oai"))
int marc_decode_type = YAZ_MARC_MARCXML;
if (!strcmp(type, "oai"))
@@
-2213,7
+2220,7
@@
ZOOM_scanset_display_term (ZOOM_scanset scan, size_t pos,
if (t->displayTerm)
{
if (t->displayTerm)
{
- term = (const char *) t->term->u.general->buf;
+ term = t->displayTerm;
*len = strlen(term);
}
else if (t->term->which == Z_Term_general)
*len = strlen(term);
}
else if (t->term->which == Z_Term_general)
@@
-2953,9
+2960,9
@@
static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
if (content_type && !yaz_strcmp_del("text/xml", content_type, "; "))
{
Z_SOAP *soap_package = 0;
if (content_type && !yaz_strcmp_del("text/xml", content_type, "; "))
{
Z_SOAP *soap_package = 0;
- ODR o = odr_createmem(ODR_DECODE);
+ ODR o = c->odr_in;
Z_SOAP_Handler soap_handlers[2] = {
Z_SOAP_Handler soap_handlers[2] = {
- {"http://www.loc.gov/zing/srw/v1.0/", 0,
+ {"http://www.loc.gov/zing/srw/", 0,
(Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
};
(Z_SOAP_fun) yaz_srw_codec},
{0, 0, 0}
};
@@
-2980,7
+2987,6
@@
static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
}
else
ret = -1;
}
else
ret = -1;
- odr_destroy(o);
}
if (ret)
{
}
if (ret)
{