34 static int str_is_negative(
const char **str)
40 while (isspace(**str)) ++*str;
102 val = strtoimax(str, &end, 10);
110 if (str == end || *end !=
'\0' || (errno == ERANGE &&
111 (val == INTMAX_MIN || val == INTMAX_MAX))) {
124 if (!str || str_is_negative(&str)) {
129 val = strtoumax(str, &end, 10);
137 if ((str == end || *end !=
'\0' || (errno == ERANGE && val == UINTMAX_MAX))) {
int ast_str_to_long(const char *str, long *res)
Convert the given string to a signed long.
int ast_str_to_int(const char *str, int *res)
Convert the given string to a signed integer.
int ast_str_to_ulong(const char *str, unsigned long *res)
Convert the given string to an unsigned long.
Conversion utility functions.
int ast_str_to_umax(const char *str, uintmax_t *res)
Convert the given string to an unsigned max size integer.
int ast_str_to_uint(const char *str, unsigned int *res)
Convert the given string to an unsigned integer.
int ast_str_to_imax(const char *str, intmax_t *res)
Convert the given string to a signed max size integer.