1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
8 * \brief Implements BER BOOLEAN encoding and decoding
10 * This source file implements BER encoding and decoding of
21 int ber_boolean(ODR o, int *val)
28 if (ber_enclen(o, 1, 1, 1) != 1)
30 if (odr_putc(o, *val) < 0)
34 if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0)
36 odr_seterror(o, OPROTO, 9);
40 if (len != 1 || odr_max(o) < len)
42 odr_seterror(o, OPROTO, 10);
50 default: odr_seterror(o, OOTHER, 11); return 0;
56 * indent-tabs-mode: nil
58 * vim: shiftwidth=4 tabstop=8 expandtab