2 * Copyright (c) 1995-2003, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Id: ber_bool.c,v 1.1 2003-10-27 12:21:30 adam Exp $
16 int ber_boolean(ODR o, int *val)
23 if (ber_enclen(o, 1, 1, 1) != 1)
25 if (odr_putc(o, *val) < 0)
28 fprintf(stderr, "[val=%d]\n", *val);
32 if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0)
34 odr_seterror(o, OPROTO, 9);
38 if (len != 1 || odr_max(o) < len)
40 odr_seterror(o, OPROTO, 10);
46 fprintf(stderr, "[val=%d]\n", *val);
51 default: odr_seterror(o, OOTHER, 11); return 0;