Updates.
[yaz-moved-to-github.git] / odr / odr_util.c
1 #include <odr.h>
2 #include <stdlib.h>
3
4 void *nalloc(ODR o, int size) { return malloc(size); }
5 char *odr_indent(ODR o) {return "";}
6
7 int odp_more_chunks(ODR o, unsigned char *base, int len)
8 {
9     if (!len)
10         return 0;
11     if (len < 0) /* indefinite length */
12     {
13         if (*o->bp == 0 && *(o->bp + 1) == 0)
14         {
15             o->bp += 2;
16             o->left -= 2;
17             return 0;
18         }
19         else
20             return 1;
21     }
22     else
23         return o->bp - base < len;
24 }