Hash :
a762d02b
Author :
Date :
2019-12-05T16:18:35
Move xstrtol_fatal to a new xstrtol-error module The xstrtol module provides a xstrtol_fatal function which uses other modules suitable mostly for command line handling (e.g. gettext, getopt), and that are completely unused when using only xstrto* functions. Furthermore, xstrtol_fatal is used only in the xstrtol-tests (within gnulib itself). As solution, move the xstrtol_fatal to a new xstrtol-error module, making xstrtol-tests depend on it. Since the prototype of xstrtol_fatal is automatically provided by xstrtol.h, it is very difficult to know whether anyone is actually using it, so add a note about this in NEWS. * 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.
Description:
Convert string to 'long' or 'unsigned long', with error checking.
Files:
lib/xstrtol.h
lib/xstrtol.c
lib/xstrtoul.c
m4/xstrtol.m4
Depends-on:
assure
inttypes-incomplete
configure.ac:
gl_XSTRTOL
Makefile.am:
lib_SOURCES += xstrtol.c xstrtoul.c
Include:
"xstrtol.h"
License:
GPL
Maintainer:
Jim Meyering