#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
Go to the source code of this file.
|
long long int | strtoll (const char *nptr, char **endptr, int base) |
|
◆ strtoll()
long long int strtoll |
( |
const char * |
nptr, |
|
|
char ** |
endptr, |
|
|
int |
base |
|
) |
| |
Definition at line 43 of file strtoll.c.
47 long long int acc, cutoff;
54 if(base < 0 || base > 36)
60 *endptr = (
char*)(uintptr_t)nptr;
80 c = (
unsigned char)*s++;
97 if((base == 0 || base == 16) && c ==
'0' && (*s ==
'x' || *s ==
'X'))
106 base = c ==
'0' ? 8 : 10;
129 cutlim = (int)(cutoff % base);
140 for(acc = 0, any = 0;; c = (
unsigned char)*s++)
151 c -=
isupper(c) ?
'A' - 10 :
'a' - 10;
174 if(acc < cutoff || (acc == cutoff && c > cutlim))
189 if(acc > cutoff || (acc == cutoff && c > cutlim))
206 *endptr = (
char*)(uintptr_t)(any ? s - 1 : nptr);
int isupper(int ch)
Checks if the given character is an uppercase character.
int isalpha(int ch)
Checks if the given character is an alphabetic character.
int isspace(int ch)
Checks if the given character is a whitespace character.
int isdigit(int ch)
Checks if the given character is a numeric character.
References isalpha(), isdigit(), isspace(), isupper(), and LLONG_MIN.