source: trunk/gsdl/packages/yaz/util/atoin.c@ 1343

Last change on this file since 1343 was 1343, checked in by johnmcp, 24 years ago

Added the YAZ toolkit source to the packages directory (for z39.50 stuff)

  • Property svn:keywords set to Author Date Id Revision
File size: 851 bytes
Line 
1/*
2 * Copyright (c) 1997, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
5 *
6 * $Log$
7 * Revision 1.1 2000/08/03 03:12:06 johnmcp
8 * Added the YAZ toolkit source to the packages directory (for z39.50 stuff)
9 *
10 * Revision 1.3 2000/02/29 13:44:55 adam
11 * Check for config.h (currently not generated).
12 *
13 * Revision 1.2 1999/11/30 13:47:12 adam
14 * Improved installation. Moved header files to include/yaz.
15 *
16 * Revision 1.1 1997/09/04 07:52:27 adam
17 * Moved atoi_n function to separate source file.
18 *
19 */
20
21#if HAVE_CONFIG_H
22#include <config.h>
23#endif
24
25#include <string.h>
26#include <ctype.h>
27#include <yaz/yaz-util.h>
28
29int atoi_n (const char *buf, int len)
30{
31 int val = 0;
32
33 while (--len >= 0)
34 {
35 if (isdigit (*buf))
36 val = val*10 + (*buf - '0');
37 buf++;
38 }
39 return val;
40}
Note: See TracBrowser for help on using the repository browser.