info with name of element. New ODR function odr_missing.
Removed depricated macros odr_implicit and odr_explicit.
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: admin.h,v 1.6 2003-03-11 11:07:47 adam Exp $
+ * $Id: admin.h,v 1.7 2003-05-20 19:55:29 adam Exp $
*/
int cmd_adm_reindex(const char* arg);
int cmd_adm_shutdown(const char* arg);
int cmd_adm_startup(const char* arg);
-void send_apdu(Z_APDU *a);
+int send_apdu(Z_APDU *a);
/*
* Local variables:
* tab-width: 8
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.193 2003-05-19 20:44:33 adam Exp $
+ * $Id: client.c,v 1.194 2003-05-20 19:55:29 adam Exp $
*/
#include <stdio.h>
}
}
-void send_apdu(Z_APDU *a)
+int send_apdu(Z_APDU *a)
{
char *buf;
int len;
{
odr_perror(out, "Encoding APDU");
close_session();
- return;
+ return 0;
}
buf = odr_getbuf(out, &len, 0);
if (ber_file)
{
fprintf(stderr, "cs_put: %s", cs_errmsg(cs_errno(conn)));
close_session();
- return;
+ return 0;
}
do_hex_dump(buf,len);
odr_reset(out); /* release the APDU structure */
+ return 1;
}
static void print_stringn(const unsigned char *buf, size_t len)
}
}
- send_apdu(apdu);
- printf("Sent initrequest.\n");
+ if (send_apdu(apdu))
+ printf("Sent initrequest.\n");
}
static int process_initResponse(Z_InitResponse *res)
printf ("Unsupported query type\n");
return 0;
}
- send_apdu(apdu);
+ if (send_apdu(apdu))
+ printf("Sent searchRequest.\n");
setno = 1;
- printf("Sent searchRequest.\n");
return 2;
}
-<!-- $Id: odr.xml,v 1.8 2002-09-03 09:50:34 adam Exp $ -->
+<!-- $Id: odr.xml,v 1.9 2003-05-20 19:55:29 adam Exp $ -->
<chapter id="odr"><title>The ODR Module</title>
<sect1 id="odr.introduction"><title>Introduction</title>
<para>
The function <function>myInt()</function> can then be used like any of
the primitive functions provided by &odr;. Note that the behavior of
- <function>odr_explicit()</function>
- and <function>odr_implicit()</function> macros
+ <function>odr_explicit_tag()</function>
+ and <function>odr_implicit_tag()</function> macros
act exactly the same as the functions they are applied to - they
respond to error conditions, etc, in the same manner - they
simply have three extra parameters. The class parameter may
Note the 1 in the call to <function>odr_bool()</function>, to mark
that the sequence member is optional.
If either of the member types had been tagged, the macros
- <function>odr_implicit()</function> or <function>odr_explicit()</function>
+ <function>odr_implicit_tag()</function> or
+ <function>odr_explicit_tag()</function>
could have been used.
The new function can be used exactly like the standard functions provided
with &odr;. It will encode, decode or pretty-print a data value of the
<para>
which overrides the tag of the type immediately following it. The
- macro <function>odr_implicit()</function> works by calling
+ macro <function>odr_implicit_tag()</function> works by calling
<function>odr_implicit_settag()</function> immediately
before calling the function pointer argument.
Your type function could look like this:
interface) is less than the time that would be required to develop a
better interface. Nevertheless, it is far from satisfying, and it's a
point that will be worked on in the future. One option for you would
- be to simply apply the <function>odr_explicit()</function> macro to
+ be to simply apply the <function>odr_explicit_tag()</function> macro to
the first function, and not
have to worry about <function>odr_constructed_*</function> yourself.
Incidentally, as you might have guessed, the
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: odr.h,v 1.10 2003-03-18 13:34:35 adam Exp $
+ * $Id: odr.h,v 1.11 2003-05-20 19:55:29 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_perror(ODR o, char *message);
YAZ_EXPORT void odr_setprint(ODR o, FILE *file);
YAZ_EXPORT ODR odr_createmem(int direction);
#define odr_release_mem(m) nmem_destroy(m)
#define ODR_MEM NMEM
-#define odr_implicit(o, t, p, cl, tg, opt)\
- (odr_implicit_settag((o), cl, tg), t ((o), (p), (opt), 0) )
-
#define odr_implicit_tag(o, t, p, cl, tg, opt, name)\
(odr_implicit_settag((o), cl, tg), t ((o), (p), (opt), name) )
-#define odr_explicit(o, t, p, cl, tg, opt)\
- ((int) (odr_constructed_begin((o), (p), (cl), (tg), 0) ? \
- t ((o), (p), (opt), 0) &&\
- odr_constructed_end(o) : opt))
-
#define odr_explicit_tag(o, t, p, cl, tg, opt, name)\
((int) (odr_constructed_begin((o), (p), (cl), (tg), 0) ? \
t ((o), (p), (opt), name) &&\
- odr_constructed_end(o) : opt))
+ odr_constructed_end(o) : odr_missing((o), opt, name)))
#define ODR_MASK_ZERO(mask)\
((void) (memset((mask)->bits, 0, ODR_BITMASK_SIZE),\
YAZ_EXPORT int ber_boolean(ODR o, int *val);
YAZ_EXPORT int ber_tag(ODR o, void *p, int zclass, int tag,
- int *constructed, int opt);
+ int *constructed, int opt, const char *name);
YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed);
YAZ_EXPORT int ber_dectag(const unsigned char *buf, int *zclass,
int *tag, int *constructed, int max);
YAZ_EXPORT int odr_initmember(ODR o, void *p, int size);
YAZ_EXPORT int odr_peektag(ODR o, int *zclass, int *tag, int *cons);
YAZ_EXPORT void odr_setlenlen(ODR o, int len);
+YAZ_EXPORT int odr_missing(ODR o, int opt, const char *name);
typedef struct Odr_external
{
-## $Id: Makefile.am,v 1.8 2003-05-06 10:08:30 adam Exp $
+## $Id: Makefile.am,v 1.9 2003-05-20 19:55:29 adam Exp $
noinst_LTLIBRARIES = libodr.la
tstodr_SOURCES = tstodr.c tstodrcodec.c tstodrcodec.h
# Rule for generating codecs for our small ASN.1 spec
-tstodrcodec.c tstodrcodec.h: $(srcdir)/tstodr.asn
+tstodrcodec.c tstodrcodec.h: $(srcdir)/tstodr.asn $(top_srcdir)/util/yaz-comp
cd $(srcdir); $(top_srcdir)/util/yaz-comp tstodr.asn
libodr_la_SOURCES = odr_bool.c ber_bool.c ber_len.c ber_tag.c odr_util.c \
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: ber_tag.c,v 1.25 2003-03-11 11:03:31 adam Exp $
+ * $Id: ber_tag.c,v 1.26 2003-05-20 19:55:29 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
*
* Should perhaps be odr_tag?
*/
-int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt)
+int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt,
+ const char *name)
{
struct Odr_ber_tag *odr_ber_tag = &o->op->odr_ber_tag;
int rd;
if (!*pp)
{
if (!opt)
+ {
odr_seterror(o, OREQUIRED, 24);
+ odr_setaddinfo (o, name);
+ }
return 0;
}
if ((rd = ber_enctag(o, zclass, tag, *constructed)) < 0)
if (o->op->stackp > -1 && !odr_constructed_more(o))
{
if (!opt)
+ {
odr_seterror(o, OREQUIRED, 25);
+ odr_setaddinfo(o, name);
+ }
return 0;
}
if (odr_ber_tag->lclass < 0)
odr_max(o))) <= 0)
{
odr_seterror(o, OPROTO, 26);
+ odr_setaddinfo(o, name);
return 0;
}
#ifdef ODR_DEBUG
else
{
if (!opt)
+ {
odr_seterror(o, OREQUIRED, 27);
+ odr_setaddinfo(o, name);
+ }
return 0;
}
case ODR_PRINT:
if (!*pp && !opt)
+ {
odr_seterror(o,OREQUIRED, 28);
+ odr_setaddinfo(o, name);
+ }
return *pp != 0;
default:
odr_seterror(o, OOTHER, 29);
+ odr_setaddinfo(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.4 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr-priv.h,v 1.5 2003-05-20 19:55:29 adam Exp $
*/
#ifndef ODR_PRIV_H
struct Odr_ber_tag odr_ber_tag;
yaz_iconv_t iconv_handle;
int error_id;
+ char addinfo[80];
};
/* Private macro.
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: odr.c,v 1.42 2003-05-19 14:37:38 adam Exp $
+ * $Id: odr.c,v 1.43 2003-05-20 19:55:29 adam Exp $
*
*/
#if HAVE_CONFIG_H
"Stack overflow",
"Length of constructed type different from sum of members",
"Overflow writing definite length of constructed type",
- "HTTP Bad Request"
+ "Bad HTTP Request"
};
char *odr_errmsg(int n)
void odr_perror(ODR o, char *message)
{
- fprintf(stderr, "%s: %s\n", message, odr_errlist[o->error]);
+ fprintf(stderr, "%s: %s: %s\n", message, odr_errlist[o->error],
+ odr_getaddinfo(o));
}
int odr_geterror(ODR o)
return o->error;
}
+char *odr_getaddinfo(ODR o)
+{
+ return o->op->addinfo;
+}
+
void odr_seterror(ODR o, int error, int id)
{
o->error = error;
o->op->error_id = id;
+ o->op->addinfo[0] = '\0';
+}
+
+void odr_setaddinfo(ODR o, const char *addinfo)
+{
+ if (addinfo)
+ {
+ strncpy(o->op->addinfo, addinfo, sizeof(o->op->addinfo)-1);
+ o->op->addinfo[sizeof(o->op->addinfo)-1] = '\0';
+ }
}
void odr_setprint(ODR o, FILE *file)
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_any.c,v 1.13 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_any.c,v 1.14 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
if (ber_any(o, p))
return 1;
*p = 0;
- if (!opt)
- odr_seterror(o, OREQUIRED, 53);
- return opt;
-}
+ return odr_missing(o, opt, name);
+}
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_bit.c,v 1.17 2003-04-24 12:48:47 adam Exp $
+ * $Id: odr_bit.c,v 1.18 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_BITSTRING;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_bool.c,v 1.14 2003-01-06 08:20:27 adam Exp $
+ * $Id: odr_bool.c,v 1.15 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_BOOLEAN;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: odr_cons.c,v 1.25 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_cons.c,v 1.26 2003-05-20 19:55:30 adam Exp $
*
*/
#if HAVE_CONFIG_H
o->t_class = zclass;
o->t_tag = tag;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, 1)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, 1, name)) < 0)
return 0;
if (!res || !cons)
return 0;
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_enum.c,v 1.8 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_enum.c,v 1.9 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_ENUM;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_int.c,v 1.18 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_int.c,v 1.19 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_INTEGER;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_null.c,v 1.16 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_null.c,v 1.17 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_NULL;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_oct.c,v 1.21 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_oct.c,v 1.22 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_OCTETSTRING;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
int i;
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_OCTETSTRING;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_OCTETSTRING;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (o->direction == ODR_PRINT)
{
odr_prname(o, name);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_oid.c,v 1.19 2003-03-11 11:03:31 adam Exp $
+ * $Id: odr_oid.c,v 1.20 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
o->t_class = ODR_UNIVERSAL;
o->t_tag = ODR_OID;
}
- if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
+ if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0)
return 0;
if (!res)
- return opt;
+ return odr_missing(o, opt, name);
if (cons)
{
odr_seterror(o, OPROTO, 46);
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: odr_use.c,v 1.13 2003-01-06 08:20:28 adam Exp $
+ * $Id: odr_use.c,v 1.14 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
odr_implicit_settag(o, ODR_UNIVERSAL, ODR_EXTERNAL);
if (!odr_sequence_begin(o, p, sizeof(Odr_external), name))
- return opt;
+ return odr_missing(o, opt, name);
pp = *p;
return
odr_oid(o, &pp->direct_reference, 1, "direct") &&
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: odr_util.c,v 1.22 2003-01-06 08:20:28 adam Exp $
+ * $Id: odr_util.c,v 1.23 2003-05-20 19:55:30 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
return odr_getoidbystr_nmem (o->mem, str);
}
-
+int odr_missing(ODR o, int opt, const char *name)
+{
+ if (o->error)
+ return 0;
+ if (!opt)
+ {
+ printf ("odr_missing set error : %s\n", name);
+ odr_seterror(o, OREQUIRED, 55);
+ odr_setaddinfo(o, name);
+ }
+ return opt;
+}
* Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
*
- * $Id: tstodr.c,v 1.2 2003-05-06 13:09:15 adam Exp $
+ * $Id: tstodr.c,v 1.3 2003-05-20 19:55:30 adam Exp $
*
*/
#include <stdio.h>
#include <yaz/odr.h>
#include "tstodrcodec.h"
-void tst_MySequence(ODR encode, ODR decode)
+void tst_MySequence1(ODR encode, ODR decode)
{
char *ber_buf;
int ber_len;
exit(8);
}
+void tst_MySequence2(ODR encode, ODR decode)
+{
+ char *ber_buf;
+ int ber_len;
+ Yc_MySequence *s = odr_malloc(encode, sizeof(*s));
+ Yc_MySequence *t;
+
+ s->first = 0; /* deliberately miss this .. */
+ s->second = odr_malloc(encode, sizeof(*s->second));
+ s->second->buf = "hello";
+ s->second->len = 5;
+ s->second->size = 0;
+ s->third = odr_intdup(encode, 1);
+ s->fourth = odr_nullval();
+ s->fifth = odr_intdup(encode, YC_MySequence_enum1);
+
+ if (yc_MySequence(encode, &s, 0, 0)) /* should fail */
+ exit(9);
+ if (odr_geterror(encode) != OREQUIRED)
+ exit(10);
+ if (strcmp(odr_getaddinfo(encode), "first"))
+ exit(11);
+ odr_reset(encode);
+
+ if (odr_geterror(encode) != ONONE)
+ exit(12);
+ if (strcmp(odr_getaddinfo(encode), ""))
+ exit(13);
+}
+
int main(int argc, char **argv)
{
ODR odr_encode = odr_createmem(ODR_ENCODE);
ODR odr_decode = odr_createmem(ODR_DECODE);
- tst_MySequence(odr_encode, odr_decode);
+ tst_MySequence1(odr_encode, odr_decode);
+ tst_MySequence2(odr_encode, odr_decode);
odr_destroy(odr_encode);
odr_destroy(odr_decode);
# (c) Index Data 1996-2003
# See the file LICENSE for details.
#
-# $Id: yaz-comp,v 1.5 2003-05-06 10:06:43 adam Exp $
+# $Id: yaz-comp,v 1.6 2003-05-20 19:55:30 adam Exp $
#
set yc_version 0.3
set nchoice 0
if {![string length $tag]} {
lappend l "\tif (!odr_sequence_begin (o, p, sizeof(**p), name))"
- lappend l "\t\treturn opt && odr_ok (o);"
+ lappend l "\t\treturn odr_missing(o, opt, name) && odr_ok (o);"
} elseif {$implicit} {
lappend l "\tif (!odr_implicit_settag (o, $tagtype, $tag) ||"
lappend l "\t\t!odr_sequence_begin (o, p, sizeof(**p), name))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
} else {
lappend l "\tif (!odr_constructed_begin (o, p, $tagtype, $tag, name))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
lappend l "\tif (o->direction == ODR_DECODE)"
lappend l "\t\t*p = ($inf(vprefix)$name *) odr_malloc (o, sizeof(**p));"
lappend j "\tint [lindex $numName 0];"
lappend l "\tif (!odr_initmember (o, p, sizeof(**p)))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
if {[string length $tag]} {
if {$implicit} {
lappend l "\todr_implicit_settag (o, $tagtype, $tag);"
lappend j "\}"
lappend l "\t\treturn 1;"
lappend l "\t*p = 0;"
- lappend l "\treturn opt && odr_ok(o);"
+ lappend l "\treturn odr_missing(o, opt, name);"
return [list [join $l \n] [join $j \n]]
}
lappend l "\t\};"
if {![string length $tag]} {
lappend l "\tif (!odr_initmember(o, p, sizeof(**p)))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
lappend l "\tif (odr_choice(o, arm, &(*p)->[lindex $uName 1], &(*p)->[lindex $uName 0], name))"
} elseif {$implicit} {
lappend l "\tif (!odr_initmember(o, p, sizeof(**p)))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
lappend l "\todr_implicit_settag(o, $tagtype, $tag);"
lappend l "\tif (odr_choice(o, arm, &(*p)->[lindex $uName 1], &(*p)->[lindex $uName 0], name))"
} else {
lappend l "\tif (!*p && o->direction != ODR_DECODE)"
lappend l "\t\treturn opt;"
lappend l "\tif (!odr_constructed_begin(o, p, $tagtype, $tag, 0))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
lappend l "\tif (!odr_initmember(o, p, sizeof(**p)))"
- lappend l "\t\treturn opt && odr_ok(o);"
+ lappend l "\t\treturn odr_missing(o, opt, name);"
lappend l "\tif (odr_choice(o, arm, &(*p)->[lindex $uName 1], &(*p)->[lindex $uName 0], name) &&"
lappend l "\t\todr_constructed_end(o))"
}
lappend l "\t\treturn 1;"
lappend l "\t*p = 0;"
- lappend l "\treturn opt && odr_ok(o);"
+ lappend l "\treturn odr_missing(o, opt, name);"
return [list [join $l \n] [join $j \n]]
}
# YC Sample Config File for Z39.50
-# $Id: z.tcl,v 1.10 2003-02-17 21:23:31 adam Exp $
+# $Id: z.tcl,v 1.11 2003-05-20 19:55:30 adam Exp $
# ----------------------------------------------------------
# Prefix Specifications
#
set body($m,c) {
int z_SUTRS (ODR o, Odr_oct **p, int opt, const char *name)
{
- return odr_implicit(o, odr_octetstring, p, ODR_UNIVERSAL,
- ODR_GENERALSTRING, opt);
+ return odr_implicit_tag(o, odr_octetstring, p, ODR_UNIVERSAL,
+ ODR_GENERALSTRING, opt, name);
}
}