2 * Copyright (c) 1995-1997, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.12 1997-10-31 12:20:08 adam
8 * Improved memory debugging for xmalloc/nmem.c. References to NMEM
9 * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
10 * Bug fix: missing fclose in data1_read_espec1.
20 char *odr_indent(ODR o)
25 memset(buf, ' ', 512);
28 buf[o->indent * 4] = 0;
32 int odp_more_chunks(ODR o, unsigned char *base, int len)
36 if (len < 0) /* indefinite length */
38 if (*o->bp == 0 && *(o->bp + 1) == 0)
48 return o->bp - base < len;
51 Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o)
57 if (!(r = nmem_malloc(nmem, (oid_oidlen(o) + 1) * sizeof(int))))
63 Odr_oid *odr_oiddup(ODR odr, Odr_oid *o)
65 return odr_oiddup_nmem (odr->mem, o);
68 Odr_oid *odr_getoidbystr_nmem(NMEM nmem, char *str)
76 while ((p = strchr(p, '.')))
78 ret = nmem_malloc(nmem, sizeof(*ret)*(num + 1));
82 while ((p = strchr(p, '.')) && ++p);
87 Odr_oid *odr_getoidbystr(ODR o, char *str)
89 return odr_getoidbystr_nmem (o->mem, str);