X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fber_bool.c;h=5364b775a0f6e7128969bee0df4b3cfe0ecb4ecf;hp=b813ff15efe1d14057de09d1532be7516057a382;hb=e33389ee14d909d3a1b9874a40aa1b53c3fe42be;hpb=05c274ef315384faafcc5900c17468f0ea2474e6 diff --git a/src/ber_bool.c b/src/ber_bool.c index b813ff1..5364b77 100644 --- a/src/ber_bool.c +++ b/src/ber_bool.c @@ -1,11 +1,9 @@ -/* - * Copyright (c) 1995-2004, Index Data +/* This file is part of the YAZ toolkit. + * Copyright (C) Index Data * See the file LICENSE for details. - * - * $Id: ber_bool.c,v 1.2 2004-10-15 00:18:59 adam Exp $ */ -/** +/** * \file ber_bool.c * \brief Implements BER BOOLEAN encoding and decoding * @@ -31,30 +29,33 @@ int ber_boolean(ODR o, int *val) return 0; if (odr_putc(o, *val) < 0) return 0; -#ifdef ODR_DEBUG - fprintf(stderr, "[val=%d]\n", *val); -#endif return 1; case ODR_DECODE: - if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0) + if ((res = ber_declen(o->op->bp, &len, odr_max(o))) < 0) { odr_seterror(o, OPROTO, 9); return 0; } - o->bp+= res; + o->op->bp+= res; if (len != 1 || odr_max(o) < len) { odr_seterror(o, OPROTO, 10); return 0; } - *val = *o->bp; - o->bp++; -#ifdef ODR_DEBUG - fprintf(stderr, "[val=%d]\n", *val); -#endif + *val = *o->op->bp; + o->op->bp++; return 1; case ODR_PRINT: return 1; default: odr_seterror(o, OOTHER, 11); return 0; } } +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +