diff options
author | Eric Blake <ebb9@byu.net> | 2007-08-08 12:45:54 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2007-08-08 12:45:54 +0000 |
commit | c7110f3b833159c91e8cbe6a14349174aeef4ab6 (patch) | |
tree | b1f30e57f6dab6db962d6ac823191b940964c6d6 /lib/xstrtol.h | |
parent | fe32d83182dd651bbdaee9a8b6a54c6e3ad9ad2e (diff) | |
download | gnulib-c7110f3b833159c91e8cbe6a14349174aeef4ab6.tar.gz |
Move xstrtol messages into gnulib domain, when --pobase is used.
* lib/xstrtol.h (_STRTOL_ERROR): Move messages out of macro...
* lib/xstrtol-error.c (xstrtol_error): ...into new file.
* modules/xstrtol (Files): Distribute new file.
* m4/xstrtol.m4 (gl_XSTRTOL): Build new file.
* lib/xstrtol.c (TESTING_XSTRTO): Move tests...
* tests/test-xstrtol.c: ...into new file.
* tests/test-xstrtoul.c: Also test xstrtoul.
* tests/test-xstrtoimax.c: Also test xstrtoimax.
* tests/test-xstrtoumax.c: Also test xstrtoumax.
* tests/test-xstrtol.sh: Drive the tests.
* tests/test-xstrtoimax.sh: Likewise.
* tests/test-xstrtoumax.sh: Likewise.
* modules/xstrtol-tests: New module.
* modules/xstrtoimax-tests: Likewise.
* modules/xstrtoumax-tests: Likewise.
Diffstat (limited to 'lib/xstrtol.h')
-rw-r--r-- | lib/xstrtol.h | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/lib/xstrtol.h b/lib/xstrtol.h index 4df140c2ef..96fc4d23e4 100644 --- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -24,8 +24,6 @@ # include <inttypes.h> -# include "gettext.h" - # ifndef _STRTOL_ERROR enum strtol_error { @@ -56,35 +54,10 @@ _DECLARE_XSTRTOL (xstrtoumax, uintmax_t) (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_ */ |