Artifact f78330ce18a6bc872d73fbb284166b8de1c05f06:
- File strtoull.c — part of check-in [2eca7c583b] at 2004-10-29 03:01:26 on branch trunk — Updated to remove PRINTERR and PRINTERR_D (Mac OS X's c preprocessor doesn't handle variadic macros) Updated strtoull.c to work. Added config.guess/config.sub (needed for determining SHLIBEXT) A few misc changes. libconfig 0.0.7 (user: rkeene, size: 426) [annotate] [blame] [check-ins using]
#include <sys/types.h> #include <stdlib.h> #include <limits.h> #include <ctype.h> #include <stdio.h> /* We only handle base 10. */ unsigned long long int strtoull(char *nptr, char **endptr, int base) { unsigned long long int retval = 0; char *idx = NULL; for (idx = nptr; *idx != '\0' && isdigit(*idx); idx++) { retval *= 10; retval += (*idx - '0'); } if (endptr != NULL) { *endptr = idx; } return(retval); }