1 /* Convert string representation of a number into an integer value.
2 Copyright (C) 1991,92,94,95,96,97,98,99,2000,2001,2002,2003,2004
3 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 #include <locale/localeinfo.h>
29 # define INT unsigned LONG int
35 # define strtol wcstoull
36 # define __strtol_l __wcstoull_l
38 # define strtol wcstoul
39 # define __strtol_l __wcstoul_l
43 # define strtol strtoull
44 # define __strtol_l __strtoull_l
46 # define strtol strtoul
47 # define __strtol_l __strtoul_l
53 # define strtol wcstoll
54 # define __strtol_l __wcstoll_l
56 # define strtol wcstol
57 # define __strtol_l __wcstol_l
61 # define strtol strtoll
62 # define __strtol_l __strtoll_l
68 /* If QUAD is defined, we are defining `strtoll' or `strtoull',
69 operating on `long long int's. */
71 # define LONG long long
78 # define STRING_TYPE wchar_t
80 # define STRING_TYPE char
84 #define INTERNAL(X) INTERNAL1(X)
85 #define INTERNAL1(X) __##X##_internal
88 extern INT
INTERNAL (__strtol_l
) (const STRING_TYPE
*, STRING_TYPE
**, int,
93 INTERNAL (strtol
) (nptr
, endptr
, base
, group
)
94 const STRING_TYPE
*nptr
;
99 return INTERNAL (__strtol_l
) (nptr
, endptr
, base
, group
, _NL_CURRENT_LOCALE
);
101 libc_hidden_def (INTERNAL (strtol
))
105 strtol (nptr
, endptr
, base
)
106 const STRING_TYPE
*nptr
;
107 STRING_TYPE
**endptr
;
110 return INTERNAL (__strtol_l
) (nptr
, endptr
, base
, 0, _NL_CURRENT_LOCALE
);