X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_cons.c;h=92ebf6a2f3beba620063194c917706bdae622f81;hb=1b06a5c10770ef964044f824a33d4cc8652d8e7a;hp=608ee65a6f78597430f7a1cd05380a7818eac8d9;hpb=0dcf720d5b83783f6dba31f44b12513cefdd2f75;p=yaz-moved-to-github.git diff --git a/odr/odr_cons.c b/odr/odr_cons.c index 608ee65..92ebf6a 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.2 1995-02-07 17:52:59 quinn + * 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 * A damn mess, but now things work, I think. * * Revision 1.1 1995/02/02 16:21:53 quinn @@ -24,6 +30,8 @@ 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) return 0; if (!res || !cons) @@ -50,6 +58,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;