Possible compatibility problems with earlier versions marked with '*'.
+New ODR utility, odr_getelement, which returns name element for
+which encoding/decoding failed.
+
+Fixed ODR so that it returns error code OREQUIRED rather than ONONE
+in cases where a required element was omitted.
+
Bug fix: some MARC8 sequences were not converted.
New ZOOM option "step" which specifies number of records to be
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: odr.h,v 1.11 2003-05-20 19:55:29 adam Exp $
+ * $Id: odr.h,v 1.12 2003-05-24 19:20:14 adam Exp $
*/
#ifndef ODR_H
YAZ_EXPORT int odr_geterror(ODR o);
YAZ_EXPORT int odr_geterrorx(ODR o, int *x);
YAZ_EXPORT void odr_seterror(ODR o, int errorno, int errorid);
-YAZ_EXPORT void odr_setaddinfo(ODR o, const char *addinfo);
-YAZ_EXPORT char *odr_getaddinfo(ODR o);
+YAZ_EXPORT void odr_setelement(ODR o, const char *addinfo);
+YAZ_EXPORT char *odr_getelement(ODR o);
YAZ_EXPORT void odr_perror(ODR o, char *message);
YAZ_EXPORT void odr_setprint(ODR o, FILE *file);
YAZ_EXPORT ODR odr_createmem(int direction);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: ber_tag.c,v 1.26 2003-05-20 19:55:29 adam Exp $
+ * $Id: ber_tag.c,v 1.27 2003-05-24 19:20:14 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
if (!opt)
{
odr_seterror(o, OREQUIRED, 24);
- odr_setaddinfo (o, name);
+ odr_setelement (o, name);
}
return 0;
}
if (!opt)
{
odr_seterror(o, OREQUIRED, 25);
- odr_setaddinfo(o, name);
+ odr_setelement(o, name);
}
return 0;
}
odr_max(o))) <= 0)
{
odr_seterror(o, OPROTO, 26);
- odr_setaddinfo(o, name);
+ odr_setelement(o, name);
return 0;
}
#ifdef ODR_DEBUG
if (!opt)
{
odr_seterror(o, OREQUIRED, 27);
- odr_setaddinfo(o, name);
+ odr_setelement(o, name);
}
return 0;
}
if (!*pp && !opt)
{
odr_seterror(o,OREQUIRED, 28);
- odr_setaddinfo(o, name);
+ odr_setelement(o, name);
}
return *pp != 0;
default:
odr_seterror(o, OOTHER, 29);
- odr_setaddinfo(o, name);
+ odr_setelement(o, name);
return 0;
}
}
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: odr-priv.h,v 1.5 2003-05-20 19:55:29 adam Exp $
+ * $Id: odr-priv.h,v 1.6 2003-05-24 19:20:14 adam Exp $
*/
#ifndef ODR_PRIV_H
struct Odr_ber_tag odr_ber_tag;
yaz_iconv_t iconv_handle;
int error_id;
- char addinfo[80];
+ char element[80];
};
/* Private macro.
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: odr.c,v 1.43 2003-05-20 19:55:29 adam Exp $
+ * $Id: odr.c,v 1.44 2003-05-24 19:20:14 adam Exp $
*
*/
#if HAVE_CONFIG_H
void odr_perror(ODR o, char *message)
{
- fprintf(stderr, "%s: %s: %s\n", message, odr_errlist[o->error],
- odr_getaddinfo(o));
+ const char *e = odr_getelement(o);
+
+ fprintf(stderr, "%s: %s", message, odr_errlist[o->error]);
+ if (e && *e)
+ fprintf (stderr, " element %s", e);
+ fprintf(stderr, "\n");
}
int odr_geterror(ODR o)
return o->error;
}
-char *odr_getaddinfo(ODR o)
+char *odr_getelement(ODR o)
{
- return o->op->addinfo;
+ return o->op->element;
}
void odr_seterror(ODR o, int error, int id)
{
o->error = error;
o->op->error_id = id;
- o->op->addinfo[0] = '\0';
+ o->op->element[0] = '\0';
}
-void odr_setaddinfo(ODR o, const char *addinfo)
+void odr_setelement(ODR o, const char *element)
{
- if (addinfo)
+ if (element)
{
- strncpy(o->op->addinfo, addinfo, sizeof(o->op->addinfo)-1);
- o->op->addinfo[sizeof(o->op->addinfo)-1] = '\0';
+ strncpy(o->op->element, element, sizeof(o->op->element)-1);
+ o->op->element[sizeof(o->op->element)-1] = '\0';
}
}
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: odr_util.c,v 1.24 2003-05-20 20:21:34 adam Exp $
+ * $Id: odr_util.c,v 1.25 2003-05-24 19:20:14 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
if (!opt)
{
odr_seterror(o, OREQUIRED, 53);
- odr_setaddinfo(o, name);
+ odr_setelement(o, name);
}
return opt;
}
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.157 2003-05-20 20:22:11 adam Exp $
+ * $Id: seshigh.c,v 1.158 2003-05-24 19:20:14 adam Exp $
*/
/*
odr_setbuf(assoc->decode, assoc->input_buffer, res, 0);
if (!z_GDU(assoc->decode, &req->gdu_request, 0, 0))
{
- yaz_log(LOG_LOG, "ODR error on incoming PDU: %s [addinfo %s] "
+ yaz_log(LOG_LOG, "ODR error on incoming PDU: %s [element %s] "
"[near byte %d] ",
odr_errmsg(odr_geterror(assoc->decode)),
- odr_getaddinfo(assoc->decode),
+ odr_getelement(assoc->decode),
odr_offset(assoc->decode));
if (assoc->decode->error != OHTTP)
{
}
if (!z_GDU(assoc->encode, &res, 0, 0))
{
- yaz_log(LOG_WARN, "ODR error when decoding PDU: %s [addinfo %s]",
+ yaz_log(LOG_WARN, "ODR error when decoding PDU: %s [element %s]",
odr_errmsg(odr_geterror(assoc->decode)),
- odr_getaddinfo(assoc->decode));
+ odr_getelement(assoc->decode));
return -1;
}
req->response = odr_getbuf(assoc->encode, &req->len_response,