]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/xstrto.h
1 #ifndef _SQUID_XSTRTO_H
2 #define _SQUID_XSTRTO_H
9 * xstrtou{i,l} - string to number conversion
10 * \param s input string
11 * \param end like strtoul's "end" pointer
12 * \param value pointer for result. Undefined on failure
13 * \param min minimum accepted value
14 * \param max maximum accepted value
16 * If @end is NULL, we assume the caller wants a "strict strtoul", and hence
18 * In either case, the value obtained is compared for min-max compliance.
19 * Base is always 0, i.e. autodetect depending on @s.
21 * \return true/false whether number was accepted. On failure, *value has
24 bool xstrtoul(const char *s
, char **end
, unsigned long *value
,
25 unsigned long min
, unsigned long max
);
27 bool xstrtoui(const char *s
, char **end
, unsigned int *value
,
28 unsigned int min
, unsigned int max
);
30 #endif /* _SQUID_XSTRTO_H */