2 * Copyright (c) 1995-1997, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.13 1998-02-11 11:53:34 adam
8 * Changed code so that it compiles as C++.
10 * Revision 1.12 1997/10/31 12:20:08 adam
11 * Improved memory debugging for xmalloc/nmem.c. References to NMEM
12 * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
13 * Bug fix: missing fclose in data1_read_espec1.
23 char *odr_indent(ODR o)
28 memset(buf, ' ', 512);
31 buf[o->indent * 4] = 0;
35 int odp_more_chunks(ODR o, unsigned char *base, int len)
39 if (len < 0) /* indefinite length */
41 if (*o->bp == 0 && *(o->bp + 1) == 0)
51 return o->bp - base < len;
54 Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o)
60 if (!(r = (int *)nmem_malloc(nmem, (oid_oidlen(o) + 1) * sizeof(int))))
66 Odr_oid *odr_oiddup(ODR odr, Odr_oid *o)
68 return odr_oiddup_nmem (odr->mem, o);
71 Odr_oid *odr_getoidbystr_nmem(NMEM nmem, char *str)
79 while ((p = strchr(p, '.')))
81 ret = (int *)nmem_malloc(nmem, sizeof(*ret)*(num + 1));
85 while ((p = strchr(p, '.')) && ++p);
90 Odr_oid *odr_getoidbystr(ODR o, char *str)
92 return odr_getoidbystr_nmem (o->mem, str);