X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_cons.c;h=f85d8172bbe6cee27e0db37c3439a355ba397b07;hb=6c126e94642b41867fb323ff39fded733757a11e;hp=3fdae22df176701d7a65065c6c83ae5e506387fd;hpb=10981b2f116449523a9f628c20a78212ce91553e;p=yaz-moved-to-github.git diff --git a/odr/odr_cons.c b/odr/odr_cons.c index 3fdae22..f85d817 100644 --- a/odr/odr_cons.c +++ b/odr/odr_cons.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_cons.c,v $ - * Revision 1.3 1995-02-09 15:51:48 quinn + * Revision 1.5 1995-02-10 18:57:25 quinn + * More in the way of error-checking. + * + * Revision 1.4 1995/02/10 15:55:29 quinn + * Bug fixes, mostly. + * + * Revision 1.3 1995/02/09 15:51:48 quinn * Works better now. * * Revision 1.2 1995/02/07 17:52:59 quinn @@ -27,9 +33,7 @@ int odr_constructed_begin(ODR o, void *p, int class, int tag) o->t_class = class; o->t_tag = tag; } - if (o->direction == ODR_DECODE) - *(char**)p = 0; - if ((res = ber_tag(o, *(char**)p, o->t_class, o->t_tag, &cons)) < 0) + if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons)) < 0) return 0; if (!res || !cons) return 0; @@ -55,6 +59,16 @@ int odr_constructed_begin(ODR o, void *p, int class, int tag) return 1; } +int odr_constructed_more(ODR o) +{ + if (o->stackp < 0) + return 0; + if (o->stack[o->stackp].len >= 0) + return o->bp - o->stack[o->stackp].base < o->stack[o->stackp].len; + else + return (!(*o->bp == 0 && *(o->bp + 1) == 0)); +} + int odr_constructed_end(ODR o) { int res;