X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fber_int.c;h=fc89b0deb1c3b255fbd68fc07d77320e47b86da9;hb=967c7d6a006f0e4dc684b8086e08186d11311cfd;hp=ef1a0e03591248d1c44791a2af2f091117ada8e0;hpb=05c274ef315384faafcc5900c17468f0ea2474e6;p=yaz-moved-to-github.git diff --git a/src/ber_int.c b/src/ber_int.c index ef1a0e0..fc89b0d 100644 --- a/src/ber_int.c +++ b/src/ber_int.c @@ -1,8 +1,8 @@ /* - * Copyright (c) 1995-2004, Index Data + * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: ber_int.c,v 1.2 2004-10-15 00:18:59 adam Exp $ + * $Id: ber_int.c,v 1.4 2005-01-16 21:51:50 adam Exp $ */ /** @@ -19,10 +19,13 @@ #include +#if HAVE_SYS_TYPES_H +#include +#endif + #ifdef WIN32 #include #else -#include #include #endif @@ -37,20 +40,22 @@ int ber_integer(ODR o, int *val) switch (o->direction) { - case ODR_DECODE: - if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0) - { - odr_seterror(o, OPROTO, 50); - return 0; - } - o->bp += res; - return 1; - case ODR_ENCODE: - if ((res = ber_encinteger(o, *val)) < 0) - return 0; - return 1; - case ODR_PRINT: return 1; - default: odr_seterror(o, OOTHER, 51); return 0; + case ODR_DECODE: + if ((res = ber_decinteger(o->bp, val, odr_max(o))) <= 0) + { + odr_seterror(o, OPROTO, 50); + return 0; + } + o->bp += res; + return 1; + case ODR_ENCODE: + if ((res = ber_encinteger(o, *val)) < 0) + return 0; + return 1; + case ODR_PRINT: + return 1; + default: + odr_seterror(o, OOTHER, 51); return 0; } }