2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.7 1995-03-10 11:44:41 quinn
8 * Fixed serious stack-bug in odr_cons_begin
10 * Revision 1.6 1995/03/08 12:12:15 quinn
11 * Added better error checking.
13 * Revision 1.5 1995/03/07 13:28:57 quinn
14 * *** empty log message ***
16 * Revision 1.4 1995/03/07 13:16:13 quinn
17 * Fixed bug in odr_reset
19 * Revision 1.3 1995/03/07 10:21:31 quinn
20 * odr_errno-->odr_error
22 * Revision 1.2 1995/03/07 10:19:05 quinn
23 * Addded some method functions to the ODR type.
25 * Revision 1.1 1995/03/07 09:23:15 quinn
26 * Installing top-level API and documentation.
39 "Memory allocation failed",
42 "Required data element missing",
50 void odr_perror(ODR o, char *message)
52 fprintf(stderr, "%s: %s\n", message, odr_errlist[o->error]);
55 int odr_geterror(ODR o)
60 void odr_setprint(ODR o, FILE *file)
65 ODR odr_createmem(int direction)
69 if (!(r = malloc(sizeof(*r))))
71 r->direction = direction;
90 void odr_destroy(ODR o)
95 void odr_setbuf(ODR o, char *buf, int len)
97 o->buf = o->bp = (unsigned char *) buf;
98 o->buflen = o->left = len;
101 char *odr_getbuf(ODR o, int *len)
103 *len = o->bp - o->buf;
104 return (char *) o->buf;