2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.6 1995-03-08 12:12:15 quinn
8 * Added better error checking.
10 * Revision 1.5 1995/03/07 13:28:57 quinn
11 * *** empty log message ***
13 * Revision 1.4 1995/03/07 13:16:13 quinn
14 * Fixed bug in odr_reset
16 * Revision 1.3 1995/03/07 10:21:31 quinn
17 * odr_errno-->odr_error
19 * Revision 1.2 1995/03/07 10:19:05 quinn
20 * Addded some method functions to the ODR type.
22 * Revision 1.1 1995/03/07 09:23:15 quinn
23 * Installing top-level API and documentation.
36 "Memory allocation failed",
39 "Required data element missing",
46 void odr_perror(ODR o, char *message)
48 fprintf(stderr, "%s: %s\n", message, odr_errlist[o->error]);
51 int odr_geterror(ODR o)
56 void odr_setprint(ODR o, FILE *file)
61 ODR odr_createmem(int direction)
65 if (!(r = malloc(sizeof(*r))))
67 r->direction = direction;
86 void odr_destroy(ODR o)
91 void odr_setbuf(ODR o, char *buf, int len)
93 o->buf = o->bp = (unsigned char *) buf;
94 o->buflen = o->left = len;
97 char *odr_getbuf(ODR o, int *len)
99 *len = o->bp - o->buf;
100 return (char *) o->buf;