Include top-level headers from cfg/ subdir.
[bertos.git] / mware / strtol10.h
1 /*!
2  * \file
3  * <!--
4  * Copyright 2005 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \brief Poor man's hex arrays (implementation).
9  *
10  * \version $Id$
11  * \author Bernardo Innocenti <bernie@develer.com>
12  */
13
14 /*#*
15  *#* $Log$
16  *#* Revision 1.2  2005/04/11 19:10:28  bernie
17  *#* Include top-level headers from cfg/ subdir.
18  *#*
19  *#* Revision 1.1  2005/03/15 00:06:30  bernie
20  *#* Simpler, smaller, faster.
21  *#*
22  *#*/
23
24 #ifndef MWARE_STRTOL10_H
25 #define MWARE_STRTOL10_H
26
27 #include <cfg/compiler.h> /* bool */
28
29 bool strtoul10(const char *first, const char *last, unsigned long *val);
30 bool strtol10(const char *first, const char *last, long *val);
31
32 /*!
33  * Replacement for standard library function atol().
34  */
35 INLINE long atol(const char *str)
36 {
37         long val;
38         strtol10(str, NULL, &val);
39         return val;
40 }
41
42 /*!
43  * Replacement for standard library function atoi().
44  */
45 INLINE int atoi(const char *str)
46 {
47         return (int)atol(str);
48 }
49
50 #endif /* MWARE_STRTOL10_H */