# include <inttypes.h>
-# include "gettext.h"
-
# ifndef _STRTOL_ERROR
enum strtol_error
{
(usually starting with one or two minus signs).
ARG is the option's argument.
ERR is the error code returned by one of the xstrto* functions. */
-# define _STRTOL_ERROR(Exit_code, Option, Arg, Err) \
- do \
- { \
- switch ((Err)) \
- { \
- default: \
- abort (); \
- \
- case LONGINT_INVALID: \
- error (Exit_code, 0, gettext ("invalid %s argument `%s'"), \
- Option, Arg); \
- break; \
- \
- case LONGINT_INVALID_SUFFIX_CHAR: \
- case LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW: \
- error ((Exit_code), 0, \
- gettext ("invalid suffix in %s argument `%s'"), \
- Option, Arg); \
- break; \
- \
- case LONGINT_OVERFLOW: \
- error (Exit_code, 0, gettext ("%s argument `%s' too large"), \
- Option, Arg); \
- break; \
- } \
- } \
- while (0)
+void xstrtol_error (int exit_code, char const *option, char const *arg,
+ strtol_error err);
# define STRTOL_FATAL_ERROR(Option, Arg, Err) \
- _STRTOL_ERROR (exit_failure, Option, Arg, Err)
+ xstrtol_error (exit_failure, Option, Arg, Err)
#endif /* not XSTRTOL_H_ */