54static const char *
str_atol_clamp(
const char *str,
long *dst,
long lmin,
long lmax)
61 if (!str || (*str ==
'\0'))
68 long res = strtol(str, &e, 10);
69 if ((e == str) || (((res == LONG_MIN) || (res == LONG_MAX)) && (errno == ERANGE)) ||
70 (res < lmin) || (res > lmax))
100 unsigned long long ullmax)
107 if (!str || (*str ==
'\0'))
114 unsigned long long res = strtoull(str, &e, 10);
115 if ((e == str) || ((res == ULLONG_MAX) && (errno == ERANGE)) || (res > ullmax))
216 unsigned long long l;
242 unsigned long long l;
268 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.