53static const char *
str_atol_clamp(
const char *str,
long *dst,
long lmin,
long lmax)
60 if (!str || (*str ==
'\0'))
67 long res = strtol(str, &e, 10);
68 if ((e == str) || (((res == LONG_MIN) || (res == LONG_MAX)) && (errno == ERANGE)) ||
69 (res < lmin) || (res > lmax))
99 unsigned long long ullmax)
106 if (!str || (*str ==
'\0'))
113 unsigned long long res = strtoull(str, &e, 10);
114 if ((e == str) || ((res == ULLONG_MAX) && (errno == ERANGE)) || (res > ullmax))
215 unsigned long long l;
241 unsigned long long l;
267 unsigned long long l;
static const char * str_atol_clamp(const char *str, long *dst, long lmin, long lmax)
Convert ASCII string to a long and clamp.
const char * mutt_str_atoull(const char *str, unsigned long long *dst)
Convert ASCII string to an unsigned long long.
const char * mutt_str_atous(const char *str, unsigned short *dst)
Convert ASCII string to an unsigned short.
const char * mutt_str_atol(const char *str, long *dst)
Convert ASCII string to a long.
const char * mutt_str_atoul(const char *str, unsigned long *dst)
Convert ASCII string to an unsigned long.
static const char * str_atoull_clamp(const char *str, unsigned long long *dst, unsigned long long ullmax)
Convert ASCII string to an unsigned long long and clamp.
const char * mutt_str_atos(const char *str, short *dst)
Convert ASCII string to a short.
const char * mutt_str_atoui(const char *str, unsigned int *dst)
Convert ASCII string to an unsigned integer.
const char * mutt_str_atoi(const char *str, int *dst)
Convert ASCII string to an integer.
Parse a number in a string.