#include <limits.h>
#include <errno.h>
#include <ctype.h>
#include <stdlib.h>
Go to the source code of this file.
|
long long | strtoll (const char *__restrict nptr, char **__restrict endptr, int base) |
|
#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL |
#define LLONG_MIN (-0x7FFFFFFFFFFFFFFFLL - 1) |
long long strtoll |
( |
const char *__restrict |
nptr, |
|
|
char **__restrict |
endptr, |
|
|
int |
base |
|
) |
| |
Definition at line 47 of file strtoll.c.
50 unsigned long long acc;
52 unsigned long long cutoff;
63 }
while (isspace((
unsigned char)c));
73 c ==
'0' && (*s ==
'x' || *s ==
'X') &&
74 ((s[1] >=
'0' && s[1] <=
'9') ||
75 (s[1] >=
'A' && s[1] <=
'F') ||
76 (s[1] >=
'a' && s[1] <=
'f'))) {
82 base = c ==
'0' ? 8 : 10;
84 if (base < 2 || base > 36)
107 cutlim = cutoff %
base;
109 for ( ; ; c = *s++) {
110 if (c >=
'0' && c <=
'9')
112 else if (c >=
'A' && c <=
'Z')
114 else if (c >=
'a' && c <=
'z')
120 if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
137 *endptr = (
char *)(any ? s - 1 : nptr);