2 * Copyright (C) 1995-2007, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: ber_bool.c,v 1.6 2007-01-03 08:42:15 adam Exp $
10 * \brief Implements BER BOOLEAN encoding and decoding
12 * This source file implements BER encoding and decoding of
23 int ber_boolean(ODR o, int *val)
30 if (ber_enclen(o, 1, 1, 1) != 1)
32 if (odr_putc(o, *val) < 0)
36 if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0)
38 odr_seterror(o, OPROTO, 9);
42 if (len != 1 || odr_max(o) < len)
44 odr_seterror(o, OPROTO, 10);
52 default: odr_seterror(o, OOTHER, 11); return 0;
58 * indent-tabs-mode: nil
60 * vim: shiftwidth=4 tabstop=8 expandtab