1 |
/* |
/* |
2 |
|
* |
3 |
|
* Licensed under GPLv2, see file LICENSE in this tarball for details. |
4 |
|
*/ |
5 |
|
/* |
6 |
You need to define the following (example): |
You need to define the following (example): |
7 |
|
|
8 |
#define type long |
#define type long |
25 |
int old_errno; |
int old_errno; |
26 |
char *e; |
char *e; |
27 |
|
|
28 |
/* Disallow '-' and any leading whitespace. Make sure we get the |
/* Disallow '-' and any leading whitespace. */ |
29 |
* actual isspace function rather than a macro implementaion. */ |
if (*numstr == '-' || *numstr == '+' || isspace(*numstr)) |
|
if (*numstr == '-' || *numstr == '+' || (isspace)(*numstr)) |
|
30 |
goto inval; |
goto inval; |
31 |
|
|
32 |
/* Since this is a lib function, we're not allowed to reset errno to 0. |
/* Since this is a lib function, we're not allowed to reset errno to 0. |
156 |
return xstrto(_range_sfx)(numstr, base, lower, upper, NULL); |
return xstrto(_range_sfx)(numstr, base, lower, upper, NULL); |
157 |
} |
} |
158 |
|
|
159 |
|
type FAST_FUNC xstrto()(const char *numstr, int base) |
160 |
|
{ |
161 |
|
return xstrto(_range_sfx)(numstr, base, XSTR_TYPE_MIN, XSTR_TYPE_MAX, NULL); |
162 |
|
} |
163 |
|
|
164 |
type FAST_FUNC xato(_range_sfx)(const char *numstr, |
type FAST_FUNC xato(_range_sfx)(const char *numstr, |
165 |
type lower, |
type lower, |
166 |
type upper, |
type upper, |