]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/xstrto.h
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef _SQUID_XSTRTO_H
10 #define _SQUID_XSTRTO_H
12 // these functions are not used by the remaining Squid C code.
13 #if defined(__cplusplus)
20 * xstrtou{i,l} - string to number conversion
21 * \param s input string
22 * \param end like strtoul's "end" pointer
23 * \param value pointer for result. Undefined on failure
24 * \param min minimum accepted value
25 * \param max maximum accepted value
27 * If @end is NULL, we assume the caller wants a "strict strtoul", and hence
29 * In either case, the value obtained is compared for min-max compliance.
30 * Base is always 0, i.e. autodetect depending on @s.
32 * \return true/false whether number was accepted. On failure, *value has
35 bool xstrtoul(const char *s
, char **end
, unsigned long *value
,
36 unsigned long min
, unsigned long max
);
38 bool xstrtoui(const char *s
, char **end
, unsigned int *value
,
39 unsigned int min
, unsigned int max
);
41 #endif /* __cplusplus */
42 #endif /* _SQUID_XSTRTO_H */