2 * Copyright (c) 1995-1999, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1999-01-08 11:23:27 adam
8 * Added const modifier to some of the BER/ODR encoding routines.
10 * Revision 1.1 1998/03/20 14:45:01 adam
11 * Implemented odr_enum and odr_set_of.
18 * Top level enum en/decoder.
19 * Returns 1 on success, 0 on error.
21 int odr_enum(ODR o, int **p, int opt)
29 o->t_class = ODR_UNIVERSAL;
32 if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
36 if (o->direction == ODR_PRINT)
38 fprintf(o->print, "%s%d\n", odr_indent(o), **p);
46 if (o->direction == ODR_DECODE)
47 *p = (int *)odr_malloc(o, sizeof(int));
48 return ber_integer(o, *p);