X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fwaislen.c;h=17a97f1d787febf71e3c3fb2bc04165c609ad38d;hp=38ddf0a1595782619733ec3a580ca29ecab98199;hb=fe42f72dc30321041420cf2d1a83867b1c450f38;hpb=c6e47cbbff56f39f6d81b079ebaeac41d793d4d9 diff --git a/src/waislen.c b/src/waislen.c index 38ddf0a..17a97f1 100644 --- a/src/waislen.c +++ b/src/waislen.c @@ -1,49 +1,42 @@ -/* - * Copyright (c) 1995-1999, Index Data. +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Log: waislen.c,v $ - * Revision 1.1 2003-10-27 12:21:36 adam - * Source restructure. yaz-marcdump part of installation - * - * Revision 1.5 1999/11/30 13:47:11 adam - * Improved installation. Moved header files to include/yaz. - * - * Revision 1.4 1999/01/08 11:23:15 adam - * Added const modifier to some of the BER/ODR encoding routines. - * - * Revision 1.3 1996/02/29 14:23:13 adam - * Bug fix. - * - * Revision 1.2 1996/02/26 18:34:44 adam - * Bug fix. - * - * Revision 1.1 1996/02/20 13:02:58 quinn - * Wais length. - * - * */ +/** + * \file waislen.c + * \brief Implements WAIS package handling + */ +#if HAVE_CONFIG_H +#include +#endif #include #include -#include /* * Return length of WAIS package or 0 */ -int completeWAIS(const unsigned char *buf, int len) +int completeWAIS(const char *buf, int len) { int i, lval = 0; if (len < 25) - return 0; + return 0; if (*buf != '0') - return 0; + return 0; /* calculate length */ for (i = 0; i < 10; i++) - lval = lval * 10 + (buf[i] - '0'); + lval = lval * 10 + (buf[i] - '0'); lval += 25; if (len >= lval) - return lval; + return lval; return 0; } +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +