+2019-12-05 Pino Toscano <ptoscano@redhat.com>
+
+ Move xstrtol_fatal to a new xstrtol-error module.
+ * lib/xstrtol.h: Stop including <getopt.h>.
+ (xstrtol_fatal): Move ...
+ * lib/xstrtol-error.h: ... here. New file.
+ * lib/xstrtol-error.c: Include xstrtol-error.h instead of xstrtol.h.
+ * tests/test-xstrtol.c: Likewise.
+ * modules/xstrtol (Files): Remove lib/xstrtol-error.c.
+ (Depends-on): Remove exitfail, error, getopt-gnu, and gettext-h.
+ (Makefile.am): Remove xstrtol-error.c from lib_SOURCES.
+ * modules/xstrtol-error: New file.
+ * modules/xstrtol-tests (Depends-on): Add xstrtol-error.
+ * MODULES.html.sh: Add xstrtol-error.
+ * NEWS: Document the change.
+
2019-12-06 Paul Eggert <eggert@cs.ucla.edu>
nstrftime: better width support for %N, %z
func_module c-strtold
func_module xstrtod
func_module xstrtol
+ func_module xstrtol-error
func_module xstrtoll
func_module xstrtold
func_end_table
Date Modules Changes
+2019-12-07 userspec The xstrtol_fatal is moved away from the xstrtol
+ xstrtoimax module to a new xstrtol-error module. Because of
+ xstrtol this, using xstrtol or any of the modules using it
+ xstrtoll does not pull automatically the exitfail, error,
+ xstrtoumax getopt-gnu, and gettext-h modules.
+
2019-03-16 fatal-signal The function that you pass to at_fatal_signal now
takes the signal as argument.
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
-#include "xstrtol.h"
+#include "xstrtol-error.h"
#include <stdlib.h>
--- /dev/null
+/* Error reporting interface for xstrto* functions.
+
+ Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2019 Free Software
+ Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+#ifndef XSTRTOL_ERROR_H_
+# define XSTRTOL_ERROR_H_ 1
+
+# include "xstrtol.h"
+
+# include <getopt.h>
+
+/* Report an error for an invalid integer in an option argument.
+
+ ERR is the error code returned by one of the xstrto* functions.
+
+ Use OPT_IDX to decide whether to print the short option string "C"
+ or "-C" or a long option string derived from LONG_OPTION. OPT_IDX
+ is -2 if the short option "C" was used, without any leading "-"; it
+ is -1 if the short option "-C" was used; otherwise it is an index
+ into LONG_OPTIONS, which should have a name preceded by two '-'
+ characters.
+
+ ARG is the option-argument containing the integer.
+
+ After reporting an error, exit with a failure status. */
+
+_Noreturn void xstrtol_fatal (enum strtol_error,
+ int, char, struct option const *,
+ char const *);
+
+#endif /* not XSTRTOL_ERROR_H_ */
#ifndef XSTRTOL_H_
# define XSTRTOL_H_ 1
-# include <getopt.h>
# include <inttypes.h>
# ifndef _STRTOL_ERROR
_DECLARE_XSTRTOL (xstrtoull, unsigned long long int)
#endif
-/* Report an error for an invalid integer in an option argument.
-
- ERR is the error code returned by one of the xstrto* functions.
-
- Use OPT_IDX to decide whether to print the short option string "C"
- or "-C" or a long option string derived from LONG_OPTION. OPT_IDX
- is -2 if the short option "C" was used, without any leading "-"; it
- is -1 if the short option "-C" was used; otherwise it is an index
- into LONG_OPTIONS, which should have a name preceded by two '-'
- characters.
-
- ARG is the option-argument containing the integer.
-
- After reporting an error, exit with a failure status. */
-
-_Noreturn void xstrtol_fatal (enum strtol_error,
- int, char, struct option const *,
- char const *);
-
#endif /* not XSTRTOL_H_ */
lib/xstrtol.h
lib/xstrtol.c
lib/xstrtoul.c
-lib/xstrtol-error.c
m4/xstrtol.m4
Depends-on:
assure
-exitfail
-error
-getopt-gnu
-gettext-h
inttypes-incomplete
configure.ac:
gl_XSTRTOL
Makefile.am:
-lib_SOURCES += xstrtol.c xstrtoul.c xstrtol-error.c
+lib_SOURCES += xstrtol.c xstrtoul.c
Include:
"xstrtol.h"
--- /dev/null
+Description:
+Error reporting function for xstrto* functions.
+
+Files:
+lib/xstrtol-error.c
+lib/xstrtol-error.h
+
+Depends-on:
+xstrtol
+error
+exitfail
+getopt-gnu
+gettext-h
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += xstrtol-error.c
+
+Include:
+"xstrtol-error.h"
+
+License:
+GPL
+
+Maintainer:
+Jim Meyering
Depends-on:
inttypes
test-framework-sh
+xstrtol-error
configure.ac:
#include <stdlib.h>
#include <stdio.h>
-#include "xstrtol.h"
+#include "xstrtol-error.h"
#include "error.h"
#ifndef __xstrtol