Possible compatibility problems with earlier versions marked with '*'.
+* SRW/SRU 1.1 updates: updated diagnostic in srw.h to use uri instead
+of code.
+
Added init command for yaz-client which sends "extra" init request.
Fixed two bugs in OID codec - ber_oidc. Throw error when encoding/decoding
* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.229 2004-02-14 15:44:15 adam Exp $
+ * $Id: client.c,v 1.230 2004-02-14 15:58:42 adam Exp $
*/
#include <stdio.h>
sr = yaz_srw_get(out, Z_SRW_searchRetrieve_request);
sr->u.request->query_type = Z_SRW_query_type_cql;
sr->u.request->query.cql = odr_strdup(out, arg);
+
+ sr->u.request->maximumRecords = odr_intdup(out, 0);
+
if (record_schema)
sr->u.request->recordSchema = record_schema;
return send_srw(sr);
for (i = 0; i<res->num_diagnostics; i++)
{
- printf ("SRW diagnostic %s\n",
- res->diagnostics[i].code);
+ if (res->diagnostics[i].uri)
+ printf ("SRW diagnostic %s\n",
+ res->diagnostics[i].uri);
+ else
+ printf ("SRW diagnostic missing or could not be decoded\n");
if (res->diagnostics[i].message)
printf ("Message: %s\n", res->diagnostics[i].message);
if (res->diagnostics[i].details)
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: srw.h,v 1.15 2004-01-27 12:15:11 adam Exp $
+ * $Id: srw.h,v 1.16 2004-02-14 15:58:42 adam Exp $
*/
#ifndef YAZ_SRW_H
} Z_SRW_record;
typedef struct {
- char *code;
+ char *uri;
char *details;
char *message;
} Z_SRW_diagnostic;
* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.19 2004-01-27 12:15:12 adam Exp $
+ * $Id: seshigh.c,v 1.20 2004-02-14 15:58:42 adam Exp $
*/
/*
yaz_mk_std_diagnostic(assoc->encode, srw_res->diagnostics,
yaz_diag_bib1_to_srw (rr.errcode),
rr.errstring);
- yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %d",
- *srw_res->diagnostics[0].code);
+ yaz_log(LOG_DEBUG, "srw_bend_search returned SRW error %s",
+ srw_res->diagnostics[0].uri);
}
else
{
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.19 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.20 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: srw.c,v 1.20 2004-01-27 21:22:44 adam Exp $
+ * $Id: srw.c,v 1.21 2004-02-14 15:58:42 adam Exp $
*/
#include <yaz/srw.h>
*recs = odr_malloc(o, *num * sizeof(**recs));
for (i = 0; i < *num; i++)
{
- (*recs)[i].code = 0;
+ (*recs)[i].uri = 0;
(*recs)[i].details = 0;
(*recs)[i].message = 0;
}
!strcmp(ptr->name, "diagnostic"))
{
xmlNodePtr rptr;
- (*recs)[i].code = 0;
+ (*recs)[i].uri = 0;
(*recs)[i].details = 0;
(*recs)[i].message = 0;
for (rptr = ptr->children; rptr; rptr = rptr->next)
{
- if (match_xsd_string(rptr, "code", o,
- &(*recs)[i].code))
+ if (match_xsd_string(rptr, "uri", o,
+ &(*recs)[i].uri))
;
else if (match_xsd_string(rptr, "details", o,
&(*recs)[i].details))
{
const char *std_diag = "info:srw/diagnostic/1/";
xmlNodePtr rptr = xmlNewChild(pptr, ns_diag, "diagnostic", 0);
- add_xsd_string(rptr, "code", (*recs)[i].code);
+ add_xsd_string(rptr, "uri", (*recs)[i].uri);
if ((*recs)[i].message)
add_xsd_string(rptr, "message", (*recs)[i].message);
- else if ((*recs)[i].code &&
- !strncmp((*recs)[i].code, std_diag, strlen(std_diag)))
+ else if ((*recs)[i].uri &&
+ !strncmp((*recs)[i].uri, std_diag, strlen(std_diag)))
{
- int no = atoi((*recs)[i].code + strlen(std_diag));
+ int no = atoi((*recs)[i].uri + strlen(std_diag));
const char *message = yaz_diag_srw_str(no);
if (message)
add_xsd_string(rptr, "message", message);
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: srwutil.c,v 1.11 2004-01-27 21:22:44 adam Exp $
+ * $Id: srwutil.c,v 1.12 2004-02-14 15:58:42 adam Exp $
*/
#include <yaz/srw.h>
void yaz_mk_std_diagnostic(ODR o, Z_SRW_diagnostic *d,
int code, const char *details)
{
- d->code = (char *) odr_malloc(o, 50);
- sprintf(d->code, "info:srw/diagnostic/1/%d", code);
+ d->uri = (char *) odr_malloc(o, 50);
+ sprintf(d->uri, "info:srw/diagnostic/1/%d", code);
d->message = 0;
if (details)
d->details = odr_strdup(o, details);
* Copyright (c) 2000-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.23 2004-02-11 13:37:17 adam Exp $
+ * $Id: zoom-c.c,v 1.24 2004-02-14 15:58:42 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.23 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.24 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
}
if (res->num_diagnostics > 0)
{
- const char *code = res->diagnostics[0].code;
- if (code)
+ const char *uri = res->diagnostics[0].uri;
+ if (uri)
{
- int code_int = 0;
+ int code = 0;
const char *cp;
- if ((cp = strrchr(code, '/')))
- code_int = atoi(cp+1);
- set_dset_error(c, code_int, code,
+ if ((cp = strrchr(uri, '/')))
+ code = atoi(cp+1);
+ set_dset_error(c, code, uri,
res->diagnostics[0].details, 0);
}
}