Sistema l'errore da me commesso in fase di conversione...
[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.3  2006/07/19 12:56:28  bernie
17  *#* Convert to new Doxygen style.
18  *#*
19  *#* Revision 1.2  2005/04/11 19:10:28  bernie
20  *#* Include top-level headers from cfg/ subdir.
21  *#*
22  *#* Revision 1.1  2005/03/15 00:06:30  bernie
23  *#* Simpler, smaller, faster.
24  *#*
25  *#*/
26
27 #ifndef MWARE_STRTOL10_H
28 #define MWARE_STRTOL10_H
29
30 #include <cfg/compiler.h> /* bool */
31
32 bool strtoul10(const char *first, const char *last, unsigned long *val);
33 bool strtol10(const char *first, const char *last, long *val);
34
35 /**
36  * Replacement for standard library function atol().
37  */
38 INLINE long atol(const char *str)
39 {
40         long val;
41         strtol10(str, NULL, &val);
42         return val;
43 }
44
45 /**
46  * Replacement for standard library function atoi().
47  */
48 INLINE int atoi(const char *str)
49 {
50         return (int)atol(str);
51 }
52
53 #endif /* MWARE_STRTOL10_H */