X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_util.c;h=af26baebbce4a98eda76be236651c2e6f9085888;hb=d092115aeed58ef669c42c9b6d013c424b26684c;hp=6814c60b3fcafafbd9219c024d932bbd8ab8e9bd;hpb=a7d28a25277a208edb9c44d124f179cc2be6db70;p=yaz-moved-to-github.git diff --git a/odr/odr_util.c b/odr/odr_util.c index 6814c60..af26bae 100644 --- a/odr/odr_util.c +++ b/odr/odr_util.c @@ -3,3 +3,22 @@ void *nalloc(ODR o, int size) { return malloc(size); } char *odr_indent(ODR o) {return "";} + +int odp_more_chunks(ODR o, unsigned char *base, int len) +{ + if (!len) + return 0; + if (len < 0) /* indefinite length */ + { + if (*o->bp == 0 && *(o->bp + 1) == 0) + { + o->bp += 2; + o->left -= 2; + return 0; + } + else + return 1; + } + else + return o->bp - base < len; +}