2 * Copyright (c) 1995-1998, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.1 1998-03-20 14:45:01 adam
8 * Implemented odr_enum and odr_set_of.
16 * Top level enum en/decoder.
17 * Returns 1 on success, 0 on error.
19 int odr_enum(ODR o, int **p, int opt)
27 o->t_class = ODR_UNIVERSAL;
30 if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt)) < 0)
34 if (o->direction == ODR_PRINT)
36 fprintf(o->print, "%s%d\n", odr_indent(o), **p);
44 if (o->direction == ODR_DECODE)
45 *p = (int *)odr_malloc(o, sizeof(int));
46 return ber_integer(o, *p);