2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.1 1995-02-02 20:38:50 quinn
17 * Top level bitstring string en/decoder.
18 * Returns 1 on success, 0 on error.
20 int odr_bitstring(ODR o, ODR_BITMASK **p, int opt)
26 o->t_class = ODR_UNIVERSAL;
27 o->t_tag = ODR_BITSTRING;
29 if ((res = ber_tag(o, *p, o->t_class, o->t_tag, &cons)) < 0)
36 if (o->direction == ODR_PRINT)
38 fprintf(o->print, "BITSTRING(len=%d)\n", (*p)->top + 1);
41 if (o->direction == ODR_DECODE && !*p)
43 *p = nalloc(o, sizeof(ODR_BITMASK));
44 memset((*p)->bits, 0, ODR_BITMASK_SIZE);
47 return ber_bitstring(o, *p, cons);