10 #define crt_tolower(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c) - 'A' + 'a') : (c)) 11 #define crt_toupper(c) ((((c) >= 'a') && ((c) <= 'z')) ? ((c) - 'a' + 'A') : (c)) 25 #define isalpha(c) (((((c) >= 'A') && ((c) <= 'Z')) || (((c) >= 'a') && ((c) <= 'z'))) ? 1 : 0) 27 #define isdigit(c) ((((c) >= '0') && ((c) <= '9')) ? 1 : 0) 29 #define isxdigit(c) (((((c) >= 'A') && ((c) <= 'F')) || (((c) >= 'a') && \ 30 ((c) <= 'f')) || (((c) >= '0') && ((c) <= '9'))) ? 1 : 0) 32 #define isprint(c) (((c) >= ' ' && (c) <= '~') ? 1 : 0) 33 #define isspace(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\v') || ((c) == '\f') || ((c) == '\r')) 87 #define FL_READDIGIT 8 107 *endptr = (
INT8 *)nptr;
130 if (ibase < 0 || ibase == 1 || ibase > 36)
144 else if (*p ==
'x' || *p ==
'X')
156 else if (*p ==
'x' || *p ==
'X')
165 if (c ==
'0' && (*p ==
'x' || *p ==
'X'))
173 maxval = INT32_MAX / ibase;
186 digval =
toupper(c) -
'A' + 10;
189 if (digval >= (
UINT32)ibase)
199 if (number < maxval || (number == maxval && (
UINT32)digval <= UINT32_MAX % ibase))
202 number = number * ibase + digval;
231 (!(flags &
FL_NEG) && (number > INT32_MAX)))))
237 else if (flags & FL_NEG)
238 number = (
UINT32)(-INT32_MIN);
272 *endptr = (
INT8 *)nptr;
295 if (ibase < 0 || ibase == 1 || ibase > 36)
309 else if (*p ==
'x' || *p ==
'X')
321 else if (*p ==
'x' || *p ==
'X')
330 if (c ==
'0' && (*p ==
'x' || *p ==
'X'))
338 maxval = UINT64_MAX / ibase;
351 digval =
toupper(c) -
'A' + 10;
354 if (digval >= (
UINT32)ibase)
364 if (number < maxval || (number == maxval && (
UINT64)digval <= UINT64_MAX % ibase))
367 number = number * ibase + digval;
396 (!(flags &
FL_NEG) && (number > INT64_MAX)))))
402 else if (flags & FL_NEG)
403 number = (
UINT64)(-INT64_MIN);
INT32 __cdecl strtol(const INT8 *nptr, INT8 **endptr, INT32 ibase)
static UINT32 __cdecl crt_strtoxl(const INT8 *nptr, const INT8 **endptr, INT32 ibase, INT32 flags)
INT64 __cdecl strtoll(const INT8 *nptr, INT8 **endptr, INT32 ibase)
unsigned long long UINT64
UINT64 __cdecl strtoull(const INT8 *nptr, INT8 **endptr, INT32 ibase)
UINT32 __cdecl strtoul(const INT8 *nptr, INT8 **endptr, INT32 ibase)
static UINT64 __cdecl crt_strtoxll(const INT8 *nptr, const INT8 **endptr, INT32 ibase, INT32 flags)