X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fber_int.c;h=84e560bdc820bc46b4f7565bc41f62ef38e7d65b;hb=f9828584ad6d0f66eb85b2e6d8bca5a29d569dcb;hp=a05c240f8ea08e8a16fd62047ea36e581f4d4bce;hpb=4c176312acdc3444c9afc820f76a393e64668e52;p=yaz-moved-to-github.git diff --git a/src/ber_int.c b/src/ber_int.c index a05c240..84e560b 100644 --- a/src/ber_int.c +++ b/src/ber_int.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: ber_int.c,v 1.3 2005-01-15 19:47:11 adam Exp $ + * $Id: ber_int.c,v 1.5 2005-06-25 15:46:03 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; } } @@ -111,3 +116,11 @@ int ber_decinteger(const unsigned char *buf, int *val, int max) #endif return b - buf; } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +