|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef XDECTOINT_H_ |
|
|
# define XDECTOINT_H_ 1 |
|
|
|
|
|
# include <inttypes.h> |
|
|
|
|
|
|
|
|
enum |
|
|
{ |
|
|
|
|
|
|
|
|
XTOINT_MIN_QUIET = 1 << 0, |
|
|
|
|
|
|
|
|
XTOINT_MAX_QUIET = 1 << 1, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XTOINT_MIN_RANGE = 1 << 2, |
|
|
|
|
|
|
|
|
XTOINT_MAX_RANGE = 1 << 3 |
|
|
}; |
|
|
|
|
|
# define _DECLARE_XDECTOINT(name, type) \ |
|
|
type name (char const *n_str, type min, type max, \ |
|
|
char const *suffixes, char const *err, int err_exit) \ |
|
|
_GL_ATTRIBUTE_NONNULL ((1, 5)); |
|
|
# define _DECLARE_XNUMTOINT(name, type) \ |
|
|
type name (char const *n_str, int base, type min, type max, \ |
|
|
char const *suffixes, char const *err, int err_exit, int flags) \ |
|
|
_GL_ATTRIBUTE_NONNULL ((1, 6)); |
|
|
|
|
|
_DECLARE_XDECTOINT (xdectoimax, intmax_t) |
|
|
_DECLARE_XDECTOINT (xdectoumax, uintmax_t) |
|
|
|
|
|
_DECLARE_XNUMTOINT (xnumtoimax, intmax_t) |
|
|
_DECLARE_XNUMTOINT (xnumtoumax, uintmax_t) |
|
|
|
|
|
#endif |
|
|
|