summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-08-05 14:36:59 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-08-05 14:36:59 +0200
commit55bccd48156066ec6ec91e91cd0efe7ea11f897b (patch)
treeb36a525fc41e093ed0b004af78c591b3aac992dc /gl
parentc76e86123bf115fc63b164ce93250afed0169b11 (diff)
downloadgnutls-55bccd48156066ec6ec91e91cd0efe7ea11f897b.tar.gz
gnulib only contains lgplv2 modules
Diffstat (limited to 'gl')
-rw-r--r--gl/Makefile.am706
-rw-r--r--gl/accept.c8
-rw-r--r--gl/alloca.in.h8
-rw-r--r--gl/alphasort.c27
-rw-r--r--gl/argp-ba.c34
-rw-r--r--gl/argp-eexst.c30
-rw-r--r--gl/argp-fmtstream.c435
-rw-r--r--gl/argp-fmtstream.h359
-rw-r--r--gl/argp-fs-xinl.c46
-rw-r--r--gl/argp-help.c1955
-rw-r--r--gl/argp-namefrob.h157
-rw-r--r--gl/argp-parse.c953
-rw-r--r--gl/argp-pin.c26
-rw-r--r--gl/argp-pv.c34
-rw-r--r--gl/argp-pvh.c31
-rw-r--r--gl/argp-xinl.c46
-rw-r--r--gl/argp.h650
-rw-r--r--gl/arpa_inet.in.h8
-rw-r--r--gl/asnprintf.c8
-rw-r--r--gl/asprintf.c8
-rw-r--r--gl/base64.c8
-rw-r--r--gl/base64.h8
-rw-r--r--gl/basename-lgpl.c75
-rw-r--r--gl/bind.c8
-rw-r--r--gl/byteswap.in.h8
-rw-r--r--gl/c-ctype.c8
-rw-r--r--gl/c-ctype.h8
-rw-r--r--gl/close.c8
-rw-r--r--gl/closedir.c67
-rw-r--r--gl/connect.c8
-rw-r--r--gl/dirent-private.h40
-rw-r--r--gl/dirent.in.h258
-rw-r--r--gl/dirname-lgpl.c86
-rw-r--r--gl/dirname.h46
-rw-r--r--gl/dup2.c8
-rw-r--r--gl/errno.in.h8
-rw-r--r--gl/error.c401
-rw-r--r--gl/error.h65
-rw-r--r--gl/fd-hook.c8
-rw-r--r--gl/fd-hook.h8
-rw-r--r--gl/filename.h54
-rw-r--r--gl/float+.h8
-rw-r--r--gl/float.c8
-rw-r--r--gl/float.in.h8
-rw-r--r--gl/frexp.c168
-rw-r--r--gl/frexpl.c35
-rw-r--r--gl/fseek.c8
-rw-r--r--gl/fseeko.c8
-rw-r--r--gl/fseterr.c79
-rw-r--r--gl/fseterr.h45
-rw-r--r--gl/fstat.c8
-rw-r--r--gl/ftell.c8
-rw-r--r--gl/ftello.c8
-rw-r--r--gl/gai_strerror.c8
-rw-r--r--gl/getaddrinfo.c8
-rw-r--r--gl/getdelim.c8
-rw-r--r--gl/getline.c8
-rw-r--r--gl/getopt.c1245
-rw-r--r--gl/getopt.in.h255
-rw-r--r--gl/getopt1.c170
-rw-r--r--gl/getopt_int.h135
-rw-r--r--gl/getpass.c8
-rw-r--r--gl/getpass.h8
-rw-r--r--gl/getpeername.c8
-rw-r--r--gl/getsubopt.c82
-rw-r--r--gl/gettext.h8
-rw-r--r--gl/gettimeofday.c8
-rw-r--r--gl/hash-pjw-bare.c8
-rw-r--r--gl/hash-pjw-bare.h8
-rw-r--r--gl/inet_ntop.c8
-rw-r--r--gl/inet_pton.c8
-rw-r--r--gl/isnan.c177
-rw-r--r--gl/isnand-nolibm.h33
-rw-r--r--gl/isnand.c19
-rw-r--r--gl/isnanf-nolibm.h40
-rw-r--r--gl/isnanf.c20
-rw-r--r--gl/isnanl-nolibm.h33
-rw-r--r--gl/isnanl.c20
-rw-r--r--gl/itold.c8
-rw-r--r--gl/listen.c8
-rw-r--r--gl/lseek.c8
-rw-r--r--gl/m4/alphasort.m421
-rw-r--r--gl/m4/argp.m461
-rw-r--r--gl/m4/closedir.m425
-rw-r--r--gl/m4/dirent_h.m464
-rw-r--r--gl/m4/dirname.m419
-rw-r--r--gl/m4/double-slash-root.m438
-rw-r--r--gl/m4/eealloc.m431
-rw-r--r--gl/m4/environ.m447
-rw-r--r--gl/m4/error.m427
-rw-r--r--gl/m4/exponentf.m492
-rw-r--r--gl/m4/exponentl.m498
-rw-r--r--gl/m4/frexp.m4172
-rw-r--r--gl/m4/frexpl.m4231
-rw-r--r--gl/m4/fseterr.m410
-rw-r--r--gl/m4/getopt.m4368
-rw-r--r--gl/m4/getsubopt.m420
-rw-r--r--gl/m4/gnulib-cache.m413
-rw-r--r--gl/m4/gnulib-comp.m4440
-rw-r--r--gl/m4/isnand.m496
-rw-r--r--gl/m4/isnanf.m4188
-rw-r--r--gl/m4/isnanl.m4255
-rw-r--r--gl/m4/ldexpl.m4133
-rw-r--r--gl/m4/malloca.m415
-rw-r--r--gl/m4/mempcpy.m426
-rw-r--r--gl/m4/nocrash.m4130
-rw-r--r--gl/m4/opendir.m425
-rw-r--r--gl/m4/printf-frexp.m438
-rw-r--r--gl/m4/printf-frexpl.m448
-rw-r--r--gl/m4/putenv.m456
-rw-r--r--gl/m4/rawmemchr.m420
-rw-r--r--gl/m4/readdir.m415
-rw-r--r--gl/m4/scandir.m421
-rw-r--r--gl/m4/setenv.m4160
-rw-r--r--gl/m4/signbit.m4365
-rw-r--r--gl/m4/sleep.m462
-rw-r--r--gl/m4/stdarg.m478
-rw-r--r--gl/m4/strchrnul.m450
-rw-r--r--gl/m4/sysexits.m444
-rw-r--r--gl/m4/version-etc.m433
-rw-r--r--gl/m4/vfprintf-posix.m4110
-rw-r--r--gl/m4/vprintf-posix.m425
-rw-r--r--gl/malloc.c8
-rw-r--r--gl/math.c3
-rw-r--r--gl/math.in.h2275
-rw-r--r--gl/memchr.c8
-rw-r--r--gl/memmem.c8
-rw-r--r--gl/mempcpy.c28
-rw-r--r--gl/minmax.h8
-rw-r--r--gl/msvc-inval.c8
-rw-r--r--gl/msvc-inval.h8
-rw-r--r--gl/msvc-nothrow.c8
-rw-r--r--gl/msvc-nothrow.h8
-rw-r--r--gl/netdb.in.h8
-rw-r--r--gl/netinet_in.in.h8
-rw-r--r--gl/opendir.c148
-rw-r--r--gl/printf-args.c8
-rw-r--r--gl/printf-args.h8
-rw-r--r--gl/printf-frexp.c190
-rw-r--r--gl/printf-frexp.h23
-rw-r--r--gl/printf-frexpl.c37
-rw-r--r--gl/printf-frexpl.h23
-rw-r--r--gl/printf-parse.c8
-rw-r--r--gl/printf-parse.h8
-rw-r--r--gl/progname.c92
-rw-r--r--gl/progname.h62
-rw-r--r--gl/rawmemchr.c136
-rw-r--r--gl/rawmemchr.valgrind12
-rw-r--r--gl/read-file.c8
-rw-r--r--gl/read-file.h8
-rw-r--r--gl/readdir.c98
-rw-r--r--gl/realloc.c8
-rw-r--r--gl/recv.c8
-rw-r--r--gl/recvfrom.c8
-rw-r--r--gl/scandir.c187
-rw-r--r--gl/select.c8
-rw-r--r--gl/send.c8
-rw-r--r--gl/sendto.c8
-rw-r--r--gl/setsockopt.c8
-rw-r--r--gl/shutdown.c8
-rw-r--r--gl/signal.in.h8
-rw-r--r--gl/signbitd.c64
-rw-r--r--gl/signbitf.c64
-rw-r--r--gl/signbitl.c64
-rw-r--r--gl/size_max.h8
-rw-r--r--gl/sleep.c76
-rw-r--r--gl/snprintf.c8
-rw-r--r--gl/socket.c8
-rw-r--r--gl/sockets.c8
-rw-r--r--gl/sockets.h8
-rw-r--r--gl/stdalign.in.h8
-rw-r--r--gl/stdarg.in.h35
-rw-r--r--gl/stdbool.in.h8
-rw-r--r--gl/stddef.in.h8
-rw-r--r--gl/stdint.in.h8
-rw-r--r--gl/stdio-impl.h8
-rw-r--r--gl/stdio.in.h8
-rw-r--r--gl/stdlib.in.h8
-rw-r--r--gl/str-two-way.h8
-rw-r--r--gl/strcasecmp.c8
-rw-r--r--gl/strchrnul.c142
-rw-r--r--gl/strchrnul.valgrind12
-rw-r--r--gl/strdup.c8
-rw-r--r--gl/string.in.h8
-rw-r--r--gl/strings.in.h8
-rw-r--r--gl/stripslash.c45
-rw-r--r--gl/strncasecmp.c8
-rw-r--r--gl/strndup.c8
-rw-r--r--gl/strnlen.c8
-rw-r--r--gl/strtok_r.c8
-rw-r--r--gl/strverscmp.c8
-rw-r--r--gl/sys_select.in.h8
-rw-r--r--gl/sys_socket.in.h8
-rw-r--r--gl/sys_stat.in.h8
-rw-r--r--gl/sys_time.in.h8
-rw-r--r--gl/sys_types.in.h8
-rw-r--r--gl/sys_uio.in.h8
-rw-r--r--gl/sysexits.in.h72
-rw-r--r--gl/tests/Makefile.am274
-rw-r--r--gl/tests/dosname.h (renamed from gl/dosname.h)0
-rw-r--r--gl/tests/fpucw.h (renamed from gl/fpucw.h)0
-rw-r--r--gl/tests/infinity.h60
-rw-r--r--gl/tests/intprops.h (renamed from gl/intprops.h)0
-rw-r--r--gl/tests/malloca.c149
-rw-r--r--gl/tests/malloca.h133
-rw-r--r--gl/tests/malloca.valgrind7
-rw-r--r--gl/tests/minus-zero.h74
-rw-r--r--gl/tests/nan.h70
-rw-r--r--gl/tests/putenv.c194
-rw-r--r--gl/tests/randomd.c1028
-rw-r--r--gl/tests/randoml.c1028
-rw-r--r--gl/tests/setenv.c390
-rw-r--r--gl/tests/strerror-override.c (renamed from gl/strerror-override.c)0
-rw-r--r--gl/tests/strerror-override.h (renamed from gl/strerror-override.h)0
-rw-r--r--gl/tests/strerror.c (renamed from gl/strerror.c)0
-rwxr-xr-xgl/tests/test-argp-2.sh113
-rw-r--r--gl/tests/test-argp.c491
-rw-r--r--gl/tests/test-dirent.c32
-rw-r--r--gl/tests/test-environ.c44
-rw-r--r--gl/tests/test-fprintf-posix.h153
-rw-r--r--gl/tests/test-frexp.c67
-rw-r--r--gl/tests/test-frexp.h179
-rw-r--r--gl/tests/test-frexpl.c78
-rw-r--r--gl/tests/test-fseterr.c44
-rw-r--r--gl/tests/test-getopt.c99
-rw-r--r--gl/tests/test-getopt.h1391
-rw-r--r--gl/tests/test-getopt_long.h2144
-rw-r--r--gl/tests/test-isnand-nolibm.c21
-rw-r--r--gl/tests/test-isnand.h63
-rw-r--r--gl/tests/test-isnanf-nolibm.c21
-rw-r--r--gl/tests/test-isnanf.h65
-rw-r--r--gl/tests/test-isnanl-nolibm.c23
-rw-r--r--gl/tests/test-isnanl.h127
-rw-r--r--gl/tests/test-malloc-gnu.c29
-rw-r--r--gl/tests/test-malloca.c62
-rw-r--r--gl/tests/test-math.c104
-rw-r--r--gl/tests/test-printf-frexp.c119
-rw-r--r--gl/tests/test-printf-frexpl.c134
-rw-r--r--gl/tests/test-printf-posix.h155
-rw-r--r--gl/tests/test-printf-posix.output40
-rw-r--r--gl/tests/test-rawmemchr.c92
-rw-r--r--gl/tests/test-setenv.c56
-rw-r--r--gl/tests/test-signbit.c177
-rw-r--r--gl/tests/test-sleep.c58
-rw-r--r--gl/tests/test-strchrnul.c86
-rw-r--r--gl/tests/test-sysexits.c52
-rw-r--r--gl/tests/test-unsetenv.c61
-rw-r--r--gl/tests/test-version-etc.c33
-rwxr-xr-xgl/tests/test-version-etc.sh43
-rw-r--r--gl/tests/test-vfprintf-posix.c52
-rwxr-xr-xgl/tests/test-vfprintf-posix.sh16
-rw-r--r--gl/tests/test-vprintf-posix.c52
-rwxr-xr-xgl/tests/test-vprintf-posix.sh16
-rw-r--r--gl/tests/unsetenv.c127
-rw-r--r--gl/time.in.h8
-rw-r--r--gl/time_r.c8
-rw-r--r--gl/u64.h8
-rw-r--r--gl/unistd.in.h8
-rw-r--r--gl/vasnprintf.c8
-rw-r--r--gl/vasnprintf.h8
-rw-r--r--gl/vasprintf.c8
-rw-r--r--gl/verify.h8
-rw-r--r--gl/version-etc-fsf.c30
-rw-r--r--gl/version-etc.c258
-rw-r--r--gl/version-etc.h78
-rw-r--r--gl/vfprintf.c74
-rw-r--r--gl/vprintf.c33
-rw-r--r--gl/vsnprintf.c8
-rw-r--r--gl/w32sock.h8
-rw-r--r--gl/wchar.in.h8
-rw-r--r--gl/xsize.h8
271 files changed, 478 insertions, 27764 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index 56ab3dc05a..d7590d9aaf 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -21,7 +21,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettimeofday hash-pjw-bare havelib iconv inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca base64 bind byteswap c-ctype close connect extensions func gendocs getaddrinfo getpass gettext gettimeofday hash-pjw-bare havelib iconv inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file recv recvfrom select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r u64 unistd valgrind-tests vasprintf vsnprintf warnings
AUTOMAKE_OPTIONS = 1.9.6 gnits
@@ -104,24 +104,6 @@ EXTRA_DIST += alloca.in.h
## end gnulib module alloca-opt
-## begin gnulib module alphasort
-
-
-EXTRA_DIST += alphasort.c
-
-EXTRA_libgnu_la_SOURCES += alphasort.c
-
-## end gnulib module alphasort
-
-## begin gnulib module argp
-
-libgnu_la_SOURCES += argp.h argp-ba.c argp-eexst.c \
- argp-fmtstream.c argp-fmtstream.h argp-fs-xinl.c argp-help.c \
- argp-namefrob.h argp-parse.c argp-pin.c argp-pv.c argp-pvh.c \
- argp-xinl.c
-
-## end gnulib module argp
-
## begin gnulib module arpa_inet
BUILT_SOURCES += arpa/inet.h
@@ -211,15 +193,6 @@ EXTRA_libgnu_la_SOURCES += close.c
## end gnulib module close
-## begin gnulib module closedir
-
-
-EXTRA_DIST += closedir.c dirent-private.h
-
-EXTRA_libgnu_la_SOURCES += closedir.c
-
-## end gnulib module closedir
-
## begin gnulib module connect
@@ -229,69 +202,6 @@ EXTRA_libgnu_la_SOURCES += connect.c
## end gnulib module connect
-## begin gnulib module dirent
-
-BUILT_SOURCES += dirent.h
-
-# We need the following in order to create <dirent.h> when the system
-# doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
- -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
- -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
- -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
- -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
- -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
- -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
- -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
- -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
- -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
- -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
- -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
- -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
- -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
- -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
- -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
- -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
- -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
- -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
- -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
- -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
- -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
- -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
- -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
- -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
- < $(srcdir)/dirent.in.h; \
- } > $@-t && \
- mv $@-t $@
-MOSTLYCLEANFILES += dirent.h dirent.h-t
-
-EXTRA_DIST += dirent.in.h
-
-## end gnulib module dirent
-
-## begin gnulib module dirname-lgpl
-
-libgnu_la_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
-
-EXTRA_DIST += dirname.h
-
-## end gnulib module dirname-lgpl
-
-## begin gnulib module dosname
-
-
-EXTRA_DIST += dosname.h
-
-## end gnulib module dosname
-
## begin gnulib module dup2
@@ -335,15 +245,6 @@ EXTRA_DIST += errno.in.h
## end gnulib module errno
-## begin gnulib module error
-
-
-EXTRA_DIST += error.c error.h
-
-EXTRA_libgnu_la_SOURCES += error.c
-
-## end gnulib module error
-
## begin gnulib module fd-hook
libgnu_la_SOURCES += fd-hook.c
@@ -352,13 +253,6 @@ EXTRA_DIST += fd-hook.h
## end gnulib module fd-hook
-## begin gnulib module filename
-
-
-EXTRA_DIST += filename.h
-
-## end gnulib module filename
-
## begin gnulib module float
BUILT_SOURCES += $(FLOAT_H)
@@ -390,31 +284,6 @@ EXTRA_libgnu_la_SOURCES += float.c itold.c
## end gnulib module float
-## begin gnulib module fpucw
-
-
-EXTRA_DIST += fpucw.h
-
-## end gnulib module fpucw
-
-## begin gnulib module frexp-nolibm
-
-
-EXTRA_DIST += frexp.c
-
-EXTRA_libgnu_la_SOURCES += frexp.c
-
-## end gnulib module frexp-nolibm
-
-## begin gnulib module frexpl-nolibm
-
-
-EXTRA_DIST += frexp.c frexpl.c
-
-EXTRA_libgnu_la_SOURCES += frexp.c frexpl.c
-
-## end gnulib module frexpl-nolibm
-
## begin gnulib module fseek
@@ -433,15 +302,6 @@ EXTRA_libgnu_la_SOURCES += fseeko.c
## end gnulib module fseeko
-## begin gnulib module fseterr
-
-
-EXTRA_DIST += fseterr.c fseterr.h stdio-impl.h
-
-EXTRA_libgnu_la_SOURCES += fseterr.c
-
-## end gnulib module fseterr
-
## begin gnulib module fstat
@@ -503,33 +363,6 @@ EXTRA_libgnu_la_SOURCES += getline.c
## end gnulib module getline
-## begin gnulib module getopt-posix
-
-BUILT_SOURCES += $(GETOPT_H)
-
-# We need the following in order to create <getopt.h> when the system
-# doesn't have one that works with the given compiler.
-getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
- -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
- -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- < $(srcdir)/getopt.in.h; \
- } > $@-t && \
- mv -f $@-t $@
-MOSTLYCLEANFILES += getopt.h getopt.h-t
-
-EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
-
-EXTRA_libgnu_la_SOURCES += getopt.c getopt1.c
-
-## end gnulib module getopt-posix
-
## begin gnulib module getpass
@@ -548,15 +381,6 @@ EXTRA_libgnu_la_SOURCES += getpeername.c
## end gnulib module getpeername
-## begin gnulib module getsubopt
-
-
-EXTRA_DIST += getsubopt.c
-
-EXTRA_libgnu_la_SOURCES += getsubopt.c
-
-## end gnulib module getsubopt
-
## begin gnulib module gettext
# If your project uses "gettextize --intl" to put a source-code
@@ -630,40 +454,6 @@ EXTRA_libgnu_la_SOURCES += inet_pton.c
## end gnulib module inet_pton
-## begin gnulib module intprops
-
-
-EXTRA_DIST += intprops.h
-
-## end gnulib module intprops
-
-## begin gnulib module isnand-nolibm
-
-
-EXTRA_DIST += float+.h isnan.c isnand-nolibm.h isnand.c
-
-EXTRA_libgnu_la_SOURCES += isnan.c isnand.c
-
-## end gnulib module isnand-nolibm
-
-## begin gnulib module isnanf-nolibm
-
-
-EXTRA_DIST += float+.h isnan.c isnanf-nolibm.h isnanf.c
-
-EXTRA_libgnu_la_SOURCES += isnan.c isnanf.c
-
-## end gnulib module isnanf-nolibm
-
-## begin gnulib module isnanl-nolibm
-
-
-EXTRA_DIST += float+.h isnan.c isnanl-nolibm.h isnanl.c
-
-EXTRA_libgnu_la_SOURCES += isnan.c isnanl.c
-
-## end gnulib module isnanl-nolibm
-
## begin gnulib module listen
@@ -688,15 +478,6 @@ EXTRA_DIST += $(top_srcdir)/maint.mk
## end gnulib module maintainer-makefile
-## begin gnulib module malloc-gnu
-
-
-EXTRA_DIST += malloc.c
-
-EXTRA_libgnu_la_SOURCES += malloc.c
-
-## end gnulib module malloc-gnu
-
## begin gnulib module malloc-posix
@@ -706,290 +487,6 @@ EXTRA_libgnu_la_SOURCES += malloc.c
## end gnulib module malloc-posix
-## begin gnulib module math
-
-BUILT_SOURCES += math.h
-libgnu_la_SOURCES += math.c
-
-# We need the following in order to create <math.h> when the system
-# doesn't have one that works with the given compiler.
-math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
- -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
- -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \
- -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \
- -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \
- -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \
- -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \
- -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \
- -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \
- -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \
- -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \
- -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \
- -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \
- -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \
- -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \
- -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \
- -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \
- -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \
- -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \
- -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \
- -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \
- -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \
- -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \
- -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \
- -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \
- -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \
- -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \
- -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \
- -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \
- -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \
- -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \
- -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \
- -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \
- -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \
- -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \
- -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \
- -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \
- -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \
- -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \
- -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \
- -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \
- -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \
- -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \
- -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \
- -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \
- -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \
- < $(srcdir)/math.in.h | \
- sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \
- -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
- -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
- -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
- -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
- -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
- -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
- -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
- -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \
- -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \
- -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \
- -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \
- -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \
- -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \
- -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \
- -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \
- -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \
- -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \
- -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \
- -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \
- -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \
- -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \
- -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \
- -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \
- -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \
- -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \
- -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \
- -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \
- -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \
- -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \
- -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \
- -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \
- -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \
- -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \
- -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \
- -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \
- -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \
- -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \
- -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \
- -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \
- -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \
- -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \
- -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \
- -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \
- -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \
- -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \
- -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \
- -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \
- -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \
- -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \
- -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \
- | \
- sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
- -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
- -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \
- -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \
- -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \
- -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \
- -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \
- -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \
- -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \
- -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \
- -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \
- -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \
- -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \
- -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \
- -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \
- -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \
- -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \
- -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \
- -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \
- -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \
- -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \
- -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \
- -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \
- -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \
- -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \
- -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \
- -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \
- -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \
- -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \
- -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \
- -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \
- -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \
- -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \
- -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \
- -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \
- -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \
- -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \
- -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \
- -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \
- -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \
- -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \
- -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \
- -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \
- -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \
- -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \
- -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \
- -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \
- -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \
- -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \
- -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \
- -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \
- -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \
- -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \
- -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \
- -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \
- -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \
- -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \
- -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \
- -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \
- -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \
- -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
- -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
- -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
- -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \
- -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \
- -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
- -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
- -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \
- -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
- -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
- -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \
- -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \
- -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \
- -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \
- -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
- -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
- -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
- -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
- -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
- -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \
- -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \
- -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \
- -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \
- -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \
- -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \
- -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \
- -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \
- -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \
- -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \
- -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \
- -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \
- -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \
- -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \
- -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \
- -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
- -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
- | \
- sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
- -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
- -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
- -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
- -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
- -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
- -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
- -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
- -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
- -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
- -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \
- -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
- -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
- -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \
- -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \
- -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \
- -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \
- -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \
- -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \
- -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \
- -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
- -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
- -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \
- -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \
- -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \
- -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
- -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
- -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
- -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
- -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
- -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
- -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \
- -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \
- -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \
- -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \
- -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \
- -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \
- -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \
- -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \
- -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \
- -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \
- -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \
- -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \
- -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \
- -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \
- -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \
- -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \
- -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \
- -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \
- -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \
- -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \
- -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \
- -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
- -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
- -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
- -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
- -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
- -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
- -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
- -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
- -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
- -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
- -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
- -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
- -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
- -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
- -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
- } > $@-t && \
- mv $@-t $@
-MOSTLYCLEANFILES += math.h math.h-t
-
-EXTRA_DIST += math.in.h
-
-## end gnulib module math
-
## begin gnulib module memchr
@@ -1008,15 +505,6 @@ EXTRA_libgnu_la_SOURCES += memmem.c
## end gnulib module memmem-simple
-## begin gnulib module mempcpy
-
-
-EXTRA_DIST += mempcpy.c
-
-EXTRA_libgnu_la_SOURCES += mempcpy.c
-
-## end gnulib module mempcpy
-
## begin gnulib module minmax
libgnu_la_SOURCES += minmax.h
@@ -1106,15 +594,6 @@ EXTRA_DIST += netinet_in.in.h
## end gnulib module netinet_in
-## begin gnulib module opendir
-
-
-EXTRA_DIST += dirent-private.h opendir.c
-
-EXTRA_libgnu_la_SOURCES += opendir.c
-
-## end gnulib module opendir
-
## begin gnulib module pmccabe2html
@@ -1122,39 +601,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/pmccabe2html $(top_srcdir)/build-aux/pmcca
## end gnulib module pmccabe2html
-## begin gnulib module printf-frexp
-
-libgnu_la_SOURCES += printf-frexp.c
-
-EXTRA_DIST += printf-frexp.h
-
-## end gnulib module printf-frexp
-
-## begin gnulib module printf-frexpl
-
-libgnu_la_SOURCES += printf-frexpl.c
-
-EXTRA_DIST += printf-frexp.c printf-frexpl.h
-
-EXTRA_libgnu_la_SOURCES += printf-frexp.c
-
-## end gnulib module printf-frexpl
-
-## begin gnulib module progname
-
-libgnu_la_SOURCES += progname.h progname.c
-
-## end gnulib module progname
-
-## begin gnulib module rawmemchr
-
-
-EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
-
-EXTRA_libgnu_la_SOURCES += rawmemchr.c
-
-## end gnulib module rawmemchr
-
## begin gnulib module read-file
libgnu_la_SOURCES += read-file.c
@@ -1163,15 +609,6 @@ EXTRA_DIST += read-file.h
## end gnulib module read-file
-## begin gnulib module readdir
-
-
-EXTRA_DIST += dirent-private.h readdir.c
-
-EXTRA_libgnu_la_SOURCES += readdir.c
-
-## end gnulib module readdir
-
## begin gnulib module realloc-posix
@@ -1199,15 +636,6 @@ EXTRA_libgnu_la_SOURCES += recvfrom.c
## end gnulib module recvfrom
-## begin gnulib module scandir
-
-
-EXTRA_DIST += scandir.c
-
-EXTRA_libgnu_la_SOURCES += scandir.c
-
-## end gnulib module scandir
-
## begin gnulib module select
@@ -1295,30 +723,12 @@ EXTRA_DIST += signal.in.h
## end gnulib module signal-h
-## begin gnulib module signbit
-
-
-EXTRA_DIST += float+.h signbitd.c signbitf.c signbitl.c
-
-EXTRA_libgnu_la_SOURCES += signbitd.c signbitf.c signbitl.c
-
-## end gnulib module signbit
-
## begin gnulib module size_max
libgnu_la_SOURCES += size_max.h
## end gnulib module size_max
-## begin gnulib module sleep
-
-
-EXTRA_DIST += sleep.c
-
-EXTRA_libgnu_la_SOURCES += sleep.c
-
-## end gnulib module sleep
-
## begin gnulib module snippet/_Noreturn
# Because this Makefile snippet defines a variable used by other
@@ -1449,34 +859,6 @@ EXTRA_DIST += stdalign.in.h
## end gnulib module stdalign
-## begin gnulib module stdarg
-
-BUILT_SOURCES += $(STDARG_H)
-
-# We need the following in order to create <stdarg.h> when the system
-# doesn't have one that works with the given compiler.
-if GL_GENERATE_STDARG_H
-stdarg.h: stdarg.in.h $(top_builddir)/config.status
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \
- < $(srcdir)/stdarg.in.h; \
- } > $@-t && \
- mv $@-t $@
-else
-stdarg.h: $(top_builddir)/config.status
- rm -f $@
-endif
-MOSTLYCLEANFILES += stdarg.h stdarg.h-t
-
-EXTRA_DIST += stdarg.in.h
-
-## end gnulib module stdarg
-
## begin gnulib module stdbool
BUILT_SOURCES += $(STDBOOL_H)
@@ -1820,15 +1202,6 @@ EXTRA_libgnu_la_SOURCES += strcasecmp.c strncasecmp.c
## end gnulib module strcase
-## begin gnulib module strchrnul
-
-
-EXTRA_DIST += strchrnul.c strchrnul.valgrind
-
-EXTRA_libgnu_la_SOURCES += strchrnul.c
-
-## end gnulib module strchrnul
-
## begin gnulib module strdup-posix
@@ -1838,24 +1211,6 @@ EXTRA_libgnu_la_SOURCES += strdup.c
## end gnulib module strdup-posix
-## begin gnulib module strerror
-
-
-EXTRA_DIST += strerror.c
-
-EXTRA_libgnu_la_SOURCES += strerror.c
-
-## end gnulib module strerror
-
-## begin gnulib module strerror-override
-
-
-EXTRA_DIST += strerror-override.c strerror-override.h
-
-EXTRA_libgnu_la_SOURCES += strerror-override.c
-
-## end gnulib module strerror-override
-
## begin gnulib module string
BUILT_SOURCES += string.h
@@ -2256,35 +1611,6 @@ EXTRA_DIST += sys_uio.in.h
## end gnulib module sys_uio
-## begin gnulib module sysexits
-
-BUILT_SOURCES += $(SYSEXITS_H)
-
-# We need the following in order to create <sysexits.h> when the system
-# doesn't have one that works with the given compiler.
-if GL_GENERATE_SYSEXITS_H
-sysexits.h: sysexits.in.h $(top_builddir)/config.status
- $(AM_V_GEN)rm -f $@-t $@ && \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''GUARD_PREFIX''@|GL|g' \
- -e 's|@''HAVE_SYSEXITS_H''@|$(HAVE_SYSEXITS_H)|g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
- -e 's|@''NEXT_SYSEXITS_H''@|$(NEXT_SYSEXITS_H)|g' \
- < $(srcdir)/sysexits.in.h; \
- } > $@-t && \
- mv -f $@-t $@
-else
-sysexits.h: $(top_builddir)/config.status
- rm -f $@
-endif
-MOSTLYCLEANFILES += sysexits.h sysexits.h-t
-
-EXTRA_DIST += sysexits.in.h
-
-## end gnulib module sysexits
-
## begin gnulib module time
BUILT_SOURCES += time.h
@@ -2534,36 +1860,6 @@ EXTRA_DIST += verify.h
## end gnulib module verify
-## begin gnulib module version-etc
-
-libgnu_la_SOURCES += version-etc.h version-etc.c
-
-## end gnulib module version-etc
-
-## begin gnulib module version-etc-fsf
-
-libgnu_la_SOURCES += version-etc-fsf.c
-
-## end gnulib module version-etc-fsf
-
-## begin gnulib module vfprintf-posix
-
-
-EXTRA_DIST += vfprintf.c
-
-EXTRA_libgnu_la_SOURCES += vfprintf.c
-
-## end gnulib module vfprintf-posix
-
-## begin gnulib module vprintf-posix
-
-
-EXTRA_DIST += vprintf.c
-
-EXTRA_libgnu_la_SOURCES += vprintf.c
-
-## end gnulib module vprintf-posix
-
## begin gnulib module vsnprintf
diff --git a/gl/accept.c b/gl/accept.c
index bf27403d45..ee98a78608 100644
--- a/gl/accept.c
+++ b/gl/accept.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/alloca.in.h b/gl/alloca.in.h
index 72d28ee306..3e3b6d7f79 100644
--- a/gl/alloca.in.h
+++ b/gl/alloca.in.h
@@ -4,16 +4,16 @@
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, or (at your option)
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1, 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public
+ You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see
<http://www.gnu.org/licenses/>.
*/
diff --git a/gl/alphasort.c b/gl/alphasort.c
deleted file mode 100644
index 0cf8d1167c..0000000000
--- a/gl/alphasort.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 1992, 1997-1998, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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, 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include <dirent.h>
-
-#include <string.h>
-
-int
-alphasort (const struct dirent **a, const struct dirent **b)
-{
- return strcoll ((*a)->d_name, (*b)->d_name);
-}
diff --git a/gl/argp-ba.c b/gl/argp-ba.c
deleted file mode 100644
index 5abc9d00a1..0000000000
--- a/gl/argp-ba.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
- Copyright (C) 1996-1997, 1999, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-/* If set by the user program, it should point to string that is the
- bug-reporting address for the program. It will be printed by argp_help if
- the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
- messages), embedded in a sentence that says something like "Report bugs to
- ADDR." */
-const char *argp_program_bug_address
-/* This variable should be zero-initialized. On most systems, putting it into
- BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
- <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
- <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
-#if defined __ELF__
- /* On ELF systems, variables in BSS behave well. */
-#else
- = (const char *) 0
-#endif
- ;
diff --git a/gl/argp-eexst.c b/gl/argp-eexst.c
deleted file mode 100644
index a8bb77fcf7..0000000000
--- a/gl/argp-eexst.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Default definition for ARGP_ERR_EXIT_STATUS
- Copyright (C) 1997, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <sysexits.h>
-
-#include "argp.h"
-
-/* The exit status that argp will use when exiting due to a parsing error.
- If not defined or set by the user program, this defaults to EX_USAGE from
- <sysexits.h>. */
-error_t argp_err_exit_status = EX_USAGE;
diff --git a/gl/argp-fmtstream.c b/gl/argp-fmtstream.c
deleted file mode 100644
index 7aa317c44c..0000000000
--- a/gl/argp-fmtstream.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/* Word-wrapping and line-truncating streams
- Copyright (C) 1997-1999, 2001-2003, 2005, 2009-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-/* This package emulates glibc 'line_wrap_stream' semantics for systems that
- don't have that. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <ctype.h>
-
-#include "argp-fmtstream.h"
-#include "argp-namefrob.h"
-
-#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
-
-#ifndef isblank
-#define isblank(ch) ((ch)==' ' || (ch)=='\t')
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-# include <libio/libioP.h>
-# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
-#endif
-
-#define INIT_BUF_SIZE 200
-#define PRINTF_SIZE_GUESS 150
-
-/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
- written on it with LMARGIN spaces and limits them to RMARGIN columns
- total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
- replacing the whitespace before them with a newline and WMARGIN spaces.
- Otherwise, chars beyond RMARGIN are simply dropped until a newline.
- Returns NULL if there was an error. */
-argp_fmtstream_t
-__argp_make_fmtstream (FILE *stream,
- size_t lmargin, size_t rmargin, ssize_t wmargin)
-{
- argp_fmtstream_t fs;
-
- fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream));
- if (fs != NULL)
- {
- fs->stream = stream;
-
- fs->lmargin = lmargin;
- fs->rmargin = rmargin;
- fs->wmargin = wmargin;
- fs->point_col = 0;
- fs->point_offs = 0;
-
- fs->buf = (char *) malloc (INIT_BUF_SIZE);
- if (! fs->buf)
- {
- free (fs);
- fs = 0;
- }
- else
- {
- fs->p = fs->buf;
- fs->end = fs->buf + INIT_BUF_SIZE;
- }
- }
-
- return fs;
-}
-#if 0
-/* Not exported. */
-#ifdef weak_alias
-weak_alias (__argp_make_fmtstream, argp_make_fmtstream)
-#endif
-#endif
-
-/* Flush FS to its stream, and free it (but don't close the stream). */
-void
-__argp_fmtstream_free (argp_fmtstream_t fs)
-{
- __argp_fmtstream_update (fs);
- if (fs->p > fs->buf)
- {
-#ifdef USE_IN_LIBIO
- __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
-#else
- fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
-#endif
- }
- free (fs->buf);
- free (fs);
-}
-#if 0
-/* Not exported. */
-#ifdef weak_alias
-weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
-#endif
-#endif
-
-/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
- end of its buffer. This code is mostly from glibc stdio/linewrap.c. */
-void
-__argp_fmtstream_update (argp_fmtstream_t fs)
-{
- char *buf, *nl;
- size_t len;
-
- /* Scan the buffer for newlines. */
- buf = fs->buf + fs->point_offs;
- while (buf < fs->p)
- {
- size_t r;
-
- if (fs->point_col == 0 && fs->lmargin != 0)
- {
- /* We are starting a new line. Print spaces to the left margin. */
- const size_t pad = fs->lmargin;
- if (fs->p + pad < fs->end)
- {
- /* We can fit in them in the buffer by moving the
- buffer text up and filling in the beginning. */
- memmove (buf + pad, buf, fs->p - buf);
- fs->p += pad; /* Compensate for bigger buffer. */
- memset (buf, ' ', pad); /* Fill in the spaces. */
- buf += pad; /* Don't bother searching them. */
- }
- else
- {
- /* No buffer space for spaces. Must flush. */
- size_t i;
- for (i = 0; i < pad; i++)
- {
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (fs->stream, 0) > 0)
- putwc_unlocked (L' ', fs->stream);
- else
-#endif
- putc_unlocked (' ', fs->stream);
- }
- }
- fs->point_col = pad;
- }
-
- len = fs->p - buf;
- nl = memchr (buf, '\n', len);
-
- if (fs->point_col < 0)
- fs->point_col = 0;
-
- if (!nl)
- {
- /* The buffer ends in a partial line. */
-
- if (fs->point_col + len < fs->rmargin)
- {
- /* The remaining buffer text is a partial line and fits
- within the maximum line width. Advance point for the
- characters to be written and stop scanning. */
- fs->point_col += len;
- break;
- }
- else
- /* Set the end-of-line pointer for the code below to
- the end of the buffer. */
- nl = fs->p;
- }
- else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
- {
- /* The buffer contains a full line that fits within the maximum
- line width. Reset point and scan the next line. */
- fs->point_col = 0;
- buf = nl + 1;
- continue;
- }
-
- /* This line is too long. */
- r = fs->rmargin - 1;
-
- if (fs->wmargin < 0)
- {
- /* Truncate the line by overwriting the excess with the
- newline and anything after it in the buffer. */
- if (nl < fs->p)
- {
- memmove (buf + (r - fs->point_col), nl, fs->p - nl);
- fs->p -= buf + (r - fs->point_col) - nl;
- /* Reset point for the next line and start scanning it. */
- fs->point_col = 0;
- buf += r + 1; /* Skip full line plus \n. */
- }
- else
- {
- /* The buffer ends with a partial line that is beyond the
- maximum line width. Advance point for the characters
- written, and discard those past the max from the buffer. */
- fs->point_col += len;
- fs->p -= fs->point_col - r;
- break;
- }
- }
- else
- {
- /* Do word wrap. Go to the column just past the maximum line
- width and scan back for the beginning of the word there.
- Then insert a line break. */
-
- char *p, *nextline;
- int i;
-
- p = buf + (r + 1 - fs->point_col);
- while (p >= buf && !isblank ((unsigned char) *p))
- --p;
- nextline = p + 1; /* This will begin the next line. */
-
- if (nextline > buf)
- {
- /* Swallow separating blanks. */
- if (p >= buf)
- do
- --p;
- while (p >= buf && isblank ((unsigned char) *p));
- nl = p + 1; /* The newline will replace the first blank. */
- }
- else
- {
- /* A single word that is greater than the maximum line width.
- Oh well. Put it on an overlong line by itself. */
- p = buf + (r + 1 - fs->point_col);
- /* Find the end of the long word. */
- if (p < nl)
- do
- ++p;
- while (p < nl && !isblank ((unsigned char) *p));
- if (p == nl)
- {
- /* It already ends a line. No fussing required. */
- fs->point_col = 0;
- buf = nl + 1;
- continue;
- }
- /* We will move the newline to replace the first blank. */
- nl = p;
- /* Swallow separating blanks. */
- do
- ++p;
- while (isblank ((unsigned char) *p));
- /* The next line will start here. */
- nextline = p;
- }
-
- /* Note: There are a bunch of tests below for
- NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall
- at the end of the buffer, and NEXTLINE is in fact empty (and so
- we need not be careful to maintain its contents). */
-
- if ((nextline == buf + len + 1
- ? fs->end - nl < fs->wmargin + 1
- : nextline - (nl + 1) < fs->wmargin)
- && fs->p > nextline)
- {
- /* The margin needs more blanks than we removed. */
- if (fs->end - fs->p > fs->wmargin + 1)
- /* Make some space for them. */
- {
- size_t mv = fs->p - nextline;
- memmove (nl + 1 + fs->wmargin, nextline, mv);
- nextline = nl + 1 + fs->wmargin;
- len = nextline + mv - buf;
- *nl++ = '\n';
- }
- else
- /* Output the first line so we can use the space. */
- {
-#ifdef _LIBC
- __fxprintf (fs->stream, "%.*s\n",
- (int) (nl - fs->buf), fs->buf);
-#else
- if (nl > fs->buf)
- fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
- putc_unlocked ('\n', fs->stream);
-#endif
-
- len += buf - fs->buf;
- nl = buf = fs->buf;
- }
- }
- else
- /* We can fit the newline and blanks in before
- the next word. */
- *nl++ = '\n';
-
- if (nextline - nl >= fs->wmargin
- || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin))
- /* Add blanks up to the wrap margin column. */
- for (i = 0; i < fs->wmargin; ++i)
- *nl++ = ' ';
- else
- for (i = 0; i < fs->wmargin; ++i)
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (fs->stream, 0) > 0)
- putwc_unlocked (L' ', fs->stream);
- else
-#endif
- putc_unlocked (' ', fs->stream);
-
- /* Copy the tail of the original buffer into the current buffer
- position. */
- if (nl < nextline)
- memmove (nl, nextline, buf + len - nextline);
- len -= nextline - buf;
-
- /* Continue the scan on the remaining lines in the buffer. */
- buf = nl;
-
- /* Restore bufp to include all the remaining text. */
- fs->p = nl + len;
-
- /* Reset the counter of what has been output this line. If wmargin
- is 0, we want to avoid the lmargin getting added, so we set
- point_col to a magic value of -1 in that case. */
- fs->point_col = fs->wmargin ? fs->wmargin : -1;
- }
- }
-
- /* Remember that we've scanned as far as the end of the buffer. */
- fs->point_offs = fs->p - fs->buf;
-}
-
-/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by
- growing the buffer, or by flushing it. True is returned iff we succeed. */
-int
-__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
-{
- if ((size_t) (fs->end - fs->p) < amount)
- {
- ssize_t wrote;
-
- /* Flush FS's buffer. */
- __argp_fmtstream_update (fs);
-
-#ifdef _LIBC
- __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
- wrote = fs->p - fs->buf;
-#else
- wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
-#endif
- if (wrote == fs->p - fs->buf)
- {
- fs->p = fs->buf;
- fs->point_offs = 0;
- }
- else
- {
- fs->p -= wrote;
- fs->point_offs -= wrote;
- memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf);
- return 0;
- }
-
- if ((size_t) (fs->end - fs->buf) < amount)
- /* Gotta grow the buffer. */
- {
- size_t old_size = fs->end - fs->buf;
- size_t new_size = old_size + amount;
- char *new_buf;
-
- if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
- {
- __set_errno (ENOMEM);
- return 0;
- }
-
- fs->buf = new_buf;
- fs->end = new_buf + new_size;
- fs->p = fs->buf;
- }
- }
-
- return 1;
-}
-
-ssize_t
-__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...)
-{
- int out;
- size_t avail;
- size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */
-
- do
- {
- va_list args;
-
- if (! __argp_fmtstream_ensure (fs, size_guess))
- return -1;
-
- va_start (args, fmt);
- avail = fs->end - fs->p;
- out = __vsnprintf (fs->p, avail, fmt, args);
- va_end (args);
- if ((size_t) out >= avail)
- size_guess = out + 1;
- }
- while ((size_t) out >= avail);
-
- fs->p += out;
-
- return out;
-}
-#if 0
-/* Not exported. */
-#ifdef weak_alias
-weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
-#endif
-#endif
-
-#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
diff --git a/gl/argp-fmtstream.h b/gl/argp-fmtstream.h
deleted file mode 100644
index 000090ea68..0000000000
--- a/gl/argp-fmtstream.h
+++ /dev/null
@@ -1,359 +0,0 @@
-/* Word-wrapping and line-truncating streams.
- Copyright (C) 1997, 2006-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-/* This package emulates glibc 'line_wrap_stream' semantics for systems that
- don't have that. If the system does have it, it is just a wrapper for
- that. This header file is only used internally while compiling argp, and
- shouldn't be installed. */
-
-#ifndef _ARGP_FMTSTREAM_H
-#define _ARGP_FMTSTREAM_H
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
-#if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
- || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
-/* line_wrap_stream is available, so use that. */
-#define ARGP_FMTSTREAM_USE_LINEWRAP
-#endif
-
-#ifdef ARGP_FMTSTREAM_USE_LINEWRAP
-/* Just be a simple wrapper for line_wrap_stream; the semantics are
- *slightly* different, as line_wrap_stream doesn't actually make a new
- object, it just modifies the given stream (reversibly) to do
- line-wrapping. Since we control who uses this code, it doesn't matter. */
-
-#include <linewrap.h>
-
-typedef FILE *argp_fmtstream_t;
-
-#define argp_make_fmtstream line_wrap_stream
-#define __argp_make_fmtstream line_wrap_stream
-#define argp_fmtstream_free line_unwrap_stream
-#define __argp_fmtstream_free line_unwrap_stream
-
-#define __argp_fmtstream_putc(fs,ch) putc(ch,fs)
-#define argp_fmtstream_putc(fs,ch) putc(ch,fs)
-#define __argp_fmtstream_puts(fs,str) fputs(str,fs)
-#define argp_fmtstream_puts(fs,str) fputs(str,fs)
-#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
-#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
-#define __argp_fmtstream_printf fprintf
-#define argp_fmtstream_printf fprintf
-
-#define __argp_fmtstream_lmargin line_wrap_lmargin
-#define argp_fmtstream_lmargin line_wrap_lmargin
-#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin
-#define argp_fmtstream_set_lmargin line_wrap_set_lmargin
-#define __argp_fmtstream_rmargin line_wrap_rmargin
-#define argp_fmtstream_rmargin line_wrap_rmargin
-#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin
-#define argp_fmtstream_set_rmargin line_wrap_set_rmargin
-#define __argp_fmtstream_wmargin line_wrap_wmargin
-#define argp_fmtstream_wmargin line_wrap_wmargin
-#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin
-#define argp_fmtstream_set_wmargin line_wrap_set_wmargin
-#define __argp_fmtstream_point line_wrap_point
-#define argp_fmtstream_point line_wrap_point
-
-#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */
-/* Guess we have to define our own version. */
-
-struct argp_fmtstream
-{
- FILE *stream; /* The stream we're outputting to. */
-
- size_t lmargin, rmargin; /* Left and right margins. */
- ssize_t wmargin; /* Margin to wrap to, or -1 to truncate. */
-
- /* Point in buffer to which we've processed for wrapping, but not output. */
- size_t point_offs;
- /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin. */
- ssize_t point_col;
-
- char *buf; /* Output buffer. */
- char *p; /* Current end of text in BUF. */
- char *end; /* Absolute end of BUF. */
-};
-
-typedef struct argp_fmtstream *argp_fmtstream_t;
-
-/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
- written on it with LMARGIN spaces and limits them to RMARGIN columns
- total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
- replacing the whitespace before them with a newline and WMARGIN spaces.
- Otherwise, chars beyond RMARGIN are simply dropped until a newline.
- Returns NULL if there was an error. */
-extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream,
- size_t __lmargin,
- size_t __rmargin,
- ssize_t __wmargin);
-extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream,
- size_t __lmargin,
- size_t __rmargin,
- ssize_t __wmargin);
-
-/* Flush __FS to its stream, and free it (but don't close the stream). */
-extern void __argp_fmtstream_free (argp_fmtstream_t __fs);
-extern void argp_fmtstream_free (argp_fmtstream_t __fs);
-
-extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs,
- const char *__fmt, ...)
- _GL_ATTRIBUTE_FORMAT ((printf, 2, 3));
-extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
- const char *__fmt, ...)
- _GL_ATTRIBUTE_FORMAT ((printf, 2, 3));
-
-#if _LIBC
-extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
-extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
-
-extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str);
-extern int argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str);
-
-extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs,
- const char *__str, size_t __len);
-extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
- const char *__str, size_t __len);
-#endif
-
-/* Access macros for various bits of state. */
-#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
-#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin)
-#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin)
-#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
-#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
-#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
-
-#if _LIBC
-/* Set __FS's left margin to LMARGIN and return the old value. */
-extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
- size_t __lmargin);
-extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
- size_t __lmargin);
-
-/* Set __FS's right margin to __RMARGIN and return the old value. */
-extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
- size_t __rmargin);
-extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
- size_t __rmargin);
-
-/* Set __FS's wrap margin to __WMARGIN and return the old value. */
-extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
- size_t __wmargin);
-extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
- size_t __wmargin);
-
-/* Return the column number of the current output point in __FS. */
-extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
-extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
-#endif
-
-/* Internal routines. */
-extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
-extern void __argp_fmtstream_update (argp_fmtstream_t __fs);
-extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
-extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
-
-#if !_LIBC || defined __OPTIMIZE__
-/* Inline versions of above routines. */
-
-#if !_LIBC
-#define __argp_fmtstream_putc argp_fmtstream_putc
-#define __argp_fmtstream_puts argp_fmtstream_puts
-#define __argp_fmtstream_write argp_fmtstream_write
-#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
-#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
-#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
-#define __argp_fmtstream_point argp_fmtstream_point
-#define __argp_fmtstream_update _argp_fmtstream_update
-#define __argp_fmtstream_ensure _argp_fmtstream_ensure
-_GL_INLINE_HEADER_BEGIN
-#ifndef ARGP_FS_EI
-# define ARGP_FS_EI _GL_INLINE
-#endif
-#endif
-
-#ifndef ARGP_FS_EI
-# ifdef __GNUC__
- /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
- inline semantics, unless -fgnu89-inline is used. It defines a macro
- __GNUC_STDC_INLINE__ to indicate this situation or a macro
- __GNUC_GNU_INLINE__ to indicate the opposite situation.
-
- GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
- semantics but warns, unless -fgnu89-inline is used:
- warning: C99 inline functions are not supported; using GNU89
- warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
- It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
-
- Whereas Apple GCC 4.0.1 build 5479 without -std=c99 or -std=gnu99
- implements the GNU C inline semantics and defines the macro
- __GNUC_GNU_INLINE__, but it does not warn and does not support
- __attribute__ ((__gnu_inline__)).
-
- All in all, these are the possible combinations. For every compiler,
- we need to choose ARGP_FS_EI so that the corresponding table cell
- contains an "ok".
-
- \ ARGP_FS_EI inline extern extern
- \ inline inline
- CC \ __attribute__
- ((gnu_inline))
-
- gcc 4.3.0 error ok ok
- gcc 4.3.0 -std=gnu99 -fgnu89-inline error ok ok
- gcc 4.3.0 -std=gnu99 ok error ok
-
- gcc 4.2.2 error ok ok
- gcc 4.2.2 -std=gnu99 -fgnu89-inline error ok ok
- gcc 4.2.2 -std=gnu99 error warning ok
-
- gcc 4.1.2 error ok warning
- gcc 4.1.2 -std=gnu99 error ok warning
-
- Apple gcc 4.0.1 error ok warning
- Apple gcc 4.0.1 -std=gnu99 ok error warning
- */
-# if defined __GNUC_STDC_INLINE__
-# define ARGP_FS_EI inline
-# elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
-# define ARGP_FS_EI extern inline __attribute__ ((__gnu_inline__))
-# else
-# define ARGP_FS_EI extern inline
-# endif
-# else
- /* With other compilers, assume the ISO C99 meaning of 'inline', if
- the compiler supports 'inline' at all. */
-# define ARGP_FS_EI inline
-# endif
-#endif
-
-ARGP_FS_EI size_t
-__argp_fmtstream_write (argp_fmtstream_t __fs,
- const char *__str, size_t __len)
-{
- if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len))
- {
- memcpy (__fs->p, __str, __len);
- __fs->p += __len;
- return __len;
- }
- else
- return 0;
-}
-
-ARGP_FS_EI int
-__argp_fmtstream_puts (argp_fmtstream_t __fs, const char *__str)
-{
- size_t __len = strlen (__str);
- if (__len)
- {
- size_t __wrote = __argp_fmtstream_write (__fs, __str, __len);
- return __wrote == __len ? 0 : -1;
- }
- else
- return 0;
-}
-
-ARGP_FS_EI int
-__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch)
-{
- if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1))
- return *__fs->p++ = __ch;
- else
- return EOF;
-}
-
-/* Set __FS's left margin to __LMARGIN and return the old value. */
-ARGP_FS_EI size_t
-__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin)
-{
- size_t __old;
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- __old = __fs->lmargin;
- __fs->lmargin = __lmargin;
- return __old;
-}
-
-/* Set __FS's right margin to __RMARGIN and return the old value. */
-ARGP_FS_EI size_t
-__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin)
-{
- size_t __old;
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- __old = __fs->rmargin;
- __fs->rmargin = __rmargin;
- return __old;
-}
-
-/* Set FS's wrap margin to __WMARGIN and return the old value. */
-ARGP_FS_EI size_t
-__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
-{
- size_t __old;
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- __old = __fs->wmargin;
- __fs->wmargin = __wmargin;
- return __old;
-}
-
-/* Return the column number of the current output point in __FS. */
-ARGP_FS_EI size_t
-__argp_fmtstream_point (argp_fmtstream_t __fs)
-{
- if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
- __argp_fmtstream_update (__fs);
- return __fs->point_col >= 0 ? __fs->point_col : 0;
-}
-
-#if !_LIBC
-#undef __argp_fmtstream_putc
-#undef __argp_fmtstream_puts
-#undef __argp_fmtstream_write
-#undef __argp_fmtstream_set_lmargin
-#undef __argp_fmtstream_set_rmargin
-#undef __argp_fmtstream_set_wmargin
-#undef __argp_fmtstream_point
-#undef __argp_fmtstream_update
-#undef __argp_fmtstream_ensure
-_GL_INLINE_HEADER_END
-#endif
-
-#endif /* !_LIBC || __OPTIMIZE__ */
-
-#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
-
-#endif /* argp-fmtstream.h */
diff --git a/gl/argp-fs-xinl.c b/gl/argp-fs-xinl.c
deleted file mode 100644
index 35547d93d4..0000000000
--- a/gl/argp-fs-xinl.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Real definitions for extern inline functions in argp-fmtstream.h
- Copyright (C) 1997, 2003-2004, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef _LIBC
-# define ARGP_FS_EI
-#else
-# define ARGP_FS_EI _GL_EXTERN_INLINE
-#endif
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
-#include "argp-fmtstream.h"
-
-#if 0
-/* Not exported. */
-/* Add weak aliases. */
-#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias)
-
-weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc)
-weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts)
-weak_alias (__argp_fmtstream_write, argp_fmtstream_write)
-weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin)
-weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin)
-weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin)
-weak_alias (__argp_fmtstream_point, argp_fmtstream_point)
-
-#endif
-#endif
diff --git a/gl/argp-help.c b/gl/argp-help.c
deleted file mode 100644
index 85def445ed..0000000000
--- a/gl/argp-help.c
+++ /dev/null
@@ -1,1955 +0,0 @@
-/* Hierarchical argument parsing help output
- Copyright (C) 1995-2005, 2007, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <alloca.h>
-#include <errno.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <assert.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <limits.h>
-#ifdef USE_IN_LIBIO
-# include <wchar.h>
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-# undef dgettext
-# define dgettext(domain, msgid) \
- INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
-#else
-# include "gettext.h"
-#endif
-
-#include "argp.h"
-#include "argp-fmtstream.h"
-#include "argp-namefrob.h"
-
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-
-/* User-selectable (using an environment variable) formatting parameters.
-
- These may be specified in an environment variable called 'ARGP_HELP_FMT',
- with a contents like: VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2
- Where VALn must be a positive integer. The list of variables is in the
- UPARAM_NAMES vector, below. */
-
-/* Default parameters. */
-#define DUP_ARGS 0 /* True if option argument can be duplicated. */
-#define DUP_ARGS_NOTE 1 /* True to print a note about duplicate args. */
-#define SHORT_OPT_COL 2 /* column in which short options start */
-#define LONG_OPT_COL 6 /* column in which long options start */
-#define DOC_OPT_COL 2 /* column in which doc options start */
-#define OPT_DOC_COL 29 /* column in which option text starts */
-#define HEADER_COL 1 /* column in which group headers are printed */
-#define USAGE_INDENT 12 /* indentation of wrapped usage lines */
-#define RMARGIN 79 /* right margin used for wrapping */
-
-/* User-selectable (using an environment variable) formatting parameters.
- They must all be of type 'int' for the parsing code to work. */
-struct uparams
-{
- /* If true, arguments for an option are shown with both short and long
- options, even when a given option has both, e.g. '-x ARG, --longx=ARG'.
- If false, then if an option has both, the argument is only shown with
- the long one, e.g., '-x, --longx=ARG', and a message indicating that
- this really means both is printed below the options. */
- int dup_args;
-
- /* This is true if when DUP_ARGS is false, and some duplicate arguments have
- been suppressed, an explanatory message should be printed. */
- int dup_args_note;
-
- /* Various output columns. */
- int short_opt_col; /* column in which short options start */
- int long_opt_col; /* column in which long options start */
- int doc_opt_col; /* column in which doc options start */
- int opt_doc_col; /* column in which option text starts */
- int header_col; /* column in which group headers are printed */
- int usage_indent; /* indentation of wrapped usage lines */
- int rmargin; /* right margin used for wrapping */
-
- int valid; /* True when the values in here are valid. */
-};
-
-/* This is a global variable, as user options are only ever read once. */
-static struct uparams uparams = {
- DUP_ARGS, DUP_ARGS_NOTE,
- SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL,
- USAGE_INDENT, RMARGIN,
- 0
-};
-
-/* A particular uparam, and what the user name is. */
-struct uparam_name
-{
- const char *name; /* User name. */
- int is_bool; /* Whether it's 'boolean'. */
- size_t uparams_offs; /* Location of the (int) field in UPARAMS. */
-};
-
-/* The name-field mappings we know about. */
-static const struct uparam_name uparam_names[] =
-{
- { "dup-args", 1, offsetof (struct uparams, dup_args) },
- { "dup-args-note", 1, offsetof (struct uparams, dup_args_note) },
- { "short-opt-col", 0, offsetof (struct uparams, short_opt_col) },
- { "long-opt-col", 0, offsetof (struct uparams, long_opt_col) },
- { "doc-opt-col", 0, offsetof (struct uparams, doc_opt_col) },
- { "opt-doc-col", 0, offsetof (struct uparams, opt_doc_col) },
- { "header-col", 0, offsetof (struct uparams, header_col) },
- { "usage-indent", 0, offsetof (struct uparams, usage_indent) },
- { "rmargin", 0, offsetof (struct uparams, rmargin) },
- { 0 }
-};
-
-static void
-validate_uparams (const struct argp_state *state, struct uparams *upptr)
-{
- const struct uparam_name *up;
-
- for (up = uparam_names; up->name; up++)
- {
- if (up->is_bool
- || up->uparams_offs == offsetof (struct uparams, rmargin))
- continue;
- if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin)
- {
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "\
-ARGP_HELP_FMT: %s value is less than or equal to %s"),
- "rmargin", up->name);
- return;
- }
- }
- uparams = *upptr;
- uparams.valid = 1;
-}
-
-/* Read user options from the environment, and fill in UPARAMS appropriately. */
-static void
-fill_in_uparams (const struct argp_state *state)
-{
- const char *var = getenv ("ARGP_HELP_FMT");
- struct uparams new_params = uparams;
-
-#define SKIPWS(p) do { while (isspace ((unsigned char) *p)) p++; } while (0);
-
- if (var)
- {
- /* Parse var. */
- while (*var)
- {
- SKIPWS (var);
-
- if (isalpha ((unsigned char) *var))
- {
- size_t var_len;
- const struct uparam_name *un;
- int unspec = 0, val = 0;
- const char *arg = var;
-
- while (isalnum ((unsigned char) *arg) || *arg == '-' || *arg == '_')
- arg++;
- var_len = arg - var;
-
- SKIPWS (arg);
-
- if (*arg == '\0' || *arg == ',')
- unspec = 1;
- else if (*arg == '=')
- {
- arg++;
- SKIPWS (arg);
- }
-
- if (unspec)
- {
- if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
- {
- val = 0;
- var += 3;
- var_len -= 3;
- }
- else
- val = 1;
- }
- else if (isdigit ((unsigned char) *arg))
- {
- val = atoi (arg);
- while (isdigit ((unsigned char) *arg))
- arg++;
- SKIPWS (arg);
- }
-
- for (un = uparam_names; un->name; un++)
- if (strlen (un->name) == var_len
- && strncmp (var, un->name, var_len) == 0)
- {
- if (unspec && !un->is_bool)
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "\
-%.*s: ARGP_HELP_FMT parameter requires a value"),
- (int) var_len, var);
- else if (val < 0)
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "\
-%.*s: ARGP_HELP_FMT parameter must be positive"),
- (int) var_len, var);
- else
- *(int *)((char *)&new_params + un->uparams_offs) = val;
- break;
- }
- if (! un->name)
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain, "\
-%.*s: Unknown ARGP_HELP_FMT parameter"),
- (int) var_len, var);
-
- var = arg;
- if (*var == ',')
- var++;
- }
- else if (*var)
- {
- __argp_failure (state, 0, 0,
- dgettext (state->root_argp->argp_domain,
- "Garbage in ARGP_HELP_FMT: %s"), var);
- break;
- }
- }
- validate_uparams (state, &new_params);
- }
-}
-
-/* Returns true if OPT hasn't been marked invisible. Visibility only affects
- whether OPT is displayed or used in sorting, not option shadowing. */
-#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN))
-
-/* Returns true if OPT is an alias for an earlier option. */
-#define oalias(opt) ((opt)->flags & OPTION_ALIAS)
-
-/* Returns true if OPT is a documentation-only entry. */
-#define odoc(opt) ((opt)->flags & OPTION_DOC)
-
-/* Returns true if OPT should not be translated */
-#define onotrans(opt) ((opt)->flags & OPTION_NO_TRANS)
-
-/* Returns true if OPT is the end-of-list marker for a list of options. */
-#define oend(opt) __option_is_end (opt)
-
-/* Returns true if OPT has a short option. */
-#define oshort(opt) __option_is_short (opt)
-
-/*
- The help format for a particular option is like:
-
- -xARG, -yARG, --long1=ARG, --long2=ARG Documentation...
-
- Where ARG will be omitted if there's no argument, for this option, or
- will be surrounded by "[" and "]" appropriately if the argument is
- optional. The documentation string is word-wrapped appropriately, and if
- the list of options is long enough, it will be started on a separate line.
- If there are no short options for a given option, the first long option is
- indented slightly in a way that's supposed to make most long options appear
- to be in a separate column.
-
- For example, the following output (from ps):
-
- -p PID, --pid=PID List the process PID
- --pgrp=PGRP List processes in the process group PGRP
- -P, -x, --no-parent Include processes without parents
- -Q, --all-fields Don't elide unusable fields (normally if there's
- some reason ps can't print a field for any
- process, it's removed from the output entirely)
- -r, --reverse, --gratuitously-long-reverse-option
- Reverse the order of any sort
- --session[=SID] Add the processes from the session SID (which
- defaults to the sid of the current process)
-
- Here are some more options:
- -f ZOT, --foonly=ZOT Glork a foonly
- -z, --zaza Snit a zar
-
- -?, --help Give this help list
- --usage Give a short usage message
- -V, --version Print program version
-
- The struct argp_option array for the above could look like:
-
- {
- {"pid", 'p', "PID", 0, "List the process PID"},
- {"pgrp", OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"},
- {"no-parent", 'P', 0, 0, "Include processes without parents"},
- {0, 'x', 0, OPTION_ALIAS},
- {"all-fields",'Q', 0, 0, "Don't elide unusable fields (normally"
- " if there's some reason ps can't"
- " print a field for any process, it's"
- " removed from the output entirely)" },
- {"reverse", 'r', 0, 0, "Reverse the order of any sort"},
- {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
- {"session", OPT_SESS, "SID", OPTION_ARG_OPTIONAL,
- "Add the processes from the session"
- " SID (which defaults to the sid of"
- " the current process)" },
-
- {0,0,0,0, "Here are some more options:"},
- {"foonly", 'f', "ZOT", 0, "Glork a foonly"},
- {"zaza", 'z', 0, 0, "Snit a zar"},
-
- {0}
- }
-
- Note that the last three options are automatically supplied by argp_parse,
- unless you tell it not to with ARGP_NO_HELP.
-
-*/
-
-/* Returns true if CH occurs between BEG and END. */
-static int
-find_char (char ch, char *beg, char *end)
-{
- while (beg < end)
- if (*beg == ch)
- return 1;
- else
- beg++;
- return 0;
-}
-
-struct hol_cluster; /* fwd decl */
-
-struct hol_entry
-{
- /* First option. */
- const struct argp_option *opt;
- /* Number of options (including aliases). */
- unsigned num;
-
- /* A pointers into the HOL's short_options field, to the first short option
- letter for this entry. The order of the characters following this point
- corresponds to the order of options pointed to by OPT, and there are at
- most NUM. A short option recorded in an option following OPT is only
- valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's
- probably been shadowed by some other entry). */
- char *short_options;
-
- /* Entries are sorted by their group first, in the order:
- 1, 2, ..., n, 0, -m, ..., -2, -1
- and then alphabetically within each group. The default is 0. */
- int group;
-
- /* The cluster of options this entry belongs to, or 0 if none. */
- struct hol_cluster *cluster;
-
- /* The argp from which this option came. */
- const struct argp *argp;
-
- /* Position in the array */
- unsigned ord;
-};
-
-/* A cluster of entries to reflect the argp tree structure. */
-struct hol_cluster
-{
- /* A descriptive header printed before options in this cluster. */
- const char *header;
-
- /* Used to order clusters within the same group with the same parent,
- according to the order in which they occurred in the parent argp's child
- list. */
- int index;
-
- /* How to sort this cluster with respect to options and other clusters at the
- same depth (clusters always follow options in the same group). */
- int group;
-
- /* The cluster to which this cluster belongs, or 0 if it's at the base
- level. */
- struct hol_cluster *parent;
-
- /* The argp from which this cluster is (eventually) derived. */
- const struct argp *argp;
-
- /* The distance this cluster is from the root. */
- int depth;
-
- /* Clusters in a given hol are kept in a linked list, to make freeing them
- possible. */
- struct hol_cluster *next;
-};
-
-/* A list of options for help. */
-struct hol
-{
- /* An array of hol_entry's. */
- struct hol_entry *entries;
- /* The number of entries in this hol. If this field is zero, the others
- are undefined. */
- unsigned num_entries;
-
- /* A string containing all short options in this HOL. Each entry contains
- pointers into this string, so the order can't be messed with blindly. */
- char *short_options;
-
- /* Clusters of entries in this hol. */
- struct hol_cluster *clusters;
-};
-
-/* Create a struct hol from the options in ARGP. CLUSTER is the
- hol_cluster in which these entries occur, or 0, if at the root. */
-static struct hol *
-make_hol (const struct argp *argp, struct hol_cluster *cluster)
-{
- char *so;
- const struct argp_option *o;
- const struct argp_option *opts = argp->options;
- struct hol_entry *entry;
- unsigned num_short_options = 0;
- struct hol *hol = malloc (sizeof (struct hol));
-
- assert (hol);
-
- hol->num_entries = 0;
- hol->clusters = 0;
-
- if (opts)
- {
- int cur_group = 0;
-
- /* The first option must not be an alias. */
- assert (! oalias (opts));
-
- /* Calculate the space needed. */
- for (o = opts; ! oend (o); o++)
- {
- if (! oalias (o))
- hol->num_entries++;
- if (oshort (o))
- num_short_options++; /* This is an upper bound. */
- }
-
- hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
- hol->short_options = malloc (num_short_options + 1);
-
- assert (hol->entries && hol->short_options);
- if (SIZE_MAX <= UINT_MAX)
- assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
-
- /* Fill in the entries. */
- so = hol->short_options;
- for (o = opts, entry = hol->entries; ! oend (o); entry++)
- {
- entry->opt = o;
- entry->num = 0;
- entry->short_options = so;
- entry->group = cur_group =
- o->group
- ? o->group
- : ((!o->name && !o->key)
- ? cur_group + 1
- : cur_group);
- entry->cluster = cluster;
- entry->argp = argp;
-
- do
- {
- entry->num++;
- if (oshort (o) && ! find_char (o->key, hol->short_options, so))
- /* O has a valid short option which hasn't already been used.*/
- *so++ = o->key;
- o++;
- }
- while (! oend (o) && oalias (o));
- }
- *so = '\0'; /* null terminated so we can find the length */
- }
-
- return hol;
-}
-
-/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the
- associated argp child list entry), INDEX, and PARENT, and return a pointer
- to it. ARGP is the argp that this cluster results from. */
-static struct hol_cluster *
-hol_add_cluster (struct hol *hol, int group, const char *header, int index,
- struct hol_cluster *parent, const struct argp *argp)
-{
- struct hol_cluster *cl = malloc (sizeof (struct hol_cluster));
- if (cl)
- {
- cl->group = group;
- cl->header = header;
-
- cl->index = index;
- cl->parent = parent;
- cl->argp = argp;
- cl->depth = parent ? parent->depth + 1 : 0;
-
- cl->next = hol->clusters;
- hol->clusters = cl;
- }
- return cl;
-}
-
-/* Free HOL and any resources it uses. */
-static void
-hol_free (struct hol *hol)
-{
- struct hol_cluster *cl = hol->clusters;
-
- while (cl)
- {
- struct hol_cluster *next = cl->next;
- free (cl);
- cl = next;
- }
-
- if (hol->num_entries > 0)
- {
- free (hol->entries);
- free (hol->short_options);
- }
-
- free (hol);
-}
-
-static int
-hol_entry_short_iterate (const struct hol_entry *entry,
- int (*func)(const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie),
- const char *domain, void *cookie)
-{
- unsigned nopts;
- int val = 0;
- const struct argp_option *opt, *real = entry->opt;
- char *so = entry->short_options;
-
- for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
- if (oshort (opt) && *so == opt->key)
- {
- if (!oalias (opt))
- real = opt;
- if (ovisible (opt))
- val = (*func)(opt, real, domain, cookie);
- so++;
- }
-
- return val;
-}
-
-static inline int
-#if __GNUC__ >= 3
-__attribute__ ((always_inline))
-#endif
-hol_entry_long_iterate (const struct hol_entry *entry,
- int (*func)(const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie),
- const char *domain, void *cookie)
-{
- unsigned nopts;
- int val = 0;
- const struct argp_option *opt, *real = entry->opt;
-
- for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
- if (opt->name)
- {
- if (!oalias (opt))
- real = opt;
- if (ovisible (opt))
- val = (*func)(opt, real, domain, cookie);
- }
-
- return val;
-}
-
-/* Iterator that returns true for the first short option. */
-static int
-until_short (const struct argp_option *opt, const struct argp_option *real,
- const char *domain, void *cookie)
-{
- return oshort (opt) ? opt->key : 0;
-}
-
-/* Returns the first valid short option in ENTRY, or 0 if there is none. */
-static char
-hol_entry_first_short (const struct hol_entry *entry)
-{
- return hol_entry_short_iterate (entry, until_short,
- entry->argp->argp_domain, 0);
-}
-
-/* Returns the first valid long option in ENTRY, or 0 if there is none. */
-static const char *
-hol_entry_first_long (const struct hol_entry *entry)
-{
- const struct argp_option *opt;
- unsigned num;
- for (opt = entry->opt, num = entry->num; num > 0; opt++, num--)
- if (opt->name && ovisible (opt))
- return opt->name;
- return 0;
-}
-
-/* Returns the entry in HOL with the long option name NAME, or 0 if there is
- none. */
-static struct hol_entry *
-hol_find_entry (struct hol *hol, const char *name)
-{
- struct hol_entry *entry = hol->entries;
- unsigned num_entries = hol->num_entries;
-
- while (num_entries-- > 0)
- {
- const struct argp_option *opt = entry->opt;
- unsigned num_opts = entry->num;
-
- while (num_opts-- > 0)
- if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
- return entry;
- else
- opt++;
-
- entry++;
- }
-
- return 0;
-}
-
-/* If an entry with the long option NAME occurs in HOL, set its special
- sort position to GROUP. */
-static void
-hol_set_group (struct hol *hol, const char *name, int group)
-{
- struct hol_entry *entry = hol_find_entry (hol, name);
- if (entry)
- entry->group = group;
-}
-
-/* Order by group: 0, 1, 2, ..., n, -m, ..., -2, -1.
- EQ is what to return if GROUP1 and GROUP2 are the same. */
-static int
-group_cmp (int group1, int group2, int eq)
-{
- if (group1 == group2)
- return eq;
- else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0))
- return group1 - group2;
- else
- return group2 - group1;
-}
-
-/* Compare clusters CL1 & CL2 by the order that they should appear in
- output. */
-static int
-hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
-{
- /* If one cluster is deeper than the other, use its ancestor at the same
- level, so that finding the common ancestor is straightforward.
-
- clN->depth > 0 means that clN->parent != NULL (see hol_add_cluster) */
- while (cl1->depth > cl2->depth)
- cl1 = cl1->parent;
- while (cl2->depth > cl1->depth)
- cl2 = cl2->parent;
-
- /* Now reduce both clusters to their ancestors at the point where both have
- a common parent; these can be directly compared. */
- while (cl1->parent != cl2->parent)
- cl1 = cl1->parent, cl2 = cl2->parent;
-
- return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index);
-}
-
-/* Return the ancestor of CL that's just below the root (i.e., has a parent
- of 0). */
-static struct hol_cluster *
-hol_cluster_base (struct hol_cluster *cl)
-{
- while (cl->parent)
- cl = cl->parent;
- return cl;
-}
-
-/* Return true if CL1 is a child of CL2. */
-static int
-hol_cluster_is_child (const struct hol_cluster *cl1,
- const struct hol_cluster *cl2)
-{
- while (cl1 && cl1 != cl2)
- cl1 = cl1->parent;
- return cl1 == cl2;
-}
-
-/* Given the name of an OPTION_DOC option, modifies NAME to start at the tail
- that should be used for comparisons, and returns true iff it should be
- treated as a non-option. */
-static int
-canon_doc_option (const char **name)
-{
- int non_opt;
-
- if (!*name)
- non_opt = 1;
- else
- {
- /* Skip initial whitespace. */
- while (isspace ((unsigned char) **name))
- (*name)++;
- /* Decide whether this looks like an option (leading '-') or not. */
- non_opt = (**name != '-');
- /* Skip until part of name used for sorting. */
- while (**name && !isalnum ((unsigned char) **name))
- (*name)++;
- }
- return non_opt;
-}
-
-#define HOL_ENTRY_PTRCMP(a,b) ((a)->ord < (b)->ord ? -1 : 1)
-
-/* Order ENTRY1 & ENTRY2 by the order which they should appear in a help
- listing. */
-static int
-hol_entry_cmp (const struct hol_entry *entry1,
- const struct hol_entry *entry2)
-{
- /* The group numbers by which the entries should be ordered; if either is
- in a cluster, then this is just the group within the cluster. */
- int group1 = entry1->group, group2 = entry2->group;
- int rc;
-
- if (entry1->cluster != entry2->cluster)
- {
- /* The entries are not within the same cluster, so we can't compare them
- directly, we have to use the appropriate clustering level too. */
- if (! entry1->cluster)
- /* ENTRY1 is at the "base level", not in a cluster, so we have to
- compare it's group number with that of the base cluster in which
- ENTRY2 resides. Note that if they're in the same group, the
- clustered option always comes laster. */
- return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1);
- else if (! entry2->cluster)
- /* Likewise, but ENTRY2's not in a cluster. */
- return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1);
- else
- /* Both entries are in clusters, we can just compare the clusters. */
- return (rc = hol_cluster_cmp (entry1->cluster, entry2->cluster)) ?
- rc : HOL_ENTRY_PTRCMP (entry1, entry2);
- }
- else if (group1 == group2)
- /* The entries are both in the same cluster and group, so compare them
- alphabetically. */
- {
- int short1 = hol_entry_first_short (entry1);
- int short2 = hol_entry_first_short (entry2);
- int doc1 = odoc (entry1->opt);
- int doc2 = odoc (entry2->opt);
- const char *long1 = hol_entry_first_long (entry1);
- const char *long2 = hol_entry_first_long (entry2);
-
- if (doc1)
- doc1 = canon_doc_option (&long1);
- if (doc2)
- doc2 = canon_doc_option (&long2);
-
- if (doc1 != doc2)
- /* "documentation" options always follow normal options (or
- documentation options that *look* like normal options). */
- return doc1 - doc2;
- else if (!short1 && !short2 && long1 && long2)
- /* Only long options. */
- return (rc = __strcasecmp (long1, long2)) ?
- rc : HOL_ENTRY_PTRCMP (entry1, entry2);
- else
- /* Compare short/short, long/short, short/long, using the first
- character of long options. Entries without *any* valid
- options (such as options with OPTION_HIDDEN set) will be put
- first, but as they're not displayed, it doesn't matter where
- they are. */
- {
- unsigned char first1 = short1 ? short1 : long1 ? *long1 : 0;
- unsigned char first2 = short2 ? short2 : long2 ? *long2 : 0;
- /* Use tolower, not _tolower, since only the former is
- guaranteed to work on something already lower case. */
- int lower_cmp = tolower (first1) - tolower (first2);
- /* Compare ignoring case, except when the options are both the
- same letter, in which case lower-case always comes first. */
- return lower_cmp ? lower_cmp :
- (rc = first2 - first1) ?
- rc : HOL_ENTRY_PTRCMP (entry1, entry2);
- }
- }
- else
- /* Within the same cluster, but not the same group, so just compare
- groups. */
- return group_cmp (group1, group2, HOL_ENTRY_PTRCMP (entry1, entry2));
-}
-
-/* Version of hol_entry_cmp with correct signature for qsort. */
-static int
-hol_entry_qcmp (const void *entry1_v, const void *entry2_v)
-{
- return hol_entry_cmp (entry1_v, entry2_v);
-}
-
-/* Sort HOL by group and alphabetically by option name (with short options
- taking precedence over long). Since the sorting is for display purposes
- only, the shadowing of options isn't effected. */
-static void
-hol_sort (struct hol *hol)
-{
- if (hol->num_entries > 0)
- {
- unsigned i;
- struct hol_entry *e;
- for (i = 0, e = hol->entries; i < hol->num_entries; i++, e++)
- e->ord = i;
- qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry),
- hol_entry_qcmp);
- }
-}
-
-/* Append MORE to HOL, destroying MORE in the process. Options in HOL shadow
- any in MORE with the same name. */
-static void
-hol_append (struct hol *hol, struct hol *more)
-{
- struct hol_cluster **cl_end = &hol->clusters;
-
- /* Steal MORE's cluster list, and add it to the end of HOL's. */
- while (*cl_end)
- cl_end = &(*cl_end)->next;
- *cl_end = more->clusters;
- more->clusters = 0;
-
- /* Merge entries. */
- if (more->num_entries > 0)
- {
- if (hol->num_entries == 0)
- {
- hol->num_entries = more->num_entries;
- hol->entries = more->entries;
- hol->short_options = more->short_options;
- more->num_entries = 0; /* Mark MORE's fields as invalid. */
- }
- else
- /* Append the entries in MORE to those in HOL, taking care to only add
- non-shadowed SHORT_OPTIONS values. */
- {
- unsigned left;
- char *so, *more_so;
- struct hol_entry *e;
- unsigned num_entries = hol->num_entries + more->num_entries;
- struct hol_entry *entries =
- malloc (num_entries * sizeof (struct hol_entry));
- unsigned hol_so_len = strlen (hol->short_options);
- char *short_options =
- malloc (hol_so_len + strlen (more->short_options) + 1);
-
- assert (entries && short_options);
- if (SIZE_MAX <= UINT_MAX)
- assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
-
- __mempcpy (__mempcpy (entries, hol->entries,
- hol->num_entries * sizeof (struct hol_entry)),
- more->entries,
- more->num_entries * sizeof (struct hol_entry));
-
- __mempcpy (short_options, hol->short_options, hol_so_len);
-
- /* Fix up the short options pointers from HOL. */
- for (e = entries, left = hol->num_entries; left > 0; e++, left--)
- e->short_options =
- short_options + (e->short_options - hol->short_options);
-
- /* Now add the short options from MORE, fixing up its entries
- too. */
- so = short_options + hol_so_len;
- more_so = more->short_options;
- for (left = more->num_entries; left > 0; e++, left--)
- {
- int opts_left;
- const struct argp_option *opt;
-
- e->short_options = so;
-
- for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--)
- {
- int ch = *more_so;
- if (oshort (opt) && ch == opt->key)
- /* The next short option in MORE_SO, CH, is from OPT. */
- {
- if (! find_char (ch, short_options,
- short_options + hol_so_len))
- /* The short option CH isn't shadowed by HOL's options,
- so add it to the sum. */
- *so++ = ch;
- more_so++;
- }
- }
- }
-
- *so = '\0';
-
- free (hol->entries);
- free (hol->short_options);
-
- hol->entries = entries;
- hol->num_entries = num_entries;
- hol->short_options = short_options;
- }
- }
-
- hol_free (more);
-}
-
-/* Inserts enough spaces to make sure STREAM is at column COL. */
-static void
-indent_to (argp_fmtstream_t stream, unsigned col)
-{
- int needed = col - __argp_fmtstream_point (stream);
- while (needed-- > 0)
- __argp_fmtstream_putc (stream, ' ');
-}
-
-/* Output to STREAM either a space, or a newline if there isn't room for at
- least ENSURE characters before the right margin. */
-static void
-space (argp_fmtstream_t stream, size_t ensure)
-{
- if (__argp_fmtstream_point (stream) + ensure
- >= __argp_fmtstream_rmargin (stream))
- __argp_fmtstream_putc (stream, '\n');
- else
- __argp_fmtstream_putc (stream, ' ');
-}
-
-/* If the option REAL has an argument, we print it in using the printf
- format REQ_FMT or OPT_FMT depending on whether it's a required or
- optional argument. */
-static void
-arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt,
- const char *domain, argp_fmtstream_t stream)
-{
- if (real->arg)
- {
- if (real->flags & OPTION_ARG_OPTIONAL)
- __argp_fmtstream_printf (stream, opt_fmt,
- dgettext (domain, real->arg));
- else
- __argp_fmtstream_printf (stream, req_fmt,
- dgettext (domain, real->arg));
- }
-}
-
-/* Helper functions for hol_entry_help. */
-
-/* State used during the execution of hol_help. */
-struct hol_help_state
-{
- /* PREV_ENTRY should contain the previous entry printed, or 0. */
- struct hol_entry *prev_entry;
-
- /* If an entry is in a different group from the previous one, and SEP_GROUPS
- is true, then a blank line will be printed before any output. */
- int sep_groups;
-
- /* True if a duplicate option argument was suppressed (only ever set if
- UPARAMS.dup_args is false). */
- int suppressed_dup_arg;
-};
-
-/* Some state used while printing a help entry (used to communicate with
- helper functions). See the doc for hol_entry_help for more info, as most
- of the fields are copied from its arguments. */
-struct pentry_state
-{
- const struct hol_entry *entry;
- argp_fmtstream_t stream;
- struct hol_help_state *hhstate;
-
- /* True if nothing's been printed so far. */
- int first;
-
- /* If non-zero, the state that was used to print this help. */
- const struct argp_state *state;
-};
-
-/* If a user doc filter should be applied to DOC, do so. */
-static const char *
-filter_doc (const char *doc, int key, const struct argp *argp,
- const struct argp_state *state)
-{
- if (argp->help_filter)
- /* We must apply a user filter to this output. */
- {
- void *input = __argp_input (argp, state);
- return (*argp->help_filter) (key, doc, input);
- }
- else
- /* No filter. */
- return doc;
-}
-
-/* Prints STR as a header line, with the margin lines set appropriately, and
- notes the fact that groups should be separated with a blank line. ARGP is
- the argp that should dictate any user doc filtering to take place. Note
- that the previous wrap margin isn't restored, but the left margin is reset
- to 0. */
-static void
-print_header (const char *str, const struct argp *argp,
- struct pentry_state *pest)
-{
- const char *tstr = dgettext (argp->argp_domain, str);
- const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state);
-
- if (fstr)
- {
- if (*fstr)
- {
- if (pest->hhstate->prev_entry)
- /* Precede with a blank line. */
- __argp_fmtstream_putc (pest->stream, '\n');
- indent_to (pest->stream, uparams.header_col);
- __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col);
- __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col);
- __argp_fmtstream_puts (pest->stream, fstr);
- __argp_fmtstream_set_lmargin (pest->stream, 0);
- __argp_fmtstream_putc (pest->stream, '\n');
- }
-
- pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */
- }
-
- if (fstr != tstr)
- free ((char *) fstr);
-}
-
-/* Inserts a comma if this isn't the first item on the line, and then makes
- sure we're at least to column COL. If this *is* the first item on a line,
- prints any pending whitespace/headers that should precede this line. Also
- clears FIRST. */
-static void
-comma (unsigned col, struct pentry_state *pest)
-{
- if (pest->first)
- {
- const struct hol_entry *pe = pest->hhstate->prev_entry;
- const struct hol_cluster *cl = pest->entry->cluster;
-
- if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group)
- __argp_fmtstream_putc (pest->stream, '\n');
-
- if (cl && cl->header && *cl->header
- && (!pe
- || (pe->cluster != cl
- && !hol_cluster_is_child (pe->cluster, cl))))
- /* If we're changing clusters, then this must be the start of the
- ENTRY's cluster unless that is an ancestor of the previous one
- (in which case we had just popped into a sub-cluster for a bit).
- If so, then print the cluster's header line. */
- {
- int old_wm = __argp_fmtstream_wmargin (pest->stream);
- print_header (cl->header, cl->argp, pest);
- __argp_fmtstream_set_wmargin (pest->stream, old_wm);
- }
-
- pest->first = 0;
- }
- else
- __argp_fmtstream_puts (pest->stream, ", ");
-
- indent_to (pest->stream, col);
-}
-
-/* Print help for ENTRY to STREAM. */
-static void
-hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
- argp_fmtstream_t stream, struct hol_help_state *hhstate)
-{
- unsigned num;
- const struct argp_option *real = entry->opt, *opt;
- char *so = entry->short_options;
- int have_long_opt = 0; /* We have any long options. */
- /* Saved margins. */
- int old_lm = __argp_fmtstream_set_lmargin (stream, 0);
- int old_wm = __argp_fmtstream_wmargin (stream);
- /* PEST is a state block holding some of our variables that we'd like to
- share with helper functions. */
- struct pentry_state pest;
-
- pest.entry = entry;
- pest.stream = stream;
- pest.hhstate = hhstate;
- pest.first = 1;
- pest.state = state;
-
- if (! odoc (real))
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (opt->name && ovisible (opt))
- {
- have_long_opt = 1;
- break;
- }
-
- /* First emit short options. */
- __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (oshort (opt) && opt->key == *so)
- /* OPT has a valid (non shadowed) short option. */
- {
- if (ovisible (opt))
- {
- comma (uparams.short_opt_col, &pest);
- __argp_fmtstream_putc (stream, '-');
- __argp_fmtstream_putc (stream, *so);
- if (!have_long_opt || uparams.dup_args)
- arg (real, " %s", "[%s]", state->root_argp->argp_domain, stream);
- else if (real->arg)
- hhstate->suppressed_dup_arg = 1;
- }
- so++;
- }
-
- /* Now, long options. */
- if (odoc (real))
- /* A "documentation" option. */
- {
- __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col);
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (opt->name && *opt->name && ovisible (opt))
- {
- comma (uparams.doc_opt_col, &pest);
- /* Calling dgettext here isn't quite right, since sorting will
- have been done on the original; but documentation options
- should be pretty rare anyway... */
- __argp_fmtstream_puts (stream,
- onotrans (opt) ?
- opt->name :
- dgettext (state->root_argp->argp_domain,
- opt->name));
- }
- }
- else
- /* A real long option. */
- {
- int first_long_opt = 1;
-
- __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col);
- for (opt = real, num = entry->num; num > 0; opt++, num--)
- if (opt->name && ovisible (opt))
- {
- comma (uparams.long_opt_col, &pest);
- __argp_fmtstream_printf (stream, "--%s", opt->name);
- if (first_long_opt || uparams.dup_args)
- arg (real, "=%s", "[=%s]", state->root_argp->argp_domain,
- stream);
- else if (real->arg)
- hhstate->suppressed_dup_arg = 1;
- }
- }
-
- /* Next, documentation strings. */
- __argp_fmtstream_set_lmargin (stream, 0);
-
- if (pest.first)
- {
- /* Didn't print any switches, what's up? */
- if (!oshort (real) && !real->name)
- /* This is a group header, print it nicely. */
- print_header (real->doc, entry->argp, &pest);
- else
- /* Just a totally shadowed option or null header; print nothing. */
- goto cleanup; /* Just return, after cleaning up. */
- }
- else
- {
- const char *tstr = real->doc ? dgettext (state->root_argp->argp_domain,
- real->doc) : 0;
- const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
- if (fstr && *fstr)
- {
- unsigned int col = __argp_fmtstream_point (stream);
-
- __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col);
- __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col);
-
- if (col > (unsigned int) (uparams.opt_doc_col + 3))
- __argp_fmtstream_putc (stream, '\n');
- else if (col >= (unsigned int) uparams.opt_doc_col)
- __argp_fmtstream_puts (stream, " ");
- else
- indent_to (stream, uparams.opt_doc_col);
-
- __argp_fmtstream_puts (stream, fstr);
- }
- if (fstr && fstr != tstr)
- free ((char *) fstr);
-
- /* Reset the left margin. */
- __argp_fmtstream_set_lmargin (stream, 0);
- __argp_fmtstream_putc (stream, '\n');
- }
-
- hhstate->prev_entry = entry;
-
-cleanup:
- __argp_fmtstream_set_lmargin (stream, old_lm);
- __argp_fmtstream_set_wmargin (stream, old_wm);
-}
-
-/* Output a long help message about the options in HOL to STREAM. */
-static void
-hol_help (struct hol *hol, const struct argp_state *state,
- argp_fmtstream_t stream)
-{
- unsigned num;
- struct hol_entry *entry;
- struct hol_help_state hhstate = { 0, 0, 0 };
-
- for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--)
- hol_entry_help (entry, state, stream, &hhstate);
-
- if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
- {
- const char *tstr = dgettext (state->root_argp->argp_domain, "\
-Mandatory or optional arguments to long options are also mandatory or \
-optional for any corresponding short options.");
- const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
- state ? state->root_argp : 0, state);
- if (fstr && *fstr)
- {
- __argp_fmtstream_putc (stream, '\n');
- __argp_fmtstream_puts (stream, fstr);
- __argp_fmtstream_putc (stream, '\n');
- }
- if (fstr && fstr != tstr)
- free ((char *) fstr);
- }
-}
-
-/* Helper functions for hol_usage. */
-
-/* If OPT is a short option without an arg, append its key to the string
- pointer pointer to by COOKIE, and advance the pointer. */
-static int
-add_argless_short_opt (const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie)
-{
- char **snao_end = cookie;
- if (!(opt->arg || real->arg)
- && !((opt->flags | real->flags) & OPTION_NO_USAGE))
- *(*snao_end)++ = opt->key;
- return 0;
-}
-
-/* If OPT is a short option with an arg, output a usage entry for it to the
- stream pointed at by COOKIE. */
-static int
-usage_argful_short_opt (const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie)
-{
- argp_fmtstream_t stream = cookie;
- const char *arg = opt->arg;
- int flags = opt->flags | real->flags;
-
- if (! arg)
- arg = real->arg;
-
- if (arg && !(flags & OPTION_NO_USAGE))
- {
- arg = dgettext (domain, arg);
-
- if (flags & OPTION_ARG_OPTIONAL)
- __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg);
- else
- {
- /* Manually do line wrapping so that it (probably) won't
- get wrapped at the embedded space. */
- space (stream, 6 + strlen (arg));
- __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg);
- }
- }
-
- return 0;
-}
-
-/* Output a usage entry for the long option opt to the stream pointed at by
- COOKIE. */
-static int
-usage_long_opt (const struct argp_option *opt,
- const struct argp_option *real,
- const char *domain, void *cookie)
-{
- argp_fmtstream_t stream = cookie;
- const char *arg = opt->arg;
- int flags = opt->flags | real->flags;
-
- if (! arg)
- arg = real->arg;
-
- if (! (flags & OPTION_NO_USAGE) && !odoc (opt))
- {
- if (arg)
- {
- arg = dgettext (domain, arg);
- if (flags & OPTION_ARG_OPTIONAL)
- __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg);
- else
- __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg);
- }
- else
- __argp_fmtstream_printf (stream, " [--%s]", opt->name);
- }
-
- return 0;
-}
-
-/* Print a short usage description for the arguments in HOL to STREAM. */
-static void
-hol_usage (struct hol *hol, argp_fmtstream_t stream)
-{
- if (hol->num_entries > 0)
- {
- unsigned nentries;
- struct hol_entry *entry;
- char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1);
- char *snao_end = short_no_arg_opts;
-
- /* First we put a list of short options without arguments. */
- for (entry = hol->entries, nentries = hol->num_entries
- ; nentries > 0
- ; entry++, nentries--)
- hol_entry_short_iterate (entry, add_argless_short_opt,
- entry->argp->argp_domain, &snao_end);
- if (snao_end > short_no_arg_opts)
- {
- *snao_end++ = 0;
- __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts);
- }
-
- /* Now a list of short options *with* arguments. */
- for (entry = hol->entries, nentries = hol->num_entries
- ; nentries > 0
- ; entry++, nentries--)
- hol_entry_short_iterate (entry, usage_argful_short_opt,
- entry->argp->argp_domain, stream);
-
- /* Finally, a list of long options (whew!). */
- for (entry = hol->entries, nentries = hol->num_entries
- ; nentries > 0
- ; entry++, nentries--)
- hol_entry_long_iterate (entry, usage_long_opt,
- entry->argp->argp_domain, stream);
- }
-}
-
-/* Make a HOL containing all levels of options in ARGP. CLUSTER is the
- cluster in which ARGP's entries should be clustered, or 0. */
-static struct hol *
-argp_hol (const struct argp *argp, struct hol_cluster *cluster)
-{
- const struct argp_child *child = argp->children;
- struct hol *hol = make_hol (argp, cluster);
- if (child)
- while (child->argp)
- {
- struct hol_cluster *child_cluster =
- ((child->group || child->header)
- /* Put CHILD->argp within its own cluster. */
- ? hol_add_cluster (hol, child->group, child->header,
- child - argp->children, cluster, argp)
- /* Just merge it into the parent's cluster. */
- : cluster);
- hol_append (hol, argp_hol (child->argp, child_cluster)) ;
- child++;
- }
- return hol;
-}
-
-/* Calculate how many different levels with alternative args strings exist in
- ARGP. */
-static size_t
-argp_args_levels (const struct argp *argp)
-{
- size_t levels = 0;
- const struct argp_child *child = argp->children;
-
- if (argp->args_doc && strchr (argp->args_doc, '\n'))
- levels++;
-
- if (child)
- while (child->argp)
- levels += argp_args_levels ((child++)->argp);
-
- return levels;
-}
-
-/* Print all the non-option args documented in ARGP to STREAM. Any output is
- preceded by a space. LEVELS is a pointer to a byte vector the length
- returned by argp_args_levels; it should be initialized to zero, and
- updated by this routine for the next call if ADVANCE is true. True is
- returned as long as there are more patterns to output. */
-static int
-argp_args_usage (const struct argp *argp, const struct argp_state *state,
- char **levels, int advance, argp_fmtstream_t stream)
-{
- char *our_level = *levels;
- int multiple = 0;
- const struct argp_child *child = argp->children;
- const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0;
- const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state);
-
- if (fdoc)
- {
- const char *cp = fdoc;
- nl = __strchrnul (cp, '\n');
- if (*nl != '\0')
- /* This is a "multi-level" args doc; advance to the correct position
- as determined by our state in LEVELS, and update LEVELS. */
- {
- int i;
- multiple = 1;
- for (i = 0; i < *our_level; i++)
- cp = nl + 1, nl = __strchrnul (cp, '\n');
- (*levels)++;
- }
-
- /* Manually do line wrapping so that it (probably) won't get wrapped at
- any embedded spaces. */
- space (stream, 1 + nl - cp);
-
- __argp_fmtstream_write (stream, cp, nl - cp);
- }
- if (fdoc && fdoc != tdoc)
- free ((char *)fdoc); /* Free user's modified doc string. */
-
- if (child)
- while (child->argp)
- advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream);
-
- if (advance && multiple)
- {
- /* Need to increment our level. */
- if (*nl)
- /* There's more we can do here. */
- {
- (*our_level)++;
- advance = 0; /* Our parent shouldn't advance also. */
- }
- else if (*our_level > 0)
- /* We had multiple levels, but used them up; reset to zero. */
- *our_level = 0;
- }
-
- return !advance;
-}
-
-/* Print the documentation for ARGP to STREAM; if POST is false, then
- everything preceding a '\v' character in the documentation strings (or
- the whole string, for those with none) is printed, otherwise, everything
- following the '\v' character (nothing for strings without). Each separate
- bit of documentation is separated a blank line, and if PRE_BLANK is true,
- then the first is as well. If FIRST_ONLY is true, only the first
- occurrence is output. Returns true if anything was output. */
-static int
-argp_doc (const struct argp *argp, const struct argp_state *state,
- int post, int pre_blank, int first_only,
- argp_fmtstream_t stream)
-{
- const char *text;
- const char *inp_text;
- size_t inp_text_len = 0;
- const char *trans_text;
- void *input = 0;
- int anything = 0;
- const struct argp_child *child = argp->children;
-
- if (argp->doc)
- {
- char *vt = strchr (argp->doc, '\v');
- if (vt)
- {
- if (post)
- inp_text = vt + 1;
- else
- {
- inp_text_len = vt - argp->doc;
- inp_text = __strndup (argp->doc, inp_text_len);
- }
- }
- else
- inp_text = post ? 0 : argp->doc;
- trans_text = inp_text ? dgettext (argp->argp_domain, inp_text) : NULL;
- }
- else
- trans_text = inp_text = 0;
-
- if (argp->help_filter)
- /* We have to filter the doc strings. */
- {
- input = __argp_input (argp, state);
- text =
- (*argp->help_filter) (post
- ? ARGP_KEY_HELP_POST_DOC
- : ARGP_KEY_HELP_PRE_DOC,
- trans_text, input);
- }
- else
- text = (const char *) trans_text;
-
- if (text)
- {
- if (pre_blank)
- __argp_fmtstream_putc (stream, '\n');
-
- __argp_fmtstream_puts (stream, text);
-
- if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream))
- __argp_fmtstream_putc (stream, '\n');
-
- anything = 1;
- }
-
- if (text && text != trans_text)
- free ((char *) text); /* Free TEXT returned from the help filter. */
-
- if (inp_text && inp_text_len)
- free ((char *) inp_text); /* We copied INP_TEXT, so free it now. */
-
- if (post && argp->help_filter)
- /* Now see if we have to output an ARGP_KEY_HELP_EXTRA text. */
- {
- text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
- if (text)
- {
- if (anything || pre_blank)
- __argp_fmtstream_putc (stream, '\n');
- __argp_fmtstream_puts (stream, text);
- free ((char *) text);
- if (__argp_fmtstream_point (stream)
- > __argp_fmtstream_lmargin (stream))
- __argp_fmtstream_putc (stream, '\n');
- anything = 1;
- }
- }
-
- if (child)
- while (child->argp && !(first_only && anything))
- anything |=
- argp_doc ((child++)->argp, state,
- post, anything || pre_blank, first_only,
- stream);
-
- return anything;
-}
-
-/* Output a usage message for ARGP to STREAM. If called from
- argp_state_help, STATE is the relevant parsing state. FLAGS are from the
- set ARGP_HELP_*. NAME is what to use wherever a "program name" is
- needed. */
-static void
-_help (const struct argp *argp, const struct argp_state *state, FILE *stream,
- unsigned flags, char *name)
-{
- int anything = 0; /* Whether we've output anything. */
- struct hol *hol = 0;
- argp_fmtstream_t fs;
-
- if (! stream)
- return;
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __flockfile (stream);
-#endif
-
- if (! uparams.valid)
- fill_in_uparams (state);
-
- fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
- if (! fs)
- {
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
- return;
- }
-
- if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG))
- {
- hol = argp_hol (argp, 0);
-
- /* If present, these options always come last. */
- hol_set_group (hol, "help", -1);
- hol_set_group (hol, "version", -1);
-
- hol_sort (hol);
- }
-
- if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE))
- /* Print a short "Usage:" message. */
- {
- int first_pattern = 1, more_patterns;
- size_t num_pattern_levels = argp_args_levels (argp);
- char *pattern_levels = alloca (num_pattern_levels);
-
- memset (pattern_levels, 0, num_pattern_levels);
-
- do
- {
- int old_lm;
- int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent);
- char *levels = pattern_levels;
-
- if (first_pattern)
- __argp_fmtstream_printf (fs, "%s %s",
- dgettext (argp->argp_domain, "Usage:"),
- name);
- else
- __argp_fmtstream_printf (fs, "%s %s",
- dgettext (argp->argp_domain, " or: "),
- name);
-
- /* We set the lmargin as well as the wmargin, because hol_usage
- manually wraps options with newline to avoid annoying breaks. */
- old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent);
-
- if (flags & ARGP_HELP_SHORT_USAGE)
- /* Just show where the options go. */
- {
- if (hol->num_entries > 0)
- __argp_fmtstream_puts (fs, dgettext (argp->argp_domain,
- " [OPTION...]"));
- }
- else
- /* Actually print the options. */
- {
- hol_usage (hol, fs);
- flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once. */
- }
-
- more_patterns = argp_args_usage (argp, state, &levels, 1, fs);
-
- __argp_fmtstream_set_wmargin (fs, old_wm);
- __argp_fmtstream_set_lmargin (fs, old_lm);
-
- __argp_fmtstream_putc (fs, '\n');
- anything = 1;
-
- first_pattern = 0;
- }
- while (more_patterns);
- }
-
- if (flags & ARGP_HELP_PRE_DOC)
- anything |= argp_doc (argp, state, 0, 0, 1, fs);
-
- if (flags & ARGP_HELP_SEE)
- {
- __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\
-Try '%s --help' or '%s --usage' for more information.\n"),
- name, name);
- anything = 1;
- }
-
- if (flags & ARGP_HELP_LONG)
- /* Print a long, detailed help message. */
- {
- /* Print info about all the options. */
- if (hol->num_entries > 0)
- {
- if (anything)
- __argp_fmtstream_putc (fs, '\n');
- hol_help (hol, state, fs);
- anything = 1;
- }
- }
-
- if (flags & ARGP_HELP_POST_DOC)
- /* Print any documentation strings at the end. */
- anything |= argp_doc (argp, state, 1, anything, 0, fs);
-
- if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address)
- {
- if (anything)
- __argp_fmtstream_putc (fs, '\n');
- __argp_fmtstream_printf (fs, dgettext (argp->argp_domain,
- "Report bugs to %s.\n"),
- argp_program_bug_address);
- anything = 1;
- }
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
-
- if (hol)
- hol_free (hol);
-
- __argp_fmtstream_free (fs);
-}
-
-/* Output a usage message for ARGP to STREAM. FLAGS are from the set
- ARGP_HELP_*. NAME is what to use wherever a "program name" is needed. */
-void __argp_help (const struct argp *argp, FILE *stream,
- unsigned flags, char *name)
-{
- struct argp_state state;
- memset (&state, 0, sizeof state);
- state.root_argp = argp;
- _help (argp, &state, stream, flags, name);
-}
-#ifdef weak_alias
-weak_alias (__argp_help, argp_help)
-#endif
-
-#if ! (defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME)
-char *
-__argp_short_program_name (void)
-{
-# if HAVE_DECL_PROGRAM_INVOCATION_NAME
- return __argp_base_name (program_invocation_name);
-# else
- /* FIXME: What now? Miles suggests that it is better to use NULL,
- but currently the value is passed on directly to fputs_unlocked,
- so that requires more changes. */
-# if __GNUC__
-# warning No reasonable value to return
-# endif /* __GNUC__ */
- return "";
-# endif
-}
-#endif
-
-/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
- from the set ARGP_HELP_*. */
-void
-__argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
-{
- if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream)
- {
- if (state && (state->flags & ARGP_LONG_ONLY))
- flags |= ARGP_HELP_LONG_ONLY;
-
- _help (state ? state->root_argp : 0, state, stream, flags,
- state ? state->name : __argp_short_program_name ());
-
- if (!state || ! (state->flags & ARGP_NO_EXIT))
- {
- if (flags & ARGP_HELP_EXIT_ERR)
- exit (argp_err_exit_status);
- if (flags & ARGP_HELP_EXIT_OK)
- exit (0);
- }
- }
-}
-#ifdef weak_alias
-weak_alias (__argp_state_help, argp_state_help)
-#endif
-
-/* If appropriate, print the printf string FMT and following args, preceded
- by the program name and ':', to stderr, and followed by a "Try ... --help"
- message, then exit (1). */
-void
-__argp_error (const struct argp_state *state, const char *fmt, ...)
-{
- if (!state || !(state->flags & ARGP_NO_ERRS))
- {
- FILE *stream = state ? state->err_stream : stderr;
-
- if (stream)
- {
- va_list ap;
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __flockfile (stream);
-#endif
-
- va_start (ap, fmt);
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- {
- char *buf;
-
- if (__asprintf (&buf, fmt, ap) < 0)
- buf = NULL;
-
- __fwprintf (stream, L"%s: %s\n",
- state ? state->name : __argp_short_program_name (),
- buf);
-
- free (buf);
- }
- else
-#endif
- {
- fputs_unlocked (state
- ? state->name : __argp_short_program_name (),
- stream);
- putc_unlocked (':', stream);
- putc_unlocked (' ', stream);
-
- vfprintf (stream, fmt, ap);
-
- putc_unlocked ('\n', stream);
- }
-
- __argp_state_help (state, stream, ARGP_HELP_STD_ERR);
-
- va_end (ap);
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
- }
- }
-}
-#ifdef weak_alias
-weak_alias (__argp_error, argp_error)
-#endif
-
-/* Similar to the standard gnu error-reporting function error(), but will
- respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
- to STATE->err_stream. This is useful for argument parsing code that is
- shared between program startup (when exiting is desired) and runtime
- option parsing (when typically an error code is returned instead). The
- difference between this function and argp_error is that the latter is for
- *parsing errors*, and the former is for other problems that occur during
- parsing but don't reflect a (syntactic) problem with the input. */
-void
-__argp_failure (const struct argp_state *state, int status, int errnum,
- const char *fmt, ...)
-{
- if (!state || !(state->flags & ARGP_NO_ERRS))
- {
- FILE *stream = state ? state->err_stream : stderr;
-
- if (stream)
- {
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __flockfile (stream);
-#endif
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- __fwprintf (stream, L"%s",
- state ? state->name : __argp_short_program_name ());
- else
-#endif
- fputs_unlocked (state
- ? state->name : __argp_short_program_name (),
- stream);
-
- if (fmt)
- {
- va_list ap;
-
- va_start (ap, fmt);
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- {
- char *buf;
-
- if (__asprintf (&buf, fmt, ap) < 0)
- buf = NULL;
-
- __fwprintf (stream, L": %s", buf);
-
- free (buf);
- }
- else
-#endif
- {
- putc_unlocked (':', stream);
- putc_unlocked (' ', stream);
-
- vfprintf (stream, fmt, ap);
- }
-
- va_end (ap);
- }
-
- if (errnum)
- {
- char buf[200];
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- __fwprintf (stream, L": %s",
- __strerror_r (errnum, buf, sizeof (buf)));
- else
-#endif
- {
- char const *s = NULL;
- putc_unlocked (':', stream);
- putc_unlocked (' ', stream);
-#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P && !defined strerror_r)
- s = __strerror_r (errnum, buf, sizeof buf);
-#elif HAVE_DECL_STRERROR_R
- if (__strerror_r (errnum, buf, sizeof buf) == 0)
- s = buf;
-#endif
-#if !_LIBC
- if (! s && ! (s = strerror (errnum)))
- s = dgettext (state->root_argp->argp_domain,
- "Unknown system error");
-#endif
- fputs (s, stream);
- }
- }
-
-#ifdef USE_IN_LIBIO
- if (_IO_fwide (stream, 0) > 0)
- putwc_unlocked (L'\n', stream);
- else
-#endif
- putc_unlocked ('\n', stream);
-
-#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
- __funlockfile (stream);
-#endif
-
- if (status && (!state || !(state->flags & ARGP_NO_EXIT)))
- exit (status);
- }
- }
-}
-#ifdef weak_alias
-weak_alias (__argp_failure, argp_failure)
-#endif
diff --git a/gl/argp-namefrob.h b/gl/argp-namefrob.h
deleted file mode 100644
index 6333958c63..0000000000
--- a/gl/argp-namefrob.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/* Name frobnication for compiling argp outside of glibc
- Copyright (C) 1997, 2003, 2007, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#if !_LIBC
-/* This code is written for inclusion in gnu-libc, and uses names in the
- namespace reserved for libc. If we're not compiling in libc, define those
- names to be the normal ones instead. */
-
-/* argp-parse functions */
-#undef __argp_parse
-#define __argp_parse argp_parse
-#undef __option_is_end
-#define __option_is_end _option_is_end
-#undef __option_is_short
-#define __option_is_short _option_is_short
-#undef __argp_input
-#define __argp_input _argp_input
-
-/* argp-help functions */
-#undef __argp_help
-#define __argp_help argp_help
-#undef __argp_error
-#define __argp_error argp_error
-#undef __argp_failure
-#define __argp_failure argp_failure
-#undef __argp_state_help
-#define __argp_state_help argp_state_help
-#undef __argp_usage
-#define __argp_usage argp_usage
-
-/* argp-fmtstream functions */
-#undef __argp_make_fmtstream
-#define __argp_make_fmtstream argp_make_fmtstream
-#undef __argp_fmtstream_free
-#define __argp_fmtstream_free argp_fmtstream_free
-#undef __argp_fmtstream_putc
-#define __argp_fmtstream_putc argp_fmtstream_putc
-#undef __argp_fmtstream_puts
-#define __argp_fmtstream_puts argp_fmtstream_puts
-#undef __argp_fmtstream_write
-#define __argp_fmtstream_write argp_fmtstream_write
-#undef __argp_fmtstream_printf
-#define __argp_fmtstream_printf argp_fmtstream_printf
-#undef __argp_fmtstream_set_lmargin
-#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
-#undef __argp_fmtstream_set_rmargin
-#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
-#undef __argp_fmtstream_set_wmargin
-#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
-#undef __argp_fmtstream_point
-#define __argp_fmtstream_point argp_fmtstream_point
-#undef __argp_fmtstream_update
-#define __argp_fmtstream_update _argp_fmtstream_update
-#undef __argp_fmtstream_ensure
-#define __argp_fmtstream_ensure _argp_fmtstream_ensure
-#undef __argp_fmtstream_lmargin
-#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
-#undef __argp_fmtstream_rmargin
-#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
-#undef __argp_fmtstream_wmargin
-#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
-
-/* normal libc functions we call */
-#undef __flockfile
-#define __flockfile flockfile
-#undef __funlockfile
-#define __funlockfile funlockfile
-#undef __mempcpy
-#define __mempcpy mempcpy
-#undef __sleep
-#define __sleep sleep
-#undef __strcasecmp
-#define __strcasecmp strcasecmp
-#undef __strchrnul
-#define __strchrnul strchrnul
-#undef __strerror_r
-#define __strerror_r strerror_r
-#undef __strndup
-#define __strndup strndup
-#undef __vsnprintf
-#define __vsnprintf vsnprintf
-
-#if defined(HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
-# define clearerr_unlocked(x) clearerr (x)
-#endif
-#if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
-# define feof_unlocked(x) feof (x)
-#endif
-#if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
-# define ferror_unlocked(x) ferror (x)
-#endif
-#if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
-# define fflush_unlocked(x) fflush (x)
-#endif
-#if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
-# define fgets_unlocked(x,y,z) fgets (x,y,z)
-#endif
-#if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED
-# define fputc_unlocked(x,y) fputc (x,y)
-#endif
-#if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
-# define fputs_unlocked(x,y) fputs (x,y)
-#endif
-#if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
-# define fread_unlocked(w,x,y,z) fread (w,x,y,z)
-#endif
-#if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
-# define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
-#endif
-#if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED
-# define getc_unlocked(x) getc (x)
-#endif
-#if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED
-# define getchar_unlocked() getchar ()
-#endif
-#if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED
-# define putc_unlocked(x,y) putc (x,y)
-#endif
-#if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED
-# define putchar_unlocked(x) putchar (x)
-#endif
-
-#endif /* !_LIBC */
-
-#ifndef __set_errno
-# define __set_errno(e) (errno = (e))
-#endif
-
-#if defined GNULIB_ARGP_DISABLE_DIRNAME
-# define __argp_base_name(arg) arg
-#elif defined GNULIB_ARGP_EXTERN_BASENAME
-extern char *__argp_base_name (const char *arg);
-#else
-# include "dirname.h"
-# define __argp_base_name last_component
-#endif
-
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
-# define __argp_short_program_name() (program_invocation_short_name)
-#else
-extern char *__argp_short_program_name (void);
-#endif
diff --git a/gl/argp-parse.c b/gl/argp-parse.c
deleted file mode 100644
index 489d6de91c..0000000000
--- a/gl/argp-parse.c
+++ /dev/null
@@ -1,953 +0,0 @@
-/* Hierarchical argument parsing, layered over getopt
- Copyright (C) 1995-2000, 2002-2004, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <alloca.h>
-#include <stdalign.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <limits.h>
-#include <getopt.h>
-#include <getopt_int.h>
-
-#ifdef _LIBC
-# include <libintl.h>
-# undef dgettext
-# define dgettext(domain, msgid) \
- INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
-#else
-# include "gettext.h"
-#endif
-#define N_(msgid) msgid
-
-#include "argp.h"
-#include "argp-namefrob.h"
-
-#define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d))
-
-/* Getopt return values. */
-#define KEY_END (-1) /* The end of the options. */
-#define KEY_ARG 1 /* A non-option argument. */
-#define KEY_ERR '?' /* An error parsing the options. */
-
-/* The meta-argument used to prevent any further arguments being interpreted
- as options. */
-#define QUOTE "--"
-
-/* The number of bits we steal in a long-option value for our own use. */
-#define GROUP_BITS CHAR_BIT
-
-/* The number of bits available for the user value. */
-#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS)
-#define USER_MASK ((1 << USER_BITS) - 1)
-
-/* EZ alias for ARGP_ERR_UNKNOWN. */
-#define EBADKEY ARGP_ERR_UNKNOWN
-
-/* Default options. */
-
-/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep
- for one second intervals, decrementing _ARGP_HANG until it's zero. Thus
- you can force the program to continue by attaching a debugger and setting
- it to 0 yourself. */
-static volatile int _argp_hang;
-
-#define OPT_PROGNAME -2
-#define OPT_USAGE -3
-#define OPT_HANG -4
-
-static const struct argp_option argp_default_options[] =
-{
- {"help", '?', 0, 0, N_("give this help list"), -1},
- {"usage", OPT_USAGE, 0, 0, N_("give a short usage message"), 0},
- {"program-name",OPT_PROGNAME,N_("NAME"), OPTION_HIDDEN, N_("set the program name"), 0},
- {"HANG", OPT_HANG, N_("SECS"), OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
- N_("hang for SECS seconds (default 3600)"), 0},
- {NULL, 0, 0, 0, NULL, 0}
-};
-
-static error_t
-argp_default_parser (int key, char *arg, struct argp_state *state)
-{
- switch (key)
- {
- case '?':
- __argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP);
- break;
- case OPT_USAGE:
- __argp_state_help (state, state->out_stream,
- ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
- break;
-
- case OPT_PROGNAME: /* Set the program name. */
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME
- program_invocation_name = arg;
-#endif
- /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
- __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined
- to be that, so we have to be a bit careful here.] */
-
- /* Update what we use for messages. */
- state->name = __argp_base_name (arg);
-
-#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
- program_invocation_short_name = state->name;
-#endif
-
- if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
- == ARGP_PARSE_ARGV0)
- /* Update what getopt uses too. */
- state->argv[0] = arg;
-
- break;
-
- case OPT_HANG:
- _argp_hang = atoi (arg ? arg : "3600");
- while (_argp_hang-- > 0)
- __sleep (1);
- break;
-
- default:
- return EBADKEY;
- }
- return 0;
-}
-
-static const struct argp argp_default_argp =
- {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"};
-
-
-static const struct argp_option argp_version_options[] =
-{
- {"version", 'V', 0, 0, N_("print program version"), -1},
- {NULL, 0, 0, 0, NULL, 0}
-};
-
-static error_t
-argp_version_parser (int key, char *arg, struct argp_state *state)
-{
- switch (key)
- {
- case 'V':
- if (argp_program_version_hook)
- (*argp_program_version_hook) (state->out_stream, state);
- else if (argp_program_version)
- fprintf (state->out_stream, "%s\n", argp_program_version);
- else
- __argp_error (state, "%s",
- dgettext (state->root_argp->argp_domain,
- "(PROGRAM ERROR) No version known!?"));
- if (! (state->flags & ARGP_NO_EXIT))
- exit (0);
- break;
- default:
- return EBADKEY;
- }
- return 0;
-}
-
-static const struct argp argp_version_argp =
- {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"};
-
-/* Returns the offset into the getopt long options array LONG_OPTIONS of a
- long option with called NAME, or -1 if none is found. Passing NULL as
- NAME will return the number of options. */
-static int
-find_long_option (struct option *long_options, const char *name)
-{
- struct option *l = long_options;
- while (l->name != NULL)
- if (name != NULL && strcmp (l->name, name) == 0)
- return l - long_options;
- else
- l++;
- if (name == NULL)
- return l - long_options;
- else
- return -1;
-}
-
-
-/* The state of a "group" during parsing. Each group corresponds to a
- particular argp structure from the tree of such descending from the top
- level argp passed to argp_parse. */
-struct group
-{
- /* This group's parsing function. */
- argp_parser_t parser;
-
- /* Which argp this group is from. */
- const struct argp *argp;
-
- /* Points to the point in SHORT_OPTS corresponding to the end of the short
- options for this group. We use it to determine from which group a
- particular short options is from. */
- char *short_end;
-
- /* The number of non-option args successfully handled by this parser. */
- unsigned args_processed;
-
- /* This group's parser's parent's group. */
- struct group *parent;
- unsigned parent_index; /* And the our position in the parent. */
-
- /* These fields are swapped into and out of the state structure when
- calling this group's parser. */
- void *input, **child_inputs;
- void *hook;
-};
-
-/* Call GROUP's parser with KEY and ARG, swapping any group-specific info
- from STATE before calling, and back into state afterwards. If GROUP has
- no parser, EBADKEY is returned. */
-static error_t
-group_parse (struct group *group, struct argp_state *state, int key, char *arg)
-{
- if (group->parser)
- {
- error_t err;
- state->hook = group->hook;
- state->input = group->input;
- state->child_inputs = group->child_inputs;
- state->arg_num = group->args_processed;
- err = (*group->parser)(key, arg, state);
- group->hook = state->hook;
- return err;
- }
- else
- return EBADKEY;
-}
-
-struct parser
-{
- const struct argp *argp;
-
- /* SHORT_OPTS is the getopt short options string for the union of all the
- groups of options. */
- char *short_opts;
- /* LONG_OPTS is the array of getop long option structures for the union of
- all the groups of options. */
- struct option *long_opts;
- /* OPT_DATA is the getopt data used for the re-entrant getopt. */
- struct _getopt_data opt_data;
-
- /* States of the various parsing groups. */
- struct group *groups;
- /* The end of the GROUPS array. */
- struct group *egroup;
- /* A vector containing storage for the CHILD_INPUTS field in all groups. */
- void **child_inputs;
-
- /* True if we think using getopt is still useful; if false, then
- remaining arguments are just passed verbatim with ARGP_KEY_ARG. This is
- cleared whenever getopt returns KEY_END, but may be set again if the user
- moves the next argument pointer backwards. */
- int try_getopt;
-
- /* State block supplied to parsing routines. */
- struct argp_state state;
-
- /* Memory used by this parser. */
- void *storage;
-};
-
-/* The next usable entries in the various parser tables being filled in by
- convert_options. */
-struct parser_convert_state
-{
- struct parser *parser;
- char *short_end;
- struct option *long_end;
- void **child_inputs_end;
-};
-
-/* Converts all options in ARGP (which is put in GROUP) and ancestors
- into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and
- CVT->LONG_END are the points at which new options are added. Returns the
- next unused group entry. CVT holds state used during the conversion. */
-static struct group *
-convert_options (const struct argp *argp,
- struct group *parent, unsigned parent_index,
- struct group *group, struct parser_convert_state *cvt)
-{
- /* REAL is the most recent non-alias value of OPT. */
- const struct argp_option *real = argp->options;
- const struct argp_child *children = argp->children;
-
- if (real || argp->parser)
- {
- const struct argp_option *opt;
-
- if (real)
- for (opt = real; !__option_is_end (opt); opt++)
- {
- if (! (opt->flags & OPTION_ALIAS))
- /* OPT isn't an alias, so we can use values from it. */
- real = opt;
-
- if (! (real->flags & OPTION_DOC))
- /* A real option (not just documentation). */
- {
- if (__option_is_short (opt))
- /* OPT can be used as a short option. */
- {
- *cvt->short_end++ = opt->key;
- if (real->arg)
- {
- *cvt->short_end++ = ':';
- if (real->flags & OPTION_ARG_OPTIONAL)
- *cvt->short_end++ = ':';
- }
- *cvt->short_end = '\0'; /* keep 0 terminated */
- }
-
- if (opt->name
- && find_long_option (cvt->parser->long_opts, opt->name) < 0)
- /* OPT can be used as a long option. */
- {
- cvt->long_end->name = opt->name;
- cvt->long_end->has_arg =
- (real->arg
- ? (real->flags & OPTION_ARG_OPTIONAL
- ? optional_argument
- : required_argument)
- : no_argument);
- cvt->long_end->flag = 0;
- /* we add a disambiguating code to all the user's
- values (which is removed before we actually call
- the function to parse the value); this means that
- the user loses use of the high 8 bits in all his
- values (the sign of the lower bits is preserved
- however)... */
- cvt->long_end->val =
- ((opt->key ? opt->key : real->key) & USER_MASK)
- + (((group - cvt->parser->groups) + 1) << USER_BITS);
-
- /* Keep the LONG_OPTS list terminated. */
- (++cvt->long_end)->name = NULL;
- }
- }
- }
-
- group->parser = argp->parser;
- group->argp = argp;
- group->short_end = cvt->short_end;
- group->args_processed = 0;
- group->parent = parent;
- group->parent_index = parent_index;
- group->input = 0;
- group->hook = 0;
- group->child_inputs = 0;
-
- if (children)
- /* Assign GROUP's CHILD_INPUTS field some space from
- CVT->child_inputs_end.*/
- {
- unsigned num_children = 0;
- while (children[num_children].argp)
- num_children++;
- group->child_inputs = cvt->child_inputs_end;
- cvt->child_inputs_end += num_children;
- }
-
- parent = group++;
- }
- else
- parent = 0;
-
- if (children)
- {
- unsigned index = 0;
- while (children->argp)
- group =
- convert_options (children++->argp, parent, index++, group, cvt);
- }
-
- return group;
-}
-
-/* Find the merged set of getopt options, with keys appropriately prefixed. */
-static void
-parser_convert (struct parser *parser, const struct argp *argp, int flags)
-{
- struct parser_convert_state cvt;
-
- cvt.parser = parser;
- cvt.short_end = parser->short_opts;
- cvt.long_end = parser->long_opts;
- cvt.child_inputs_end = parser->child_inputs;
-
- if (flags & ARGP_IN_ORDER)
- *cvt.short_end++ = '-';
- else if (flags & ARGP_NO_ARGS)
- *cvt.short_end++ = '+';
- *cvt.short_end = '\0';
-
- cvt.long_end->name = NULL;
-
- parser->argp = argp;
-
- if (argp)
- parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt);
- else
- parser->egroup = parser->groups; /* No parsers at all! */
-}
-
-/* Lengths of various parser fields which we will allocated. */
-struct parser_sizes
-{
- size_t short_len; /* Getopt short options string. */
- size_t long_len; /* Getopt long options vector. */
- size_t num_groups; /* Group structures we allocate. */
- size_t num_child_inputs; /* Child input slots. */
-};
-
-/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of
- argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by
- the maximum lengths of the resulting merged getopt short options string and
- long-options array, respectively. */
-static void
-calc_sizes (const struct argp *argp, struct parser_sizes *szs)
-{
- const struct argp_child *child = argp->children;
- const struct argp_option *opt = argp->options;
-
- if (opt || argp->parser)
- {
- szs->num_groups++;
- if (opt)
- {
- int num_opts = 0;
- while (!__option_is_end (opt++))
- num_opts++;
- szs->short_len += num_opts * 3; /* opt + up to 2 ':'s */
- szs->long_len += num_opts;
- }
- }
-
- if (child)
- while (child->argp)
- {
- calc_sizes ((child++)->argp, szs);
- szs->num_child_inputs++;
- }
-}
-
-/* Initializes PARSER to parse ARGP in a manner described by FLAGS. */
-static error_t
-parser_init (struct parser *parser, const struct argp *argp,
- int argc, char **argv, int flags, void *input)
-{
- error_t err = 0;
- struct group *group;
- struct parser_sizes szs;
- struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER;
- char *storage;
- size_t glen, gsum;
- size_t clen, csum;
- size_t llen, lsum;
- size_t slen, ssum;
-
- szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1;
- szs.long_len = 0;
- szs.num_groups = 0;
- szs.num_child_inputs = 0;
-
- if (argp)
- calc_sizes (argp, &szs);
-
- /* Lengths of the various bits of storage used by PARSER. */
- glen = (szs.num_groups + 1) * sizeof (struct group);
- clen = szs.num_child_inputs * sizeof (void *);
- llen = (szs.long_len + 1) * sizeof (struct option);
- slen = szs.short_len + 1;
-
- /* Sums of previous lengths, properly aligned. There's no need to
- align gsum, since struct group is aligned at least as strictly as
- void * (since it contains a void * member). And there's no need
- to align lsum, since struct option is aligned at least as
- strictly as char. */
- gsum = glen;
- csum = alignto (gsum + clen, alignof (struct option));
- lsum = csum + llen;
- ssum = lsum + slen;
-
- parser->storage = malloc (ssum);
- if (! parser->storage)
- return ENOMEM;
-
- storage = parser->storage;
- parser->groups = parser->storage;
- parser->child_inputs = (void **) (storage + gsum);
- parser->long_opts = (struct option *) (storage + csum);
- parser->short_opts = storage + lsum;
- parser->opt_data = opt_data;
-
- memset (parser->child_inputs, 0, clen);
- parser_convert (parser, argp, flags);
-
- memset (&parser->state, 0, sizeof (struct argp_state));
- parser->state.root_argp = parser->argp;
- parser->state.argc = argc;
- parser->state.argv = argv;
- parser->state.flags = flags;
- parser->state.err_stream = stderr;
- parser->state.out_stream = stdout;
- parser->state.next = 0; /* Tell getopt to initialize. */
- parser->state.pstate = parser;
-
- parser->try_getopt = 1;
-
- /* Call each parser for the first time, giving it a chance to propagate
- values to child parsers. */
- if (parser->groups < parser->egroup)
- parser->groups->input = input;
- for (group = parser->groups;
- group < parser->egroup && (!err || err == EBADKEY);
- group++)
- {
- if (group->parent)
- /* If a child parser, get the initial input value from the parent. */
- group->input = group->parent->child_inputs[group->parent_index];
-
- if (!group->parser
- && group->argp->children && group->argp->children->argp)
- /* For the special case where no parsing function is supplied for an
- argp, propagate its input to its first child, if any (this just
- makes very simple wrapper argps more convenient). */
- group->child_inputs[0] = group->input;
-
- err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0);
- }
- if (err == EBADKEY)
- err = 0; /* Some parser didn't understand. */
-
- if (err)
- return err;
-
- if (parser->state.flags & ARGP_NO_ERRS)
- {
- parser->opt_data.opterr = 0;
- if (parser->state.flags & ARGP_PARSE_ARGV0)
- /* getopt always skips ARGV[0], so we have to fake it out. As long
- as OPTERR is 0, then it shouldn't actually try to access it. */
- parser->state.argv--, parser->state.argc++;
- }
- else
- parser->opt_data.opterr = 1; /* Print error messages. */
-
- if (parser->state.argv == argv && argv[0])
- /* There's an argv[0]; use it for messages. */
- parser->state.name = __argp_base_name (argv[0]);
- else
- parser->state.name = __argp_short_program_name ();
-
- return 0;
-}
-
-/* Free any storage consumed by PARSER (but not PARSER itself). */
-static error_t
-parser_finalize (struct parser *parser,
- error_t err, int arg_ebadkey, int *end_index)
-{
- struct group *group;
-
- if (err == EBADKEY && arg_ebadkey)
- /* Suppress errors generated by unparsed arguments. */
- err = 0;
-
- if (! err)
- {
- if (parser->state.next == parser->state.argc)
- /* We successfully parsed all arguments! Call all the parsers again,
- just a few more times... */
- {
- for (group = parser->groups;
- group < parser->egroup && (!err || err==EBADKEY);
- group++)
- if (group->args_processed == 0)
- err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0);
- for (group = parser->egroup - 1;
- group >= parser->groups && (!err || err==EBADKEY);
- group--)
- err = group_parse (group, &parser->state, ARGP_KEY_END, 0);
-
- if (err == EBADKEY)
- err = 0; /* Some parser didn't understand. */
-
- /* Tell the user that all arguments are parsed. */
- if (end_index)
- *end_index = parser->state.next;
- }
- else if (end_index)
- /* Return any remaining arguments to the user. */
- *end_index = parser->state.next;
- else
- /* No way to return the remaining arguments, they must be bogus. */
- {
- if (!(parser->state.flags & ARGP_NO_ERRS)
- && parser->state.err_stream)
- fprintf (parser->state.err_stream,
- dgettext (parser->argp->argp_domain,
- "%s: Too many arguments\n"),
- parser->state.name);
- err = EBADKEY;
- }
- }
-
- /* Okay, we're all done, with either an error or success; call the parsers
- to indicate which one. */
-
- if (err)
- {
- /* Maybe print an error message. */
- if (err == EBADKEY)
- /* An appropriate message describing what the error was should have
- been printed earlier. */
- __argp_state_help (&parser->state, parser->state.err_stream,
- ARGP_HELP_STD_ERR);
-
- /* Since we didn't exit, give each parser an error indication. */
- for (group = parser->groups; group < parser->egroup; group++)
- group_parse (group, &parser->state, ARGP_KEY_ERROR, 0);
- }
- else
- /* Notify parsers of success, and propagate back values from parsers. */
- {
- /* We pass over the groups in reverse order so that child groups are
- given a chance to do there processing before passing back a value to
- the parent. */
- for (group = parser->egroup - 1
- ; group >= parser->groups && (!err || err == EBADKEY)
- ; group--)
- err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0);
- if (err == EBADKEY)
- err = 0; /* Some parser didn't understand. */
- }
-
- /* Call parsers once more, to do any final cleanup. Errors are ignored. */
- for (group = parser->egroup - 1; group >= parser->groups; group--)
- group_parse (group, &parser->state, ARGP_KEY_FINI, 0);
-
- if (err == EBADKEY)
- err = EINVAL;
-
- free (parser->storage);
-
- return err;
-}
-
-/* Call the user parsers to parse the non-option argument VAL, at the current
- position, returning any error. The state NEXT pointer is assumed to have
- been adjusted (by getopt) to point after this argument; this function will
- adjust it correctly to reflect however many args actually end up being
- consumed. */
-static error_t
-parser_parse_arg (struct parser *parser, char *val)
-{
- /* Save the starting value of NEXT, first adjusting it so that the arg
- we're parsing is again the front of the arg vector. */
- int index = --parser->state.next;
- error_t err = EBADKEY;
- struct group *group;
- int key = 0; /* Which of ARGP_KEY_ARG[S] we used. */
-
- /* Try to parse the argument in each parser. */
- for (group = parser->groups
- ; group < parser->egroup && err == EBADKEY
- ; group++)
- {
- parser->state.next++; /* For ARGP_KEY_ARG, consume the arg. */
- key = ARGP_KEY_ARG;
- err = group_parse (group, &parser->state, key, val);
-
- if (err == EBADKEY)
- /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */
- {
- parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg. */
- key = ARGP_KEY_ARGS;
- err = group_parse (group, &parser->state, key, 0);
- }
- }
-
- if (! err)
- {
- if (key == ARGP_KEY_ARGS)
- /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't
- changed by the user, *all* arguments should be considered
- consumed. */
- parser->state.next = parser->state.argc;
-
- if (parser->state.next > index)
- /* Remember that we successfully processed a non-option
- argument -- but only if the user hasn't gotten tricky and set
- the clock back. */
- (--group)->args_processed += (parser->state.next - index);
- else
- /* The user wants to reparse some args, give getopt another try. */
- parser->try_getopt = 1;
- }
-
- return err;
-}
-
-/* Call the user parsers to parse the option OPT, with argument VAL, at the
- current position, returning any error. */
-static error_t
-parser_parse_opt (struct parser *parser, int opt, char *val)
-{
- /* The group key encoded in the high bits; 0 for short opts or
- group_number + 1 for long opts. */
- int group_key = opt >> USER_BITS;
- error_t err = EBADKEY;
-
- if (group_key == 0)
- /* A short option. By comparing OPT's position in SHORT_OPTS to the
- various starting positions in each group's SHORT_END field, we can
- determine which group OPT came from. */
- {
- struct group *group;
- char *short_index = strchr (parser->short_opts, opt);
-
- if (short_index)
- for (group = parser->groups; group < parser->egroup; group++)
- if (group->short_end > short_index)
- {
- err = group_parse (group, &parser->state, opt,
- parser->opt_data.optarg);
- break;
- }
- }
- else
- /* A long option. We use shifts instead of masking for extracting
- the user value in order to preserve the sign. */
- err =
- group_parse (&parser->groups[group_key - 1], &parser->state,
- (opt << GROUP_BITS) >> GROUP_BITS,
- parser->opt_data.optarg);
-
- if (err == EBADKEY)
- /* At least currently, an option not recognized is an error in the
- parser, because we pre-compute which parser is supposed to deal
- with each option. */
- {
- static const char bad_key_err[] =
- N_("(PROGRAM ERROR) Option should have been recognized!?");
- if (group_key == 0)
- __argp_error (&parser->state, "-%c: %s", opt,
- dgettext (parser->argp->argp_domain, bad_key_err));
- else
- {
- struct option *long_opt = parser->long_opts;
- while (long_opt->val != opt && long_opt->name)
- long_opt++;
- __argp_error (&parser->state, "--%s: %s",
- long_opt->name ? long_opt->name : "???",
- dgettext (parser->argp->argp_domain, bad_key_err));
- }
- }
-
- return err;
-}
-
-/* Parse the next argument in PARSER (as indicated by PARSER->state.next).
- Any error from the parsers is returned, and *ARGP_EBADKEY indicates
- whether a value of EBADKEY is due to an unrecognized argument (which is
- generally not fatal). */
-static error_t
-parser_parse_next (struct parser *parser, int *arg_ebadkey)
-{
- int opt;
- error_t err = 0;
-
- if (parser->state.quoted && parser->state.next < parser->state.quoted)
- /* The next argument pointer has been moved to before the quoted
- region, so pretend we never saw the quoting "--", and give getopt
- another chance. If the user hasn't removed it, getopt will just
- process it again. */
- parser->state.quoted = 0;
-
- if (parser->try_getopt && !parser->state.quoted)
- /* Give getopt a chance to parse this. */
- {
- /* Put it back in OPTIND for getopt. */
- parser->opt_data.optind = parser->state.next;
- /* Distinguish KEY_ERR from a real option. */
- parser->opt_data.optopt = KEY_END;
- if (parser->state.flags & ARGP_LONG_ONLY)
- opt = _getopt_long_only_r (parser->state.argc, parser->state.argv,
- parser->short_opts, parser->long_opts, 0,
- &parser->opt_data);
- else
- opt = _getopt_long_r (parser->state.argc, parser->state.argv,
- parser->short_opts, parser->long_opts, 0,
- &parser->opt_data);
- /* And see what getopt did. */
- parser->state.next = parser->opt_data.optind;
-
- if (opt == KEY_END)
- /* Getopt says there are no more options, so stop using
- getopt; we'll continue if necessary on our own. */
- {
- parser->try_getopt = 0;
- if (parser->state.next > 1
- && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
- == 0)
- /* Not only is this the end of the options, but it's a
- "quoted" region, which may have args that *look* like
- options, so we definitely shouldn't try to use getopt past
- here, whatever happens. */
- parser->state.quoted = parser->state.next;
- }
- else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END)
- /* KEY_ERR can have the same value as a valid user short
- option, but in the case of a real error, getopt sets OPTOPT
- to the offending character, which can never be KEY_END. */
- {
- *arg_ebadkey = 0;
- return EBADKEY;
- }
- }
- else
- opt = KEY_END;
-
- if (opt == KEY_END)
- {
- /* We're past what getopt considers the options. */
- if (parser->state.next >= parser->state.argc
- || (parser->state.flags & ARGP_NO_ARGS))
- /* Indicate that we're done. */
- {
- *arg_ebadkey = 1;
- return EBADKEY;
- }
- else
- /* A non-option arg; simulate what getopt might have done. */
- {
- opt = KEY_ARG;
- parser->opt_data.optarg = parser->state.argv[parser->state.next++];
- }
- }
-
- if (opt == KEY_ARG)
- /* A non-option argument; try each parser in turn. */
- err = parser_parse_arg (parser, parser->opt_data.optarg);
- else
- err = parser_parse_opt (parser, opt, parser->opt_data.optarg);
-
- if (err == EBADKEY)
- *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG);
-
- return err;
-}
-
-/* Parse the options strings in ARGC & ARGV according to the argp in ARGP.
- FLAGS is one of the ARGP_ flags above. If END_INDEX is non-NULL, the
- index in ARGV of the first unparsed option is returned in it. If an
- unknown option is present, EINVAL is returned; if some parser routine
- returned a non-zero value, it is returned; otherwise 0 is returned. */
-error_t
-__argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
- int *end_index, void *input)
-{
- error_t err;
- struct parser parser;
-
- /* If true, then err == EBADKEY is a result of a non-option argument failing
- to be parsed (which in some cases isn't actually an error). */
- int arg_ebadkey = 0;
-
-#ifndef _LIBC
- if (!(flags & ARGP_PARSE_ARGV0))
- {
-#if HAVE_DECL_PROGRAM_INVOCATION_NAME
- if (!program_invocation_name)
- program_invocation_name = argv[0];
-#endif
-#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
- if (!program_invocation_short_name)
- program_invocation_short_name = __argp_base_name (argv[0]);
-#endif
- }
-#endif
-
- if (! (flags & ARGP_NO_HELP))
- /* Add our own options. */
- {
- struct argp_child *child = alloca (4 * sizeof (struct argp_child));
- struct argp *top_argp = alloca (sizeof (struct argp));
-
- /* TOP_ARGP has no options, it just serves to group the user & default
- argps. */
- memset (top_argp, 0, sizeof (*top_argp));
- top_argp->children = child;
-
- memset (child, 0, 4 * sizeof (struct argp_child));
-
- if (argp)
- (child++)->argp = argp;
- (child++)->argp = &argp_default_argp;
- if (argp_program_version || argp_program_version_hook)
- (child++)->argp = &argp_version_argp;
- child->argp = 0;
-
- argp = top_argp;
- }
-
- /* Construct a parser for these arguments. */
- err = parser_init (&parser, argp, argc, argv, flags, input);
-
- if (! err)
- /* Parse! */
- {
- while (! err)
- err = parser_parse_next (&parser, &arg_ebadkey);
- err = parser_finalize (&parser, err, arg_ebadkey, end_index);
- }
-
- return err;
-}
-#ifdef weak_alias
-weak_alias (__argp_parse, argp_parse)
-#endif
-
-/* Return the input field for ARGP in the parser corresponding to STATE; used
- by the help routines. */
-void *
-__argp_input (const struct argp *argp, const struct argp_state *state)
-{
- if (state)
- {
- struct group *group;
- struct parser *parser = state->pstate;
-
- for (group = parser->groups; group < parser->egroup; group++)
- if (group->argp == argp)
- return group->input;
- }
-
- return 0;
-}
-#ifdef weak_alias
-weak_alias (__argp_input, _argp_input)
-#endif
diff --git a/gl/argp-pin.c b/gl/argp-pin.c
deleted file mode 100644
index 78cbb355b7..0000000000
--- a/gl/argp-pin.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Full and short program names for argp module
- Copyright (C) 2005, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
-char *program_invocation_short_name = 0;
-#endif
-#ifndef HAVE_PROGRAM_INVOCATION_NAME
-char *program_invocation_name = 0;
-#endif
diff --git a/gl/argp-pv.c b/gl/argp-pv.c
deleted file mode 100644
index c74070d124..0000000000
--- a/gl/argp-pv.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Default definition for ARGP_PROGRAM_VERSION.
- Copyright (C) 1996-1997, 1999, 2006, 2009-2013 Free Software Foundation,
- Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-/* If set by the user program to a non-zero value, then a default option
- --version is added (unless the ARGP_NO_HELP flag is used), which will
- print this string followed by a newline and exit (unless the
- ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
-const char *argp_program_version
-/* This variable should be zero-initialized. On most systems, putting it into
- BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
- <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
- <http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
-#if defined __ELF__
- /* On ELF systems, variables in BSS behave well. */
-#else
- = (const char *) 0
-#endif
- ;
diff --git a/gl/argp-pvh.c b/gl/argp-pvh.c
deleted file mode 100644
index 885ff4b75b..0000000000
--- a/gl/argp-pvh.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
- Copyright (C) 1996-1997, 1999, 2004, 2009-2013 Free Software Foundation,
- Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "argp.h"
-
-/* If set by the user program to a non-zero value, then a default option
- --version is added (unless the ARGP_NO_HELP flag is used), which calls
- this function with a stream to print the version to and a pointer to the
- current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
- used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
-void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) = NULL;
diff --git a/gl/argp-xinl.c b/gl/argp-xinl.c
deleted file mode 100644
index 04d8cf7035..0000000000
--- a/gl/argp-xinl.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Real definitions for extern inline functions in argp.h
- Copyright (C) 1997-1998, 2004, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if defined _LIBC || defined HAVE_FEATURES_H
-# include <features.h>
-#endif
-
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#ifdef _LIBC
-# define ARGP_EI
-#else
-# define ARGP_EI _GL_EXTERN_INLINE
-#endif
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
-#include "argp.h"
-
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
-weak_alias (__argp_usage, argp_usage)
-weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-
-#endif
diff --git a/gl/argp.h b/gl/argp.h
deleted file mode 100644
index c4094a40c3..0000000000
--- a/gl/argp.h
+++ /dev/null
@@ -1,650 +0,0 @@
-/* Hierarchical argument parsing, layered over getopt.
- Copyright (C) 1995-1999, 2003-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Written by Miles Bader <miles@gnu.ai.mit.edu>.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _ARGP_H
-#define _ARGP_H
-
-#include <stdio.h>
-#include <ctype.h>
-#include <getopt.h>
-#include <limits.h>
-
-#define __need_error_t
-#include <errno.h>
-
-#ifndef __THROW
-# define __THROW
-#endif
-#ifndef __NTH
-# define __NTH(fct) fct __THROW
-#endif
-
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
- "restrict", and "configure" may have defined "restrict".
- Other compilers use __restrict, __restrict__, and _Restrict, and
- 'configure' might #define 'restrict' to those words. */
-#ifndef __restrict
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
-# if 199901L <= __STDC_VERSION__
-# define __restrict restrict
-# else
-# define __restrict
-# endif
-# endif
-#endif
-
-#ifndef __error_t_defined
-typedef int error_t;
-# define __error_t_defined
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* A description of a particular option. A pointer to an array of
- these is passed in the OPTIONS field of an argp structure. Each option
- entry can correspond to one long option and/or one short option; more
- names for the same option can be added by following an entry in an option
- array with options having the OPTION_ALIAS flag set. */
-struct argp_option
-{
- /* The long option name. For more than one name for the same option, you
- can use following options with the OPTION_ALIAS flag set. */
- const char *name;
-
- /* What key is returned for this option. If > 0 and printable, then it's
- also accepted as a short option. */
- int key;
-
- /* If non-NULL, this is the name of the argument associated with this
- option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
- const char *arg;
-
- /* OPTION_ flags. */
- int flags;
-
- /* The doc string for this option. If both NAME and KEY are 0, This string
- will be printed outdented from the normal option column, making it
- useful as a group header (it will be the first thing printed in its
- group); in this usage, it's conventional to end the string with a ':'.
-
- Write the initial value as N_("TEXT") if you want xgettext to collect
- it into a POT file. */
- const char *doc;
-
- /* The group this option is in. In a long help message, options are sorted
- alphabetically within each group, and the groups presented in the order
- 0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
- if this field 0 will inherit the group number of the previous entry, or
- zero if it's the first one, unless its a group header (NAME and KEY both
- 0), in which case, the previous entry + 1 is the default. Automagic
- options such as --help are put into group -1. */
- int group;
-};
-
-/* The argument associated with this option is optional. */
-#define OPTION_ARG_OPTIONAL 0x1
-
-/* This option isn't displayed in any help messages. */
-#define OPTION_HIDDEN 0x2
-
-/* This option is an alias for the closest previous non-alias option. This
- means that it will be displayed in the same help entry, and will inherit
- fields other than NAME and KEY from the aliased option. */
-#define OPTION_ALIAS 0x4
-
-/* This option isn't actually an option (and so should be ignored by the
- actual option parser), but rather an arbitrary piece of documentation that
- should be displayed in much the same manner as the options. If this flag
- is set, then the option NAME field is displayed unmodified (e.g., no '--'
- prefix is added) at the left-margin (where a *short* option would normally
- be displayed), and the documentation string in the normal place. The NAME
- field will be translated using gettext, unless OPTION_NO_TRANS is set (see
- below). For purposes of sorting, any leading whitespace and punctuation is
- ignored, except that if the first non-whitespace character is not '-', this
- entry is displayed after all options (and OPTION_DOC entries with a leading
- '-') in the same group. */
-#define OPTION_DOC 0x8
-
-/* This option shouldn't be included in "long" usage messages (but is still
- included in help messages). This is mainly intended for options that are
- completely documented in an argp's ARGS_DOC field, in which case including
- the option in the generic usage list would be redundant. For instance,
- if ARGS_DOC is "FOO BAR\n-x BLAH", and the '-x' option's purpose is to
- distinguish these two cases, -x should probably be marked
- OPTION_NO_USAGE. */
-#define OPTION_NO_USAGE 0x10
-
-/* Valid only in conjunction with OPTION_DOC. This option disables translation
- of option name. */
-#define OPTION_NO_TRANS 0x20
-
-
-struct argp; /* fwd declare this type */
-struct argp_state; /* " */
-struct argp_child; /* " */
-
-/* The type of a pointer to an argp parsing function. */
-typedef error_t (*argp_parser_t) (int key, char *arg,
- struct argp_state *state);
-
-/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
- returns will simply be ignored. For user keys, this error will be turned
- into EINVAL (if the call to argp_parse is such that errors are propagated
- back to the user instead of exiting); returning EINVAL itself would result
- in an immediate stop to parsing in *all* cases. */
-#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
-
-/* Special values for the KEY argument to an argument parsing function.
- ARGP_ERR_UNKNOWN should be returned if they aren't understood.
-
- The sequence of keys to a parsing function is either (where each
- uppercased word should be prefixed by 'ARGP_KEY_' and opt is a user key):
-
- INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
- or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
- or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
-
- The third case is where every parser returned ARGP_KEY_UNKNOWN for an
- argument, in which case parsing stops at that argument (returning the
- unparsed arguments to the caller of argp_parse if requested, or stopping
- with an error message if not).
-
- If an error occurs (either detected by argp, or because the parsing
- function returned an error value), then the parser is called with
- ARGP_KEY_ERROR, and no further calls are made. */
-
-/* This is not an option at all, but rather a command line argument. If a
- parser receiving this key returns success, the fact is recorded, and the
- ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
- argument, a parser function decrements the NEXT field of the state it's
- passed, the option won't be considered processed; this is to allow you to
- actually modify the argument (perhaps into an option), and have it
- processed again. */
-#define ARGP_KEY_ARG 0
-/* There are remaining arguments not parsed by any parser, which may be found
- starting at (STATE->argv + STATE->next). If success is returned, but
- STATE->next left untouched, it's assumed that all arguments were consume,
- otherwise, the parser should adjust STATE->next to reflect any arguments
- consumed. */
-#define ARGP_KEY_ARGS 0x1000006
-/* There are no more command line arguments at all. */
-#define ARGP_KEY_END 0x1000001
-/* Because it's common to want to do some special processing if there aren't
- any non-option args, user parsers are called with this key if they didn't
- successfully process any non-option arguments. Called just before
- ARGP_KEY_END (where more general validity checks on previously parsed
- arguments can take place). */
-#define ARGP_KEY_NO_ARGS 0x1000002
-/* Passed in before any parsing is done. Afterwards, the values of each
- element of the CHILD_INPUT field, if any, in the state structure is
- copied to each child's state to be the initial value of the INPUT field. */
-#define ARGP_KEY_INIT 0x1000003
-/* Use after all other keys, including SUCCESS & END. */
-#define ARGP_KEY_FINI 0x1000007
-/* Passed in when parsing has successfully been completed (even if there are
- still arguments remaining). */
-#define ARGP_KEY_SUCCESS 0x1000004
-/* Passed in if an error occurs. */
-#define ARGP_KEY_ERROR 0x1000005
-
-/* An argp structure contains a set of options declarations, a function to
- deal with parsing one, documentation string, a possible vector of child
- argp's, and perhaps a function to filter help output. When actually
- parsing options, getopt is called with the union of all the argp
- structures chained together through their CHILD pointers, with conflicts
- being resolved in favor of the first occurrence in the chain. */
-struct argp
-{
- /* An array of argp_option structures, terminated by an entry with both
- NAME and KEY having a value of 0. */
- const struct argp_option *options;
-
- /* What to do with an option from this structure. KEY is the key
- associated with the option, and ARG is any associated argument (NULL if
- none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
- returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
- parsing is stopped immediately, and that value is returned from
- argp_parse(). For special (non-user-supplied) values of KEY, see the
- ARGP_KEY_ definitions below. */
- argp_parser_t parser;
-
- /* A string describing what other arguments are wanted by this program. It
- is only used by argp_usage to print the "Usage:" message. If it
- contains newlines, the strings separated by them are considered
- alternative usage patterns, and printed on separate lines (lines after
- the first are prefix by " or: " instead of "Usage:"). */
- const char *args_doc;
-
- /* If non-NULL, a string containing extra text to be printed before and
- after the options in a long help message (separated by a vertical tab
- '\v' character).
- Write the initial value as N_("BEFORE-TEXT") "\v" N_("AFTER-TEXT") if
- you want xgettext to collect the two pieces of text into a POT file. */
- const char *doc;
-
- /* A vector of argp_children structures, terminated by a member with a 0
- argp field, pointing to child argps should be parsed with this one. Any
- conflicts are resolved in favor of this argp, or early argps in the
- CHILDREN list. This field is useful if you use libraries that supply
- their own argp structure, which you want to use in conjunction with your
- own. */
- const struct argp_child *children;
-
- /* If non-zero, this should be a function to filter the output of help
- messages. KEY is either a key from an option, in which case TEXT is
- that option's help text, or a special key from the ARGP_KEY_HELP_
- defines, below, describing which other help text TEXT is. The function
- should return either TEXT, if it should be used as-is, a replacement
- string, which should be malloced, and will be freed by argp, or NULL,
- meaning "print nothing". The value for TEXT is *after* any translation
- has been done, so if any of the replacement text also needs translation,
- that should be done by the filter function. INPUT is either the input
- supplied to argp_parse, or NULL, if argp_help was called directly. */
- char *(*help_filter) (int __key, const char *__text, void *__input);
-
- /* If non-zero the strings used in the argp library are translated using
- the domain described by this string. Otherwise the currently installed
- default domain is used. */
- const char *argp_domain;
-};
-
-/* Possible KEY arguments to a help filter function. */
-#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceding options. */
-#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
-#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
-#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
- TEXT is NULL for this key. */
-/* Explanatory note emitted when duplicate option arguments have been
- suppressed. */
-#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
-#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
-
-/* When an argp has a non-zero CHILDREN field, it should point to a vector of
- argp_child structures, each of which describes a subsidiary argp. */
-struct argp_child
-{
- /* The child parser. */
- const struct argp *argp;
-
- /* Flags for this child. */
- int flags;
-
- /* If non-zero, an optional header to be printed in help output before the
- child options. As a side-effect, a non-zero value forces the child
- options to be grouped together; to achieve this effect without actually
- printing a header string, use a value of "". */
- const char *header;
-
- /* Where to group the child options relative to the other ("consolidated")
- options in the parent argp; the values are the same as the GROUP field
- in argp_option structs, but all child-groupings follow parent options at
- a particular group level. If both this field and HEADER are zero, then
- they aren't grouped at all, but rather merged with the parent options
- (merging the child's grouping levels with the parents). */
- int group;
-};
-
-/* Parsing state. This is provided to parsing functions called by argp,
- which may examine and, as noted, modify fields. */
-struct argp_state
-{
- /* The top level ARGP being parsed. */
- const struct argp *root_argp;
-
- /* The argument vector being parsed. May be modified. */
- int argc;
- char **argv;
-
- /* The index in ARGV of the next arg that to be parsed. May be modified. */
- int next;
-
- /* The flags supplied to argp_parse. May be modified. */
- unsigned flags;
-
- /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
- number of the current arg, starting at zero, and incremented after each
- such call returns. At all other times, this is the number of such
- arguments that have been processed. */
- unsigned arg_num;
-
- /* If non-zero, the index in ARGV of the first argument following a special
- '--' argument (which prevents anything following being interpreted as an
- option). Only set once argument parsing has proceeded past this point. */
- int quoted;
-
- /* An arbitrary pointer passed in from the user. */
- void *input;
- /* Values to pass to child parsers. This vector will be the same length as
- the number of children for the current parser. */
- void **child_inputs;
-
- /* For the parser's use. Initialized to 0. */
- void *hook;
-
- /* The name used when printing messages. This is initialized to ARGV[0],
- or PROGRAM_INVOCATION_NAME if that is unavailable. */
- char *name;
-
- /* Streams used when argp prints something. */
- FILE *err_stream; /* For errors; initialized to stderr. */
- FILE *out_stream; /* For information; initialized to stdout. */
-
- void *pstate; /* Private, for use by argp. */
-};
-
-/* Flags for argp_parse (note that the defaults are those that are
- convenient for program command line parsing): */
-
-/* Don't ignore the first element of ARGV. Normally (and always unless
- ARGP_NO_ERRS is set) the first element of the argument vector is
- skipped for option parsing purposes, as it corresponds to the program name
- in a command line. */
-#define ARGP_PARSE_ARGV0 0x01
-
-/* Don't print error messages for unknown options to stderr; unless this flag
- is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
- name in the error messages. This flag implies ARGP_NO_EXIT (on the
- assumption that silent exiting upon errors is bad behaviour). */
-#define ARGP_NO_ERRS 0x02
-
-/* Don't parse any non-option args. Normally non-option args are parsed by
- calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
- as the value. Since it's impossible to know which parse function wants to
- handle it, each one is called in turn, until one returns 0 or an error
- other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
- argp_parse returns prematurely (but with a return value of 0). If all
- args have been parsed without error, all parsing functions are called one
- last time with a key of ARGP_KEY_END. This flag needn't normally be set,
- as the normal behavior is to stop parsing as soon as some argument can't
- be handled. */
-#define ARGP_NO_ARGS 0x04
-
-/* Parse options and arguments in the same order they occur on the command
- line -- normally they're rearranged so that all options come first. */
-#define ARGP_IN_ORDER 0x08
-
-/* Don't provide the standard long option --help, which causes usage and
- option help information to be output to stdout, and exit (0) called. */
-#define ARGP_NO_HELP 0x10
-
-/* Don't exit on errors (they may still result in error messages). */
-#define ARGP_NO_EXIT 0x20
-
-/* Use the gnu getopt "long-only" rules for parsing arguments. */
-#define ARGP_LONG_ONLY 0x40
-
-/* Turns off any message-printing/exiting options. */
-#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
-
-/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
- FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
- index in ARGV of the first unparsed option is returned in it. If an
- unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
- routine returned a non-zero value, it is returned; otherwise 0 is
- returned. This function may also call exit unless the ARGP_NO_HELP flag
- is set. INPUT is a pointer to a value to be passed in to the parser. */
-extern error_t argp_parse (const struct argp *__restrict __argp,
- int /*argc*/, char **__restrict /*argv*/,
- unsigned __flags, int *__restrict __arg_index,
- void *__restrict __input);
-extern error_t __argp_parse (const struct argp *__restrict __argp,
- int /*argc*/, char **__restrict /*argv*/,
- unsigned __flags, int *__restrict __arg_index,
- void *__restrict __input);
-
-/* Global variables. */
-
-/* GNULIB makes sure both program_invocation_name and
- program_invocation_short_name are available */
-#ifdef GNULIB_PROGRAM_INVOCATION_NAME
-extern char *program_invocation_name;
-# undef HAVE_DECL_PROGRAM_INVOCATION_NAME
-# define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
-#endif
-
-#ifdef GNULIB_PROGRAM_INVOCATION_SHORT_NAME
-extern char *program_invocation_short_name;
-# undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
-# define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
-#endif
-
-/* If defined or set by the user program to a non-zero value, then a default
- option --version is added (unless the ARGP_NO_HELP flag is used), which
- will print this string followed by a newline and exit (unless the
- ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
-extern const char *argp_program_version;
-
-/* If defined or set by the user program to a non-zero value, then a default
- option --version is added (unless the ARGP_NO_HELP flag is used), which
- calls this function with a stream to print the version to and a pointer to
- the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
- used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
-extern void (*argp_program_version_hook) (FILE *__restrict __stream,
- struct argp_state *__restrict
- __state);
-
-/* If defined or set by the user program, it should point to string that is
- the bug-reporting address for the program. It will be printed by
- argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
- standard help messages), embedded in a sentence that says something like
- "Report bugs to ADDR." */
-extern const char *argp_program_bug_address;
-
-/* The exit status that argp will use when exiting due to a parsing error.
- If not defined or set by the user program, this defaults to EX_USAGE from
- <sysexits.h>. */
-extern error_t argp_err_exit_status;
-
-/* Flags for argp_help. */
-#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
-#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
-#define ARGP_HELP_SEE 0x04 /* a "Try ... for more help" message. */
-#define ARGP_HELP_LONG 0x08 /* a long help message. */
-#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
-#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
-#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
-#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
-#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
- reflect ARGP_LONG_ONLY mode. */
-
-/* These ARGP_HELP flags are only understood by argp_state_help. */
-#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
-#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
-
-/* The standard thing to do after a program command line parsing error, if an
- error message has already been printed. */
-#define ARGP_HELP_STD_ERR \
- (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
-/* The standard thing to do after a program command line parsing error, if no
- more specific error message has been printed. */
-#define ARGP_HELP_STD_USAGE \
- (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
-/* The standard thing to do in response to a --help option. */
-#define ARGP_HELP_STD_HELP \
- (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
- | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
-
-/* Output a usage message for ARGP to STREAM. FLAGS are from the set
- ARGP_HELP_*. */
-extern void argp_help (const struct argp *__restrict __argp,
- FILE *__restrict __stream,
- unsigned __flags, char *__restrict __name);
-extern void __argp_help (const struct argp *__restrict __argp,
- FILE *__restrict __stream, unsigned __flags,
- char *__name);
-
-/* The following routines are intended to be called from within an argp
- parsing routine (thus taking an argp_state structure as the first
- argument). They may or may not print an error message and exit, depending
- on the flags in STATE -- in any case, the caller should be prepared for
- them *not* to exit, and should return an appropriate error after calling
- them. [argp_usage & argp_error should probably be called argp_state_...,
- but they're used often enough that they should be short] */
-
-/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
- from the set ARGP_HELP_*. */
-extern void argp_state_help (const struct argp_state *__restrict __state,
- FILE *__restrict __stream,
- unsigned int __flags);
-extern void __argp_state_help (const struct argp_state *__restrict __state,
- FILE *__restrict __stream,
- unsigned int __flags);
-
-#if _LIBC
-/* Possibly output the standard usage message for ARGP to stderr and exit. */
-extern void argp_usage (const struct argp_state *__state);
-extern void __argp_usage (const struct argp_state *__state);
-#endif
-
-/* If appropriate, print the printf string FMT and following args, preceded
- by the program name and ':', to stderr, and followed by a "Try ... --help"
- message, then exit (1). */
-extern void argp_error (const struct argp_state *__restrict __state,
- const char *__restrict __fmt, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
-extern void __argp_error (const struct argp_state *__restrict __state,
- const char *__restrict __fmt, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
-
-/* Similar to the standard gnu error-reporting function error(), but will
- respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
- to STATE->err_stream. This is useful for argument parsing code that is
- shared between program startup (when exiting is desired) and runtime
- option parsing (when typically an error code is returned instead). The
- difference between this function and argp_error is that the latter is for
- *parsing errors*, and the former is for other problems that occur during
- parsing but don't reflect a (syntactic) problem with the input. */
-extern void argp_failure (const struct argp_state *__restrict __state,
- int __status, int __errnum,
- const char *__restrict __fmt, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5));
-extern void __argp_failure (const struct argp_state *__restrict __state,
- int __status, int __errnum,
- const char *__restrict __fmt, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 4, 5));
-
-#if _LIBC
-/* Returns true if the option OPT is a valid short option. */
-extern int _option_is_short (const struct argp_option *__opt) __THROW;
-extern int __option_is_short (const struct argp_option *__opt) __THROW;
-
-/* Returns true if the option OPT is in fact the last (unused) entry in an
- options array. */
-extern int _option_is_end (const struct argp_option *__opt) __THROW;
-extern int __option_is_end (const struct argp_option *__opt) __THROW;
-#endif
-
-/* Return the input field for ARGP in the parser corresponding to STATE; used
- by the help routines. */
-extern void *_argp_input (const struct argp *__restrict __argp,
- const struct argp_state *__restrict __state)
- __THROW;
-extern void *__argp_input (const struct argp *__restrict __argp,
- const struct argp_state *__restrict __state)
- __THROW;
-
-#if !_LIBC || defined __USE_EXTERN_INLINES
-
-# if !_LIBC
-# define __argp_usage argp_usage
-# define __argp_state_help argp_state_help
-# define __option_is_short _option_is_short
-# define __option_is_end _option_is_end
-_GL_INLINE_HEADER_BEGIN
-# ifndef ARGP_EI
-# define ARGP_EI _GL_INLINE
-# endif
-# endif
-
-# ifndef ARGP_EI
-# ifdef __GNUC__
- /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
- inline semantics, unless -fgnu89-inline is used. It defines a macro
- __GNUC_STDC_INLINE__ to indicate this situation or a macro
- __GNUC_GNU_INLINE__ to indicate the opposite situation.
- GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
- semantics but warns, unless -fgnu89-inline is used:
- warning: C99 inline functions are not supported; using GNU89
- warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
- It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. */
-# if defined __GNUC_STDC_INLINE__
-# define ARGP_EI __inline__
-# elif defined __GNUC_GNU_INLINE__
-# define ARGP_EI extern __inline__ __attribute__ ((__gnu_inline__))
-# else
-# define ARGP_EI extern __inline__
-# endif
-# else
- /* With other compilers, assume the ISO C99 meaning of 'inline', if
- the compiler supports 'inline' at all. */
-# define ARGP_EI inline
-# endif
-# endif
-
-ARGP_EI void
-__argp_usage (const struct argp_state *__state)
-{
- __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
-}
-
-ARGP_EI int
-__NTH (__option_is_short (const struct argp_option *__opt))
-{
- if (__opt->flags & OPTION_DOC)
- return 0;
- else
- {
- int __key = __opt->key;
- return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
- }
-}
-
-ARGP_EI int
-__NTH (__option_is_end (const struct argp_option *__opt))
-{
- return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
-}
-
-# if !_LIBC
-# undef __argp_usage
-# undef __argp_state_help
-# undef __option_is_short
-# undef __option_is_end
-_GL_INLINE_HEADER_END
-# endif
-#endif /* Use extern inlines. */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* argp.h */
diff --git a/gl/arpa_inet.in.h b/gl/arpa_inet.in.h
index ba89e9776e..532fbaa500 100644
--- a/gl/arpa_inet.in.h
+++ b/gl/arpa_inet.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2005-2006, 2008-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
diff --git a/gl/asnprintf.c b/gl/asnprintf.c
index 76e228d860..b8a4d10582 100644
--- a/gl/asnprintf.c
+++ b/gl/asnprintf.c
@@ -2,16 +2,16 @@
Copyright (C) 1999, 2002, 2006, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/asprintf.c b/gl/asprintf.c
index 713dae132f..a95d2c2fda 100644
--- a/gl/asprintf.c
+++ b/gl/asprintf.c
@@ -3,16 +3,16 @@
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/base64.c b/gl/base64.c
index 8da969c0f6..f9ea4e45c4 100644
--- a/gl/base64.c
+++ b/gl/base64.c
@@ -2,16 +2,16 @@
Copyright (C) 1999-2001, 2004-2006, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Simon Josefsson. Partially adapted from GNU MailUtils
diff --git a/gl/base64.h b/gl/base64.h
index 343150cb53..e6550a75c7 100644
--- a/gl/base64.h
+++ b/gl/base64.h
@@ -3,16 +3,16 @@
Written by Simon Josefsson.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef BASE64_H
diff --git a/gl/basename-lgpl.c b/gl/basename-lgpl.c
deleted file mode 100644
index 9307e83142..0000000000
--- a/gl/basename-lgpl.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* basename.c -- return the last element in a file name
-
- Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "dirname.h"
-
-#include <string.h>
-
-/* Return the address of the last file name component of NAME. If
- NAME has no relative file name components because it is a file
- system root, return the empty string. */
-
-char *
-last_component (char const *name)
-{
- char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
- char const *p;
- bool saw_slash = false;
-
- while (ISSLASH (*base))
- base++;
-
- for (p = base; *p; p++)
- {
- if (ISSLASH (*p))
- saw_slash = true;
- else if (saw_slash)
- {
- base = p;
- saw_slash = false;
- }
- }
-
- return (char *) base;
-}
-
-/* Return the length of the basename NAME. Typically NAME is the
- value returned by base_name or last_component. Act like strlen
- (NAME), except omit all trailing slashes. */
-
-size_t
-base_len (char const *name)
-{
- size_t len;
- size_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
-
- for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--)
- continue;
-
- if (DOUBLE_SLASH_IS_DISTINCT_ROOT && len == 1
- && ISSLASH (name[0]) && ISSLASH (name[1]) && ! name[2])
- return 2;
-
- if (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE && prefix_len
- && len == prefix_len && ISSLASH (name[prefix_len]))
- return prefix_len + 1;
-
- return len;
-}
diff --git a/gl/bind.c b/gl/bind.c
index e6edb8551f..9dd60b57ba 100644
--- a/gl/bind.c
+++ b/gl/bind.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/byteswap.in.h b/gl/byteswap.in.h
index a323ca3570..10ee8de7f4 100644
--- a/gl/byteswap.in.h
+++ b/gl/byteswap.in.h
@@ -3,16 +3,16 @@
Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _GL_BYTESWAP_H
diff --git a/gl/c-ctype.c b/gl/c-ctype.c
index 752d2e32ae..567c9dbffb 100644
--- a/gl/c-ctype.c
+++ b/gl/c-ctype.c
@@ -3,16 +3,16 @@
Copyright 2000-2003, 2006, 2009-2013 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
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 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.
+GNU Lesser General Public License for more details.
-You should have received a copy of the GNU General Public License
+You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/c-ctype.h b/gl/c-ctype.h
index ad589b5c20..fa992f6405 100644
--- a/gl/c-ctype.h
+++ b/gl/c-ctype.h
@@ -8,16 +8,16 @@
Copyright (C) 2000-2003, 2006, 2008-2013 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
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 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.
+GNU Lesser General Public License for more details.
-You should have received a copy of the GNU General Public License
+You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef C_CTYPE_H
diff --git a/gl/close.c b/gl/close.c
index f620e54bba..d5845849f5 100644
--- a/gl/close.c
+++ b/gl/close.c
@@ -2,16 +2,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/closedir.c b/gl/closedir.c
deleted file mode 100644
index fa8e210633..0000000000
--- a/gl/closedir.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Stop reading the entries of a directory.
- Copyright (C) 2006-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <dirent.h>
-
-#if REPLACE_FCHDIR
-# include <unistd.h>
-#endif
-
-#if HAVE_CLOSEDIR
-
-/* Override closedir(), to keep track of the open file descriptors.
- Needed because there is a function dirfd(). */
-
-#else
-
-# include <stdlib.h>
-
-# include "dirent-private.h"
-
-#endif
-
-int
-closedir (DIR *dirp)
-{
-# if REPLACE_FCHDIR
- int fd = dirfd (dirp);
-# endif
- int retval;
-
-#if HAVE_CLOSEDIR
-# undef closedir
-
- retval = closedir (dirp);
-
-#else
-
- if (dirp->current != INVALID_HANDLE_VALUE)
- FindClose (dirp->current);
- free (dirp);
-
- retval = 0;
-
-#endif
-
-#if REPLACE_FCHDIR
- if (retval >= 0)
- _gl_unregister_fd (fd);
-#endif
- return retval;
-}
diff --git a/gl/connect.c b/gl/connect.c
index 04cd5a262e..c333ba92bd 100644
--- a/gl/connect.c
+++ b/gl/connect.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/dirent-private.h b/gl/dirent-private.h
deleted file mode 100644
index 441071ca0a..0000000000
--- a/gl/dirent-private.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Private details of the DIR type.
- Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _DIRENT_PRIVATE_H
-#define _DIRENT_PRIVATE_H 1
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-struct gl_directory
-{
- /* Status, or error code to produce in next readdir() call.
- -2 means the end of the directory is already reached,
- -1 means the entry was already filled by FindFirstFile,
- 0 means the entry needs to be filled using FindNextFile.
- A positive value is an error code. */
- int status;
- /* Handle, reading the directory, at current position. */
- HANDLE current;
- /* Found directory entry. */
- WIN32_FIND_DATA entry;
- /* Argument to pass to FindFirstFile. It consists of the absolutized
- directory name, followed by a directory separator and the wildcards. */
- char dir_name_mask[1];
-};
-
-#endif /* _DIRENT_PRIVATE_H */
diff --git a/gl/dirent.in.h b/gl/dirent.in.h
deleted file mode 100644
index fad3797b8b..0000000000
--- a/gl/dirent.in.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/* A GNU-like <dirent.h>.
- Copyright (C) 2006-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _@GUARD_PREFIX@_DIRENT_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-/* The include_next requires a split double-inclusion guard. */
-#if @HAVE_DIRENT_H@
-# @INCLUDE_NEXT@ @NEXT_DIRENT_H@
-#endif
-
-#ifndef _@GUARD_PREFIX@_DIRENT_H
-#define _@GUARD_PREFIX@_DIRENT_H
-
-/* Get ino_t. Needed on some systems, including glibc 2.8. */
-#include <sys/types.h>
-
-#if !@HAVE_DIRENT_H@
-/* Define types DIR and 'struct dirent'. */
-# if !GNULIB_defined_struct_dirent
-struct dirent
-{
- char d_type;
- char d_name[1];
-};
-/* Possible values for 'd_type'. */
-# define DT_UNKNOWN 0
-# define DT_FIFO 1 /* FIFO */
-# define DT_CHR 2 /* character device */
-# define DT_DIR 4 /* directory */
-# define DT_BLK 6 /* block device */
-# define DT_REG 8 /* regular file */
-# define DT_LNK 10 /* symbolic link */
-# define DT_SOCK 12 /* socket */
-# define DT_WHT 14 /* whiteout */
-typedef struct gl_directory DIR;
-# define GNULIB_defined_struct_dirent 1
-# endif
-#endif
-
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The attribute __pure__ was added in gcc 2.96. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
-#endif
-
-/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
-
-/* The definition of _GL_ARG_NONNULL is copied here. */
-
-/* The definition of _GL_WARN_ON_USE is copied here. */
-
-
-/* Declare overridden functions. */
-
-#if @GNULIB_OPENDIR@
-# if @REPLACE_OPENDIR@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef opendir
-# define opendir rpl_opendir
-# endif
-_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
-# else
-# if !@HAVE_OPENDIR@
-_GL_FUNCDECL_SYS (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
-# endif
-_GL_CXXALIAS_SYS (opendir, DIR *, (const char *dir_name));
-# endif
-_GL_CXXALIASWARN (opendir);
-#elif defined GNULIB_POSIXCHECK
-# undef opendir
-# if HAVE_RAW_DECL_OPENDIR
-_GL_WARN_ON_USE (opendir, "opendir is not portable - "
- "use gnulib module opendir for portability");
-# endif
-#endif
-
-#if @GNULIB_READDIR@
-# if !@HAVE_READDIR@
-_GL_FUNCDECL_SYS (readdir, struct dirent *, (DIR *dirp) _GL_ARG_NONNULL ((1)));
-# endif
-_GL_CXXALIAS_SYS (readdir, struct dirent *, (DIR *dirp));
-_GL_CXXALIASWARN (readdir);
-#elif defined GNULIB_POSIXCHECK
-# undef readdir
-# if HAVE_RAW_DECL_READDIR
-_GL_WARN_ON_USE (readdir, "readdir is not portable - "
- "use gnulib module readdir for portability");
-# endif
-#endif
-
-#if @GNULIB_REWINDDIR@
-# if !@HAVE_REWINDDIR@
-_GL_FUNCDECL_SYS (rewinddir, void, (DIR *dirp) _GL_ARG_NONNULL ((1)));
-# endif
-_GL_CXXALIAS_SYS (rewinddir, void, (DIR *dirp));
-_GL_CXXALIASWARN (rewinddir);
-#elif defined GNULIB_POSIXCHECK
-# undef rewinddir
-# if HAVE_RAW_DECL_REWINDDIR
-_GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
- "use gnulib module rewinddir for portability");
-# endif
-#endif
-
-#if @GNULIB_CLOSEDIR@
-# if @REPLACE_CLOSEDIR@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef closedir
-# define closedir rpl_closedir
-# endif
-_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
-# else
-# if !@HAVE_CLOSEDIR@
-_GL_FUNCDECL_SYS (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
-# endif
-_GL_CXXALIAS_SYS (closedir, int, (DIR *dirp));
-# endif
-_GL_CXXALIASWARN (closedir);
-#elif defined GNULIB_POSIXCHECK
-# undef closedir
-# if HAVE_RAW_DECL_CLOSEDIR
-_GL_WARN_ON_USE (closedir, "closedir is not portable - "
- "use gnulib module closedir for portability");
-# endif
-#endif
-
-#if @GNULIB_DIRFD@
-/* Return the file descriptor associated with the given directory stream,
- or -1 if none exists. */
-# if @REPLACE_DIRFD@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef dirfd
-# define dirfd rpl_dirfd
-# endif
-_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
-# else
-# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
- /* dirfd is defined as a macro and not as a function.
- Turn it into a function and get rid of the macro. */
-static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
-# undef dirfd
-# endif
-# if !(@HAVE_DECL_DIRFD@ || defined dirfd)
-_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
-# endif
-_GL_CXXALIAS_SYS (dirfd, int, (DIR *));
-# endif
-_GL_CXXALIASWARN (dirfd);
-#elif defined GNULIB_POSIXCHECK
-# undef dirfd
-# if HAVE_RAW_DECL_DIRFD
-_GL_WARN_ON_USE (dirfd, "dirfd is unportable - "
- "use gnulib module dirfd for portability");
-# endif
-#endif
-
-#if @GNULIB_FDOPENDIR@
-/* Open a directory stream visiting the given directory file
- descriptor. Return NULL and set errno if fd is not visiting a
- directory. On success, this function consumes fd (it will be
- implicitly closed either by this function or by a subsequent
- closedir). */
-# if @REPLACE_FDOPENDIR@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fdopendir
-# define fdopendir rpl_fdopendir
-# endif
-_GL_FUNCDECL_RPL (fdopendir, DIR *, (int fd));
-_GL_CXXALIAS_RPL (fdopendir, DIR *, (int fd));
-# else
-# if !@HAVE_FDOPENDIR@ || !@HAVE_DECL_FDOPENDIR@
-_GL_FUNCDECL_SYS (fdopendir, DIR *, (int fd));
-# endif
-_GL_CXXALIAS_SYS (fdopendir, DIR *, (int fd));
-# endif
-_GL_CXXALIASWARN (fdopendir);
-#elif defined GNULIB_POSIXCHECK
-# undef fdopendir
-# if HAVE_RAW_DECL_FDOPENDIR
-_GL_WARN_ON_USE (fdopendir, "fdopendir is unportable - "
- "use gnulib module fdopendir for portability");
-# endif
-#endif
-
-#if @GNULIB_SCANDIR@
-/* Scan the directory DIR, calling FILTER on each directory entry.
- Entries for which FILTER returns nonzero are individually malloc'd,
- sorted using qsort with CMP, and collected in a malloc'd array in
- *NAMELIST. Returns the number of entries selected, or -1 on error. */
-# if !@HAVE_SCANDIR@
-_GL_FUNCDECL_SYS (scandir, int,
- (const char *dir, struct dirent ***namelist,
- int (*filter) (const struct dirent *),
- int (*cmp) (const struct dirent **, const struct dirent **))
- _GL_ARG_NONNULL ((1, 2, 4)));
-# endif
-/* Need to cast, because on glibc systems, the fourth parameter is
- int (*cmp) (const void *, const void *). */
-_GL_CXXALIAS_SYS_CAST (scandir, int,
- (const char *dir, struct dirent ***namelist,
- int (*filter) (const struct dirent *),
- int (*cmp) (const struct dirent **, const struct dirent **)));
-_GL_CXXALIASWARN (scandir);
-#elif defined GNULIB_POSIXCHECK
-# undef scandir
-# if HAVE_RAW_DECL_SCANDIR
-_GL_WARN_ON_USE (scandir, "scandir is unportable - "
- "use gnulib module scandir for portability");
-# endif
-#endif
-
-#if @GNULIB_ALPHASORT@
-/* Compare two 'struct dirent' entries alphabetically. */
-# if !@HAVE_ALPHASORT@
-_GL_FUNCDECL_SYS (alphasort, int,
- (const struct dirent **, const struct dirent **)
- _GL_ATTRIBUTE_PURE
- _GL_ARG_NONNULL ((1, 2)));
-# endif
-/* Need to cast, because on glibc systems, the parameters are
- (const void *, const void *). */
-_GL_CXXALIAS_SYS_CAST (alphasort, int,
- (const struct dirent **, const struct dirent **));
-_GL_CXXALIASWARN (alphasort);
-#elif defined GNULIB_POSIXCHECK
-# undef alphasort
-# if HAVE_RAW_DECL_ALPHASORT
-_GL_WARN_ON_USE (alphasort, "alphasort is unportable - "
- "use gnulib module alphasort for portability");
-# endif
-#endif
-
-
-#endif /* _@GUARD_PREFIX@_DIRENT_H */
-#endif /* _@GUARD_PREFIX@_DIRENT_H */
diff --git a/gl/dirname-lgpl.c b/gl/dirname-lgpl.c
deleted file mode 100644
index 82f66301f2..0000000000
--- a/gl/dirname-lgpl.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* dirname.c -- return all but the last element in a file name
-
- Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "dirname.h"
-
-#include <stdlib.h>
-#include <string.h>
-
-/* Return the length of the prefix of FILE that will be used by
- dir_name. If FILE is in the working directory, this returns zero
- even though 'dir_name (FILE)' will return ".". Works properly even
- if there are trailing slashes (by effectively ignoring them). */
-
-size_t
-dir_len (char const *file)
-{
- size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
- size_t length;
-
- /* Advance prefix_length beyond important leading slashes. */
- prefix_length += (prefix_length != 0
- ? (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
- && ISSLASH (file[prefix_length]))
- : (ISSLASH (file[0])
- ? ((DOUBLE_SLASH_IS_DISTINCT_ROOT
- && ISSLASH (file[1]) && ! ISSLASH (file[2])
- ? 2 : 1))
- : 0));
-
- /* Strip the basename and any redundant slashes before it. */
- for (length = last_component (file) - file;
- prefix_length < length; length--)
- if (! ISSLASH (file[length - 1]))
- break;
- return length;
-}
-
-
-/* In general, we can't use the builtin 'dirname' function if available,
- since it has different meanings in different environments.
- In some environments the builtin 'dirname' modifies its argument.
-
- Return the leading directories part of FILE, allocated with malloc.
- Works properly even if there are trailing slashes (by effectively
- ignoring them). Return NULL on failure.
-
- If lstat (FILE) would succeed, then { chdir (dir_name (FILE));
- lstat (base_name (FILE)); } will access the same file. Likewise,
- if the sequence { chdir (dir_name (FILE));
- rename (base_name (FILE), "foo"); } succeeds, you have renamed FILE
- to "foo" in the same directory FILE was in. */
-
-char *
-mdir_name (char const *file)
-{
- size_t length = dir_len (file);
- bool append_dot = (length == 0
- || (FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
- && length == FILE_SYSTEM_PREFIX_LEN (file)
- && file[2] != '\0' && ! ISSLASH (file[2])));
- char *dir = malloc (length + append_dot + 1);
- if (!dir)
- return NULL;
- memcpy (dir, file, length);
- if (append_dot)
- dir[length++] = '.';
- dir[length] = '\0';
- return dir;
-}
diff --git a/gl/dirname.h b/gl/dirname.h
deleted file mode 100644
index 4ad0312008..0000000000
--- a/gl/dirname.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Take file names apart into directory and base names.
-
- Copyright (C) 1998, 2001, 2003-2006, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef DIRNAME_H_
-# define DIRNAME_H_ 1
-
-# include <stdbool.h>
-# include <stddef.h>
-# include "dosname.h"
-
-# ifndef DIRECTORY_SEPARATOR
-# define DIRECTORY_SEPARATOR '/'
-# endif
-
-# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
-# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
-# endif
-
-# if GNULIB_DIRNAME
-char *base_name (char const *file);
-char *dir_name (char const *file);
-# endif
-
-char *mdir_name (char const *file);
-size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
-size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
-char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
-
-bool strip_trailing_slashes (char *file);
-
-#endif /* not DIRNAME_H_ */
diff --git a/gl/dup2.c b/gl/dup2.c
index 9219eb3823..db12f630aa 100644
--- a/gl/dup2.c
+++ b/gl/dup2.c
@@ -3,16 +3,16 @@
Copyright (C) 1999, 2004-2007, 2009-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* written by Paul Eggert */
diff --git a/gl/errno.in.h b/gl/errno.in.h
index 49b35464b9..0eead95d01 100644
--- a/gl/errno.in.h
+++ b/gl/errno.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_ERRNO_H
diff --git a/gl/error.c b/gl/error.c
deleted file mode 100644
index 865b29340b..0000000000
--- a/gl/error.c
+++ /dev/null
@@ -1,401 +0,0 @@
-/* Error handler for noninteractive utilities
- Copyright (C) 1990-1998, 2000-2007, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-
-#if !_LIBC
-# include <config.h>
-#endif
-
-#include "error.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#if !_LIBC && ENABLE_NLS
-# include "gettext.h"
-# define _(msgid) gettext (msgid)
-#endif
-
-#ifdef _LIBC
-# include <libintl.h>
-# include <stdbool.h>
-# include <stdint.h>
-# include <wchar.h>
-# define mbsrtowcs __mbsrtowcs
-#endif
-
-#if USE_UNLOCKED_IO
-# include "unlocked-io.h"
-#endif
-
-#ifndef _
-# define _(String) String
-#endif
-
-/* If NULL, error will flush stdout, then print on stderr the program
- name, a colon and a space. Otherwise, error will call this
- function without parameters instead. */
-void (*error_print_progname) (void);
-
-/* This variable is incremented each time 'error' is called. */
-unsigned int error_message_count;
-
-#ifdef _LIBC
-/* In the GNU C library, there is a predefined variable for this. */
-
-# define program_name program_invocation_name
-# include <errno.h>
-# include <limits.h>
-# include <libio/libioP.h>
-
-/* In GNU libc we want do not want to use the common name 'error' directly.
- Instead make it a weak alias. */
-extern void __error (int status, int errnum, const char *message, ...)
- __attribute__ ((__format__ (__printf__, 3, 4)));
-extern void __error_at_line (int status, int errnum, const char *file_name,
- unsigned int line_number, const char *message,
- ...)
- __attribute__ ((__format__ (__printf__, 5, 6)));;
-# define error __error
-# define error_at_line __error_at_line
-
-# include <libio/iolibio.h>
-# define fflush(s) INTUSE(_IO_fflush) (s)
-# undef putc
-# define putc(c, fp) INTUSE(_IO_putc) (c, fp)
-
-# include <bits/libc-lock.h>
-
-#else /* not _LIBC */
-
-# include <fcntl.h>
-# include <unistd.h>
-
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Get declarations of the native Windows API functions. */
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-/* Get _get_osfhandle. */
-# include "msvc-nothrow.h"
-# endif
-
-/* The gnulib override of fcntl is not needed in this file. */
-# undef fcntl
-
-# if !HAVE_DECL_STRERROR_R
-# ifndef HAVE_DECL_STRERROR_R
-"this configure-time declaration test was not run"
-# endif
-# if STRERROR_R_CHAR_P
-char *strerror_r ();
-# else
-int strerror_r ();
-# endif
-# endif
-
-/* The calling program should define program_name and set it to the
- name of the executing program. */
-extern char *program_name;
-
-# if HAVE_STRERROR_R || defined strerror_r
-# define __strerror_r strerror_r
-# endif /* HAVE_STRERROR_R || defined strerror_r */
-#endif /* not _LIBC */
-
-#if !_LIBC
-/* Return non-zero if FD is open. */
-static int
-is_open (int fd)
-{
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- /* On native Windows: The initial state of unassigned standard file
- descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
- There is no fcntl, and the gnulib replacement fcntl does not support
- F_GETFL. */
- return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
-# else
-# ifndef F_GETFL
-# error Please port fcntl to your platform
-# endif
- return 0 <= fcntl (fd, F_GETFL);
-# endif
-}
-#endif
-
-static void
-flush_stdout (void)
-{
-#if !_LIBC
- int stdout_fd;
-
-# if GNULIB_FREOPEN_SAFER
- /* Use of gnulib's freopen-safer module normally ensures that
- fileno (stdout) == 1
- whenever stdout is open. */
- stdout_fd = STDOUT_FILENO;
-# else
- /* POSIX states that fileno (stdout) after fclose is unspecified. But in
- practice it is not a problem, because stdout is statically allocated and
- the fd of a FILE stream is stored as a field in its allocated memory. */
- stdout_fd = fileno (stdout);
-# endif
- /* POSIX states that fflush (stdout) after fclose is unspecified; it
- is safe in glibc, but not on all other platforms. fflush (NULL)
- is always defined, but too draconian. */
- if (0 <= stdout_fd && is_open (stdout_fd))
-#endif
- fflush (stdout);
-}
-
-static void
-print_errno_message (int errnum)
-{
- char const *s;
-
-#if defined HAVE_STRERROR_R || _LIBC
- char errbuf[1024];
-# if STRERROR_R_CHAR_P || _LIBC
- s = __strerror_r (errnum, errbuf, sizeof errbuf);
-# else
- if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
- s = errbuf;
- else
- s = 0;
-# endif
-#else
- s = strerror (errnum);
-#endif
-
-#if !_LIBC
- if (! s)
- s = _("Unknown system error");
-#endif
-
-#if _LIBC
- __fxprintf (NULL, ": %s", s);
-#else
- fprintf (stderr, ": %s", s);
-#endif
-}
-
-static void
-error_tail (int status, int errnum, const char *message, va_list args)
-{
-#if _LIBC
- if (_IO_fwide (stderr, 0) > 0)
- {
-# define ALLOCA_LIMIT 2000
- size_t len = strlen (message) + 1;
- wchar_t *wmessage = NULL;
- mbstate_t st;
- size_t res;
- const char *tmp;
- bool use_malloc = false;
-
- while (1)
- {
- if (__libc_use_alloca (len * sizeof (wchar_t)))
- wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
- else
- {
- if (!use_malloc)
- wmessage = NULL;
-
- wchar_t *p = (wchar_t *) realloc (wmessage,
- len * sizeof (wchar_t));
- if (p == NULL)
- {
- free (wmessage);
- fputws_unlocked (L"out of memory\n", stderr);
- return;
- }
- wmessage = p;
- use_malloc = true;
- }
-
- memset (&st, '\0', sizeof (st));
- tmp = message;
-
- res = mbsrtowcs (wmessage, &tmp, len, &st);
- if (res != len)
- break;
-
- if (__builtin_expect (len >= SIZE_MAX / 2, 0))
- {
- /* This really should not happen if everything is fine. */
- res = (size_t) -1;
- break;
- }
-
- len *= 2;
- }
-
- if (res == (size_t) -1)
- {
- /* The string cannot be converted. */
- if (use_malloc)
- {
- free (wmessage);
- use_malloc = false;
- }
- wmessage = (wchar_t *) L"???";
- }
-
- __vfwprintf (stderr, wmessage, args);
-
- if (use_malloc)
- free (wmessage);
- }
- else
-#endif
- vfprintf (stderr, message, args);
- va_end (args);
-
- ++error_message_count;
- if (errnum)
- print_errno_message (errnum);
-#if _LIBC
- __fxprintf (NULL, "\n");
-#else
- putc ('\n', stderr);
-#endif
- fflush (stderr);
- if (status)
- exit (status);
-}
-
-
-/* Print the program name and error message MESSAGE, which is a printf-style
- format string with optional args.
- If ERRNUM is nonzero, print its corresponding system error message.
- Exit with status STATUS if it is nonzero. */
-void
-error (int status, int errnum, const char *message, ...)
-{
- va_list args;
-
-#if defined _LIBC && defined __libc_ptf_call
- /* We do not want this call to be cut short by a thread
- cancellation. Therefore disable cancellation for now. */
- int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
-#endif
-
- flush_stdout ();
-#ifdef _LIBC
- _IO_flockfile (stderr);
-#endif
- if (error_print_progname)
- (*error_print_progname) ();
- else
- {
-#if _LIBC
- __fxprintf (NULL, "%s: ", program_name);
-#else
- fprintf (stderr, "%s: ", program_name);
-#endif
- }
-
- va_start (args, message);
- error_tail (status, errnum, message, args);
-
-#ifdef _LIBC
- _IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
-# endif
-#endif
-}
-
-/* Sometimes we want to have at most one error per line. This
- variable controls whether this mode is selected or not. */
-int error_one_per_line;
-
-void
-error_at_line (int status, int errnum, const char *file_name,
- unsigned int line_number, const char *message, ...)
-{
- va_list args;
-
- if (error_one_per_line)
- {
- static const char *old_file_name;
- static unsigned int old_line_number;
-
- if (old_line_number == line_number
- && (file_name == old_file_name
- || strcmp (old_file_name, file_name) == 0))
- /* Simply return and print nothing. */
- return;
-
- old_file_name = file_name;
- old_line_number = line_number;
- }
-
-#if defined _LIBC && defined __libc_ptf_call
- /* We do not want this call to be cut short by a thread
- cancellation. Therefore disable cancellation for now. */
- int state = PTHREAD_CANCEL_ENABLE;
- __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state),
- 0);
-#endif
-
- flush_stdout ();
-#ifdef _LIBC
- _IO_flockfile (stderr);
-#endif
- if (error_print_progname)
- (*error_print_progname) ();
- else
- {
-#if _LIBC
- __fxprintf (NULL, "%s:", program_name);
-#else
- fprintf (stderr, "%s:", program_name);
-#endif
- }
-
-#if _LIBC
- __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
- file_name, line_number);
-#else
- fprintf (stderr, file_name != NULL ? "%s:%d: " : " ",
- file_name, line_number);
-#endif
-
- va_start (args, message);
- error_tail (status, errnum, message, args);
-
-#ifdef _LIBC
- _IO_funlockfile (stderr);
-# ifdef __libc_ptf_call
- __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
-# endif
-#endif
-}
-
-#ifdef _LIBC
-/* Make the weak alias. */
-# undef error
-# undef error_at_line
-weak_alias (__error, error)
-weak_alias (__error_at_line, error_at_line)
-#endif
diff --git a/gl/error.h b/gl/error.h
deleted file mode 100644
index afcb0e10c8..0000000000
--- a/gl/error.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Declaration for error-reporting function
- Copyright (C) 1995-1997, 2003, 2006, 2008-2013 Free Software Foundation,
- Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _ERROR_H
-#define _ERROR_H 1
-
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
- The __-protected variants of the attributes 'format' and 'printf' are
- accepted by gcc versions 2.6.4 (effectively 2.7) and later.
- We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
- gnulib and libintl do '#define printf __printf__' when they override
- the 'printf' function. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Print a message with 'fprintf (stderr, FORMAT, ...)';
- if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
- If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
-
-extern void error (int __status, int __errnum, const char *__format, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
-
-extern void error_at_line (int __status, int __errnum, const char *__fname,
- unsigned int __lineno, const char *__format, ...)
- _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 6));
-
-/* If NULL, error will flush stdout, then print on stderr the program
- name, a colon and a space. Otherwise, error will call this
- function without parameters instead. */
-extern void (*error_print_progname) (void);
-
-/* This variable is incremented each time 'error' is called. */
-extern unsigned int error_message_count;
-
-/* Sometimes we want to have at most one error per line. This
- variable controls whether this mode is selected or not. */
-extern int error_one_per_line;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* error.h */
diff --git a/gl/fd-hook.c b/gl/fd-hook.c
index e158a52aa3..b6d7ddaa7d 100644
--- a/gl/fd-hook.c
+++ b/gl/fd-hook.c
@@ -3,16 +3,16 @@
Written by Bruno Haible <bruno@clisp.org>, 2009.
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
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/fd-hook.h b/gl/fd-hook.h
index d15b577114..2a6eb280cf 100644
--- a/gl/fd-hook.h
+++ b/gl/fd-hook.h
@@ -2,16 +2,16 @@
Copyright (C) 2009-2013 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
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/gl/filename.h b/gl/filename.h
deleted file mode 100644
index b82a0ac389..0000000000
--- a/gl/filename.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Basic filename support macros.
- Copyright (C) 2001-2004, 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _FILENAME_H
-#define _FILENAME_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Pathname support.
- ISSLASH(C) tests whether C is a directory separator character.
- IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
- it may be concatenated to a directory pathname.
- IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
- */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
- /* Native Windows, Cygwin, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-# define HAS_DEVICE(P) \
- ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
- && (P)[1] == ':')
-# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
-# define IS_PATH_WITH_DIR(P) \
- (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
-# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
-#else
- /* Unix */
-# define ISSLASH(C) ((C) == '/')
-# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
-# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
-# define FILE_SYSTEM_PREFIX_LEN(P) 0
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _FILENAME_H */
diff --git a/gl/float+.h b/gl/float+.h
index 32fb790bb5..052a2d51e9 100644
--- a/gl/float+.h
+++ b/gl/float+.h
@@ -3,16 +3,16 @@
Written by Bruno Haible <bruno@clisp.org>, 2007.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _FLOATPLUS_H
diff --git a/gl/float.c b/gl/float.c
index 366945fa38..5cac06da74 100644
--- a/gl/float.c
+++ b/gl/float.c
@@ -3,16 +3,16 @@
Written by Bruno Haible <bruno@clisp.org>, 2011.
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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/float.in.h b/gl/float.in.h
index 84e1950f95..fc21a68063 100644
--- a/gl/float.in.h
+++ b/gl/float.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2007-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_FLOAT_H
diff --git a/gl/frexp.c b/gl/frexp.c
deleted file mode 100644
index d847fa38b3..0000000000
--- a/gl/frexp.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Split a double into fraction and mantissa.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Paolo Bonzini <bonzini@gnu.org>, 2003, and
- Bruno Haible <bruno@clisp.org>, 2007. */
-
-#if ! defined USE_LONG_DOUBLE
-# include <config.h>
-#endif
-
-/* Specification. */
-#include <math.h>
-
-#include <float.h>
-#ifdef USE_LONG_DOUBLE
-# include "isnanl-nolibm.h"
-# include "fpucw.h"
-#else
-# include "isnand-nolibm.h"
-#endif
-
-/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
- than 2, or not even a power of 2, some rounding errors can occur, so that
- then the returned mantissa is only guaranteed to be <= 1.0, not < 1.0. */
-
-#ifdef USE_LONG_DOUBLE
-# define FUNC frexpl
-# define DOUBLE long double
-# define ISNAN isnanl
-# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
-# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
-# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
-# define L_(literal) literal##L
-#else
-# define FUNC frexp
-# define DOUBLE double
-# define ISNAN isnand
-# define DECL_ROUNDING
-# define BEGIN_ROUNDING()
-# define END_ROUNDING()
-# define L_(literal) literal
-#endif
-
-DOUBLE
-FUNC (DOUBLE x, int *expptr)
-{
- int sign;
- int exponent;
- DECL_ROUNDING
-
- /* Test for NaN, infinity, and zero. */
- if (ISNAN (x) || x + x == x)
- {
- *expptr = 0;
- return x;
- }
-
- sign = 0;
- if (x < 0)
- {
- x = - x;
- sign = -1;
- }
-
- BEGIN_ROUNDING ();
-
- {
- /* Since the exponent is an 'int', it fits in 64 bits. Therefore the
- loops are executed no more than 64 times. */
- DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
- DOUBLE powh[64]; /* powh[i] = 2^-2^i */
- int i;
-
- exponent = 0;
- if (x >= L_(1.0))
- {
- /* A positive exponent. */
- DOUBLE pow2_i; /* = pow2[i] */
- DOUBLE powh_i; /* = powh[i] */
-
- /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
- x * 2^exponent = argument, x >= 1.0. */
- for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
- ;
- i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
- {
- if (x >= pow2_i)
- {
- exponent += (1 << i);
- x *= powh_i;
- }
- else
- break;
-
- pow2[i] = pow2_i;
- powh[i] = powh_i;
- }
- /* Avoid making x too small, as it could become a denormalized
- number and thus lose precision. */
- while (i > 0 && x < pow2[i - 1])
- {
- i--;
- powh_i = powh[i];
- }
- exponent += (1 << i);
- x *= powh_i;
- /* Here 2^-2^i <= x < 1.0. */
- }
- else
- {
- /* A negative or zero exponent. */
- DOUBLE pow2_i; /* = pow2[i] */
- DOUBLE powh_i; /* = powh[i] */
-
- /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
- x * 2^exponent = argument, x < 1.0. */
- for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
- ;
- i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
- {
- if (x < powh_i)
- {
- exponent -= (1 << i);
- x *= pow2_i;
- }
- else
- break;
-
- pow2[i] = pow2_i;
- powh[i] = powh_i;
- }
- /* Here 2^-2^i <= x < 1.0. */
- }
-
- /* Invariants: x * 2^exponent = argument, and 2^-2^i <= x < 1.0. */
- while (i > 0)
- {
- i--;
- if (x < powh[i])
- {
- exponent -= (1 << i);
- x *= pow2[i];
- }
- }
- /* Here 0.5 <= x < 1.0. */
- }
-
- if (sign < 0)
- x = - x;
-
- END_ROUNDING ();
-
- *expptr = exponent;
- return x;
-}
diff --git a/gl/frexpl.c b/gl/frexpl.c
deleted file mode 100644
index 5ec2780ed4..0000000000
--- a/gl/frexpl.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Split a 'long double' into fraction and mantissa.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-
-/* Specification. */
-# include <math.h>
-
-long double
-frexpl (long double x, int *expptr)
-{
- return frexp (x, expptr);
-}
-
-#else
-
-# define USE_LONG_DOUBLE
-# include "frexp.c"
-
-#endif
diff --git a/gl/fseek.c b/gl/fseek.c
index 4708287c30..58d9e3eddb 100644
--- a/gl/fseek.c
+++ b/gl/fseek.c
@@ -2,16 +2,16 @@
Copyright (C) 2007, 2009-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/fseeko.c b/gl/fseeko.c
index c03be3d0c5..f5f3f86088 100644
--- a/gl/fseeko.c
+++ b/gl/fseeko.c
@@ -2,16 +2,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/fseterr.c b/gl/fseterr.c
deleted file mode 100644
index 0fca65f503..0000000000
--- a/gl/fseterr.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Set the error indicator of a stream.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include "fseterr.h"
-
-#include <errno.h>
-
-#include "stdio-impl.h"
-
-void
-fseterr (FILE *fp)
-{
- /* Most systems provide FILE as a struct and the necessary bitmask in
- <stdio.h>, because they need it for implementing getc() and putc() as
- fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags |= _IO_ERR_SEEN;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
- fp_->_flags |= __SERR;
-#elif defined __EMX__ /* emx+gcc */
- fp->_flags |= _IOERR;
-#elif defined __minix /* Minix */
- fp->_flags |= _IOERR;
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
- fp_->_flag |= _IOERR;
-#elif defined __UCLIBC__ /* uClibc */
- fp->__modeflags |= __FLAG_ERROR;
-#elif defined __QNX__ /* QNX */
- fp->_Mode |= 0x200 /* _MERR */;
-#elif defined __MINT__ /* Atari FreeMiNT */
- fp->__error = 1;
-#elif defined EPLAN9 /* Plan9 */
- if (fp->state != 0 /* CLOSED */)
- fp->state = 5 /* ERR */;
-#elif 0 /* unknown */
- /* Portable fallback, based on an idea by Rich Felker.
- Wow! 6 system calls for something that is just a bit operation!
- Not activated on any system, because there is no way to repair FP when
- the sequence of system calls fails, and library code should not call
- abort(). */
- int saved_errno;
- int fd;
- int fd2;
-
- saved_errno = errno;
- fflush (fp);
- fd = fileno (fp);
- fd2 = dup (fd);
- if (fd2 >= 0)
- {
- close (fd);
- fputc ('\0', fp); /* This should set the error indicator. */
- fflush (fp); /* Or this. */
- if (dup2 (fd2, fd) < 0)
- /* Whee... we botched the stream and now cannot restore it! */
- abort ();
- close (fd2);
- }
- errno = saved_errno;
-#else
- #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
-#endif
-}
diff --git a/gl/fseterr.h b/gl/fseterr.h
deleted file mode 100644
index 630fa8647f..0000000000
--- a/gl/fseterr.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Set the error indicator of a stream.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _FSETERR_H
-#define _FSETERR_H
-
-#include <stdio.h>
-
-/* Set the error indicator of the stream FP.
- The "error indicator" is set when an I/O operation on the stream fails, and
- is cleared (together with the "end-of-file" indicator) by clearerr (FP). */
-
-#if HAVE___FSETERR /* musl libc */
-
-# include <stdio_ext.h>
-# define fseterr(fp) __fseterr (fp)
-
-#else
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-extern void fseterr (FILE *fp);
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-#endif /* _FSETERR_H */
diff --git a/gl/fstat.c b/gl/fstat.c
index dc802f502b..b07db7408e 100644
--- a/gl/fstat.c
+++ b/gl/fstat.c
@@ -2,16 +2,16 @@
Copyright (C) 2011-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* If the user's config.h happens to include <sys/stat.h>, let it include only
diff --git a/gl/ftell.c b/gl/ftell.c
index 4ad13c9f48..cf42ee0d9a 100644
--- a/gl/ftell.c
+++ b/gl/ftell.c
@@ -2,16 +2,16 @@
Copyright (C) 2007-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/ftello.c b/gl/ftello.c
index 3a2a0f2012..c0085de697 100644
--- a/gl/ftello.c
+++ b/gl/ftello.c
@@ -2,16 +2,16 @@
Copyright (C) 2007, 2009-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/gai_strerror.c b/gl/gai_strerror.c
index 1e371d2764..709ffc1867 100644
--- a/gl/gai_strerror.c
+++ b/gl/gai_strerror.c
@@ -4,16 +4,16 @@
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBC
diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c
index 58d2811567..5fbe08f5da 100644
--- a/gl/getaddrinfo.c
+++ b/gl/getaddrinfo.c
@@ -3,16 +3,16 @@
Contributed by Simon Josefsson <simon@josefsson.org>.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
diff --git a/gl/getdelim.c b/gl/getdelim.c
index fdbcde2a21..7fc44964f5 100644
--- a/gl/getdelim.c
+++ b/gl/getdelim.c
@@ -3,16 +3,16 @@
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, or (at
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1, 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Ported from glibc by Simon Josefsson. */
diff --git a/gl/getline.c b/gl/getline.c
index 1aa07b9c77..5decbcc607 100644
--- a/gl/getline.c
+++ b/gl/getline.c
@@ -2,16 +2,16 @@
Copyright (C) 2005-2007, 2009-2013 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, or (at
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1, 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Simon Josefsson. */
diff --git a/gl/getopt.c b/gl/getopt.c
deleted file mode 100644
index ef0f4ceec7..0000000000
--- a/gl/getopt.c
+++ /dev/null
@@ -1,1245 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to drepper@gnu.org
- before changing it!
- Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _LIBC
-# include <config.h>
-#endif
-
-#include "getopt.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifdef _LIBC
-# include <libintl.h>
-#else
-# include "gettext.h"
-# define _(msgid) gettext (msgid)
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-#endif
-
-/* This version of 'getopt' appears to the caller like standard Unix 'getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As 'getopt_long' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Using 'getopt' or setting the environment variable POSIXLY_CORRECT
- disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt_int.h"
-
-/* For communication from 'getopt' to the caller.
- When 'getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when 'ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to 'getopt'.
-
- On entry to 'getopt', zero means this is the first call; initialize.
-
- When 'getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, 'optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Keep a global copy of all internal members of getopt_data. */
-
-static struct _getopt_data getopt_data;
-
-
-#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV
-extern char *getenv ();
-#endif
-
-#ifdef _LIBC
-/* Stored original parameters.
- XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
-extern int __libc_argc;
-extern char **__libc_argv;
-
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-# ifdef USE_NONOPTION_FLAGS
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-# endif
-
-# ifdef USE_NONOPTION_FLAGS
-# define SWAP_FLAGS(ch1, ch2) \
- if (d->__nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-# else
-# define SWAP_FLAGS(ch1, ch2)
-# endif
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- 'first_nonopt' and 'last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-static void
-exchange (char **argv, struct _getopt_data *d)
-{
- int bottom = d->__first_nonopt;
- int middle = d->__last_nonopt;
- int top = d->optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
- /* First make sure the handling of the '__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- d->__nonoption_flags_max_len),
- '\0', top + 1 - d->__nonoption_flags_max_len);
- d->__nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- d->__first_nonopt += (d->optind - d->__last_nonopt);
- d->__last_nonopt = d->optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-static const char *
-_getopt_initialize (int argc _GL_UNUSED,
- char **argv _GL_UNUSED, const char *optstring,
- struct _getopt_data *d, int posixly_correct)
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- d->__first_nonopt = d->__last_nonopt = d->optind;
-
- d->__nextchar = NULL;
-
- d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- d->__ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- d->__ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (d->__posixly_correct)
- d->__ordering = REQUIRE_ORDER;
- else
- d->__ordering = PERMUTE;
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
- if (!d->__posixly_correct
- && argc == __libc_argc && argv == __libc_argv)
- {
- if (d->__nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- d->__nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = d->__nonoption_flags_max_len = strlen (orig_str);
- if (d->__nonoption_flags_max_len < argc)
- d->__nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (d->__nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- d->__nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', d->__nonoption_flags_max_len - len);
- }
- }
- d->__nonoption_flags_len = d->__nonoption_flags_max_len;
- }
- else
- d->__nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If 'getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If 'getopt' finds another option character, it returns that character,
- updating 'optind' and 'nextchar' so that the next call to 'getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, 'getopt' returns -1.
- Then 'optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set 'opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in 'optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in 'optarg', otherwise 'optarg' is set to zero.
-
- If OPTSTRING starts with '-' or '+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with '--' instead of '-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a '=', or else the in next ARGV-element.
- When 'getopt' finds a long-named option, it returns 0 if that option's
- 'flag' field is nonzero, the value of the option's 'val' field
- if the 'flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of 'struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal_r (int argc, char **argv, const char *optstring,
- const struct option *longopts, int *longind,
- int long_only, struct _getopt_data *d, int posixly_correct)
-{
- int print_errors = d->opterr;
-
- if (argc < 1)
- return -1;
-
- d->optarg = NULL;
-
- if (d->optind == 0 || !d->__initialized)
- {
- if (d->optind == 0)
- d->optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring, d,
- posixly_correct);
- d->__initialized = 1;
- }
- else if (optstring[0] == '-' || optstring[0] == '+')
- optstring++;
- if (optstring[0] == ':')
- print_errors = 0;
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
- || (d->optind < d->__nonoption_flags_len \
- && __getopt_nonoption_flags[d->optind] == '1'))
-#else
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
-#endif
-
- if (d->__nextchar == NULL || *d->__nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (d->__last_nonopt > d->optind)
- d->__last_nonopt = d->optind;
- if (d->__first_nonopt > d->optind)
- d->__first_nonopt = d->optind;
-
- if (d->__ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (d->__first_nonopt != d->__last_nonopt
- && d->__last_nonopt != d->optind)
- exchange ((char **) argv, d);
- else if (d->__last_nonopt != d->optind)
- d->__first_nonopt = d->optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (d->optind < argc && NONOPTION_P)
- d->optind++;
- d->__last_nonopt = d->optind;
- }
-
- /* The special ARGV-element '--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (d->optind != argc && !strcmp (argv[d->optind], "--"))
- {
- d->optind++;
-
- if (d->__first_nonopt != d->__last_nonopt
- && d->__last_nonopt != d->optind)
- exchange ((char **) argv, d);
- else if (d->__first_nonopt == d->__last_nonopt)
- d->__first_nonopt = d->optind;
- d->__last_nonopt = argc;
-
- d->optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (d->optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (d->__first_nonopt != d->__last_nonopt)
- d->optind = d->__first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (d->__ordering == REQUIRE_ORDER)
- return -1;
- d->optarg = argv[d->optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- d->__nextchar = (argv[d->optind] + 1
- + (longopts != NULL && argv[d->optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[d->optind][1] == '-'
- || (long_only && (argv[d->optind][2]
- || !strchr (optstring, argv[d->optind][1])))))
- {
- char *nameend;
- unsigned int namelen;
- const struct option *p;
- const struct option *pfound = NULL;
- struct option_list
- {
- const struct option *p;
- struct option_list *next;
- } *ambig_list = NULL;
- int exact = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
- namelen = nameend - d->__nextchar;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, d->__nextchar, namelen))
- {
- if (namelen == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else if (long_only
- || pfound->has_arg != p->has_arg
- || pfound->flag != p->flag
- || pfound->val != p->val)
- {
- /* Second or later nonexact match found. */
- struct option_list *newp = malloc (sizeof (*newp));
- newp->p = p;
- newp->next = ambig_list;
- ambig_list = newp;
- }
- }
-
- if (ambig_list != NULL && !exact)
- {
- if (print_errors)
- {
- struct option_list first;
- first.p = pfound;
- first.next = ambig_list;
- ambig_list = &first;
-
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf = NULL;
- size_t buflen = 0;
-
- FILE *fp = open_memstream (&buf, &buflen);
- if (fp != NULL)
- {
- fprintf (fp,
- _("%s: option '%s' is ambiguous; possibilities:"),
- argv[0], argv[d->optind]);
-
- do
- {
- fprintf (fp, " '--%s'", ambig_list->p->name);
- ambig_list = ambig_list->next;
- }
- while (ambig_list != NULL);
-
- fputc_unlocked ('\n', fp);
-
- if (__builtin_expect (fclose (fp) != EOF, 1))
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
- }
-#else
- fprintf (stderr,
- _("%s: option '%s' is ambiguous; possibilities:"),
- argv[0], argv[d->optind]);
- do
- {
- fprintf (stderr, " '--%s'", ambig_list->p->name);
- ambig_list = ambig_list->next;
- }
- while (ambig_list != NULL);
-
- fputc ('\n', stderr);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- d->optind++;
- d->optopt = 0;
- return '?';
- }
-
- while (ambig_list != NULL)
- {
- struct option_list *pn = ambig_list->next;
- free (ambig_list);
- ambig_list = pn;
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- d->optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- d->optarg = nameend + 1;
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
- int n;
-#endif
-
- if (argv[d->optind - 1][1] == '-')
- {
- /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("\
-%s: option '--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-#else
- fprintf (stderr, _("\
-%s: option '--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-#endif
- }
- else
- {
- /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("\
-%s: option '%c%s' doesn't allow an argument\n"),
- argv[0], argv[d->optind - 1][0],
- pfound->name);
-#else
- fprintf (stderr, _("\
-%s: option '%c%s' doesn't allow an argument\n"),
- argv[0], argv[d->optind - 1][0],
- pfound->name);
-#endif
- }
-
-#if defined _LIBC && defined USE_IN_LIBIO
- if (n >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#endif
- }
-
- d->__nextchar += strlen (d->__nextchar);
-
- d->optopt = pfound->val;
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (d->optind < argc)
- d->optarg = argv[d->optind++];
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option '--%s' requires an argument\n"),
- argv[0], pfound->name) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr,
- _("%s: option '--%s' requires an argument\n"),
- argv[0], pfound->name);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- d->optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- d->__nextchar += strlen (d->__nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[d->optind][1] == '-'
- || strchr (optstring, *d->__nextchar) == NULL)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
- int n;
-#endif
-
- if (argv[d->optind][1] == '-')
- {
- /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"),
- argv[0], d->__nextchar);
-#else
- fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
- argv[0], d->__nextchar);
-#endif
- }
- else
- {
- /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"),
- argv[0], argv[d->optind][0], d->__nextchar);
-#else
- fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
- argv[0], argv[d->optind][0], d->__nextchar);
-#endif
- }
-
-#if defined _LIBC && defined USE_IN_LIBIO
- if (n >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#endif
- }
- d->__nextchar = (char *) "";
- d->optind++;
- d->optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *d->__nextchar++;
- const char *temp = strchr (optstring, c);
-
- /* Increment 'optind' when we start to process its last character. */
- if (*d->__nextchar == '\0')
- ++d->optind;
-
- if (temp == NULL || c == ':' || c == ';')
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
- int n;
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
- n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"),
- argv[0], c);
-#else
- fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
- if (n >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#endif
- }
- d->optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- if (longopts == NULL)
- goto no_longs;
-
- /* This is an option that requires an argument. */
- if (*d->__nextchar != '\0')
- {
- d->optarg = d->__nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- d->optind++;
- }
- else if (d->optind == argc)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf,
- _("%s: option requires an argument -- '%c'\n"),
- argv[0], c) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr,
- _("%s: option requires an argument -- '%c'\n"),
- argv[0], c);
-#endif
- }
- d->optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented 'd->optind' once;
- increment it again when taking next ARGV-elt as argument. */
- d->optarg = argv[d->optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
- nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
- {
- if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else if (long_only
- || pfound->has_arg != p->has_arg
- || pfound->flag != p->flag
- || pfound->val != p->val)
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
- argv[0], d->optarg) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
- argv[0], d->optarg);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- d->optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- d->optarg = nameend + 1;
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option '-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("\
-%s: option '-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-#endif
- }
-
- d->__nextchar += strlen (d->__nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (d->optind < argc)
- d->optarg = argv[d->optind++];
- else
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option '-W %s' requires an argument\n"),
- argv[0], pfound->name) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2
- |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr, _("\
-%s: option '-W %s' requires an argument\n"),
- argv[0], pfound->name);
-#endif
- }
- d->__nextchar += strlen (d->__nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- else
- d->optarg = NULL;
- d->__nextchar += strlen (d->__nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- no_longs:
- d->__nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*d->__nextchar != '\0')
- {
- d->optarg = d->__nextchar;
- d->optind++;
- }
- else
- d->optarg = NULL;
- d->__nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*d->__nextchar != '\0')
- {
- d->optarg = d->__nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- d->optind++;
- }
- else if (d->optind == argc)
- {
- if (print_errors)
- {
-#if defined _LIBC && defined USE_IN_LIBIO
- char *buf;
-
- if (__asprintf (&buf, _("\
-%s: option requires an argument -- '%c'\n"),
- argv[0], c) >= 0)
- {
- _IO_flockfile (stderr);
-
- int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
- ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
- __fxprintf (NULL, "%s", buf);
-
- ((_IO_FILE *) stderr)->_flags2 = old_flags2;
- _IO_funlockfile (stderr);
-
- free (buf);
- }
-#else
- fprintf (stderr,
- _("%s: option requires an argument -- '%c'\n"),
- argv[0], c);
-#endif
- }
- d->optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented 'optind' once;
- increment it again when taking next ARGV-elt as argument. */
- d->optarg = argv[d->optind++];
- d->__nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-_getopt_internal (int argc, char **argv, const char *optstring,
- const struct option *longopts, int *longind, int long_only,
- int posixly_correct)
-{
- int result;
-
- getopt_data.optind = optind;
- getopt_data.opterr = opterr;
-
- result = _getopt_internal_r (argc, argv, optstring, longopts,
- longind, long_only, &getopt_data,
- posixly_correct);
-
- optind = getopt_data.optind;
- optarg = getopt_data.optarg;
- optopt = getopt_data.optopt;
-
- return result;
-}
-
-/* glibc gets a LSB-compliant getopt.
- Standalone applications get a POSIX-compliant getopt. */
-#if _LIBC
-enum { POSIXLY_CORRECT = 0 };
-#else
-enum { POSIXLY_CORRECT = 1 };
-#endif
-
-int
-getopt (int argc, char *const *argv, const char *optstring)
-{
- return _getopt_internal (argc, (char **) argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0, POSIXLY_CORRECT);
-}
-
-#ifdef _LIBC
-int
-__posix_getopt (int argc, char *const *argv, const char *optstring)
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0, 1);
-}
-#endif
-
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of 'getopt'. */
-
-int
-main (int argc, char **argv)
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value '%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/gl/getopt.in.h b/gl/getopt.in.h
deleted file mode 100644
index d9c7d8144a..0000000000
--- a/gl/getopt.in.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _@GUARD_PREFIX@_GETOPT_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-/* The include_next requires a split double-inclusion guard. We must
- also inform the replacement unistd.h to not recursively use
- <getopt.h>; our definitions will be present soon enough. */
-#if @HAVE_GETOPT_H@
-# define _GL_SYSTEM_GETOPT
-# @INCLUDE_NEXT@ @NEXT_GETOPT_H@
-# undef _GL_SYSTEM_GETOPT
-#endif
-
-#ifndef _@GUARD_PREFIX@_GETOPT_H
-
-#ifndef __need_getopt
-# define _@GUARD_PREFIX@_GETOPT_H 1
-#endif
-
-/* Standalone applications should #define __GETOPT_PREFIX to an
- identifier that prefixes the external functions and variables
- defined in this header. When this happens, include the
- headers that might declare getopt so that they will not cause
- confusion if included after this file (if the system had <getopt.h>,
- we have already included it). Then systematically rename
- identifiers so that they do not collide with the system functions
- and variables. Renaming avoids problems with some compilers and
- linkers. */
-#if defined __GETOPT_PREFIX && !defined __need_getopt
-# if !@HAVE_GETOPT_H@
-# define __need_system_stdlib_h
-# include <stdlib.h>
-# undef __need_system_stdlib_h
-# include <stdio.h>
-# include <unistd.h>
-# endif
-# undef __need_getopt
-# undef getopt
-# undef getopt_long
-# undef getopt_long_only
-# undef optarg
-# undef opterr
-# undef optind
-# undef optopt
-# undef option
-# define __GETOPT_CONCAT(x, y) x ## y
-# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
-# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
-# define getopt __GETOPT_ID (getopt)
-# define getopt_long __GETOPT_ID (getopt_long)
-# define getopt_long_only __GETOPT_ID (getopt_long_only)
-# define optarg __GETOPT_ID (optarg)
-# define opterr __GETOPT_ID (opterr)
-# define optind __GETOPT_ID (optind)
-# define optopt __GETOPT_ID (optopt)
-# define option __GETOPT_ID (option)
-# define _getopt_internal __GETOPT_ID (getopt_internal)
-#endif
-
-/* Standalone applications get correct prototypes for getopt_long and
- getopt_long_only; they declare "char **argv". libc uses prototypes
- with "char *const *argv" that are incorrect because getopt_long and
- getopt_long_only can permute argv; this is required for backward
- compatibility (e.g., for LSB 2.0.1).
-
- This used to be '#if defined __GETOPT_PREFIX && !defined __need_getopt',
- but it caused redefinition warnings if both unistd.h and getopt.h were
- included, since unistd.h includes getopt.h having previously defined
- __need_getopt.
-
- The only place where __getopt_argv_const is used is in definitions
- of getopt_long and getopt_long_only below, but these are visible
- only if __need_getopt is not defined, so it is quite safe to rewrite
- the conditional as follows:
-*/
-#if !defined __need_getopt
-# if defined __GETOPT_PREFIX
-# define __getopt_argv_const /* empty */
-# else
-# define __getopt_argv_const const
-# endif
-#endif
-
-/* If __GNU_LIBRARY__ is not already defined, either we are being used
- standalone, or this is the first header included in the source file.
- If we are being used with glibc, we need to include <features.h>, but
- that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
- not defined, include <ctype.h>, which will pull in <features.h> for us
- if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
- doesn't flood the namespace with stuff the way some other headers do.) */
-#if !defined __GNU_LIBRARY__
-# include <ctype.h>
-#endif
-
-#ifndef __THROW
-# ifndef __GNUC_PREREQ
-# define __GNUC_PREREQ(maj, min) (0)
-# endif
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
-# define __THROW throw ()
-# else
-# define __THROW
-# endif
-#endif
-
-/* The definition of _GL_ARG_NONNULL is copied here. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from 'getopt' to the caller.
- When 'getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when 'ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to 'getopt'.
-
- On entry to 'getopt', zero means this is the first call; initialize.
-
- When 'getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, 'optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message 'getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of 'struct option' terminated by an element containing a name which is
- zero.
-
- The field 'has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field 'flag' is not NULL, it points to a variable that is set
- to the value given in the field 'val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an 'int' to
- a compiled-in constant, such as set a value from 'optarg', set the
- option's 'flag' field to zero and its 'val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero 'flag' field, 'getopt'
- returns the contents of the 'val' field. */
-
-# if !GNULIB_defined_struct_option
-struct option
-{
- const char *name;
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-# define GNULIB_defined_struct_option 1
-# endif
-
-/* Names for the values of the 'has_arg' field of 'struct option'. */
-
-# define no_argument 0
-# define required_argument 1
-# define optional_argument 2
-#endif /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
- arguments in ARGV (ARGC of them, minus the program name) for
- options given in OPTS.
-
- Return the option character from OPTS just read. Return -1 when
- there are no more options. For unrecognized options, or options
- missing arguments, 'optopt' is set to the option letter, and '?' is
- returned.
-
- The OPTS string is a list of characters which are recognized option
- letters, optionally followed by colons, specifying that that letter
- takes an argument, to be placed in 'optarg'.
-
- If a letter in OPTS is followed by two colons, its argument is
- optional. This behavior is specific to the GNU 'getopt'.
-
- The argument '--' causes premature termination of argument
- scanning, explicitly telling 'getopt' that there are no more
- options.
-
- If OPTS begins with '-', then non-option arguments are treated as
- arguments to the option '\1'. This behavior is specific to the GNU
- 'getopt'. If OPTS begins with '+', or POSIXLY_CORRECT is set in
- the environment, then do not permute arguments. */
-
-extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
- __THROW _GL_ARG_NONNULL ((2, 3));
-
-#ifndef __need_getopt
-extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind)
- __THROW _GL_ARG_NONNULL ((2, 3));
-extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind)
- __THROW _GL_ARG_NONNULL ((2, 3));
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations. */
-#undef __need_getopt
-
-#endif /* _@GUARD_PREFIX@_GETOPT_H */
-#endif /* _@GUARD_PREFIX@_GETOPT_H */
diff --git a/gl/getopt1.c b/gl/getopt1.c
deleted file mode 100644
index 55a6b4eae4..0000000000
--- a/gl/getopt1.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef _LIBC
-# include <getopt.h>
-#else
-# include <config.h>
-# include "getopt.h"
-#endif
-#include "getopt_int.h"
-
-#include <stdio.h>
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
- const struct option *long_options, int *opt_index)
-{
- return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 0, 0);
-}
-
-int
-_getopt_long_r (int argc, char **argv, const char *options,
- const struct option *long_options, int *opt_index,
- struct _getopt_data *d)
-{
- return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 0, d, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (int argc, char *__getopt_argv_const *argv,
- const char *options,
- const struct option *long_options, int *opt_index)
-{
- return _getopt_internal (argc, (char **) argv, options, long_options,
- opt_index, 1, 0);
-}
-
-int
-_getopt_long_only_r (int argc, char **argv, const char *options,
- const struct option *long_options, int *opt_index,
- struct _getopt_data *d)
-{
- return _getopt_internal_r (argc, argv, options, long_options, opt_index,
- 1, d, 0);
-}
-
-
-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (int argc, char **argv)
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static const struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value '%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value '%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/gl/getopt_int.h b/gl/getopt_int.h
deleted file mode 100644
index a6e4b9ea71..0000000000
--- a/gl/getopt_int.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/* Internal declarations for getopt.
- Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _GETOPT_INT_H
-#define _GETOPT_INT_H 1
-
-#include <getopt.h>
-
-extern int _getopt_internal (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only, int __posixly_correct);
-
-
-/* Reentrant versions which can handle parsing multiple argument
- vectors at the same time. */
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using '+' as the first character
- of the list of option characters, or by calling getopt.
-
- PERMUTE is the default. We permute the contents of ARGV as we
- scan, so that eventually all the non-options are at the end.
- This allows options to be given in any order, even with programs
- that were not written to expect this.
-
- RETURN_IN_ORDER is an option available to programs that were
- written to expect options and other ARGV-elements in any order
- and that care about the ordering of the two. We describe each
- non-option ARGV-element as if it were the argument of an option
- with character code 1. Using '-' as the first character of the
- list of option characters selects this mode of operation.
-
- The special argument '--' forces an end of option-scanning regardless
- of the value of 'ordering'. In the case of RETURN_IN_ORDER, only
- '--' can cause 'getopt' to return -1 with 'optind' != ARGC. */
-
-enum __ord
- {
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
- };
-
-/* Data type for reentrant functions. */
-struct _getopt_data
-{
- /* These have exactly the same meaning as the corresponding global
- variables, except that they are used for the reentrant
- versions of getopt. */
- int optind;
- int opterr;
- int optopt;
- char *optarg;
-
- /* Internal members. */
-
- /* True if the internal members have been initialized. */
- int __initialized;
-
- /* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
- char *__nextchar;
-
- /* See __ord above. */
- enum __ord __ordering;
-
- /* If the POSIXLY_CORRECT environment variable is set
- or getopt was called. */
- int __posixly_correct;
-
-
- /* Handle permutation of arguments. */
-
- /* Describe the part of ARGV that contains non-options that have
- been skipped. 'first_nonopt' is the index in ARGV of the first
- of them; 'last_nonopt' is the index after the last of them. */
-
- int __first_nonopt;
- int __last_nonopt;
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
- int __nonoption_flags_max_len;
- int __nonoption_flags_len;
-#endif
-};
-
-/* The initializer is necessary to set OPTIND and OPTERR to their
- default values and to clear the initialization flag. */
-#define _GETOPT_DATA_INITIALIZER { 1, 1 }
-
-extern int _getopt_internal_r (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only, struct _getopt_data *__data,
- int __posixly_correct);
-
-extern int _getopt_long_r (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- struct _getopt_data *__data);
-
-extern int _getopt_long_only_r (int ___argc, char **___argv,
- const char *__shortopts,
- const struct option *__longopts,
- int *__longind,
- struct _getopt_data *__data);
-
-#endif /* getopt_int.h */
diff --git a/gl/getpass.c b/gl/getpass.c
index 3c9c4d8ae9..84a2a1e6a7 100644
--- a/gl/getpass.c
+++ b/gl/getpass.c
@@ -3,16 +3,16 @@
This file is part of the GNU C Library.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBC
diff --git a/gl/getpass.h b/gl/getpass.h
index 9b59abb155..83b8dc3ab2 100644
--- a/gl/getpass.h
+++ b/gl/getpass.h
@@ -3,16 +3,16 @@
Contributed by Simon Josefsson <jas@extundo.com>, 2004.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef GETPASS_H
diff --git a/gl/getpeername.c b/gl/getpeername.c
index be4dcfd31f..4cfe4a8de6 100644
--- a/gl/getpeername.c
+++ b/gl/getpeername.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/getsubopt.c b/gl/getsubopt.c
deleted file mode 100644
index 539fdd0247..0000000000
--- a/gl/getsubopt.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Parse comma separated list into words.
- Copyright (C) 1996-1997, 1999, 2004, 2007, 2009-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#if !_LIBC
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#if !_LIBC
-/* This code is written for inclusion in gnu-libc, and uses names in
- the namespace reserved for libc. If we're compiling in gnulib,
- define those names to be the normal ones instead. */
-# undef __strchrnul
-# define __strchrnul strchrnul
-#endif
-
-/* Parse comma separated suboption from *OPTIONP and match against
- strings in TOKENS. If found return index and set *VALUEP to
- optional value introduced by an equal sign. If the suboption is
- not part of TOKENS return in *VALUEP beginning of unknown
- suboption. On exit *OPTIONP is set to the beginning of the next
- token or at the terminating NUL character. */
-int
-getsubopt (char **optionp, char *const *tokens, char **valuep)
-{
- char *endp, *vstart;
- int cnt;
-
- if (**optionp == '\0')
- return -1;
-
- /* Find end of next token. */
- endp = __strchrnul (*optionp, ',');
-
- /* Find start of value. */
- vstart = memchr (*optionp, '=', endp - *optionp);
- if (vstart == NULL)
- vstart = endp;
-
- /* Try to match the characters between *OPTIONP and VSTART against
- one of the TOKENS. */
- for (cnt = 0; tokens[cnt] != NULL; ++cnt)
- if (strncmp (*optionp, tokens[cnt], vstart - *optionp) == 0
- && tokens[cnt][vstart - *optionp] == '\0')
- {
- /* We found the current option in TOKENS. */
- *valuep = vstart != endp ? vstart + 1 : NULL;
-
- if (*endp != '\0')
- *endp++ = '\0';
- *optionp = endp;
-
- return cnt;
- }
-
- /* The current suboption does not match any option. */
- *valuep = *optionp;
-
- if (*endp != '\0')
- *endp++ = '\0';
- *optionp = endp;
-
- return -1;
-}
diff --git a/gl/gettext.h b/gl/gettext.h
index d0215715a9..e059b20991 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -3,16 +3,16 @@
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBGETTEXT_H
diff --git a/gl/gettimeofday.c b/gl/gettimeofday.c
index ad65c6da8b..b1b4d59745 100644
--- a/gl/gettimeofday.c
+++ b/gl/gettimeofday.c
@@ -3,16 +3,16 @@
Copyright (C) 2001-2003, 2005-2007, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* written by Jim Meyering */
diff --git a/gl/hash-pjw-bare.c b/gl/hash-pjw-bare.c
index f26f15c42a..08746765fe 100644
--- a/gl/hash-pjw-bare.c
+++ b/gl/hash-pjw-bare.c
@@ -3,16 +3,16 @@
Copyright (C) 2012-2013 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
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/hash-pjw-bare.h b/gl/hash-pjw-bare.h
index c470beb575..b98ff0858c 100644
--- a/gl/hash-pjw-bare.h
+++ b/gl/hash-pjw-bare.h
@@ -2,16 +2,16 @@
Copyright (C) 2012-2013 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
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 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.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stddef.h>
diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c
index fdfd21dcbc..f5e9b34268 100644
--- a/gl/inet_ntop.c
+++ b/gl/inet_ntop.c
@@ -3,16 +3,16 @@
Copyright (C) 2005-2006, 2008-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/*
diff --git a/gl/inet_pton.c b/gl/inet_pton.c
index 78ebf1a1bb..dfe11acb02 100644
--- a/gl/inet_pton.c
+++ b/gl/inet_pton.c
@@ -3,16 +3,16 @@
Copyright (C) 2006, 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/*
diff --git a/gl/isnan.c b/gl/isnan.c
deleted file mode 100644
index d95e4bac77..0000000000
--- a/gl/isnan.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-/* Specification. */
-#ifdef USE_LONG_DOUBLE
-/* Specification found in math.h or isnanl-nolibm.h. */
-extern int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
-#elif ! defined USE_FLOAT
-/* Specification found in math.h or isnand-nolibm.h. */
-extern int rpl_isnand (double x);
-#else /* defined USE_FLOAT */
-/* Specification found in math.h or isnanf-nolibm.h. */
-extern int rpl_isnanf (float x);
-#endif
-
-#include <float.h>
-#include <string.h>
-
-#include "float+.h"
-
-#ifdef USE_LONG_DOUBLE
-# define FUNC rpl_isnanl
-# define DOUBLE long double
-# define MAX_EXP LDBL_MAX_EXP
-# define MIN_EXP LDBL_MIN_EXP
-# if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT
-# define KNOWN_EXPBIT0_LOCATION
-# define EXPBIT0_WORD LDBL_EXPBIT0_WORD
-# define EXPBIT0_BIT LDBL_EXPBIT0_BIT
-# endif
-# define SIZE SIZEOF_LDBL
-# define L_(literal) literal##L
-#elif ! defined USE_FLOAT
-# define FUNC rpl_isnand
-# define DOUBLE double
-# define MAX_EXP DBL_MAX_EXP
-# define MIN_EXP DBL_MIN_EXP
-# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
-# define KNOWN_EXPBIT0_LOCATION
-# define EXPBIT0_WORD DBL_EXPBIT0_WORD
-# define EXPBIT0_BIT DBL_EXPBIT0_BIT
-# endif
-# define SIZE SIZEOF_DBL
-# define L_(literal) literal
-#else /* defined USE_FLOAT */
-# define FUNC rpl_isnanf
-# define DOUBLE float
-# define MAX_EXP FLT_MAX_EXP
-# define MIN_EXP FLT_MIN_EXP
-# if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
-# define KNOWN_EXPBIT0_LOCATION
-# define EXPBIT0_WORD FLT_EXPBIT0_WORD
-# define EXPBIT0_BIT FLT_EXPBIT0_BIT
-# endif
-# define SIZE SIZEOF_FLT
-# define L_(literal) literal##f
-#endif
-
-#define EXP_MASK ((MAX_EXP - MIN_EXP) | 7)
-
-#define NWORDS \
- ((sizeof (DOUBLE) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { DOUBLE value; unsigned int word[NWORDS]; } memory_double;
-
-int
-FUNC (DOUBLE x)
-{
-#ifdef KNOWN_EXPBIT0_LOCATION
-# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
- /* Special CPU dependent code is needed to treat bit patterns outside the
- IEEE 754 specification (such as Pseudo-NaNs, Pseudo-Infinities,
- Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals) as NaNs.
- These bit patterns are:
- - exponent = 0x0001..0x7FFF, mantissa bit 63 = 0,
- - exponent = 0x0000, mantissa bit 63 = 1.
- The NaN bit pattern is:
- - exponent = 0x7FFF, mantissa >= 0x8000000000000001. */
- memory_double m;
- unsigned int exponent;
-
- m.value = x;
- exponent = (m.word[EXPBIT0_WORD] >> EXPBIT0_BIT) & EXP_MASK;
-# ifdef WORDS_BIGENDIAN
- /* Big endian: EXPBIT0_WORD = 0, EXPBIT0_BIT = 16. */
- if (exponent == 0)
- return 1 & (m.word[0] >> 15);
- else if (exponent == EXP_MASK)
- return (((m.word[0] ^ 0x8000U) << 16) | m.word[1] | (m.word[2] >> 16)) != 0;
- else
- return 1 & ~(m.word[0] >> 15);
-# else
- /* Little endian: EXPBIT0_WORD = 2, EXPBIT0_BIT = 0. */
- if (exponent == 0)
- return (m.word[1] >> 31);
- else if (exponent == EXP_MASK)
- return ((m.word[1] ^ 0x80000000U) | m.word[0]) != 0;
- else
- return (m.word[1] >> 31) ^ 1;
-# endif
-# else
- /* Be careful to not do any floating-point operation on x, such as x == x,
- because x may be a signaling NaN. */
-# if defined __SUNPRO_C || defined __ICC || defined _MSC_VER \
- || defined __DECC || defined __TINYC__ \
- || (defined __sgi && !defined __GNUC__)
- /* The Sun C 5.0, Intel ICC 10.0, Microsoft Visual C/C++ 9.0, Compaq (ex-DEC)
- 6.4, and TinyCC compilers don't recognize the initializers as constant
- expressions. The Compaq compiler also fails when constant-folding
- 0.0 / 0.0 even when constant-folding is not required. The Microsoft
- Visual C/C++ compiler also fails when constant-folding 1.0 / 0.0 even
- when constant-folding is not required. The SGI MIPSpro C compiler
- complains about "floating-point operation result is out of range". */
- static DOUBLE zero = L_(0.0);
- memory_double nan;
- DOUBLE plus_inf = L_(1.0) / zero;
- DOUBLE minus_inf = -L_(1.0) / zero;
- nan.value = zero / zero;
-# else
- static memory_double nan = { L_(0.0) / L_(0.0) };
- static DOUBLE plus_inf = L_(1.0) / L_(0.0);
- static DOUBLE minus_inf = -L_(1.0) / L_(0.0);
-# endif
- {
- memory_double m;
-
- /* A NaN can be recognized through its exponent. But exclude +Infinity and
- -Infinity, which have the same exponent. */
- m.value = x;
- if (((m.word[EXPBIT0_WORD] ^ nan.word[EXPBIT0_WORD])
- & (EXP_MASK << EXPBIT0_BIT))
- == 0)
- return (memcmp (&m.value, &plus_inf, SIZE) != 0
- && memcmp (&m.value, &minus_inf, SIZE) != 0);
- else
- return 0;
- }
-# endif
-#else
- /* The configuration did not find sufficient information. Give up about
- the signaling NaNs, handle only the quiet NaNs. */
- if (x == x)
- {
-# if defined USE_LONG_DOUBLE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
- /* Detect any special bit patterns that pass ==; see comment above. */
- memory_double m1;
- memory_double m2;
-
- memset (&m1.value, 0, SIZE);
- memset (&m2.value, 0, SIZE);
- m1.value = x;
- m2.value = x + (x ? 0.0L : -0.0L);
- if (memcmp (&m1.value, &m2.value, SIZE) != 0)
- return 1;
-# endif
- return 0;
- }
- else
- return 1;
-#endif
-}
diff --git a/gl/isnand-nolibm.h b/gl/isnand-nolibm.h
deleted file mode 100644
index 8a84ff8140..0000000000
--- a/gl/isnand-nolibm.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#if HAVE_ISNAND_IN_LIBC
-/* Get declaration of isnan macro. */
-# include <math.h>
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
-# undef isnand
-# define isnand(x) __builtin_isnan ((double)(x))
-# else
-# undef isnand
-# define isnand(x) isnan ((double)(x))
-# endif
-#else
-/* Test whether X is a NaN. */
-# undef isnand
-# define isnand rpl_isnand
-extern int isnand (double x);
-#endif
diff --git a/gl/isnand.c b/gl/isnand.c
deleted file mode 100644
index cbad17b583..0000000000
--- a/gl/isnand.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2008-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
-
-#include "isnan.c"
diff --git a/gl/isnanf-nolibm.h b/gl/isnanf-nolibm.h
deleted file mode 100644
index dc43863a69..0000000000
--- a/gl/isnanf-nolibm.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#if HAVE_ISNANF_IN_LIBC
-/* Get declaration of isnan macro or (older) isnanf function. */
-# include <math.h>
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
-# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
-# elif defined isnan
-# undef isnanf
-# define isnanf(x) isnan ((float)(x))
-# else
- /* Get declaration of isnanf(), if not declared in <math.h>. */
-# if defined __sgi
- /* We can't include <ieeefp.h>, because it conflicts with our definition of
- isnand. Therefore declare isnanf separately. */
-extern int isnanf (float x);
-# endif
-# endif
-#else
-/* Test whether X is a NaN. */
-# undef isnanf
-# define isnanf rpl_isnanf
-extern int isnanf (float x);
-#endif
diff --git a/gl/isnanf.c b/gl/isnanf.c
deleted file mode 100644
index 946cb69ce0..0000000000
--- a/gl/isnanf.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#define USE_FLOAT
-#include "isnan.c"
diff --git a/gl/isnanl-nolibm.h b/gl/isnanl-nolibm.h
deleted file mode 100644
index 18eb803714..0000000000
--- a/gl/isnanl-nolibm.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#if HAVE_ISNANL_IN_LIBC
-/* Get declaration of isnan macro or (older) isnanl function. */
-# include <math.h>
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
-# undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
-# elif defined isnan
-# undef isnanl
-# define isnanl(x) isnan ((long double)(x))
-# endif
-#else
-/* Test whether X is a NaN. */
-# undef isnanl
-# define isnanl rpl_isnanl
-extern int isnanl (long double x);
-#endif
diff --git a/gl/isnanl.c b/gl/isnanl.c
deleted file mode 100644
index 9d9d84b974..0000000000
--- a/gl/isnanl.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Test for NaN that does not need libm.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#define USE_LONG_DOUBLE
-#include "isnan.c"
diff --git a/gl/itold.c b/gl/itold.c
index 9aabc7e464..993a688bac 100644
--- a/gl/itold.c
+++ b/gl/itold.c
@@ -3,16 +3,16 @@
Written by Bruno Haible <bruno@clisp.org>, 2011.
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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/listen.c b/gl/listen.c
index 0ca834628e..ca3d9fb5bd 100644
--- a/gl/listen.c
+++ b/gl/listen.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/lseek.c b/gl/lseek.c
index fa7440d151..b2c2466740 100644
--- a/gl/lseek.c
+++ b/gl/lseek.c
@@ -2,16 +2,16 @@
Copyright (C) 2007, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/m4/alphasort.m4 b/gl/m4/alphasort.m4
deleted file mode 100644
index bb5e9d0976..0000000000
--- a/gl/m4/alphasort.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-# alphasort.m4 serial 2
-dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_ALPHASORT],
-[
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-
- dnl Persuade glibc and Solaris <dirent.h> to declare alphasort().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_CHECK_FUNCS([alphasort])
- if test $ac_cv_func_alphasort = no; then
- HAVE_ALPHASORT=0
- fi
-])
-
-# Prerequisites of lib/alphasort.c.
-AC_DEFUN([gl_PREREQ_ALPHASORT], [:])
diff --git a/gl/m4/argp.m4 b/gl/m4/argp.m4
deleted file mode 100644
index 4445d8e6c3..0000000000
--- a/gl/m4/argp.m4
+++ /dev/null
@@ -1,61 +0,0 @@
-# argp.m4 serial 14
-dnl Copyright (C) 2003-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_ARGP],
-[
- AC_REQUIRE([AC_C_INLINE])
- AC_REQUIRE([AC_C_RESTRICT])
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- AC_CHECK_DECLS([program_invocation_name], [],
- [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_NAME], [1],
- [Define to 1 to add extern declaration of program_invocation_name to argp.h])],
- [[#include <errno.h>]])
- AC_CHECK_DECLS([program_invocation_short_name], [],
- [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_SHORT_NAME], [1],
- [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])],
- [[#include <errno.h>]])
-
- # Check if program_invocation_name and program_invocation_short_name
- # are defined elsewhere. It is improbable that only one of them will
- # be defined and other not, I prefer to stay on the safe side and to
- # test each one separately.
- AC_MSG_CHECKING([whether program_invocation_name is defined])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <argp.h>]],
- [[program_invocation_name = "test";]])],
- [AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
- [Define if program_invocation_name is defined])
- AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])])
-
- AC_MSG_CHECKING([whether program_invocation_short_name is defined])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <argp.h>]],
- [[program_invocation_short_name = "test";]])],
- [AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
- [Define if program_invocation_short_name is defined])
- AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])])
-
- AC_CHECK_DECLS_ONCE([clearerr_unlocked])
- AC_CHECK_DECLS_ONCE([feof_unlocked])
- AC_CHECK_DECLS_ONCE([ferror_unlocked])
- AC_CHECK_DECLS_ONCE([fflush_unlocked])
- AC_CHECK_DECLS_ONCE([fgets_unlocked])
- AC_CHECK_DECLS_ONCE([fputc_unlocked])
- AC_CHECK_DECLS_ONCE([fputs_unlocked])
- AC_CHECK_DECLS_ONCE([fread_unlocked])
- AC_CHECK_DECLS_ONCE([fwrite_unlocked])
- AC_CHECK_DECLS_ONCE([getc_unlocked])
- AC_CHECK_DECLS_ONCE([getchar_unlocked])
- AC_CHECK_DECLS_ONCE([putc_unlocked])
- AC_CHECK_DECLS_ONCE([putchar_unlocked])
- AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
- AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
-])
-
-dnl argp-parse.c depends on GNU getopt internals, therefore use GNU getopt
-dnl always.
-AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], [])
diff --git a/gl/m4/closedir.m4 b/gl/m4/closedir.m4
deleted file mode 100644
index bb8708b69b..0000000000
--- a/gl/m4/closedir.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-# closedir.m4 serial 2
-dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_CLOSEDIR],
-[
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-
- AC_CHECK_FUNCS([closedir])
- if test $ac_cv_func_closedir = no; then
- HAVE_CLOSEDIR=0
- fi
- dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- if test $HAVE_CLOSEDIR = 1; then
- REPLACE_CLOSEDIR=1
- fi
- fi
- ])
-])
diff --git a/gl/m4/dirent_h.m4 b/gl/m4/dirent_h.m4
deleted file mode 100644
index 54c1663431..0000000000
--- a/gl/m4/dirent_h.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-# dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Written by Bruno Haible.
-
-AC_DEFUN([gl_DIRENT_H],
-[
- dnl Use AC_REQUIRE here, so that the default behavior below is expanded
- dnl once only, before all statements that occur in other macros.
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-
- dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
- gl_CHECK_NEXT_HEADERS([dirent.h])
- if test $ac_cv_header_dirent_h = yes; then
- HAVE_DIRENT_H=1
- else
- HAVE_DIRENT_H=0
- fi
- AC_SUBST([HAVE_DIRENT_H])
-
- dnl Check for declarations of anything we want to poison if the
- dnl corresponding gnulib module is not in use.
- gl_WARN_ON_USE_PREPARE([[#include <dirent.h>
- ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
-])
-
-AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
-[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
- gl_MODULE_INDICATOR_SET_VARIABLE([$1])
- dnl Define it also as a C macro, for the benefit of the unit tests.
- gl_MODULE_INDICATOR_FOR_TESTS([$1])
-])
-
-AC_DEFUN([gl_DIRENT_H_DEFAULTS],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
- GNULIB_OPENDIR=0; AC_SUBST([GNULIB_OPENDIR])
- GNULIB_READDIR=0; AC_SUBST([GNULIB_READDIR])
- GNULIB_REWINDDIR=0; AC_SUBST([GNULIB_REWINDDIR])
- GNULIB_CLOSEDIR=0; AC_SUBST([GNULIB_CLOSEDIR])
- GNULIB_DIRFD=0; AC_SUBST([GNULIB_DIRFD])
- GNULIB_FDOPENDIR=0; AC_SUBST([GNULIB_FDOPENDIR])
- GNULIB_SCANDIR=0; AC_SUBST([GNULIB_SCANDIR])
- GNULIB_ALPHASORT=0; AC_SUBST([GNULIB_ALPHASORT])
- dnl Assume proper GNU behavior unless another module says otherwise.
- HAVE_OPENDIR=1; AC_SUBST([HAVE_OPENDIR])
- HAVE_READDIR=1; AC_SUBST([HAVE_READDIR])
- HAVE_REWINDDIR=1; AC_SUBST([HAVE_REWINDDIR])
- HAVE_CLOSEDIR=1; AC_SUBST([HAVE_CLOSEDIR])
- HAVE_DECL_DIRFD=1; AC_SUBST([HAVE_DECL_DIRFD])
- HAVE_DECL_FDOPENDIR=1;AC_SUBST([HAVE_DECL_FDOPENDIR])
- HAVE_FDOPENDIR=1; AC_SUBST([HAVE_FDOPENDIR])
- HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR])
- HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT])
- REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR])
- REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR])
- REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD])
- REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR])
-])
diff --git a/gl/m4/dirname.m4 b/gl/m4/dirname.m4
deleted file mode 100644
index 5897a2a8b3..0000000000
--- a/gl/m4/dirname.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-#serial 10 -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_DIRNAME],
-[
- AC_REQUIRE([gl_DIRNAME_LGPL])
-])
-
-AC_DEFUN([gl_DIRNAME_LGPL],
-[
- dnl Prerequisites of lib/dirname.h.
- AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
-
- dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
- dnl lib/stripslash.c.
-])
diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
deleted file mode 100644
index bd6f867143..0000000000
--- a/gl/m4/double-slash-root.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-# double-slash-root.m4 serial 4 -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
-[
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
- [ if test x"$cross_compiling" = xyes ; then
- # When cross-compiling, there is no way to tell whether // is special
- # short of a list of hosts. However, the only known hosts to date
- # that have a distinct // are Apollo DomainOS (too old to port to),
- # Cygwin, and z/OS. If anyone knows of another system for which // has
- # special semantics and is distinct from /, please report it to
- # <bug-gnulib@gnu.org>.
- case $host in
- *-cygwin | i370-ibm-openedition)
- gl_cv_double_slash_root=yes ;;
- *)
- # Be optimistic and assume that / and // are the same when we
- # don't know.
- gl_cv_double_slash_root='unknown, assuming no' ;;
- esac
- else
- set x `ls -di / // 2>/dev/null`
- if test "$[2]" = "$[4]" && wc //dev/null >/dev/null 2>&1; then
- gl_cv_double_slash_root=no
- else
- gl_cv_double_slash_root=yes
- fi
- fi])
- if test "$gl_cv_double_slash_root" = yes; then
- AC_DEFINE([DOUBLE_SLASH_IS_DISTINCT_ROOT], [1],
- [Define to 1 if // is a file system root distinct from /.])
- fi
-])
diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
deleted file mode 100644
index c640ec1299..0000000000
--- a/gl/m4/eealloc.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-# eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_EEALLOC],
-[
- AC_REQUIRE([gl_EEMALLOC])
- AC_REQUIRE([gl_EEREALLOC])
-])
-
-AC_DEFUN([gl_EEMALLOC],
-[
- _AC_FUNC_MALLOC_IF(
- [gl_cv_func_malloc_0_nonnull=1],
- [gl_cv_func_malloc_0_nonnull=0])
- AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], [$gl_cv_func_malloc_0_nonnull],
- [If malloc(0) is != NULL, define this to 1. Otherwise define this
- to 0.])
-])
-
-AC_DEFUN([gl_EEREALLOC],
-[
- _AC_FUNC_REALLOC_IF(
- [gl_cv_func_realloc_0_nonnull=1],
- [gl_cv_func_realloc_0_nonnull=0])
- AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], [$gl_cv_func_realloc_0_nonnull],
- [If realloc(NULL,0) is != NULL, define this to 1. Otherwise define this
- to 0.])
-])
diff --git a/gl/m4/environ.m4 b/gl/m4/environ.m4
deleted file mode 100644
index 593a33ed42..0000000000
--- a/gl/m4/environ.m4
+++ /dev/null
@@ -1,47 +0,0 @@
-# environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN_ONCE([gl_ENVIRON],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- dnl Persuade glibc <unistd.h> to declare environ.
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- AC_CHECK_HEADERS_ONCE([unistd.h])
- gt_CHECK_VAR_DECL(
- [#if HAVE_UNISTD_H
- #include <unistd.h>
- #endif
- /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */
- #include <stdlib.h>
- ],
- [environ])
- if test $gt_cv_var_environ_declaration != yes; then
- HAVE_DECL_ENVIRON=0
- fi
-])
-
-# Check if a variable is properly declared.
-# gt_CHECK_VAR_DECL(includes,variable)
-AC_DEFUN([gt_CHECK_VAR_DECL],
-[
- define([gt_cv_var], [gt_cv_var_]$2[_declaration])
- AC_MSG_CHECKING([if $2 is properly declared])
- AC_CACHE_VAL([gt_cv_var], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[$1
- extern struct { int foo; } $2;]],
- [[$2.foo = 1;]])],
- [gt_cv_var=no],
- [gt_cv_var=yes])])
- AC_MSG_RESULT([$gt_cv_var])
- if test $gt_cv_var = yes; then
- AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
- [Define if you have the declaration of $2.])
- fi
- undefine([gt_cv_var])
-])
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
deleted file mode 100644
index 29e6fdc9c2..0000000000
--- a/gl/m4/error.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-#serial 14
-
-# Copyright (C) 1996-1998, 2001-2004, 2009-2013 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_ERROR],
-[
- dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
- dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
- AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
- [AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <error.h>]],
- [[error_at_line (0, 0, "", 0, "an error occurred");]])],
- [ac_cv_lib_error_at_line=yes],
- [ac_cv_lib_error_at_line=no])])
-])
-
-# Prerequisites of lib/error.c.
-AC_DEFUN([gl_PREREQ_ERROR],
-[
- AC_REQUIRE([AC_FUNC_STRERROR_R])
- :
-])
diff --git a/gl/m4/exponentf.m4 b/gl/m4/exponentf.m4
deleted file mode 100644
index 55a04e63cc..0000000000
--- a/gl/m4/exponentf.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-# exponentf.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_FLOAT_EXPONENT_LOCATION],
-[
- AC_CACHE_CHECK([where to find the exponent in a 'float'],
- [gl_cv_cc_float_expbit0],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
-{
- memory_float m;
- size_t i;
- /* Clear it first, in case
- sizeof (float) < sizeof (memory_float). */
- memset (&m, 0, sizeof (memory_float));
- m.value = x;
- for (i = 0; i < NWORDS; i++)
- {
- ored_words[i] |= m.word[i];
- anded_words[i] &= m.word[i];
- }
-}
-int main ()
-{
- size_t j;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- for (j = 0; j < NWORDS; j++)
- anded_words[j] = ~ (unsigned int) 0;
- add_to_ored_words (0.25f);
- add_to_ored_words (0.5f);
- add_to_ored_words (1.0f);
- add_to_ored_words (2.0f);
- add_to_ored_words (4.0f);
- /* Remove bits that are common (e.g. if representation of the first mantissa
- bit is explicit). */
- for (j = 0; j < NWORDS; j++)
- ored_words[j] &= ~anded_words[j];
- /* Now find the nonzero word. */
- for (j = 0; j < NWORDS; j++)
- if (ored_words[j] != 0)
- break;
- if (j < NWORDS)
- {
- size_t i;
- for (i = j + 1; i < NWORDS; i++)
- if (ored_words[i] != 0)
- {
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
- }
- for (i = 0; ; i++)
- if ((ored_words[j] >> i) & 1)
- {
- fprintf (fp, "word %d bit %d", (int) j, (int) i);
- return (fclose (fp) != 0);
- }
- }
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
-}
- ]])],
- [gl_cv_cc_float_expbit0=`cat conftest.out`],
- [gl_cv_cc_float_expbit0="unknown"],
- [gl_cv_cc_float_expbit0="word 0 bit 23"])
- rm -f conftest.out
- ])
- case "$gl_cv_cc_float_expbit0" in
- word*bit*)
- word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([FLT_EXPBIT0_WORD], [$word],
- [Define as the word index where to find the exponent of 'float'.])
- AC_DEFINE_UNQUOTED([FLT_EXPBIT0_BIT], [$bit],
- [Define as the bit index in the word where to find bit 0 of the exponent of 'float'.])
- ;;
- esac
-])
diff --git a/gl/m4/exponentl.m4 b/gl/m4/exponentl.m4
deleted file mode 100644
index f877cf140f..0000000000
--- a/gl/m4/exponentl.m4
+++ /dev/null
@@ -1,98 +0,0 @@
-# exponentl.m4 serial 3
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
-[
- AC_REQUIRE([gl_BIGENDIAN])
- AC_CACHE_CHECK([where to find the exponent in a 'long double'],
- [gl_cv_cc_long_double_expbit0],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
- memory_long_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double x)
-{
- memory_long_double m;
- size_t i;
- /* Clear it first, in case
- sizeof (long double) < sizeof (memory_long_double). */
- memset (&m, 0, sizeof (memory_long_double));
- m.value = x;
- for (i = 0; i < NWORDS; i++)
- {
- ored_words[i] |= m.word[i];
- anded_words[i] &= m.word[i];
- }
-}
-int main ()
-{
- size_t j;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- for (j = 0; j < NWORDS; j++)
- anded_words[j] = ~ (unsigned int) 0;
- add_to_ored_words (0.25L);
- add_to_ored_words (0.5L);
- add_to_ored_words (1.0L);
- add_to_ored_words (2.0L);
- add_to_ored_words (4.0L);
- /* Remove bits that are common (e.g. if representation of the first mantissa
- bit is explicit). */
- for (j = 0; j < NWORDS; j++)
- ored_words[j] &= ~anded_words[j];
- /* Now find the nonzero word. */
- for (j = 0; j < NWORDS; j++)
- if (ored_words[j] != 0)
- break;
- if (j < NWORDS)
- {
- size_t i;
- for (i = j + 1; i < NWORDS; i++)
- if (ored_words[i] != 0)
- {
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
- }
- for (i = 0; ; i++)
- if ((ored_words[j] >> i) & 1)
- {
- fprintf (fp, "word %d bit %d", (int) j, (int) i);
- return (fclose (fp) != 0);
- }
- }
- fprintf (fp, "unknown");
- return (fclose (fp) != 0);
-}
- ]])],
- [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
- [gl_cv_cc_long_double_expbit0="unknown"],
- [
- dnl When cross-compiling, we don't know. It depends on the
- dnl ABI and compiler version. There are too many cases.
- gl_cv_cc_long_double_expbit0="unknown"
- ])
- rm -f conftest.out
- ])
- case "$gl_cv_cc_long_double_expbit0" in
- word*bit*)
- word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_WORD], [$word],
- [Define as the word index where to find the exponent of 'long double'.])
- AC_DEFINE_UNQUOTED([LDBL_EXPBIT0_BIT], [$bit],
- [Define as the bit index in the word where to find bit 0 of the exponent of 'long double'.])
- ;;
- esac
-])
diff --git a/gl/m4/frexp.m4 b/gl/m4/frexp.m4
deleted file mode 100644
index 2eb98a1dcd..0000000000
--- a/gl/m4/frexp.m4
+++ /dev/null
@@ -1,172 +0,0 @@
-# frexp.m4 serial 15
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_FREXP],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
- FREXP_LIBM=
- if test $gl_cv_func_frexp_no_libm = no; then
- AC_CACHE_CHECK([whether frexp() can be used with libm],
- [gl_cv_func_frexp_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x;]],
- [[int e; return frexp (x, &e) > 0;]])],
- [gl_cv_func_frexp_in_libm=yes],
- [gl_cv_func_frexp_in_libm=no])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_frexp_in_libm = yes; then
- FREXP_LIBM=-lm
- fi
- fi
- if test $gl_cv_func_frexp_no_libm = yes \
- || test $gl_cv_func_frexp_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $FREXP_LIBM"
- gl_FUNC_FREXP_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_frexp_works" in
- *yes) gl_func_frexp=yes ;;
- *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;;
- esac
- else
- gl_func_frexp=no
- fi
- if test $gl_func_frexp = yes; then
- AC_DEFINE([HAVE_FREXP], [1],
- [Define if the frexp() function is available and works.])
- fi
- AC_SUBST([FREXP_LIBM])
-])
-
-AC_DEFUN([gl_FUNC_FREXP_NO_LIBM],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
- if test $gl_cv_func_frexp_no_libm = yes; then
- gl_FUNC_FREXP_WORKS
- case "$gl_cv_func_frexp_works" in
- *yes) gl_func_frexp_no_libm=yes ;;
- *) gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;;
- esac
- else
- gl_func_frexp_no_libm=no
- dnl Set REPLACE_FREXP here because the system may have frexp in libm.
- REPLACE_FREXP=1
- fi
- if test $gl_func_frexp_no_libm = yes; then
- AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
- [Define if the frexp() function is available in libc.])
- fi
-])
-
-dnl Test whether frexp() can be used without linking with libm.
-dnl Set gl_cv_func_frexp_no_libm to 'yes' or 'no' accordingly.
-AC_DEFUN([gl_CHECK_FREXP_NO_LIBM],
-[
- AC_CACHE_CHECK([whether frexp() can be used without linking with libm],
- [gl_cv_func_frexp_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x;]],
- [[int e; return frexp (x, &e) > 0;]])],
- [gl_cv_func_frexp_no_libm=yes],
- [gl_cv_func_frexp_no_libm=no])
- ])
-])
-
-dnl Test whether frexp() works also on denormalized numbers (this fails e.g. on
-dnl NetBSD 3.0), on infinite numbers (this fails e.g. on IRIX 6.5 and mingw),
-dnl and on negative zero (this fails e.g. on NetBSD 4.99 and mingw).
-AC_DEFUN([gl_FUNC_FREXP_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_DECLS_ONCE([alarm])
- AC_CACHE_CHECK([whether frexp works], [gl_cv_func_frexp_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <math.h>
-#include <string.h>
-#if HAVE_DECL_ALARM
-# include <signal.h>
-# include <unistd.h>
-#endif
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
- ICC 10.0 has a bug when optimizing the expression -zero.
- The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
- to PowerPC on Mac OS X 10.5. */
-#if defined __hpux || defined __sgi || defined __ICC
-static double
-compute_minus_zero (void)
-{
- return -DBL_MIN * DBL_MIN;
-}
-# define minus_zero compute_minus_zero ()
-#else
-double minus_zero = -0.0;
-#endif
-int main()
-{
- int result = 0;
- int i;
- volatile double x;
- double zero = 0.0;
-#if HAVE_DECL_ALARM
- /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
- number. Let the test fail in this case. */
- signal (SIGALRM, SIG_DFL);
- alarm (5);
-#endif
- /* Test on denormalized numbers. */
- for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
- ;
- if (x > 0.0)
- {
- int exp;
- double y = frexp (x, &exp);
- /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
- On NetBSD: y = 0.75. Correct: y = 0.5. */
- if (y != 0.5)
- result |= 1;
- }
- /* Test on infinite numbers. */
- x = 1.0 / zero;
- {
- int exp;
- double y = frexp (x, &exp);
- if (y != x)
- result |= 2;
- }
- /* Test on negative zero. */
- x = minus_zero;
- {
- int exp;
- double y = frexp (x, &exp);
- if (memcmp (&y, &x, sizeof x))
- result |= 4;
- }
- return result;
-}]])],
- [gl_cv_func_frexp_works=yes],
- [gl_cv_func_frexp_works=no],
- [case "$host_os" in
- netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
- *) gl_cv_func_frexp_works="guessing yes";;
- esac
- ])
- ])
-])
diff --git a/gl/m4/frexpl.m4 b/gl/m4/frexpl.m4
deleted file mode 100644
index 3b64c52233..0000000000
--- a/gl/m4/frexpl.m4
+++ /dev/null
@@ -1,231 +0,0 @@
-# frexpl.m4 serial 20
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_FREXPL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
-
- dnl Persuade glibc <math.h> to declare frexpl().
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- dnl Check whether it's declared.
- dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
-
- FREXPL_LIBM=
- if test $HAVE_DECL_FREXPL = 1; then
- gl_CHECK_FREXPL_NO_LIBM
- if test $gl_cv_func_frexpl_no_libm = no; then
- AC_CACHE_CHECK([whether frexpl() can be used with libm],
- [gl_cv_func_frexpl_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[int e; return frexpl (x, &e) > 0;]])],
- [gl_cv_func_frexpl_in_libm=yes],
- [gl_cv_func_frexpl_in_libm=no])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_frexpl_in_libm = yes; then
- FREXPL_LIBM=-lm
- fi
- fi
- if test $gl_cv_func_frexpl_no_libm = yes \
- || test $gl_cv_func_frexpl_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $FREXPL_LIBM"
- gl_FUNC_FREXPL_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_frexpl_works" in
- *yes) gl_func_frexpl=yes ;;
- *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;;
- esac
- else
- gl_func_frexpl=no
- fi
- if test $gl_func_frexpl = yes; then
- AC_DEFINE([HAVE_FREXPL], [1],
- [Define if the frexpl() function is available.])
- fi
- fi
- if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then
- dnl Find libraries needed to link lib/frexpl.c.
- if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
- AC_REQUIRE([gl_FUNC_FREXP])
- FREXPL_LIBM="$FREXP_LIBM"
- else
- FREXPL_LIBM=
- fi
- fi
- AC_SUBST([FREXPL_LIBM])
-])
-
-AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- dnl Check whether it's declared.
- dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
- if test $HAVE_DECL_FREXPL = 1; then
- gl_CHECK_FREXPL_NO_LIBM
- if test $gl_cv_func_frexpl_no_libm = yes; then
- gl_FUNC_FREXPL_WORKS
- case "$gl_cv_func_frexpl_works" in
- *yes) gl_func_frexpl_no_libm=yes ;;
- *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
- esac
- else
- gl_func_frexpl_no_libm=no
- dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
- REPLACE_FREXPL=1
- fi
- if test $gl_func_frexpl_no_libm = yes; then
- AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
- [Define if the frexpl() function is available in libc.])
- fi
- fi
-])
-
-dnl Test whether frexpl() can be used without linking with libm.
-dnl Set gl_cv_func_frexpl_no_libm to 'yes' or 'no' accordingly.
-AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM],
-[
- AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
- [gl_cv_func_frexpl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[int e; return frexpl (x, &e) > 0;]])],
- [gl_cv_func_frexpl_no_libm=yes],
- [gl_cv_func_frexpl_no_libm=no])
- ])
-])
-
-dnl Test whether frexpl() works on finite numbers (this fails on
-dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
-dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this
-dnl fails e.g. on IRIX 6.5 and mingw).
-AC_DEFUN([gl_FUNC_FREXPL_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether frexpl works], [gl_cv_func_frexpl_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <math.h>
-/* Override the values of <float.h>, like done in float.in.h. */
-#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP (-16381)
-#endif
-#if defined __i386__ && defined __FreeBSD__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP (-16381)
-#endif
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP DBL_MIN_EXP
-#endif
-#if defined __sgi && (LDBL_MANT_DIG >= 106)
-# if defined __GNUC__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP DBL_MIN_EXP
-# endif
-#endif
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double frexpl (long double, int *);
-int main()
-{
- int result = 0;
- volatile long double x;
- /* Test on finite numbers that fails on AIX 5.1. */
- x = 16.0L;
- {
- int exp = -9999;
- frexpl (x, &exp);
- if (exp != 5)
- result |= 1;
- }
- /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
- function returns an invalid (incorrectly normalized) value: it returns
- y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
- but the correct result is
- 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */
- x = 1.01L;
- {
- int exp = -9999;
- long double y = frexpl (x, &exp);
- if (!(exp == 1 && y == 0.505L))
- result |= 2;
- }
- /* Test on large finite numbers. This fails on BeOS at i = 16322, while
- LDBL_MAX_EXP = 16384.
- In the loop end test, we test x against Infinity, rather than comparing
- i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP. */
- {
- int i;
- for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
- {
- int exp = -9999;
- frexpl (x, &exp);
- if (exp != i)
- {
- result |= 4;
- break;
- }
- }
- }
- /* Test on denormalized numbers. */
- {
- int i;
- for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
- ;
- if (x > 0.0L)
- {
- int exp;
- long double y = frexpl (x, &exp);
- /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
- exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
- if (exp != LDBL_MIN_EXP - 1)
- result |= 8;
- }
- }
- /* Test on infinite numbers. */
- x = 1.0L / 0.0L;
- {
- int exp;
- long double y = frexpl (x, &exp);
- if (y != x)
- result |= 16;
- }
- return result;
-}]])],
- [gl_cv_func_frexpl_works=yes],
- [gl_cv_func_frexpl_works=no],
- [
-changequote(,)dnl
- case "$host_os" in
- aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
- gl_cv_func_frexpl_works="guessing no";;
- *) gl_cv_func_frexpl_works="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
diff --git a/gl/m4/fseterr.m4 b/gl/m4/fseterr.m4
deleted file mode 100644
index b8e044b5b7..0000000000
--- a/gl/m4/fseterr.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-# fseterr.m4 serial 1
-dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_FSETERR],
-[
- AC_CHECK_FUNCS_ONCE([__fseterr])
-])
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
deleted file mode 100644
index 50f4509193..0000000000
--- a/gl/m4/getopt.m4
+++ /dev/null
@@ -1,368 +0,0 @@
-# getopt.m4 serial 44
-dnl Copyright (C) 2002-2006, 2008-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Request a POSIX compliant getopt function.
-AC_DEFUN([gl_FUNC_GETOPT_POSIX],
-[
- m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
- dnl Other modules can request the gnulib implementation of the getopt
- dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
- dnl argp.m4 does this.
- m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
- REPLACE_GETOPT=1
- ], [
- REPLACE_GETOPT=0
- if test -n "$gl_replace_getopt"; then
- REPLACE_GETOPT=1
- fi
- ])
- if test $REPLACE_GETOPT = 1; then
- dnl Arrange for getopt.h to be created.
- gl_GETOPT_SUBSTITUTE_HEADER
- fi
-])
-
-# Request a POSIX compliant getopt function with GNU extensions (such as
-# options with optional arguments) and the functions getopt_long,
-# getopt_long_only.
-AC_DEFUN([gl_FUNC_GETOPT_GNU],
-[
- m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
-
- AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
-])
-
-# Determine whether to replace the entire getopt facility.
-AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
-[
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([AC_PROG_AWK]) dnl for awk that supports ENVIRON
-
- dnl Persuade Solaris <unistd.h> to declare optarg, optind, opterr, optopt.
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- gl_CHECK_NEXT_HEADERS([getopt.h])
- if test $ac_cv_header_getopt_h = yes; then
- HAVE_GETOPT_H=1
- else
- HAVE_GETOPT_H=0
- fi
- AC_SUBST([HAVE_GETOPT_H])
-
- gl_replace_getopt=
-
- dnl Test whether <getopt.h> is available.
- if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
- AC_CHECK_HEADERS([getopt.h], [], [gl_replace_getopt=yes])
- fi
-
- dnl Test whether the function getopt_long is available.
- if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
- AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
- fi
-
- dnl POSIX 2008 does not specify leading '+' behavior, but see
- dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
- dnl the next version of POSIX. For now, we only guarantee leading '+'
- dnl behavior with getopt-gnu.
- if test -z "$gl_replace_getopt"; then
- AC_CACHE_CHECK([whether getopt is POSIX compatible],
- [gl_cv_func_getopt_posix],
- [
- dnl Merging these three different test programs into a single one
- dnl would require a reset mechanism. On BSD systems, it can be done
- dnl through 'optreset'; on some others (glibc), it can be done by
- dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
- dnl Solaris 9, musl libc), there is no such mechanism.
- if test $cross_compiling = no; then
- dnl Sanity check. Succeeds everywhere (except on MSVC,
- dnl which lacks <unistd.h> and getopt() entirely).
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-int
-main ()
-{
- static char program[] = "program";
- static char a[] = "-a";
- static char foo[] = "foo";
- static char bar[] = "bar";
- char *argv[] = { program, a, foo, bar, NULL };
- int c;
-
- c = getopt (4, argv, "ab");
- if (!(c == 'a'))
- return 1;
- c = getopt (4, argv, "ab");
- if (!(c == -1))
- return 2;
- if (!(optind == 2))
- return 3;
- return 0;
-}
-]])],
- [gl_cv_func_getopt_posix=maybe],
- [gl_cv_func_getopt_posix=no])
- if test $gl_cv_func_getopt_posix = maybe; then
- dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
- dnl which lacks <unistd.h> and getopt() entirely).
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-int
-main ()
-{
- static char program[] = "program";
- static char donald[] = "donald";
- static char p[] = "-p";
- static char billy[] = "billy";
- static char duck[] = "duck";
- static char a[] = "-a";
- static char bar[] = "bar";
- char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
- int c;
-
- c = getopt (7, argv, "+abp:q:");
- if (!(c == -1))
- return 4;
- if (!(strcmp (argv[0], "program") == 0))
- return 5;
- if (!(strcmp (argv[1], "donald") == 0))
- return 6;
- if (!(strcmp (argv[2], "-p") == 0))
- return 7;
- if (!(strcmp (argv[3], "billy") == 0))
- return 8;
- if (!(strcmp (argv[4], "duck") == 0))
- return 9;
- if (!(strcmp (argv[5], "-a") == 0))
- return 10;
- if (!(strcmp (argv[6], "bar") == 0))
- return 11;
- if (!(optind == 1))
- return 12;
- return 0;
-}
-]])],
- [gl_cv_func_getopt_posix=maybe],
- [gl_cv_func_getopt_posix=no])
- fi
- if test $gl_cv_func_getopt_posix = maybe; then
- dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-int
-main ()
-{
- static char program[] = "program";
- static char ab[] = "-ab";
- char *argv[3] = { program, ab, NULL };
- if (getopt (2, argv, "ab:") != 'a')
- return 13;
- if (getopt (2, argv, "ab:") != '?')
- return 14;
- if (optopt != 'b')
- return 15;
- if (optind != 2)
- return 16;
- return 0;
-}
-]])],
- [gl_cv_func_getopt_posix=yes],
- [gl_cv_func_getopt_posix=no])
- fi
- else
- case "$host_os" in
- darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
- *) gl_cv_func_getopt_posix="guessing yes";;
- esac
- fi
- ])
- case "$gl_cv_func_getopt_posix" in
- *no) gl_replace_getopt=yes ;;
- esac
- fi
-
- if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
- AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_getopt_gnu],
- [# Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
- # optstring is necessary for programs like m4 that have POSIX-mandated
- # semantics for supporting options interspersed with files.
- # Also, since getopt_long is a GNU extension, we require optind=0.
- # Bash ties 'set -o posix' to a non-exported POSIXLY_CORRECT;
- # so take care to revert to the correct (non-)export state.
-dnl GNU Coding Standards currently allow awk but not env; besides, env
-dnl is ambiguous with environment values that contain newlines.
- gl_awk_probe='BEGIN { if ("POSIXLY_CORRECT" in ENVIRON) print "x" }'
- case ${POSIXLY_CORRECT+x}`$AWK "$gl_awk_probe" </dev/null` in
- xx) gl_had_POSIXLY_CORRECT=exported ;;
- x) gl_had_POSIXLY_CORRECT=yes ;;
- *) gl_had_POSIXLY_CORRECT= ;;
- esac
- POSIXLY_CORRECT=1
- export POSIXLY_CORRECT
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[#include <getopt.h>
- #include <stddef.h>
- #include <string.h>
- ]GL_NOCRASH[
- ]], [[
- int result = 0;
-
- nocrash_init();
-
- /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
- and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
- OSF/1 5.1, Solaris 10. */
- {
- static char conftest[] = "conftest";
- static char plus[] = "-+";
- char *argv[3] = { conftest, plus, NULL };
- opterr = 0;
- if (getopt (2, argv, "+a") != '?')
- result |= 1;
- }
- /* This code succeeds on glibc 2.8, mingw,
- and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
- IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
- {
- static char program[] = "program";
- static char p[] = "-p";
- static char foo[] = "foo";
- static char bar[] = "bar";
- char *argv[] = { program, p, foo, bar, NULL };
-
- optind = 1;
- if (getopt (4, argv, "p::") != 'p')
- result |= 2;
- else if (optarg != NULL)
- result |= 4;
- else if (getopt (4, argv, "p::") != -1)
- result |= 6;
- else if (optind != 2)
- result |= 8;
- }
- /* This code succeeds on glibc 2.8 and fails on Cygwin 1.7.0. */
- {
- static char program[] = "program";
- static char foo[] = "foo";
- static char p[] = "-p";
- char *argv[] = { program, foo, p, NULL };
- optind = 0;
- if (getopt (3, argv, "-p") != 1)
- result |= 16;
- else if (getopt (3, argv, "-p") != 'p')
- result |= 16;
- }
- /* This code fails on glibc 2.11. */
- {
- static char program[] = "program";
- static char b[] = "-b";
- static char a[] = "-a";
- char *argv[] = { program, b, a, NULL };
- optind = opterr = 0;
- if (getopt (3, argv, "+:a:b") != 'b')
- result |= 32;
- else if (getopt (3, argv, "+:a:b") != ':')
- result |= 32;
- }
- /* This code dumps core on glibc 2.14. */
- {
- static char program[] = "program";
- static char w[] = "-W";
- static char dummy[] = "dummy";
- char *argv[] = { program, w, dummy, NULL };
- optind = opterr = 1;
- if (getopt (3, argv, "W;") != 'W')
- result |= 64;
- }
- return result;
- ]])],
- [gl_cv_func_getopt_gnu=yes],
- [gl_cv_func_getopt_gnu=no],
- [dnl Cross compiling. Assume the worst, even on glibc platforms.
- gl_cv_func_getopt_gnu="guessing no"
- ])
- case $gl_had_POSIXLY_CORRECT in
- exported) ;;
- yes) AS_UNSET([POSIXLY_CORRECT]); POSIXLY_CORRECT=1 ;;
- *) AS_UNSET([POSIXLY_CORRECT]) ;;
- esac
- ])
- if test "$gl_cv_func_getopt_gnu" != yes; then
- gl_replace_getopt=yes
- else
- AC_CACHE_CHECK([for working GNU getopt_long function],
- [gl_cv_func_getopt_long_gnu],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <getopt.h>
- #include <stddef.h>
- #include <string.h>
- ]],
- [[static const struct option long_options[] =
- {
- { "xtremely-",no_argument, NULL, 1003 },
- { "xtra", no_argument, NULL, 1001 },
- { "xtreme", no_argument, NULL, 1002 },
- { "xtremely", no_argument, NULL, 1003 },
- { NULL, 0, NULL, 0 }
- };
- /* This code fails on OpenBSD 5.0. */
- {
- static char program[] = "program";
- static char xtremel[] = "--xtremel";
- char *argv[] = { program, xtremel, NULL };
- int option_index;
- optind = 1; opterr = 0;
- if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
- return 1;
- }
- return 0;
- ]])],
- [gl_cv_func_getopt_long_gnu=yes],
- [gl_cv_func_getopt_long_gnu=no],
- [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
- case "$host_os" in
- openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
- *) gl_cv_func_getopt_long_gnu="guessing yes";;
- esac
- ])
- ])
- case "$gl_cv_func_getopt_long_gnu" in
- *yes) ;;
- *) gl_replace_getopt=yes ;;
- esac
- fi
- fi
-])
-
-AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
-[
- GETOPT_H=getopt.h
- AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
- [Define to rpl_ if the getopt replacement functions and variables
- should be used.])
- AC_SUBST([GETOPT_H])
-])
-
-# Prerequisites of lib/getopt*.
-AC_DEFUN([gl_PREREQ_GETOPT],
-[
- AC_CHECK_DECLS_ONCE([getenv])
-])
diff --git a/gl/m4/getsubopt.m4 b/gl/m4/getsubopt.m4
deleted file mode 100644
index 4bcfd7ff7c..0000000000
--- a/gl/m4/getsubopt.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# getsubopt.m4 serial 5
-dnl Copyright (C) 2004, 2007, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_GETSUBOPT],
-[
- dnl Persuade glibc <stdlib.h> to declare getsubopt().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([getsubopt])
- if test $ac_cv_func_getsubopt = no; then
- HAVE_GETSUBOPT=0
- fi
-])
-
-# Prerequisites of lib/getsubopt.c.
-AC_DEFUN([gl_PREREQ_GETSUBOPT], [:])
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 7508887da4..8fd1dab998 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -27,28 +27,24 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettimeofday hash-pjw-bare havelib iconv inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings
+# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca base64 bind byteswap c-ctype close connect extensions func gendocs getaddrinfo getpass gettext gettimeofday hash-pjw-bare havelib iconv inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file recv recvfrom select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r u64 unistd valgrind-tests vasprintf vsnprintf warnings
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([gl/override])
gl_MODULES([
accept
alloca
- alphasort
- argp
base64
bind
byteswap
c-ctype
close
connect
- error
extensions
func
gendocs
getaddrinfo
getpass
- getsubopt
gettext
gettimeofday
hash-pjw-bare
@@ -66,11 +62,9 @@ gl_MODULES([
netdb
netinet_in
pmccabe2html
- progname
read-file
recv
recvfrom
- scandir
select
send
sendto
@@ -93,10 +87,6 @@ gl_MODULES([
unistd
valgrind-tests
vasprintf
- version-etc
- version-etc-fsf
- vfprintf-posix
- vprintf-posix
vsnprintf
warnings
])
@@ -108,6 +98,7 @@ gl_DOC_BASE([doc])
gl_TESTS_BASE([gl/tests])
gl_WITH_TESTS
gl_LIB([libgnu])
+gl_LGPL([2])
gl_MAKEFILE_NAME([])
gl_LIBTOOL
gl_MACRO_PREFIX([gl])
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 44786be30c..eb65fb07f4 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -43,9 +43,6 @@ AC_DEFUN([gl_EARLY],
# Code from module alloca:
# Code from module alloca-opt:
# Code from module alloca-opt-tests:
- # Code from module alphasort:
- # Code from module argp:
- # Code from module argp-tests:
# Code from module arpa_inet:
# Code from module arpa_inet-tests:
# Code from module base64:
@@ -60,21 +57,13 @@ AC_DEFUN([gl_EARLY],
# Code from module c-ctype-tests:
# Code from module close:
# Code from module close-tests:
- # Code from module closedir:
# Code from module connect:
# Code from module connect-tests:
- # Code from module dirent:
- # Code from module dirent-tests:
- # Code from module dirname-lgpl:
# Code from module dosname:
- # Code from module double-slash-root:
# Code from module dup2:
# Code from module dup2-tests:
- # Code from module environ:
- # Code from module environ-tests:
# Code from module errno:
# Code from module errno-tests:
- # Code from module error:
# Code from module extensions:
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module extern-inline:
@@ -84,7 +73,6 @@ AC_DEFUN([gl_EARLY],
# Code from module fdopen:
# Code from module fdopen-tests:
# Code from module fgetc-tests:
- # Code from module filename:
# Code from module float:
# Code from module float-tests:
# Code from module fpieee:
@@ -92,17 +80,11 @@ AC_DEFUN([gl_EARLY],
# Code from module fpucw:
# Code from module fputc-tests:
# Code from module fread-tests:
- # Code from module frexp-nolibm:
- # Code from module frexp-nolibm-tests:
- # Code from module frexpl-nolibm:
- # Code from module frexpl-nolibm-tests:
# Code from module fseek:
# Code from module fseek-tests:
# Code from module fseeko:
AC_REQUIRE([AC_FUNC_FSEEKO])
# Code from module fseeko-tests:
- # Code from module fseterr:
- # Code from module fseterr-tests:
# Code from module fstat:
# Code from module fstat-tests:
# Code from module ftell:
@@ -126,14 +108,10 @@ AC_DEFUN([gl_EARLY],
# Code from module getdtablesize-tests:
# Code from module getline:
# Code from module getline-tests:
- # Code from module getopt-gnu:
- # Code from module getopt-posix:
- # Code from module getopt-posix-tests:
# Code from module getpagesize:
# Code from module getpass:
# Code from module getpeername:
# Code from module getpeername-tests:
- # Code from module getsubopt:
# Code from module gettext:
# Code from module gettext-h:
# Code from module gettimeofday:
@@ -158,12 +136,6 @@ AC_DEFUN([gl_EARLY],
# Code from module inttypes-tests:
# Code from module ioctl:
# Code from module ioctl-tests:
- # Code from module isnand-nolibm:
- # Code from module isnand-nolibm-tests:
- # Code from module isnanf-nolibm:
- # Code from module isnanf-nolibm-tests:
- # Code from module isnanl-nolibm:
- # Code from module isnanl-nolibm-tests:
# Code from module largefile:
AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module lib-msvc-compat:
@@ -175,18 +147,11 @@ AC_DEFUN([gl_EARLY],
# Code from module lstat:
# Code from module lstat-tests:
# Code from module maintainer-makefile:
- # Code from module malloc-gnu:
- # Code from module malloc-gnu-tests:
# Code from module malloc-posix:
- # Code from module malloca:
- # Code from module malloca-tests:
# Code from module manywarnings:
- # Code from module math:
- # Code from module math-tests:
# Code from module memchr:
# Code from module memchr-tests:
# Code from module memmem-simple:
- # Code from module mempcpy:
# Code from module minmax:
# Code from module msvc-inval:
# Code from module msvc-nothrow:
@@ -195,10 +160,8 @@ AC_DEFUN([gl_EARLY],
# Code from module netdb-tests:
# Code from module netinet_in:
# Code from module netinet_in-tests:
- # Code from module nocrash:
# Code from module open:
# Code from module open-tests:
- # Code from module opendir:
# Code from module pathmax:
# Code from module pathmax-tests:
# Code from module perror:
@@ -206,25 +169,14 @@ AC_DEFUN([gl_EARLY],
# Code from module pipe-posix:
# Code from module pipe-posix-tests:
# Code from module pmccabe2html:
- # Code from module printf-frexp:
- # Code from module printf-frexp-tests:
- # Code from module printf-frexpl:
- # Code from module printf-frexpl-tests:
- # Code from module printf-safe:
- # Code from module progname:
- # Code from module putenv:
- # Code from module rawmemchr:
- # Code from module rawmemchr-tests:
# Code from module read-file:
# Code from module read-file-tests:
- # Code from module readdir:
# Code from module realloc-posix:
# Code from module recv:
# Code from module recv-tests:
# Code from module recvfrom:
# Code from module recvfrom-tests:
# Code from module same-inode:
- # Code from module scandir:
# Code from module select:
# Code from module select-tests:
# Code from module send:
@@ -232,19 +184,13 @@ AC_DEFUN([gl_EARLY],
# Code from module sendto:
# Code from module sendto-tests:
# Code from module servent:
- # Code from module setenv:
- # Code from module setenv-tests:
# Code from module setsockopt:
# Code from module setsockopt-tests:
# Code from module shutdown:
# Code from module shutdown-tests:
# Code from module signal-h:
# Code from module signal-h-tests:
- # Code from module signbit:
- # Code from module signbit-tests:
# Code from module size_max:
- # Code from module sleep:
- # Code from module sleep-tests:
# Code from module snippet/_Noreturn:
# Code from module snippet/arg-nonnull:
# Code from module snippet/c++defs:
@@ -261,12 +207,6 @@ AC_DEFUN([gl_EARLY],
# Code from module stat-tests:
# Code from module stdalign:
# Code from module stdalign-tests:
- # Code from module stdarg:
- dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
- dnl for the builtin va_copy to work. With Autoconf 2.60 or later,
- dnl gl_PROG_CC_C99 arranges for this. With older Autoconf gl_PROG_CC_C99
- dnl shouldn't hurt, though installers are on their own to set c99 mode.
- gl_PROG_CC_C99
# Code from module stdbool:
# Code from module stdbool-tests:
# Code from module stddef:
@@ -278,8 +218,6 @@ AC_DEFUN([gl_EARLY],
# Code from module stdlib:
# Code from module stdlib-tests:
# Code from module strcase:
- # Code from module strchrnul:
- # Code from module strchrnul-tests:
# Code from module strdup-posix:
# Code from module strerror:
# Code from module strerror-override:
@@ -312,8 +250,6 @@ AC_DEFUN([gl_EARLY],
# Code from module sys_types-tests:
# Code from module sys_uio:
# Code from module sys_uio-tests:
- # Code from module sysexits:
- # Code from module sysexits-tests:
# Code from module test-framework-sh:
# Code from module test-framework-sh-tests:
# Code from module threadlib:
@@ -325,8 +261,6 @@ AC_DEFUN([gl_EARLY],
# Code from module u64-tests:
# Code from module unistd:
# Code from module unistd-tests:
- # Code from module unsetenv:
- # Code from module unsetenv-tests:
# Code from module useless-if-before-free:
# Code from module valgrind-tests:
# Code from module vasnprintf:
@@ -337,13 +271,6 @@ AC_DEFUN([gl_EARLY],
# Code from module vc-list-files-tests:
# Code from module verify:
# Code from module verify-tests:
- # Code from module version-etc:
- # Code from module version-etc-fsf:
- # Code from module version-etc-tests:
- # Code from module vfprintf-posix:
- # Code from module vfprintf-posix-tests:
- # Code from module vprintf-posix:
- # Code from module vprintf-posix-tests:
# Code from module vsnprintf:
# Code from module vsnprintf-tests:
# Code from module warnings:
@@ -376,16 +303,6 @@ LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
changequote([, ])dnl
AC_SUBST([LTALLOCA])
gl_FUNC_ALLOCA
- gl_FUNC_ALPHASORT
- if test $HAVE_ALPHASORT = 0; then
- AC_LIBOBJ([alphasort])
- gl_PREREQ_ALPHASORT
- fi
- gl_DIRENT_MODULE_INDICATOR([alphasort])
- gl_ARGP
- m4_ifdef([AM_XGETTEXT_OPTION],
- [AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format])
- AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])])
gl_HEADER_ARPA_INET
AC_PROG_MKDIR_P
gl_FUNC_BASE64
@@ -400,19 +317,11 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([close])
fi
gl_UNISTD_MODULE_INDICATOR([close])
- gl_FUNC_CLOSEDIR
- if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
- AC_LIBOBJ([closedir])
- fi
- gl_DIRENT_MODULE_INDICATOR([closedir])
AC_REQUIRE([gl_HEADER_SYS_SOCKET])
if test "$ac_cv_header_winsock2_h" = yes; then
AC_LIBOBJ([connect])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([connect])
- gl_DIRENT_H
- gl_DIRNAME_LGPL
- gl_DOUBLE_SLASH_ROOT
gl_FUNC_DUP2
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
AC_LIBOBJ([dup2])
@@ -420,14 +329,6 @@ AC_SUBST([LTALLOCA])
fi
gl_UNISTD_MODULE_INDICATOR([dup2])
gl_HEADER_ERRNO_H
- gl_ERROR
- if test $ac_cv_lib_error_at_line = no; then
- AC_LIBOBJ([error])
- gl_PREREQ_ERROR
- fi
- m4_ifdef([AM_XGETTEXT_OPTION],
- [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
- AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FLOAT_H
if test $REPLACE_FLOAT_LDBL = 1; then
@@ -436,16 +337,6 @@ AC_SUBST([LTALLOCA])
if test $REPLACE_ITOLD = 1; then
AC_LIBOBJ([itold])
fi
- gl_FUNC_FREXP_NO_LIBM
- if test $gl_func_frexp_no_libm != yes; then
- AC_LIBOBJ([frexp])
- fi
- gl_MATH_MODULE_INDICATOR([frexp])
- gl_FUNC_FREXPL_NO_LIBM
- if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
- AC_LIBOBJ([frexpl])
- fi
- gl_MATH_MODULE_INDICATOR([frexpl])
gl_FUNC_FSEEK
if test $REPLACE_FSEEK = 1; then
AC_LIBOBJ([fseek])
@@ -457,10 +348,6 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_FSEEKO
fi
gl_STDIO_MODULE_INDICATOR([fseeko])
- gl_FUNC_FSETERR
- if test $ac_cv_func___fseterr = no; then
- AC_LIBOBJ([fseterr])
- fi
gl_FUNC_FSTAT
if test $REPLACE_FSTAT = 1; then
AC_LIBOBJ([fstat])
@@ -499,25 +386,6 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_GETLINE
fi
gl_STDIO_MODULE_INDICATOR([getline])
- gl_FUNC_GETOPT_GNU
- if test $REPLACE_GETOPT = 1; then
- AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])
- gl_PREREQ_GETOPT
- dnl Arrange for unistd.h to include getopt.h.
- GNULIB_GL_UNISTD_H_GETOPT=1
- fi
- AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
- gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu])
- gl_FUNC_GETOPT_POSIX
- if test $REPLACE_GETOPT = 1; then
- AC_LIBOBJ([getopt])
- AC_LIBOBJ([getopt1])
- gl_PREREQ_GETOPT
- dnl Arrange for unistd.h to include getopt.h.
- GNULIB_GL_UNISTD_H_GETOPT=1
- fi
- AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT])
gl_FUNC_GETPASS
if test $HAVE_GETPASS = 0; then
AC_LIBOBJ([getpass])
@@ -528,12 +396,6 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([getpeername])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([getpeername])
- gl_FUNC_GETSUBOPT
- if test $HAVE_GETSUBOPT = 0; then
- AC_LIBOBJ([getsubopt])
- gl_PREREQ_GETSUBOPT
- fi
- gl_STDLIB_MODULE_INDICATOR([getsubopt])
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
AM_GNU_GETTEXT_VERSION([0.18.1])
AC_SUBST([LIBINTL])
@@ -570,21 +432,6 @@ AC_SUBST([LTALLOCA])
gl_PREREQ_INET_PTON
fi
gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
- gl_FUNC_ISNAND_NO_LIBM
- if test $gl_func_isnand_no_libm != yes; then
- AC_LIBOBJ([isnand])
- gl_PREREQ_ISNAND
- fi
- gl_FUNC_ISNANF_NO_LIBM
- if test $gl_func_isnanf_no_libm != yes; then
- AC_LIBOBJ([isnanf])
- gl_PREREQ_ISNANF
- fi
- gl_FUNC_ISNANL_NO_LIBM
- if test $gl_func_isnanl_no_libm != yes; then
- AC_LIBOBJ([isnanl])
- gl_PREREQ_ISNANL
- fi
AC_REQUIRE([gl_LARGEFILE])
gl_LD_OUTPUT_DEF
gl_LD_VERSION_SCRIPT
@@ -600,17 +447,11 @@ AC_SUBST([LTALLOCA])
gl_UNISTD_MODULE_INDICATOR([lseek])
AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
[AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
- gl_FUNC_MALLOC_GNU
- if test $REPLACE_MALLOC = 1; then
- AC_LIBOBJ([malloc])
- fi
- gl_MODULE_INDICATOR([malloc-gnu])
gl_FUNC_MALLOC_POSIX
if test $REPLACE_MALLOC = 1; then
AC_LIBOBJ([malloc])
fi
gl_STDLIB_MODULE_INDICATOR([malloc-posix])
- gl_MATH_H
gl_FUNC_MEMCHR
if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
AC_LIBOBJ([memchr])
@@ -622,12 +463,6 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([memmem])
fi
gl_STRING_MODULE_INDICATOR([memmem])
- gl_FUNC_MEMPCPY
- if test $HAVE_MEMPCPY = 0; then
- AC_LIBOBJ([mempcpy])
- gl_PREREQ_MEMPCPY
- fi
- gl_STRING_MODULE_INDICATOR([mempcpy])
gl_MINMAX
gl_MSVC_INVAL
if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
@@ -641,29 +476,8 @@ AC_SUBST([LTALLOCA])
gl_HEADER_NETDB
gl_HEADER_NETINET_IN
AC_PROG_MKDIR_P
- gl_FUNC_OPENDIR
- if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
- AC_LIBOBJ([opendir])
- fi
- gl_DIRENT_MODULE_INDICATOR([opendir])
AC_PATH_PROG([PMCCABE], [pmccabe], [false])
- gl_FUNC_PRINTF_FREXP
- gl_FUNC_PRINTF_FREXPL
- m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
- AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
- AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
- gl_FUNC_RAWMEMCHR
- if test $HAVE_RAWMEMCHR = 0; then
- AC_LIBOBJ([rawmemchr])
- gl_PREREQ_RAWMEMCHR
- fi
- gl_STRING_MODULE_INDICATOR([rawmemchr])
gl_PREREQ_READ_FILE
- gl_FUNC_READDIR
- if test $HAVE_READDIR = 0; then
- AC_LIBOBJ([readdir])
- fi
- gl_DIRENT_MODULE_INDICATOR([readdir])
gl_FUNC_REALLOC_POSIX
if test $REPLACE_REALLOC = 1; then
AC_LIBOBJ([realloc])
@@ -679,12 +493,6 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([recvfrom])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom])
- gl_FUNC_SCANDIR
- if test $HAVE_SCANDIR = 0; then
- AC_LIBOBJ([scandir])
- gl_PREREQ_SCANDIR
- fi
- gl_DIRENT_MODULE_INDICATOR([scandir])
gl_FUNC_SELECT
if test $REPLACE_SELECT = 1; then
AC_LIBOBJ([select])
@@ -712,19 +520,7 @@ AC_SUBST([LTALLOCA])
fi
gl_SYS_SOCKET_MODULE_INDICATOR([shutdown])
gl_SIGNAL_H
- gl_SIGNBIT
- if test $REPLACE_SIGNBIT = 1; then
- AC_LIBOBJ([signbitf])
- AC_LIBOBJ([signbitd])
- AC_LIBOBJ([signbitl])
- fi
- gl_MATH_MODULE_INDICATOR([signbit])
gl_SIZE_MAX
- gl_FUNC_SLEEP
- if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
- AC_LIBOBJ([sleep])
- fi
- gl_UNISTD_MODULE_INDICATOR([sleep])
gl_FUNC_SNPRINTF
gl_STDIO_MODULE_INDICATOR([snprintf])
gl_MODULE_INDICATOR([snprintf])
@@ -747,7 +543,6 @@ AC_SUBST([LTALLOCA])
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
gl_STDALIGN_H
- gl_STDARG_H
AM_STDBOOL_H
gl_STDDEF_H
gl_STDINT_H
@@ -762,30 +557,12 @@ AC_SUBST([LTALLOCA])
AC_LIBOBJ([strncasecmp])
gl_PREREQ_STRNCASECMP
fi
- gl_FUNC_STRCHRNUL
- if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
- AC_LIBOBJ([strchrnul])
- gl_PREREQ_STRCHRNUL
- fi
- gl_STRING_MODULE_INDICATOR([strchrnul])
gl_FUNC_STRDUP_POSIX
if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
AC_LIBOBJ([strdup])
gl_PREREQ_STRDUP
fi
gl_STRING_MODULE_INDICATOR([strdup])
- gl_FUNC_STRERROR
- if test $REPLACE_STRERROR = 1; then
- AC_LIBOBJ([strerror])
- fi
- gl_MODULE_INDICATOR([strerror])
- gl_STRING_MODULE_INDICATOR([strerror])
- AC_REQUIRE([gl_HEADER_ERRNO_H])
- AC_REQUIRE([gl_FUNC_STRERROR_0])
- if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
- AC_LIBOBJ([strerror-override])
- gl_PREREQ_SYS_H_WINSOCK2
- fi
gl_HEADER_STRING_H
gl_HEADER_STRINGS_H
gl_FUNC_STRNDUP
@@ -823,7 +600,6 @@ AC_SUBST([LTALLOCA])
AC_PROG_MKDIR_P
gl_HEADER_SYS_UIO
AC_PROG_MKDIR_P
- gl_SYSEXITS
gl_HEADER_TIME_H
gl_TIME_R
if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then
@@ -839,11 +615,6 @@ AC_SUBST([LTALLOCA])
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
- gl_VERSION_ETC
- gl_FUNC_VFPRINTF_POSIX
- gl_STDIO_MODULE_INDICATOR([vfprintf-posix])
- gl_FUNC_VPRINTF_POSIX
- gl_STDIO_MODULE_INDICATOR([vprintf-posix])
gl_FUNC_VSNPRINTF
gl_STDIO_MODULE_INDICATOR([vsnprintf])
gl_WCHAR_H
@@ -894,8 +665,6 @@ changequote([, ])dnl
AC_SUBST([gltests_WITNESS])
gl_module_indicator_condition=$gltests_WITNESS
m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
- gl_ENVIRON
- gl_UNISTD_MODULE_INDICATOR([environ])
gl_FCNTL_H
gl_FUNC_FDOPEN
if test $REPLACE_FDOPEN = 1; then
@@ -938,10 +707,6 @@ changequote([, ])dnl
AC_LIBOBJ([ioctl])
fi
gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
- gl_DOUBLE_EXPONENT_LOCATION
- gl_FLOAT_EXPONENT_LOCATION
- gl_LONG_DOUBLE_EXPONENT_LOCATION
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
gl_LOCK
gl_MODULE_INDICATOR([lock])
gl_FUNC_LSTAT
@@ -950,7 +715,6 @@ changequote([, ])dnl
gl_PREREQ_LSTAT
fi
gl_SYS_STAT_MODULE_INDICATOR([lstat])
- gl_MALLOCA
dnl Check for prerequisites for memory fence checks.
gl_FUNC_MMAP_ANON
AC_CHECK_HEADERS_ONCE([sys/mman.h])
@@ -972,26 +736,7 @@ changequote([, ])dnl
AC_LIBOBJ([pipe])
fi
gl_UNISTD_MODULE_INDICATOR([pipe])
- gl_FUNC_PUTENV
- if test $REPLACE_PUTENV = 1; then
- AC_LIBOBJ([putenv])
- gl_PREREQ_PUTENV
- fi
- gl_STDLIB_MODULE_INDICATOR([putenv])
- dnl Check for prerequisites for memory fence checks.
- gl_FUNC_MMAP_ANON
- AC_CHECK_HEADERS_ONCE([sys/mman.h])
- AC_CHECK_FUNCS_ONCE([mprotect])
AC_CHECK_HEADERS_ONCE([sys/wait.h])
- gl_FUNC_SETENV
- if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
- AC_LIBOBJ([setenv])
- fi
- gl_STDLIB_MODULE_INDICATOR([setenv])
- AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
- AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
- AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION])
- AC_CHECK_DECLS_ONCE([alarm])
gl_FUNC_STAT
if test $REPLACE_STAT = 1; then
AC_LIBOBJ([stat])
@@ -1000,6 +745,18 @@ changequote([, ])dnl
gl_SYS_STAT_MODULE_INDICATOR([stat])
AC_REQUIRE([gt_TYPE_WCHAR_T])
AC_REQUIRE([gt_TYPE_WINT_T])
+ gl_FUNC_STRERROR
+ if test $REPLACE_STRERROR = 1; then
+ AC_LIBOBJ([strerror])
+ fi
+ gl_MODULE_INDICATOR([strerror])
+ gl_STRING_MODULE_INDICATOR([strerror])
+ AC_REQUIRE([gl_HEADER_ERRNO_H])
+ AC_REQUIRE([gl_FUNC_STRERROR_0])
+ if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+ AC_LIBOBJ([strerror-override])
+ gl_PREREQ_SYS_H_WINSOCK2
+ fi
gl_FUNC_STRERROR_R
if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
AC_LIBOBJ([strerror_r])
@@ -1019,12 +776,6 @@ changequote([, ])dnl
AC_PROG_MKDIR_P
AC_CHECK_FUNCS_ONCE([shutdown])
gl_THREADLIB
- gl_FUNC_UNSETENV
- if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
- AC_LIBOBJ([unsetenv])
- gl_PREREQ_UNSETENV
- fi
- gl_STDLIB_MODULE_INDICATOR([unsetenv])
gl_VALGRIND_TESTS
abs_aux_dir=`cd "$ac_aux_dir"; pwd`
AC_SUBST([abs_aux_dir])
@@ -1134,55 +885,26 @@ AC_DEFUN([gl_FILE_LIST], [
lib/accept.c
lib/alloca.c
lib/alloca.in.h
- lib/alphasort.c
- lib/argp-ba.c
- lib/argp-eexst.c
- lib/argp-fmtstream.c
- lib/argp-fmtstream.h
- lib/argp-fs-xinl.c
- lib/argp-help.c
- lib/argp-namefrob.h
- lib/argp-parse.c
- lib/argp-pin.c
- lib/argp-pv.c
- lib/argp-pvh.c
- lib/argp-xinl.c
- lib/argp.h
lib/arpa_inet.in.h
lib/asnprintf.c
lib/asprintf.c
lib/base64.c
lib/base64.h
- lib/basename-lgpl.c
lib/bind.c
lib/byteswap.in.h
lib/c-ctype.c
lib/c-ctype.h
lib/close.c
- lib/closedir.c
lib/connect.c
- lib/dirent-private.h
- lib/dirent.in.h
- lib/dirname-lgpl.c
- lib/dirname.h
- lib/dosname.h
lib/dup2.c
lib/errno.in.h
- lib/error.c
- lib/error.h
lib/fd-hook.c
lib/fd-hook.h
- lib/filename.h
lib/float+.h
lib/float.c
lib/float.in.h
- lib/fpucw.h
- lib/frexp.c
- lib/frexpl.c
lib/fseek.c
lib/fseeko.c
- lib/fseterr.c
- lib/fseterr.h
lib/fstat.c
lib/ftell.c
lib/ftello.c
@@ -1190,38 +912,22 @@ AC_DEFUN([gl_FILE_LIST], [
lib/getaddrinfo.c
lib/getdelim.c
lib/getline.c
- lib/getopt.c
- lib/getopt.in.h
- lib/getopt1.c
- lib/getopt_int.h
lib/getpass.c
lib/getpass.h
lib/getpeername.c
- lib/getsubopt.c
lib/gettext.h
lib/gettimeofday.c
lib/hash-pjw-bare.c
lib/hash-pjw-bare.h
lib/inet_ntop.c
lib/inet_pton.c
- lib/intprops.h
- lib/isnan.c
- lib/isnand-nolibm.h
- lib/isnand.c
- lib/isnanf-nolibm.h
- lib/isnanf.c
- lib/isnanl-nolibm.h
- lib/isnanl.c
lib/itold.c
lib/listen.c
lib/lseek.c
lib/malloc.c
- lib/math.c
- lib/math.in.h
lib/memchr.c
lib/memchr.valgrind
lib/memmem.c
- lib/mempcpy.c
lib/minmax.h
lib/msvc-inval.c
lib/msvc-inval.h
@@ -1229,43 +935,27 @@ AC_DEFUN([gl_FILE_LIST], [
lib/msvc-nothrow.h
lib/netdb.in.h
lib/netinet_in.in.h
- lib/opendir.c
lib/printf-args.c
lib/printf-args.h
- lib/printf-frexp.c
- lib/printf-frexp.h
- lib/printf-frexpl.c
- lib/printf-frexpl.h
lib/printf-parse.c
lib/printf-parse.h
- lib/progname.c
- lib/progname.h
- lib/rawmemchr.c
- lib/rawmemchr.valgrind
lib/read-file.c
lib/read-file.h
- lib/readdir.c
lib/realloc.c
lib/recv.c
lib/recvfrom.c
- lib/scandir.c
lib/select.c
lib/send.c
lib/sendto.c
lib/setsockopt.c
lib/shutdown.c
lib/signal.in.h
- lib/signbitd.c
- lib/signbitf.c
- lib/signbitl.c
lib/size_max.h
- lib/sleep.c
lib/snprintf.c
lib/socket.c
lib/sockets.c
lib/sockets.h
lib/stdalign.in.h
- lib/stdarg.in.h
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
@@ -1274,15 +964,9 @@ AC_DEFUN([gl_FILE_LIST], [
lib/stdlib.in.h
lib/str-two-way.h
lib/strcasecmp.c
- lib/strchrnul.c
- lib/strchrnul.valgrind
lib/strdup.c
- lib/strerror-override.c
- lib/strerror-override.h
- lib/strerror.c
lib/string.in.h
lib/strings.in.h
- lib/stripslash.c
lib/strncasecmp.c
lib/strndup.c
lib/strnlen.c
@@ -1295,7 +979,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/sys_time.in.h
lib/sys_types.in.h
lib/sys_uio.in.h
- lib/sysexits.in.h
lib/time.in.h
lib/time_r.c
lib/u64.c
@@ -1306,11 +989,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/vasnprintf.h
lib/vasprintf.c
lib/verify.h
- lib/version-etc-fsf.c
- lib/version-etc.c
- lib/version-etc.h
- lib/vfprintf.c
- lib/vprintf.c
lib/vsnprintf.c
lib/w32sock.h
lib/wchar.in.h
@@ -1318,25 +996,14 @@ AC_DEFUN([gl_FILE_LIST], [
lib/xsize.h
m4/00gnulib.m4
m4/alloca.m4
- m4/alphasort.m4
- m4/argp.m4
m4/arpa_inet_h.m4
m4/base64.m4
m4/byteswap.m4
m4/close.m4
- m4/closedir.m4
m4/codeset.m4
- m4/dirent_h.m4
- m4/dirname.m4
- m4/double-slash-root.m4
m4/dup2.m4
- m4/eealloc.m4
- m4/environ.m4
m4/errno_h.m4
- m4/error.m4
m4/exponentd.m4
- m4/exponentf.m4
- m4/exponentl.m4
m4/extensions.m4
m4/extern-inline.m4
m4/fcntl-o.m4
@@ -1344,11 +1011,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/fdopen.m4
m4/float_h.m4
m4/fpieee.m4
- m4/frexp.m4
- m4/frexpl.m4
m4/fseek.m4
m4/fseeko.m4
- m4/fseterr.m4
m4/fstat.m4
m4/ftell.m4
m4/ftello.m4
@@ -1359,10 +1023,8 @@ AC_DEFUN([gl_FILE_LIST], [
m4/getdelim.m4
m4/getdtablesize.m4
m4/getline.m4
- m4/getopt.m4
m4/getpagesize.m4
m4/getpass.m4
- m4/getsubopt.m4
m4/gettext.m4
m4/gettimeofday.m4
m4/glibc2.m4
@@ -1383,14 +1045,10 @@ AC_DEFUN([gl_FILE_LIST], [
m4/inttypes.m4
m4/inttypes_h.m4
m4/ioctl.m4
- m4/isnand.m4
- m4/isnanf.m4
- m4/isnanl.m4
m4/largefile.m4
m4/lcmessage.m4
m4/ld-output-def.m4
m4/ld-version-script.m4
- m4/ldexpl.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
@@ -1399,12 +1057,10 @@ AC_DEFUN([gl_FILE_LIST], [
m4/lseek.m4
m4/lstat.m4
m4/malloc.m4
- m4/malloca.m4
m4/manywarnings.m4
m4/math_h.m4
m4/memchr.m4
m4/memmem.m4
- m4/mempcpy.m4
m4/minmax.m4
m4/mmap-anon.m4
m4/mode_t.m4
@@ -1414,32 +1070,21 @@ AC_DEFUN([gl_FILE_LIST], [
m4/netdb_h.m4
m4/netinet_in_h.m4
m4/nls.m4
- m4/nocrash.m4
m4/off_t.m4
m4/open.m4
- m4/opendir.m4
m4/pathmax.m4
m4/perror.m4
m4/pipe.m4
m4/po.m4
- m4/printf-frexp.m4
- m4/printf-frexpl.m4
m4/printf-posix.m4
m4/printf.m4
m4/progtest.m4
- m4/putenv.m4
- m4/rawmemchr.m4
m4/read-file.m4
- m4/readdir.m4
m4/realloc.m4
- m4/scandir.m4
m4/select.m4
m4/servent.m4
- m4/setenv.m4
m4/signal_h.m4
- m4/signbit.m4
m4/size_max.m4
- m4/sleep.m4
m4/snprintf.m4
m4/socketlib.m4
m4/sockets.m4
@@ -1448,7 +1093,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/ssize_t.m4
m4/stat.m4
m4/stdalign.m4
- m4/stdarg.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
@@ -1456,7 +1100,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/stdio_h.m4
m4/stdlib_h.m4
m4/strcase.m4
- m4/strchrnul.m4
m4/strdup.m4
m4/strerror.m4
m4/strerror_r.m4
@@ -1474,7 +1117,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/sys_time_h.m4
m4/sys_types_h.m4
m4/sys_uio_h.m4
- m4/sysexits.m4
m4/threadlib.m4
m4/time_h.m4
m4/time_r.m4
@@ -1484,10 +1126,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/valgrind-tests.m4
m4/vasnprintf.m4
m4/vasprintf.m4
- m4/version-etc.m4
- m4/vfprintf-posix.m4
m4/visibility.m4
- m4/vprintf-posix.m4
m4/vsnprintf.m4
m4/warn-on-use.m4
m4/warnings.m4
@@ -1495,18 +1134,11 @@ AC_DEFUN([gl_FILE_LIST], [
m4/wchar_t.m4
m4/wint_t.m4
m4/xsize.m4
- tests/infinity.h
tests/init.sh
tests/macros.h
- tests/minus-zero.h
- tests/nan.h
- tests/randomd.c
- tests/randoml.c
tests/signature.h
tests/test-accept.c
tests/test-alloca-opt.c
- tests/test-argp-2.sh
- tests/test-argp.c
tests/test-arpa_inet.c
tests/test-base64.c
tests/test-binary-io.c
@@ -1516,20 +1148,14 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-c-ctype.c
tests/test-close.c
tests/test-connect.c
- tests/test-dirent.c
tests/test-dup2.c
- tests/test-environ.c
tests/test-errno.c
tests/test-fcntl-h.c
tests/test-fdopen.c
tests/test-fgetc.c
tests/test-float.c
- tests/test-fprintf-posix.h
tests/test-fputc.c
tests/test-fread.c
- tests/test-frexp.c
- tests/test-frexp.h
- tests/test-frexpl.c
tests/test-fseek.c
tests/test-fseek.sh
tests/test-fseek2.sh
@@ -1540,7 +1166,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-fseeko3.sh
tests/test-fseeko4.c
tests/test-fseeko4.sh
- tests/test-fseterr.c
tests/test-fstat.c
tests/test-ftell.c
tests/test-ftell.sh
@@ -1561,9 +1186,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-getdelim.c
tests/test-getdtablesize.c
tests/test-getline.c
- tests/test-getopt.c
- tests/test-getopt.h
- tests/test-getopt_long.h
tests/test-getpeername.c
tests/test-gettimeofday.c
tests/test-iconv.c
@@ -1574,18 +1196,9 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-intprops.c
tests/test-inttypes.c
tests/test-ioctl.c
- tests/test-isnand-nolibm.c
- tests/test-isnand.h
- tests/test-isnanf-nolibm.c
- tests/test-isnanf.h
- tests/test-isnanl-nolibm.c
- tests/test-isnanl.h
tests/test-listen.c
tests/test-lstat.c
tests/test-lstat.h
- tests/test-malloc-gnu.c
- tests/test-malloca.c
- tests/test-math.c
tests/test-memchr.c
tests/test-netdb.c
tests/test-netinet_in.c
@@ -1596,11 +1209,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-perror.sh
tests/test-perror2.c
tests/test-pipe.c
- tests/test-printf-frexp.c
- tests/test-printf-frexpl.c
- tests/test-printf-posix.h
- tests/test-printf-posix.output
- tests/test-rawmemchr.c
tests/test-read-file.c
tests/test-recv.c
tests/test-recvfrom.c
@@ -1612,12 +1220,9 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-select.h
tests/test-send.c
tests/test-sendto.c
- tests/test-setenv.c
tests/test-setsockopt.c
tests/test-shutdown.c
tests/test-signal-h.c
- tests/test-signbit.c
- tests/test-sleep.c
tests/test-snprintf.c
tests/test-sockets.c
tests/test-stat.c
@@ -1628,7 +1233,6 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-stdint.c
tests/test-stdio.c
tests/test-stdlib.c
- tests/test-strchrnul.c
tests/test-strerror.c
tests/test-strerror_r.c
tests/test-string.c
@@ -1645,30 +1249,24 @@ AC_DEFUN([gl_FILE_LIST], [
tests/test-sys_types.c
tests/test-sys_uio.c
tests/test-sys_wait.h
- tests/test-sysexits.c
tests/test-time.c
tests/test-u64.c
tests/test-unistd.c
- tests/test-unsetenv.c
tests/test-vasnprintf.c
tests/test-vasprintf.c
tests/test-vc-list-files-cvs.sh
tests/test-vc-list-files-git.sh
tests/test-verify.c
tests/test-verify.sh
- tests/test-version-etc.c
- tests/test-version-etc.sh
- tests/test-vfprintf-posix.c
- tests/test-vfprintf-posix.sh
- tests/test-vprintf-posix.c
- tests/test-vprintf-posix.sh
tests/test-vsnprintf.c
tests/test-wchar.c
tests/zerosize-ptr.h
tests=lib/binary-io.c
tests=lib/binary-io.h
+ tests=lib/dosname.h
tests=lib/fcntl.in.h
tests=lib/fdopen.c
+ tests=lib/fpucw.h
tests=lib/ftruncate.c
tests=lib/getcwd-lgpl.c
tests=lib/getdtablesize.c
@@ -1677,24 +1275,22 @@ AC_DEFUN([gl_FILE_LIST], [
tests=lib/glthread/lock.h
tests=lib/glthread/threadlib.c
tests=lib/ignore-value.h
+ tests=lib/intprops.h
tests=lib/inttypes.in.h
tests=lib/ioctl.c
tests=lib/lstat.c
- tests=lib/malloca.c
- tests=lib/malloca.h
- tests=lib/malloca.valgrind
tests=lib/open.c
tests=lib/pathmax.h
tests=lib/perror.c
tests=lib/pipe.c
- tests=lib/putenv.c
tests=lib/same-inode.h
- tests=lib/setenv.c
tests=lib/stat.c
+ tests=lib/strerror-override.c
+ tests=lib/strerror-override.h
+ tests=lib/strerror.c
tests=lib/strerror_r.c
tests=lib/symlink.c
tests=lib/sys_ioctl.in.h
- tests=lib/unsetenv.c
tests=lib/w32sock.h
top/GNUmakefile
top/maint.mk
diff --git a/gl/m4/isnand.m4 b/gl/m4/isnand.m4
deleted file mode 100644
index ee05e0f93c..0000000000
--- a/gl/m4/isnand.m4
+++ /dev/null
@@ -1,96 +0,0 @@
-# isnand.m4 serial 11
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Check how to get or define isnand().
-
-AC_DEFUN([gl_FUNC_ISNAND],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- ISNAND_LIBM=
- gl_HAVE_ISNAND_NO_LIBM
- if test $gl_cv_func_isnand_no_libm = no; then
- gl_HAVE_ISNAND_IN_LIBM
- if test $gl_cv_func_isnand_in_libm = yes; then
- ISNAND_LIBM=-lm
- fi
- fi
- dnl The variable gl_func_isnand set here is used by isnan.m4.
- if test $gl_cv_func_isnand_no_libm = yes \
- || test $gl_cv_func_isnand_in_libm = yes; then
- gl_func_isnand=yes
- else
- gl_func_isnand=no
- HAVE_ISNAND=0
- fi
- AC_SUBST([ISNAND_LIBM])
-])
-
-dnl Check how to get or define isnand() without linking with libm.
-
-AC_DEFUN([gl_FUNC_ISNAND_NO_LIBM],
-[
- gl_HAVE_ISNAND_NO_LIBM
- gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
- if test $gl_cv_func_isnand_no_libm = yes; then
- AC_DEFINE([HAVE_ISNAND_IN_LIBC], [1],
- [Define if the isnan(double) function is available in libc.])
- fi
-])
-
-dnl Prerequisites of replacement isnand definition. It does not need -lm.
-AC_DEFUN([gl_PREREQ_ISNAND],
-[
- AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
-])
-
-dnl Test whether isnand() can be used with libm.
-
-AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(double) can be used with libm],
- [gl_cv_func_isnand_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if __GNUC__ >= 4
- # undef isnand
- # define isnand(x) __builtin_isnan ((double)(x))
- #elif defined isnan
- # undef isnand
- # define isnand(x) isnan ((double)(x))
- #endif
- double x;]],
- [[return isnand (x);]])],
- [gl_cv_func_isnand_in_libm=yes],
- [gl_cv_func_isnand_in_libm=no])
- LIBS="$save_LIBS"
- ])
-])
-
-AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(double) can be used without linking with libm],
- [gl_cv_func_isnand_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if __GNUC__ >= 4
- # undef isnand
- # define isnand(x) __builtin_isnan ((double)(x))
- #else
- # undef isnand
- # define isnand(x) isnan ((double)(x))
- #endif
- double x;]],
- [[return isnand (x);]])],
- [gl_cv_func_isnand_no_libm=yes],
- [gl_cv_func_isnand_no_libm=no])
- ])
-])
diff --git a/gl/m4/isnanf.m4 b/gl/m4/isnanf.m4
deleted file mode 100644
index f01886a683..0000000000
--- a/gl/m4/isnanf.m4
+++ /dev/null
@@ -1,188 +0,0 @@
-# isnanf.m4 serial 14
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Check how to get or define isnanf().
-
-AC_DEFUN([gl_FUNC_ISNANF],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- ISNANF_LIBM=
- gl_HAVE_ISNANF_NO_LIBM
- if test $gl_cv_func_isnanf_no_libm = no; then
- gl_HAVE_ISNANF_IN_LIBM
- if test $gl_cv_func_isnanf_in_libm = yes; then
- ISNANF_LIBM=-lm
- fi
- fi
- dnl The variable gl_func_isnanf set here is used by isnan.m4.
- if test $gl_cv_func_isnanf_no_libm = yes \
- || test $gl_cv_func_isnanf_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $ISNANF_LIBM"
- gl_ISNANF_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_isnanf_works" in
- *yes) gl_func_isnanf=yes ;;
- *) gl_func_isnanf=no; ISNANF_LIBM= ;;
- esac
- else
- gl_func_isnanf=no
- fi
- if test $gl_func_isnanf != yes; then
- HAVE_ISNANF=0
- fi
- AC_SUBST([ISNANF_LIBM])
-])
-
-dnl Check how to get or define isnanf() without linking with libm.
-
-AC_DEFUN([gl_FUNC_ISNANF_NO_LIBM],
-[
- gl_HAVE_ISNANF_NO_LIBM
- if test $gl_cv_func_isnanf_no_libm = yes; then
- gl_ISNANF_WORKS
- fi
- if test $gl_cv_func_isnanf_no_libm = yes \
- && { case "$gl_cv_func_isnanf_works" in
- *yes) true;;
- *) false;;
- esac
- }; then
- gl_func_isnanf_no_libm=yes
- AC_DEFINE([HAVE_ISNANF_IN_LIBC], [1],
- [Define if the isnan(float) function is available in libc.])
- else
- gl_func_isnanf_no_libm=no
- fi
-])
-
-dnl Prerequisites of replacement isnanf definition. It does not need -lm.
-AC_DEFUN([gl_PREREQ_ISNANF],
-[
- gl_FLOAT_EXPONENT_LOCATION
-])
-
-dnl Test whether isnanf() can be used without libm.
-AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(float) can be used without linking with libm],
- [gl_cv_func_isnanf_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if __GNUC__ >= 4
- # undef isnanf
- # define isnanf(x) __builtin_isnanf ((float)(x))
- #elif defined isnan
- # undef isnanf
- # define isnanf(x) isnan ((float)(x))
- #endif
- float x;]],
- [[return isnanf (x);]])],
- [gl_cv_func_isnanf_no_libm=yes],
- [gl_cv_func_isnanf_no_libm=no])
- ])
-])
-
-dnl Test whether isnanf() can be used with libm.
-AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(float) can be used with libm],
- [gl_cv_func_isnanf_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if __GNUC__ >= 4
- # undef isnanf
- # define isnanf(x) __builtin_isnanf ((float)(x))
- #elif defined isnan
- # undef isnanf
- # define isnanf(x) isnan ((float)(x))
- #endif
- float x;]],
- [[return isnanf (x);]])],
- [gl_cv_func_isnanf_in_libm=yes],
- [gl_cv_func_isnanf_in_libm=no])
- LIBS="$save_LIBS"
- ])
-])
-
-dnl Test whether isnanf() rejects Infinity (this fails on Solaris 2.5.1),
-dnl recognizes a NaN (this fails on IRIX 6.5 with cc), and recognizes a NaN
-dnl with in-memory representation 0x7fbfffff (this fails on IRIX 6.5).
-AC_DEFUN([gl_ISNANF_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
- AC_CACHE_CHECK([whether isnan(float) works], [gl_cv_func_isnanf_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <math.h>
-#if __GNUC__ >= 4
-# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
-#elif defined isnan
-# undef isnanf
-# define isnanf(x) isnan ((float)(x))
-#endif
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
-#ifdef __DECC
-static float
-NaN ()
-{
- static float zero = 0.0f;
- return zero / zero;
-}
-#else
-# define NaN() (0.0f / 0.0f)
-#endif
-#define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; float value; } memory_float;
-int main()
-{
- int result = 0;
-
- if (isnanf (1.0f / 0.0f))
- result |= 1;
-
- if (!isnanf (NaN ()))
- result |= 2;
-
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
- /* The isnanf function should be immune against changes in the sign bit and
- in the mantissa bits. The xor operation twiddles a bit that can only be
- a sign bit or a mantissa bit. */
- if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
- {
- memory_float m;
-
- m.value = NaN ();
- /* Set the bits below the exponent to 01111...111. */
- m.word[0] &= -1U << FLT_EXPBIT0_BIT;
- m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
- if (!isnanf (m.value))
- result |= 4;
- }
-#endif
-
- return result;
-}]])],
- [gl_cv_func_isnanf_works=yes],
- [gl_cv_func_isnanf_works=no],
- [case "$host_os" in
- irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
- *) gl_cv_func_isnanf_works="guessing yes";;
- esac
- ])
- ])
-])
diff --git a/gl/m4/isnanl.m4 b/gl/m4/isnanl.m4
deleted file mode 100644
index ed5bbf8ba2..0000000000
--- a/gl/m4/isnanl.m4
+++ /dev/null
@@ -1,255 +0,0 @@
-# isnanl.m4 serial 17
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_ISNANL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- ISNANL_LIBM=
- gl_HAVE_ISNANL_NO_LIBM
- if test $gl_cv_func_isnanl_no_libm = no; then
- gl_HAVE_ISNANL_IN_LIBM
- if test $gl_cv_func_isnanl_in_libm = yes; then
- ISNANL_LIBM=-lm
- fi
- fi
- dnl The variable gl_func_isnanl set here is used by isnan.m4.
- if test $gl_cv_func_isnanl_no_libm = yes \
- || test $gl_cv_func_isnanl_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $ISNANL_LIBM"
- gl_FUNC_ISNANL_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_isnanl_works" in
- *yes) gl_func_isnanl=yes ;;
- *) gl_func_isnanl=no; ISNANL_LIBM= ;;
- esac
- else
- gl_func_isnanl=no
- fi
- if test $gl_func_isnanl != yes; then
- HAVE_ISNANL=0
- fi
- AC_SUBST([ISNANL_LIBM])
-])
-
-AC_DEFUN([gl_FUNC_ISNANL_NO_LIBM],
-[
- gl_HAVE_ISNANL_NO_LIBM
- gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
- if test $gl_func_isnanl_no_libm = yes; then
- gl_FUNC_ISNANL_WORKS
- case "$gl_cv_func_isnanl_works" in
- *yes) ;;
- *) gl_func_isnanl_no_libm=no ;;
- esac
- fi
- if test $gl_func_isnanl_no_libm = yes; then
- AC_DEFINE([HAVE_ISNANL_IN_LIBC], [1],
- [Define if the isnan(long double) function is available in libc.])
- fi
-])
-
-dnl Prerequisites of replacement isnanl definition. It does not need -lm.
-AC_DEFUN([gl_PREREQ_ISNANL],
-[
- gl_LONG_DOUBLE_EXPONENT_LOCATION
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
-])
-
-dnl Test whether isnanl() can be used without libm.
-AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(long double) can be used without linking with libm],
- [gl_cv_func_isnanl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if __GNUC__ >= 4
- # undef isnanl
- # define isnanl(x) __builtin_isnanl ((long double)(x))
- #elif defined isnan
- # undef isnanl
- # define isnanl(x) isnan ((long double)(x))
- #endif
- long double x;]],
- [[return isnanl (x);]])],
- [gl_cv_func_isnanl_no_libm=yes],
- [gl_cv_func_isnanl_no_libm=no])
- ])
-])
-
-dnl Test whether isnanl() can be used with libm.
-AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
-[
- AC_CACHE_CHECK([whether isnan(long double) can be used with libm],
- [gl_cv_func_isnanl_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- #if __GNUC__ >= 4
- # undef isnanl
- # define isnanl(x) __builtin_isnanl ((long double)(x))
- #elif defined isnan
- # undef isnanl
- # define isnanl(x) isnan ((long double)(x))
- #endif
- long double x;]],
- [[return isnanl (x);]])],
- [gl_cv_func_isnanl_in_libm=yes],
- [gl_cv_func_isnanl_in_libm=no])
- LIBS="$save_LIBS"
- ])
-])
-
-dnl Test whether isnanl() recognizes all numbers which are neither finite nor
-dnl infinite. This test fails e.g. on NetBSD/i386 and on glibc/ia64.
-dnl Also, the GCC >= 4.0 built-in __builtin_isnanl does not pass the tests
-dnl - for pseudo-denormals on i686 and x86_64,
-dnl - for pseudo-zeroes, unnormalized numbers, and pseudo-denormals on ia64.
-AC_DEFUN([gl_FUNC_ISNANL_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([gl_BIGENDIAN])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-#if __GNUC__ >= 4
-# undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
-#elif defined isnan
-# undef isnanl
-# define isnanl(x) isnan ((long double)(x))
-#endif
-#define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; long double value; }
- memory_long_double;
-/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
- runtime type conversion. */
-#ifdef __sgi
-static long double NaNl ()
-{
- double zero = 0.0;
- return zero / zero;
-}
-#else
-# define NaNl() (0.0L / 0.0L)
-#endif
-int main ()
-{
- int result = 0;
-
- if (!isnanl (NaNl ()))
- result |= 1;
-
- {
- memory_long_double m;
- unsigned int i;
-
- /* The isnanl function should be immune against changes in the sign bit and
- in the mantissa bits. The xor operation twiddles a bit that can only be
- a sign bit or a mantissa bit (since the exponent never extends to
- bit 31). */
- m.value = NaNl ();
- m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
- for (i = 0; i < NWORDS; i++)
- m.word[i] |= 1;
- if (!isnanl (m.value))
- result |= 1;
- }
-
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-/* Representation of an 80-bit 'long double' as an initializer for a sequence
- of 'unsigned int' words. */
-# ifdef WORDS_BIGENDIAN
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
- ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
- (unsigned int) (mantlo) << 16 \
- }
-# else
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { mantlo, manthi, exponent }
-# endif
- { /* Quiet NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
- if (!isnanl (x.value))
- result |= 2;
- }
- {
- /* Signalling NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
- if (!isnanl (x.value))
- result |= 2;
- }
- /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities,
- Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
- Intel IA-64 Architecture Software Developer's Manual, Volume 1:
- Application Architecture.
- Table 5-2 "Floating-Point Register Encodings"
- Figure 5-6 "Memory to Floating-Point Register Data Translation"
- */
- { /* Pseudo-NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
- if (!isnanl (x.value))
- result |= 4;
- }
- { /* Pseudo-Infinity. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
- if (!isnanl (x.value))
- result |= 8;
- }
- { /* Pseudo-Zero. */
- static memory_long_double x =
- { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
- if (!isnanl (x.value))
- result |= 16;
- }
- { /* Unnormalized number. */
- static memory_long_double x =
- { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
- if (!isnanl (x.value))
- result |= 32;
- }
- { /* Pseudo-Denormal. */
- static memory_long_double x =
- { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
- if (!isnanl (x.value))
- result |= 64;
- }
-#endif
-
- return result;
-}]])],
- [gl_cv_func_isnanl_works=yes],
- [gl_cv_func_isnanl_works=no],
- [case "$host_cpu" in
- # Guess no on ia64, x86_64, i386.
- ia64 | x86_64 | i*86) gl_cv_func_isnanl_works="guessing no";;
- *)
- case "$host_os" in
- netbsd*) gl_cv_func_isnanl_works="guessing no";;
- *) gl_cv_func_isnanl_works="guessing yes";;
- esac
- ;;
- esac
- ])
- ])
-])
diff --git a/gl/m4/ldexpl.m4 b/gl/m4/ldexpl.m4
deleted file mode 100644
index 1223711469..0000000000
--- a/gl/m4/ldexpl.m4
+++ /dev/null
@@ -1,133 +0,0 @@
-# ldexpl.m4 serial 16
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_LDEXPL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
- AC_REQUIRE([gl_FUNC_ISNANL]) dnl for ISNANL_LIBM
-
- dnl Persuade glibc <math.h> to declare ldexpl().
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- dnl Check whether it's declared.
- dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
-
- LDEXPL_LIBM=
- if test $HAVE_DECL_LDEXPL = 1; then
- gl_CHECK_LDEXPL_NO_LIBM
- if test $gl_cv_func_ldexpl_no_libm = no; then
- AC_CACHE_CHECK([whether ldexpl() can be used with libm],
- [gl_cv_func_ldexpl_in_libm],
- [
- save_LIBS="$LIBS"
- LIBS="$LIBS -lm"
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[return ldexpl (x, -1) > 0;]])],
- [gl_cv_func_ldexpl_in_libm=yes],
- [gl_cv_func_ldexpl_in_libm=no])
- LIBS="$save_LIBS"
- ])
- if test $gl_cv_func_ldexpl_in_libm = yes; then
- LDEXPL_LIBM=-lm
- fi
- fi
- if test $gl_cv_func_ldexpl_no_libm = yes \
- || test $gl_cv_func_ldexpl_in_libm = yes; then
- save_LIBS="$LIBS"
- LIBS="$LIBS $LDEXPL_LIBM"
- gl_FUNC_LDEXPL_WORKS
- LIBS="$save_LIBS"
- case "$gl_cv_func_ldexpl_works" in
- *yes) gl_func_ldexpl=yes ;;
- *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;;
- esac
- else
- gl_func_ldexpl=no
- fi
- if test $gl_func_ldexpl = yes; then
- AC_DEFINE([HAVE_LDEXPL], [1],
- [Define if the ldexpl() function is available.])
- fi
- fi
- if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then
- dnl Find libraries needed to link lib/ldexpl.c.
- if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
- AC_REQUIRE([gl_FUNC_LDEXP])
- LDEXPL_LIBM="$LDEXP_LIBM"
- else
- LDEXPL_LIBM="$ISNANL_LIBM"
- fi
- fi
- AC_SUBST([LDEXPL_LIBM])
-])
-
-dnl Test whether ldexpl() can be used without linking with libm.
-dnl Set gl_cv_func_ldexpl_no_libm to 'yes' or 'no' accordingly.
-AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
-[
- AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm],
- [gl_cv_func_ldexpl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x;]],
- [[return ldexpl (x, -1) > 0;]])],
- [gl_cv_func_ldexpl_no_libm=yes],
- [gl_cv_func_ldexpl_no_libm=no])
- ])
-])
-
-dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
-dnl and Mac OS X 10.4/PowerPC).
-AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([whether ldexpl works], [gl_cv_func_ldexpl_works],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <math.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double ldexpl (long double, int);
-int main()
-{
- int result = 0;
- {
- volatile long double x = 1.0;
- volatile long double y = ldexpl (x, -1);
- if (y != 0.5L)
- result |= 1;
- }
- {
- volatile long double x = 1.73205L;
- volatile long double y = ldexpl (x, 0);
- if (y != x)
- result |= 2;
- }
- return result;
-}]])],
- [gl_cv_func_ldexpl_works=yes],
- [gl_cv_func_ldexpl_works=no],
- [
-changequote(,)dnl
- case "$host_os" in
- aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";;
- *) gl_cv_func_ldexpl_works="guessing yes";;
- esac
-changequote([,])dnl
- ])
- ])
-])
diff --git a/gl/m4/malloca.m4 b/gl/m4/malloca.m4
deleted file mode 100644
index 791ce10d5f..0000000000
--- a/gl/m4/malloca.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-# malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
-dnl Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_MALLOCA],
-[
- dnl Use the autoconf tests for alloca(), but not the AC_SUBSTed variables
- dnl @ALLOCA@ and @LTALLOCA@.
- dnl gl_FUNC_ALLOCA dnl Already brought in by the module dependencies.
- AC_REQUIRE([gl_EEMALLOC])
- AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-])
diff --git a/gl/m4/mempcpy.m4 b/gl/m4/mempcpy.m4
deleted file mode 100644
index a48f2d107c..0000000000
--- a/gl/m4/mempcpy.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-# mempcpy.m4 serial 11
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2013 Free Software Foundation,
-dnl Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_MEMPCPY],
-[
- dnl Persuade glibc <string.h> to declare mempcpy().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- dnl The mempcpy() declaration in lib/string.in.h uses 'restrict'.
- AC_REQUIRE([AC_C_RESTRICT])
-
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([mempcpy])
- if test $ac_cv_func_mempcpy = no; then
- HAVE_MEMPCPY=0
- fi
-])
-
-# Prerequisites of lib/mempcpy.c.
-AC_DEFUN([gl_PREREQ_MEMPCPY], [
- :
-])
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
deleted file mode 100644
index 105b884f18..0000000000
--- a/gl/m4/nocrash.m4
+++ /dev/null
@@ -1,130 +0,0 @@
-# nocrash.m4 serial 4
-dnl Copyright (C) 2005, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Based on libsigsegv, from Bruno Haible and Paolo Bonzini.
-
-AC_PREREQ([2.13])
-
-dnl Expands to some code for use in .c programs that will cause the configure
-dnl test to exit instead of crashing. This is useful to avoid triggering
-dnl action from a background debugger and to avoid core dumps.
-dnl Usage: ...
-dnl ]GL_NOCRASH[
-dnl ...
-dnl int main() { nocrash_init(); ... }
-AC_DEFUN([GL_NOCRASH],[[
-#include <stdlib.h>
-#if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on Mac OS X. */
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <mach/thread_status.h>
-#include <mach/exception.h>
-#include <mach/task.h>
-#include <pthread.h>
-/* The exception port on which our thread listens. */
-static mach_port_t our_exception_port;
-/* The main function of the thread listening for exceptions of type
- EXC_BAD_ACCESS. */
-static void *
-mach_exception_thread (void *arg)
-{
- /* Buffer for a message to be received. */
- struct {
- mach_msg_header_t head;
- mach_msg_body_t msgh_body;
- char data[1024];
- } msg;
- mach_msg_return_t retval;
- /* Wait for a message on the exception port. */
- retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
- our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
- if (retval != MACH_MSG_SUCCESS)
- abort ();
- exit (1);
-}
-static void
-nocrash_init (void)
-{
- mach_port_t self = mach_task_self ();
- /* Allocate a port on which the thread shall listen for exceptions. */
- if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
- == KERN_SUCCESS) {
- /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html. */
- if (mach_port_insert_right (self, our_exception_port, our_exception_port,
- MACH_MSG_TYPE_MAKE_SEND)
- == KERN_SUCCESS) {
- /* The exceptions we want to catch. Only EXC_BAD_ACCESS is interesting
- for us. */
- exception_mask_t mask = EXC_MASK_BAD_ACCESS;
- /* Create the thread listening on the exception port. */
- pthread_attr_t attr;
- pthread_t thread;
- if (pthread_attr_init (&attr) == 0
- && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
- && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
- pthread_attr_destroy (&attr);
- /* Replace the exception port info for these exceptions with our own.
- Note that we replace the exception port for the entire task, not only
- for a particular thread. This has the effect that when our exception
- port gets the message, the thread specific exception port has already
- been asked, and we don't need to bother about it.
- See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html. */
- task_set_exception_ports (self, mask, our_exception_port,
- EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
- }
- }
- }
-}
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Avoid a crash on native Windows. */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winerror.h>
-static LONG WINAPI
-exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
-{
- switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
- {
- case EXCEPTION_ACCESS_VIOLATION:
- case EXCEPTION_IN_PAGE_ERROR:
- case EXCEPTION_STACK_OVERFLOW:
- case EXCEPTION_GUARD_PAGE:
- case EXCEPTION_PRIV_INSTRUCTION:
- case EXCEPTION_ILLEGAL_INSTRUCTION:
- case EXCEPTION_DATATYPE_MISALIGNMENT:
- case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
- case EXCEPTION_NONCONTINUABLE_EXCEPTION:
- exit (1);
- }
- return EXCEPTION_CONTINUE_SEARCH;
-}
-static void
-nocrash_init (void)
-{
- SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
-}
-#else
-/* Avoid a crash on POSIX systems. */
-#include <signal.h>
-/* A POSIX signal handler. */
-static void
-exception_handler (int sig)
-{
- exit (1);
-}
-static void
-nocrash_init (void)
-{
-#ifdef SIGSEGV
- signal (SIGSEGV, exception_handler);
-#endif
-#ifdef SIGBUS
- signal (SIGBUS, exception_handler);
-#endif
-}
-#endif
-]])
diff --git a/gl/m4/opendir.m4 b/gl/m4/opendir.m4
deleted file mode 100644
index d411680561..0000000000
--- a/gl/m4/opendir.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-# opendir.m4 serial 2
-dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_OPENDIR],
-[
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-
- AC_CHECK_FUNCS([opendir])
- if test $ac_cv_func_opendir = no; then
- HAVE_OPENDIR=0
- fi
- dnl Replace opendir() for supporting the gnulib-defined fchdir() function,
- dnl to keep fchdir's bookkeeping up-to-date.
- m4_ifdef([gl_FUNC_FCHDIR], [
- gl_TEST_FCHDIR
- if test $HAVE_FCHDIR = 0; then
- if test $HAVE_OPENDIR = 1; then
- REPLACE_OPENDIR=1
- fi
- fi
- ])
-])
diff --git a/gl/m4/printf-frexp.m4 b/gl/m4/printf-frexp.m4
deleted file mode 100644
index 8b373b1910..0000000000
--- a/gl/m4/printf-frexp.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-# printf-frexp.m4 serial 5
-dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Check how to define printf_frexp() without linking with libm.
-
-AC_DEFUN([gl_FUNC_PRINTF_FREXP],
-[
- AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
- if test $gl_cv_func_frexp_no_libm = yes; then
- gl_FUNC_FREXP_WORKS
- case "$gl_cv_func_frexp_works" in
- *yes)
- AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
- [Define if the frexp function is available in libc.])
- ;;
- esac
- fi
-
- AC_CACHE_CHECK([whether ldexp can be used without linking with libm],
- [gl_cv_func_ldexp_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x;
- int y;]],
- [[return ldexp (x, y) < 1;]])],
- [gl_cv_func_ldexp_no_libm=yes],
- [gl_cv_func_ldexp_no_libm=no])
- ])
- if test $gl_cv_func_ldexp_no_libm = yes; then
- AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1],
- [Define if the ldexp function is available in libc.])
- fi
-])
diff --git a/gl/m4/printf-frexpl.m4 b/gl/m4/printf-frexpl.m4
deleted file mode 100644
index f1ce4c8a3d..0000000000
--- a/gl/m4/printf-frexpl.m4
+++ /dev/null
@@ -1,48 +0,0 @@
-# printf-frexpl.m4 serial 10
-dnl Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Check how to define printf_frexpl() without linking with libm.
-
-AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
-
- dnl Subset of gl_FUNC_FREXPL_NO_LIBM.
- gl_CHECK_FREXPL_NO_LIBM
- if test $gl_cv_func_frexpl_no_libm = yes; then
- gl_FUNC_FREXPL_WORKS
- case "$gl_cv_func_frexpl_works" in
- *yes) gl_func_frexpl_no_libm=yes ;;
- *) gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
- esac
- else
- gl_func_frexpl_no_libm=no
- dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
- REPLACE_FREXPL=1
- fi
- if test $gl_func_frexpl_no_libm = yes; then
- AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
- [Define if the frexpl function is available in libc.])
- dnl Also check whether it's declared.
- dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
- fi
-
- gl_CHECK_LDEXPL_NO_LIBM
- if test $gl_cv_func_ldexpl_no_libm = yes; then
- gl_FUNC_LDEXPL_WORKS
- case "$gl_cv_func_ldexpl_works" in
- *yes)
- AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
- [Define if the ldexpl function is available in libc.])
- dnl Also check whether it's declared.
- dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
- AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
- ;;
- esac
- fi
-])
diff --git a/gl/m4/putenv.m4 b/gl/m4/putenv.m4
deleted file mode 100644
index c33b5b5170..0000000000
--- a/gl/m4/putenv.m4
+++ /dev/null
@@ -1,56 +0,0 @@
-# putenv.m4 serial 20
-dnl Copyright (C) 2002-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Jim Meyering.
-dnl
-dnl Check whether putenv ("FOO") removes FOO from the environment.
-dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
-
-AC_DEFUN([gl_FUNC_PUTENV],
-[
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([for putenv compatible with GNU and SVID],
- [gl_cv_func_svid_putenv],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[
- /* Put it in env. */
- if (putenv ("CONFTEST_putenv=val"))
- return 1;
-
- /* Try to remove it. */
- if (putenv ("CONFTEST_putenv"))
- return 2;
-
- /* Make sure it was deleted. */
- if (getenv ("CONFTEST_putenv") != 0)
- return 3;
-
- return 0;
- ]])],
- gl_cv_func_svid_putenv=yes,
- gl_cv_func_svid_putenv=no,
- dnl When crosscompiling, assume putenv is broken.
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_svid_putenv="guessing no" ;;
- esac
- ])
- ])
- case "$gl_cv_func_svid_putenv" in
- *yes) ;;
- *)
- REPLACE_PUTENV=1
- ;;
- esac
-])
-
-# Prerequisites of lib/putenv.c.
-AC_DEFUN([gl_PREREQ_PUTENV],
-[
- AC_CHECK_DECLS([_putenv])
-])
diff --git a/gl/m4/rawmemchr.m4 b/gl/m4/rawmemchr.m4
deleted file mode 100644
index 8c500547c5..0000000000
--- a/gl/m4/rawmemchr.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# rawmemchr.m4 serial 2
-dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_RAWMEMCHR],
-[
- dnl Persuade glibc <string.h> to declare rawmemchr().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([rawmemchr])
- if test $ac_cv_func_rawmemchr = no; then
- HAVE_RAWMEMCHR=0
- fi
-])
-
-# Prerequisites of lib/strchrnul.c.
-AC_DEFUN([gl_PREREQ_RAWMEMCHR], [:])
diff --git a/gl/m4/readdir.m4 b/gl/m4/readdir.m4
deleted file mode 100644
index 4269bb486a..0000000000
--- a/gl/m4/readdir.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-# readdir.m4 serial 1
-dnl Copyright (C) 2011-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_READDIR],
-[
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-
- AC_CHECK_FUNCS([readdir])
- if test $ac_cv_func_readdir = no; then
- HAVE_READDIR=0
- fi
-])
diff --git a/gl/m4/scandir.m4 b/gl/m4/scandir.m4
deleted file mode 100644
index a7834ae1ec..0000000000
--- a/gl/m4/scandir.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-# scandir.m4 serial 2
-dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_SCANDIR],
-[
- AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
-
- dnl Persuade glibc and Solaris <dirent.h> to declare scandir().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_CHECK_FUNCS([scandir])
- if test $ac_cv_func_scandir = no; then
- HAVE_SCANDIR=0
- fi
-])
-
-# Prerequisites of lib/scandir.c.
-AC_DEFUN([gl_PREREQ_SCANDIR], [:])
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
deleted file mode 100644
index cb5351a07b..0000000000
--- a/gl/m4/setenv.m4
+++ /dev/null
@@ -1,160 +0,0 @@
-# setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_SETENV],
-[
- AC_REQUIRE([gl_FUNC_SETENV_SEPARATE])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- if test $ac_cv_func_setenv = no; then
- HAVE_SETENV=0
- else
- AC_CACHE_CHECK([whether setenv validates arguments],
- [gl_cv_func_setenv_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
- #include <stdlib.h>
- #include <errno.h>
- #include <string.h>
- ]], [[
- int result = 0;
- {
- if (setenv ("", "", 0) != -1)
- result |= 1;
- else if (errno != EINVAL)
- result |= 2;
- }
- {
- if (setenv ("a", "=", 1) != 0)
- result |= 4;
- else if (strcmp (getenv ("a"), "=") != 0)
- result |= 8;
- }
- return result;
- ]])],
- [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_setenv_works="guessing no" ;;
- esac
- ])])
- case "$gl_cv_func_setenv_works" in
- *yes) ;;
- *)
- REPLACE_SETENV=1
- ;;
- esac
- fi
-])
-
-# Like gl_FUNC_SETENV, except prepare for separate compilation
-# (no REPLACE_SETENV, no AC_LIBOBJ).
-AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
-[
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_CHECK_DECLS_ONCE([setenv])
- if test $ac_cv_have_decl_setenv = no; then
- HAVE_DECL_SETENV=0
- fi
- AC_CHECK_FUNCS_ONCE([setenv])
- gl_PREREQ_SETENV
-])
-
-AC_DEFUN([gl_FUNC_UNSETENV],
-[
- AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CHECK_DECLS_ONCE([unsetenv])
- if test $ac_cv_have_decl_unsetenv = no; then
- HAVE_DECL_UNSETENV=0
- fi
- AC_CHECK_FUNCS([unsetenv])
- if test $ac_cv_func_unsetenv = no; then
- HAVE_UNSETENV=0
- else
- HAVE_UNSETENV=1
- dnl Some BSDs return void, failing to do error checking.
- AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#undef _BSD
-#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
-#include <stdlib.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-int unsetenv (const char *name);
- ]],
- [[]])],
- [gt_cv_func_unsetenv_ret='int'],
- [gt_cv_func_unsetenv_ret='void'])])
- if test $gt_cv_func_unsetenv_ret = 'void'; then
- AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
- instead of int.])
- REPLACE_UNSETENV=1
- fi
-
- dnl Solaris 10 unsetenv does not remove all copies of a name.
- dnl Haiku alpha 2 unsetenv gets confused by assignment to environ.
- dnl OpenBSD 4.7 unsetenv("") does not fail.
- AC_CACHE_CHECK([whether unsetenv obeys POSIX],
- [gl_cv_func_unsetenv_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
- #include <stdlib.h>
- #include <errno.h>
- extern char **environ;
- ]], [[
- char entry1[] = "a=1";
- char entry2[] = "b=2";
- char *env[] = { entry1, entry2, NULL };
- if (putenv ((char *) "a=1")) return 1;
- if (putenv (entry2)) return 2;
- entry2[0] = 'a';
- unsetenv ("a");
- if (getenv ("a")) return 3;
- if (!unsetenv ("") || errno != EINVAL) return 4;
- entry2[0] = 'b';
- environ = env;
- if (!getenv ("a")) return 5;
- entry2[0] = 'a';
- unsetenv ("a");
- if (getenv ("a")) return 6;
- ]])],
- [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_unsetenv_works="guessing no" ;;
- esac
- ])])
- case "$gl_cv_func_unsetenv_works" in
- *yes) ;;
- *)
- REPLACE_UNSETENV=1
- ;;
- esac
- fi
-])
-
-# Prerequisites of lib/setenv.c.
-AC_DEFUN([gl_PREREQ_SETENV],
-[
- AC_REQUIRE([AC_FUNC_ALLOCA])
- AC_REQUIRE([gl_ENVIRON])
- AC_CHECK_HEADERS_ONCE([unistd.h])
- AC_CHECK_HEADERS([search.h])
- AC_CHECK_FUNCS([tsearch])
-])
-
-# Prerequisites of lib/unsetenv.c.
-AC_DEFUN([gl_PREREQ_UNSETENV],
-[
- AC_REQUIRE([gl_ENVIRON])
- AC_CHECK_HEADERS_ONCE([unistd.h])
-])
diff --git a/gl/m4/signbit.m4 b/gl/m4/signbit.m4
deleted file mode 100644
index d58caaf058..0000000000
--- a/gl/m4/signbit.m4
+++ /dev/null
@@ -1,365 +0,0 @@
-# signbit.m4 serial 13
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_SIGNBIT],
-[
- AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <math.h>
-/* If signbit is defined as a function, don't use it, since calling it for
- 'float' or 'long double' arguments would involve conversions.
- If signbit is not declared at all but exists as a library function, don't
- use it, since the prototype may not match.
- If signbit is not declared at all but exists as a compiler built-in, don't
- use it, since it's preferable to use __builtin_signbit* (no warnings,
- no conversions). */
-#ifndef signbit
-# error "signbit should be a macro"
-#endif
-#include <string.h>
-]gl_SIGNBIT_TEST_PROGRAM
-])],
- [gl_cv_func_signbit=yes],
- [gl_cv_func_signbit=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_signbit="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_signbit="guessing no" ;;
- esac
- ])
- ])
- dnl GCC 4.0 and newer provides three built-ins for signbit.
- dnl They can be used without warnings, also in C++, regardless of <math.h>.
- dnl But they may expand to calls to functions, which may or may not be in
- dnl libc.
- AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#if __GNUC__ >= 4
-# define signbit(x) \
- (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
- sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
- __builtin_signbitf (x))
-#else
-# error "signbit should be three compiler built-ins"
-#endif
-#include <string.h>
-]gl_SIGNBIT_TEST_PROGRAM
-])],
- [gl_cv_func_signbit_gcc=yes],
- [gl_cv_func_signbit_gcc=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_signbit_gcc="guessing no" ;;
- esac
- ])
- ])
- dnl Use the compiler built-ins whenever possible, because they are more
- dnl efficient than the system library functions (if they exist).
- case "$gl_cv_func_signbit_gcc" in
- *yes)
- REPLACE_SIGNBIT_USING_GCC=1
- ;;
- *)
- case "$gl_cv_func_signbit" in
- *yes) ;;
- *)
- dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
- REPLACE_SIGNBIT=1
- gl_FLOAT_SIGN_LOCATION
- gl_DOUBLE_SIGN_LOCATION
- gl_LONG_DOUBLE_SIGN_LOCATION
- if test "$gl_cv_cc_float_signbit" = unknown; then
- dnl Test whether copysignf() is declared.
- AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysignf" = yes; then
- dnl Test whether copysignf() can be used without libm.
- AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
- [gl_cv_func_copysignf_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- float x, y;]],
- [[return copysignf (x, y) < 0;]])],
- [gl_cv_func_copysignf_no_libm=yes],
- [gl_cv_func_copysignf_no_libm=no])
- ])
- if test $gl_cv_func_copysignf_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
- [Define if the copysignf function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- if test "$gl_cv_cc_double_signbit" = unknown; then
- dnl Test whether copysign() is declared.
- AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysign" = yes; then
- dnl Test whether copysign() can be used without libm.
- AC_CACHE_CHECK([whether copysign can be used without linking with libm],
- [gl_cv_func_copysign_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- double x, y;]],
- [[return copysign (x, y) < 0;]])],
- [gl_cv_func_copysign_no_libm=yes],
- [gl_cv_func_copysign_no_libm=no])
- ])
- if test $gl_cv_func_copysign_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
- [Define if the copysign function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- if test "$gl_cv_cc_long_double_signbit" = unknown; then
- dnl Test whether copysignl() is declared.
- AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
- if test "$ac_cv_have_decl_copysignl" = yes; then
- dnl Test whether copysignl() can be used without libm.
- AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
- [gl_cv_func_copysignl_no_libm],
- [
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <math.h>
- long double x, y;]],
- [[return copysignl (x, y) < 0;]])],
- [gl_cv_func_copysignl_no_libm=yes],
- [gl_cv_func_copysignl_no_libm=no])
- ])
- if test $gl_cv_func_copysignl_no_libm = yes; then
- AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
- [Define if the copysignl function is declared in <math.h> and available in libc.])
- fi
- fi
- fi
- ;;
- esac
- ;;
- esac
-])
-
-AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
-/* Global variables.
- Needed because GCC 4 constant-folds __builtin_signbitl (literal)
- but cannot constant-fold __builtin_signbitl (variable). */
-float vf;
-double vd;
-long double vl;
-int main ()
-{
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
- So we use -p0f and -p0d instead. */
-float p0f = 0.0f;
-float m0f = -p0f;
-double p0d = 0.0;
-double m0d = -p0d;
-/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use another constant expression instead.
- But that expression does not work on other platforms, such as when
- cross-compiling to PowerPC on Mac OS X 10.5. */
-long double p0l = 0.0L;
-#if defined __hpux || defined __sgi
-long double m0l = -LDBL_MIN * LDBL_MIN;
-#else
-long double m0l = -p0l;
-#endif
- int result = 0;
- if (signbit (vf)) /* link check */
- vf++;
- {
- float plus_inf = 1.0f / p0f;
- float minus_inf = -1.0f / p0f;
- if (!(!signbit (255.0f)
- && signbit (-255.0f)
- && !signbit (p0f)
- && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
- && !signbit (plus_inf)
- && signbit (minus_inf)))
- result |= 1;
- }
- if (signbit (vd)) /* link check */
- vd++;
- {
- double plus_inf = 1.0 / p0d;
- double minus_inf = -1.0 / p0d;
- if (!(!signbit (255.0)
- && signbit (-255.0)
- && !signbit (p0d)
- && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
- && !signbit (plus_inf)
- && signbit (minus_inf)))
- result |= 2;
- }
- if (signbit (vl)) /* link check */
- vl++;
- {
- long double plus_inf = 1.0L / p0l;
- long double minus_inf = -1.0L / p0l;
- if (signbit (255.0L))
- result |= 4;
- if (!signbit (-255.0L))
- result |= 4;
- if (signbit (p0l))
- result |= 8;
- if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
- result |= 16;
- if (signbit (plus_inf))
- result |= 32;
- if (!signbit (minus_inf))
- result |= 64;
- }
- return result;
-}
-]])
-
-AC_DEFUN([gl_FLOAT_SIGN_LOCATION],
-[
- gl_FLOATTYPE_SIGN_LOCATION([float], [gl_cv_cc_float_signbit], [f], [FLT])
-])
-
-AC_DEFUN([gl_DOUBLE_SIGN_LOCATION],
-[
- gl_FLOATTYPE_SIGN_LOCATION([double], [gl_cv_cc_double_signbit], [], [DBL])
-])
-
-AC_DEFUN([gl_LONG_DOUBLE_SIGN_LOCATION],
-[
- gl_FLOATTYPE_SIGN_LOCATION([long double], [gl_cv_cc_long_double_signbit], [L], [LDBL])
-])
-
-AC_DEFUN([gl_FLOATTYPE_SIGN_LOCATION],
-[
- AC_CACHE_CHECK([where to find the sign bit in a '$1'],
- [$2],
- [
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
-#include <stddef.h>
-#include <stdio.h>
-#define NWORDS \
- ((sizeof ($1) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { $1 value; unsigned int word[NWORDS]; }
- memory_float;
-static memory_float plus = { 1.0$3 };
-static memory_float minus = { -1.0$3 };
-int main ()
-{
- size_t j, k, i;
- unsigned int m;
- FILE *fp = fopen ("conftest.out", "w");
- if (fp == NULL)
- return 1;
- /* Find the different bit. */
- k = 0; m = 0;
- for (j = 0; j < NWORDS; j++)
- {
- unsigned int x = plus.word[j] ^ minus.word[j];
- if ((x & (x - 1)) || (x && m))
- {
- /* More than one bit difference. */
- fprintf (fp, "unknown");
- return 2;
- }
- if (x)
- {
- k = j;
- m = x;
- }
- }
- if (m == 0)
- {
- /* No difference. */
- fprintf (fp, "unknown");
- return 3;
- }
- /* Now m = plus.word[k] ^ ~minus.word[k]. */
- if (plus.word[k] & ~minus.word[k])
- {
- /* Oh? The sign bit is set in the positive and cleared in the negative
- numbers? */
- fprintf (fp, "unknown");
- return 4;
- }
- for (i = 0; ; i++)
- if ((m >> i) & 1)
- break;
- fprintf (fp, "word %d bit %d", (int) k, (int) i);
- if (fclose (fp) != 0)
- return 5;
- return 0;
-}
- ]])],
- [$2=`cat conftest.out`],
- [$2="unknown"],
- [
- dnl When cross-compiling, we don't know. It depends on the
- dnl ABI and compiler version. There are too many cases.
- $2="unknown"
- ])
- rm -f conftest.out
- ])
- case "$]$2[" in
- word*bit*)
- word=`echo "$]$2[" | sed -e 's/word //' -e 's/ bit.*//'`
- bit=`echo "$]$2[" | sed -e 's/word.*bit //'`
- AC_DEFINE_UNQUOTED([$4][_SIGNBIT_WORD], [$word],
- [Define as the word index where to find the sign of '$1'.])
- AC_DEFINE_UNQUOTED([$4][_SIGNBIT_BIT], [$bit],
- [Define as the bit index in the word where to find the sign of '$1'.])
- ;;
- esac
-])
-
-# Expands to code that defines a function signbitf(float).
-# It extracts the sign bit of a non-NaN value.
-AC_DEFUN([gl_FLOAT_SIGNBIT_CODE],
-[
- gl_FLOATTYPE_SIGNBIT_CODE([float], [f], [f])
-])
-
-# Expands to code that defines a function signbitd(double).
-# It extracts the sign bit of a non-NaN value.
-AC_DEFUN([gl_DOUBLE_SIGNBIT_CODE],
-[
- gl_FLOATTYPE_SIGNBIT_CODE([double], [d], [])
-])
-
-# Expands to code that defines a function signbitl(long double).
-# It extracts the sign bit of a non-NaN value.
-AC_DEFUN([gl_LONG_DOUBLE_SIGNBIT_CODE],
-[
- gl_FLOATTYPE_SIGNBIT_CODE([long double], [l], [L])
-])
-
-AC_DEFUN([gl_FLOATTYPE_SIGNBIT_CODE],
-[[
-static int
-signbit$2 ($1 value)
-{
- typedef union { $1 f; unsigned char b[sizeof ($1)]; } float_union;
- static float_union plus_one = { 1.0$3 }; /* unused bits are zero here */
- static float_union minus_one = { -1.0$3 }; /* unused bits are zero here */
- /* Compute the sign bit mask as the XOR of plus_one and minus_one. */
- float_union u;
- unsigned int i;
- u.f = value;
- for (i = 0; i < sizeof ($1); i++)
- if (u.b[i] & (plus_one.b[i] ^ minus_one.b[i]))
- return 1;
- return 0;
-}
-]])
diff --git a/gl/m4/sleep.m4 b/gl/m4/sleep.m4
deleted file mode 100644
index a27baa6d5b..0000000000
--- a/gl/m4/sleep.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-# sleep.m4 serial 7
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_SLEEP],
-[
- AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
- dnl We expect to see the declaration of sleep() in a header file.
- dnl Older versions of mingw have a sleep() function that is an alias to
- dnl _sleep() in MSVCRT. It has a different signature than POSIX sleep():
- dnl it takes the number of milliseconds as argument and returns void.
- dnl mingw does not declare this function.
- AC_CHECK_DECLS([sleep], , , [[#include <unistd.h>]])
- AC_CHECK_FUNCS_ONCE([sleep])
- if test $ac_cv_have_decl_sleep != yes; then
- HAVE_SLEEP=0
- else
- dnl Cygwin 1.5.x has a bug where sleep can't exceed 49.7 days.
- AC_CACHE_CHECK([for working sleep], [gl_cv_func_sleep_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <errno.h>
-#include <unistd.h>
-#include <signal.h>
-static void
-handle_alarm (int sig)
-{
- if (sig != SIGALRM)
- _exit (2);
-}
-]], [[
- /* Failure to compile this test due to missing alarm is okay,
- since all such platforms (mingw) also lack sleep. */
- unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
- unsigned int remaining;
- signal (SIGALRM, handle_alarm);
- alarm (1);
- remaining = sleep (pentecost);
- if (remaining > pentecost)
- return 3;
- if (remaining <= pentecost - 10)
- return 4;
- return 0;
- ]])],
- [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no],
- [case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu*) gl_cv_func_sleep_works="guessing yes" ;;
- # If we don't know, assume the worst.
- *) gl_cv_func_sleep_works="guessing no" ;;
- esac
- ])])
- case "$gl_cv_func_sleep_works" in
- *yes) ;;
- *)
- REPLACE_SLEEP=1
- ;;
- esac
- fi
-])
diff --git a/gl/m4/stdarg.m4 b/gl/m4/stdarg.m4
deleted file mode 100644
index c087f61ed3..0000000000
--- a/gl/m4/stdarg.m4
+++ /dev/null
@@ -1,78 +0,0 @@
-# stdarg.m4 serial 6
-dnl Copyright (C) 2006, 2008-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Provide a working va_copy in combination with <stdarg.h>.
-
-AC_DEFUN([gl_STDARG_H],
-[
- STDARG_H=''
- NEXT_STDARG_H='<stdarg.h>'
- AC_MSG_CHECKING([for va_copy])
- AC_CACHE_VAL([gl_cv_func_va_copy], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stdarg.h>]],
- [[
-#ifndef va_copy
-void (*func) (va_list, va_list) = va_copy;
-#endif
- ]])],
- [gl_cv_func_va_copy=yes],
- [gl_cv_func_va_copy=no])])
- AC_MSG_RESULT([$gl_cv_func_va_copy])
- if test $gl_cv_func_va_copy = no; then
- dnl Provide a substitute.
- dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
- dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
- dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
- dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
- dnl approach on other platforms, because <stdarg.h> often defines only
- dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
- dnl not work in this situation.
- AC_EGREP_CPP([vaccine],
- [#if defined _AIX && !defined __GNUC__
- AIX vaccine
- #endif
- ], [gl_aixcc=yes], [gl_aixcc=no])
- if test $gl_aixcc = yes; then
- dnl Provide a substitute <stdarg.h> file.
- STDARG_H=stdarg.h
- gl_NEXT_HEADERS([stdarg.h])
- dnl Fallback for the case when <stdarg.h> contains only macro definitions.
- if test "$gl_cv_next_stdarg_h" = '""'; then
- gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
- NEXT_STDARG_H="$gl_cv_next_stdarg_h"
- fi
- else
- dnl Provide a substitute in <config.h>, either __va_copy or as a simple
- dnl assignment.
- gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <stdarg.h>]],
- [[
-#ifndef __va_copy
-error, bail out
-#endif
- ]])],
- [gl_cv_func___va_copy=yes],
- [gl_cv_func___va_copy=no])])
- if test $gl_cv_func___va_copy = yes; then
- AC_DEFINE([va_copy], [__va_copy],
- [Define as a macro for copying va_list variables.])
- else
- AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed. */
-#define gl_va_copy(a,b) ((a) = (b))])
- AC_DEFINE([va_copy], [gl_va_copy],
- [Define as a macro for copying va_list variables.])
- fi
- fi
- fi
- AC_SUBST([STDARG_H])
- AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"])
- AC_SUBST([NEXT_STDARG_H])
-])
diff --git a/gl/m4/strchrnul.m4 b/gl/m4/strchrnul.m4
deleted file mode 100644
index b59eda9d72..0000000000
--- a/gl/m4/strchrnul.m4
+++ /dev/null
@@ -1,50 +0,0 @@
-# strchrnul.m4 serial 9
-dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRCHRNUL],
-[
- dnl Persuade glibc <string.h> to declare strchrnul().
- AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
-
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS([strchrnul])
- if test $ac_cv_func_strchrnul = no; then
- HAVE_STRCHRNUL=0
- else
- AC_CACHE_CHECK([whether strchrnul works],
- [gl_cv_func_strchrnul_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <string.h> /* for strchrnul */
-]], [[const char *buf = "a";
- return strchrnul (buf, 'b') != buf + 1;
- ]])],
- [gl_cv_func_strchrnul_works=yes],
- [gl_cv_func_strchrnul_works=no],
- [dnl Cygwin 1.7.9 introduced strchrnul, but it was broken until 1.7.10
- AC_EGREP_CPP([Lucky user],
- [
-#if defined __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
- Lucky user
- #endif
-#else
- Lucky user
-#endif
- ],
- [gl_cv_func_strchrnul_works="guessing yes"],
- [gl_cv_func_strchrnul_works="guessing no"])
- ])
- ])
- case "$gl_cv_func_strchrnul_works" in
- *yes) ;;
- *) REPLACE_STRCHRNUL=1 ;;
- esac
- fi
-])
-
-# Prerequisites of lib/strchrnul.c.
-AC_DEFUN([gl_PREREQ_STRCHRNUL], [:])
diff --git a/gl/m4/sysexits.m4 b/gl/m4/sysexits.m4
deleted file mode 100644
index bd8abaa0d4..0000000000
--- a/gl/m4/sysexits.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-# sysexits.m4 serial 6
-dnl Copyright (C) 2003, 2005, 2007, 2009-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_SYSEXITS],
-[
- AC_CHECK_HEADERS_ONCE([sysexits.h])
- if test $ac_cv_header_sysexits_h = yes; then
- HAVE_SYSEXITS_H=1
- gl_CHECK_NEXT_HEADERS([sysexits.h])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sysexits.h>]],
- [[switch (0)
- {
- case EX_OK:
- case EX_USAGE:
- case EX_DATAERR:
- case EX_NOINPUT:
- case EX_NOUSER:
- case EX_NOHOST:
- case EX_UNAVAILABLE:
- case EX_SOFTWARE:
- case EX_OSERR:
- case EX_OSFILE:
- case EX_CANTCREAT:
- case EX_IOERR:
- case EX_TEMPFAIL:
- case EX_PROTOCOL:
- case EX_NOPERM:
- case EX_CONFIG:
- break;
- }
- ]])],
- [SYSEXITS_H=],
- [SYSEXITS_H=sysexits.h])
- else
- HAVE_SYSEXITS_H=0
- SYSEXITS_H=sysexits.h
- fi
- AC_SUBST([HAVE_SYSEXITS_H])
- AC_SUBST([SYSEXITS_H])
- AM_CONDITIONAL([GL_GENERATE_SYSEXITS_H], [test -n "$SYSEXITS_H"])
-])
diff --git a/gl/m4/version-etc.m4 b/gl/m4/version-etc.m4
deleted file mode 100644
index 5dbef8e5ba..0000000000
--- a/gl/m4/version-etc.m4
+++ /dev/null
@@ -1,33 +0,0 @@
-# version-etc.m4 serial 1
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-dnl $1 - configure flag and define name
-dnl $2 - human readable description
-m4_define([gl_VERSION_ETC_FLAG],
-[dnl
- AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])],
- [dnl
- case $withval in
- yes|no) ;;
- *) AC_DEFINE_UNQUOTED(AS_TR_CPP([PACKAGE_$1]), ["$withval"], [$2]) ;;
- esac
- ])
-])
-
-AC_DEFUN([gl_VERSION_ETC],
-[dnl
- gl_VERSION_ETC_FLAG([packager],
- [String identifying the packager of this software])
- gl_VERSION_ETC_FLAG([packager-version],
- [Packager-specific version information])
- gl_VERSION_ETC_FLAG([packager-bug-reports],
- [Packager info for bug reports (URL/e-mail/...)])
- if test "X$with_packager" = "X" && \
- test "X$with_packager_version$with_packager_bug_reports" != "X"
- then
- AC_MSG_ERROR([The --with-packager-{bug-reports,version} options require --with-packager])
- fi
-])
diff --git a/gl/m4/vfprintf-posix.m4 b/gl/m4/vfprintf-posix.m4
deleted file mode 100644
index 47a4645b9f..0000000000
--- a/gl/m4/vfprintf-posix.m4
+++ /dev/null
@@ -1,110 +0,0 @@
-# vfprintf-posix.m4 serial 14
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_VFPRINTF_POSIX],
-[
- AC_REQUIRE([gl_PRINTF_SIZES_C99])
- AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
- AC_REQUIRE([gl_PRINTF_INFINITE])
- AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])
- AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
- AC_REQUIRE([gl_PRINTF_POSITIONS])
- AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
- AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
- AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
- AC_REQUIRE([gl_PRINTF_PRECISION])
- AC_REQUIRE([gl_PRINTF_ENOMEM])
- gl_cv_func_vfprintf_posix=no
- case "$gl_cv_func_printf_sizes_c99" in
- *yes)
- case "$gl_cv_func_printf_long_double" in
- *yes)
- case "$gl_cv_func_printf_infinite" in
- *yes)
- case "$gl_cv_func_printf_infinite_long_double" in
- *yes)
- case "$gl_cv_func_printf_directive_a" in
- *yes)
- case "$gl_cv_func_printf_directive_f" in
- *yes)
- case "$gl_cv_func_printf_directive_n" in
- *yes)
- case "$gl_cv_func_printf_directive_ls" in
- *yes)
- case "$gl_cv_func_printf_positions" in
- *yes)
- case "$gl_cv_func_printf_flag_grouping" in
- *yes)
- case "$gl_cv_func_printf_flag_leftadjust" in
- *yes)
- case "$gl_cv_func_printf_flag_zero" in
- *yes)
- case "$gl_cv_func_printf_precision" in
- *yes)
- case "$gl_cv_func_printf_enomem" in
- *yes)
- # vfprintf exists and is
- # already POSIX compliant.
- gl_cv_func_vfprintf_posix=yes
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
- esac
- if test $gl_cv_func_vfprintf_posix = no; then
- gl_PREREQ_VASNPRINTF_LONG_DOUBLE
- gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
- gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
- gl_PREREQ_VASNPRINTF_DIRECTIVE_A
- gl_PREREQ_VASNPRINTF_DIRECTIVE_F
- gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
- gl_PREREQ_VASNPRINTF_FLAG_GROUPING
- gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
- gl_PREREQ_VASNPRINTF_FLAG_ZERO
- gl_PREREQ_VASNPRINTF_PRECISION
- gl_PREREQ_VASNPRINTF_ENOMEM
- gl_REPLACE_VASNPRINTF
- gl_REPLACE_VFPRINTF
- fi
-])
-
-AC_DEFUN([gl_REPLACE_VFPRINTF],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_LIBOBJ([vfprintf])
- REPLACE_VFPRINTF=1
- AC_DEFINE([REPLACE_VFPRINTF_POSIX], [1],
- [Define if vfprintf is overridden by a POSIX compliant gnulib implementation.])
- gl_PREREQ_VFPRINTF
-])
-
-AC_DEFUN([gl_PREREQ_VFPRINTF], [:])
diff --git a/gl/m4/vprintf-posix.m4 b/gl/m4/vprintf-posix.m4
deleted file mode 100644
index 8a4eb19cfb..0000000000
--- a/gl/m4/vprintf-posix.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-# vprintf-posix.m4 serial 3
-dnl Copyright (C) 2007-2013 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_VPRINTF_POSIX],
-[
- AC_REQUIRE([gl_FUNC_VFPRINTF_POSIX])
- if test $gl_cv_func_vfprintf_posix = no; then
- gl_REPLACE_VPRINTF
- fi
-])
-
-AC_DEFUN([gl_REPLACE_VPRINTF],
-[
- AC_REQUIRE([gl_STDIO_H_DEFAULTS])
- AC_LIBOBJ([vprintf])
- REPLACE_VPRINTF=1
- AC_DEFINE([REPLACE_VPRINTF_POSIX], [1],
- [Define if vprintf is overridden by a POSIX compliant gnulib implementation.])
- gl_PREREQ_VPRINTF
-])
-
-AC_DEFUN([gl_PREREQ_VPRINTF], [:])
diff --git a/gl/malloc.c b/gl/malloc.c
index 908735d278..a15e2ca82c 100644
--- a/gl/malloc.c
+++ b/gl/malloc.c
@@ -3,16 +3,16 @@
Copyright (C) 1997-1998, 2006-2007, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* written by Jim Meyering and Bruno Haible */
diff --git a/gl/math.c b/gl/math.c
deleted file mode 100644
index ddb2ded530..0000000000
--- a/gl/math.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <config.h>
-#define _GL_MATH_INLINE _GL_EXTERN_INLINE
-#include "math.h"
diff --git a/gl/math.in.h b/gl/math.in.h
deleted file mode 100644
index 7189819b04..0000000000
--- a/gl/math.in.h
+++ /dev/null
@@ -1,2275 +0,0 @@
-/* A GNU-like <math.h>.
-
- Copyright (C) 2002-2003, 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _@GUARD_PREFIX@_MATH_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-/* The include_next requires a split double-inclusion guard. */
-#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
-
-#ifndef _@GUARD_PREFIX@_MATH_H
-#define _@GUARD_PREFIX@_MATH_H
-
-_GL_INLINE_HEADER_BEGIN
-#ifndef _GL_MATH_INLINE
-# define _GL_MATH_INLINE _GL_INLINE
-#endif
-
-/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
-
-/* The definition of _GL_ARG_NONNULL is copied here. */
-
-/* The definition of _GL_WARN_ON_USE is copied here. */
-
-#ifdef __cplusplus
-/* Helper macros to define type-generic function FUNC as overloaded functions,
- rather than as macros like in C. POSIX declares these with an argument of
- real-floating (that is, one of float, double, or long double). */
-# define _GL_MATH_CXX_REAL_FLOATING_DECL_1(func) \
-static inline int \
-_gl_cxx_ ## func ## f (float f) \
-{ \
- return func (f); \
-} \
-static inline int \
-_gl_cxx_ ## func ## d (double d) \
-{ \
- return func (d); \
-} \
-static inline int \
-_gl_cxx_ ## func ## l (long double l) \
-{ \
- return func (l); \
-}
-# define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
-inline int \
-func (float f) \
-{ \
- return _gl_cxx_ ## func ## f (f); \
-} \
-inline int \
-func (double d) \
-{ \
- return _gl_cxx_ ## func ## d (d); \
-} \
-inline int \
-func (long double l) \
-{ \
- return _gl_cxx_ ## func ## l (l); \
-}
-#endif
-
-/* Helper macros to define a portability warning for the
- classification macro FUNC called with VALUE. POSIX declares the
- classification macros with an argument of real-floating (that is,
- one of float, double, or long double). */
-#define _GL_WARN_REAL_FLOATING_DECL(func) \
-_GL_MATH_INLINE int \
-rpl_ ## func ## f (float f) \
-{ \
- return func (f); \
-} \
-_GL_MATH_INLINE int \
-rpl_ ## func ## d (double d) \
-{ \
- return func (d); \
-} \
-_GL_MATH_INLINE int \
-rpl_ ## func ## l (long double l) \
-{ \
- return func (l); \
-} \
-_GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - " \
- "use gnulib module " #func " for portability"); \
-_GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - " \
- "use gnulib module " #func " for portability"); \
-_GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - " \
- "use gnulib module " #func " for portability")
-#define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
- (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
- : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
- : rpl_ ## func ## l (value))
-
-
-#if @REPLACE_ITOLD@
-/* Pull in a function that fixes the 'int' to 'long double' conversion
- of glibc 2.7. */
-_GL_EXTERN_C void _Qp_itoq (long double *, int);
-static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
-#endif
-
-
-/* POSIX allows platforms that don't support NAN. But all major
- machines in the past 15 years have supported something close to
- IEEE NaN, so we define this unconditionally. We also must define
- it on platforms like Solaris 10, where NAN is present but defined
- as a function pointer rather than a floating point constant. */
-#if !defined NAN || @REPLACE_NAN@
-# if !GNULIB_defined_NAN
-# undef NAN
- /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler
- choke on the expression 0.0 / 0.0. */
-# if defined __DECC || defined _MSC_VER
-_GL_MATH_INLINE float
-_NaN ()
-{
- static float zero = 0.0f;
- return zero / zero;
-}
-# define NAN (_NaN())
-# else
-# define NAN (0.0f / 0.0f)
-# endif
-# define GNULIB_defined_NAN 1
-# endif
-#endif
-
-/* Solaris 10 defines HUGE_VAL, but as a function pointer rather
- than a floating point constant. */
-#if @REPLACE_HUGE_VAL@
-# undef HUGE_VALF
-# define HUGE_VALF (1.0f / 0.0f)
-# undef HUGE_VAL
-# define HUGE_VAL (1.0 / 0.0)
-# undef HUGE_VALL
-# define HUGE_VALL (1.0L / 0.0L)
-#endif
-
-/* HUGE_VALF is a 'float' Infinity. */
-#ifndef HUGE_VALF
-# if defined _MSC_VER
-/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. */
-# define HUGE_VALF (1e25f * 1e25f)
-# else
-# define HUGE_VALF (1.0f / 0.0f)
-# endif
-#endif
-
-/* HUGE_VAL is a 'double' Infinity. */
-#ifndef HUGE_VAL
-# if defined _MSC_VER
-/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */
-# define HUGE_VAL (1e250 * 1e250)
-# else
-# define HUGE_VAL (1.0 / 0.0)
-# endif
-#endif
-
-/* HUGE_VALL is a 'long double' Infinity. */
-#ifndef HUGE_VALL
-# if defined _MSC_VER
-/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. */
-# define HUGE_VALL (1e250L * 1e250L)
-# else
-# define HUGE_VALL (1.0L / 0.0L)
-# endif
-#endif
-
-
-/* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */
-#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
-# if defined __NetBSD__ || defined __sgi
- /* NetBSD, IRIX 6.5: match what ilogb() does */
-# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
-# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
-# elif defined _AIX
- /* AIX 5.1: match what ilogb() does in AIX >= 5.2 */
-# define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
-# define FP_ILOGBNAN 2147483647 /* INT_MAX */
-# elif defined __sun
- /* Solaris 9: match what ilogb() does */
-# define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
-# define FP_ILOGBNAN 2147483647 /* INT_MAX */
-# else
- /* Gnulib defined values. */
-# define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
-# define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
-# endif
-#endif
-
-
-#if @GNULIB_ACOSF@
-# if !@HAVE_ACOSF@
-# undef acosf
-_GL_FUNCDECL_SYS (acosf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (acosf, float, (float x));
-_GL_CXXALIASWARN (acosf);
-#elif defined GNULIB_POSIXCHECK
-# undef acosf
-# if HAVE_RAW_DECL_ACOSF
-_GL_WARN_ON_USE (acosf, "acosf is unportable - "
- "use gnulib module acosf for portability");
-# endif
-#endif
-
-#if @GNULIB_ACOSL@
-# if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
-# undef acosl
-_GL_FUNCDECL_SYS (acosl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (acosl, long double, (long double x));
-_GL_CXXALIASWARN (acosl);
-#elif defined GNULIB_POSIXCHECK
-# undef acosl
-# if HAVE_RAW_DECL_ACOSL
-_GL_WARN_ON_USE (acosl, "acosl is unportable - "
- "use gnulib module acosl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_ASINF@
-# if !@HAVE_ASINF@
-# undef asinf
-_GL_FUNCDECL_SYS (asinf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (asinf, float, (float x));
-_GL_CXXALIASWARN (asinf);
-#elif defined GNULIB_POSIXCHECK
-# undef asinf
-# if HAVE_RAW_DECL_ASINF
-_GL_WARN_ON_USE (asinf, "asinf is unportable - "
- "use gnulib module asinf for portability");
-# endif
-#endif
-
-#if @GNULIB_ASINL@
-# if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
-# undef asinl
-_GL_FUNCDECL_SYS (asinl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (asinl, long double, (long double x));
-_GL_CXXALIASWARN (asinl);
-#elif defined GNULIB_POSIXCHECK
-# undef asinl
-# if HAVE_RAW_DECL_ASINL
-_GL_WARN_ON_USE (asinl, "asinl is unportable - "
- "use gnulib module asinl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_ATANF@
-# if !@HAVE_ATANF@
-# undef atanf
-_GL_FUNCDECL_SYS (atanf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (atanf, float, (float x));
-_GL_CXXALIASWARN (atanf);
-#elif defined GNULIB_POSIXCHECK
-# undef atanf
-# if HAVE_RAW_DECL_ATANF
-_GL_WARN_ON_USE (atanf, "atanf is unportable - "
- "use gnulib module atanf for portability");
-# endif
-#endif
-
-#if @GNULIB_ATANL@
-# if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
-# undef atanl
-_GL_FUNCDECL_SYS (atanl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (atanl, long double, (long double x));
-_GL_CXXALIASWARN (atanl);
-#elif defined GNULIB_POSIXCHECK
-# undef atanl
-# if HAVE_RAW_DECL_ATANL
-_GL_WARN_ON_USE (atanl, "atanl is unportable - "
- "use gnulib module atanl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_ATAN2F@
-# if !@HAVE_ATAN2F@
-# undef atan2f
-_GL_FUNCDECL_SYS (atan2f, float, (float y, float x));
-# endif
-_GL_CXXALIAS_SYS (atan2f, float, (float y, float x));
-_GL_CXXALIASWARN (atan2f);
-#elif defined GNULIB_POSIXCHECK
-# undef atan2f
-# if HAVE_RAW_DECL_ATAN2F
-_GL_WARN_ON_USE (atan2f, "atan2f is unportable - "
- "use gnulib module atan2f for portability");
-# endif
-#endif
-
-
-#if @GNULIB_CBRTF@
-# if @REPLACE_CBRTF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef cbrtf
-# define cbrtf rpl_cbrtf
-# endif
-_GL_FUNCDECL_RPL (cbrtf, float, (float x));
-_GL_CXXALIAS_RPL (cbrtf, float, (float x));
-# else
-# if !@HAVE_DECL_CBRTF@
-_GL_FUNCDECL_SYS (cbrtf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (cbrtf, float, (float x));
-# endif
-_GL_CXXALIASWARN (cbrtf);
-#elif defined GNULIB_POSIXCHECK
-# undef cbrtf
-# if HAVE_RAW_DECL_CBRTF
-_GL_WARN_ON_USE (cbrtf, "cbrtf is unportable - "
- "use gnulib module cbrtf for portability");
-# endif
-#endif
-
-#if @GNULIB_CBRT@
-# if !@HAVE_CBRT@
-_GL_FUNCDECL_SYS (cbrt, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (cbrt, double, (double x));
-_GL_CXXALIASWARN (cbrt);
-#elif defined GNULIB_POSIXCHECK
-# undef cbrt
-# if HAVE_RAW_DECL_CBRT
-_GL_WARN_ON_USE (cbrt, "cbrt is unportable - "
- "use gnulib module cbrt for portability");
-# endif
-#endif
-
-#if @GNULIB_CBRTL@
-# if @REPLACE_CBRTL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef cbrtl
-# define cbrtl rpl_cbrtl
-# endif
-_GL_FUNCDECL_RPL (cbrtl, long double, (long double x));
-_GL_CXXALIAS_RPL (cbrtl, long double, (long double x));
-# else
-# if !@HAVE_DECL_CBRTL@
-_GL_FUNCDECL_SYS (cbrtl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (cbrtl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (cbrtl);
-#elif defined GNULIB_POSIXCHECK
-# undef cbrtl
-# if HAVE_RAW_DECL_CBRTL
-_GL_WARN_ON_USE (cbrtl, "cbrtl is unportable - "
- "use gnulib module cbrtl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_CEILF@
-# if @REPLACE_CEILF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef ceilf
-# define ceilf rpl_ceilf
-# endif
-_GL_FUNCDECL_RPL (ceilf, float, (float x));
-_GL_CXXALIAS_RPL (ceilf, float, (float x));
-# else
-# if !@HAVE_DECL_CEILF@
-# undef ceilf
-_GL_FUNCDECL_SYS (ceilf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (ceilf, float, (float x));
-# endif
-_GL_CXXALIASWARN (ceilf);
-#elif defined GNULIB_POSIXCHECK
-# undef ceilf
-# if HAVE_RAW_DECL_CEILF
-_GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
- "use gnulib module ceilf for portability");
-# endif
-#endif
-
-#if @GNULIB_CEIL@
-# if @REPLACE_CEIL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define ceil rpl_ceil
-# endif
-_GL_FUNCDECL_RPL (ceil, double, (double x));
-_GL_CXXALIAS_RPL (ceil, double, (double x));
-# else
-_GL_CXXALIAS_SYS (ceil, double, (double x));
-# endif
-_GL_CXXALIASWARN (ceil);
-#endif
-
-#if @GNULIB_CEILL@
-# if @REPLACE_CEILL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef ceill
-# define ceill rpl_ceill
-# endif
-_GL_FUNCDECL_RPL (ceill, long double, (long double x));
-_GL_CXXALIAS_RPL (ceill, long double, (long double x));
-# else
-# if !@HAVE_DECL_CEILL@
-# undef ceill
-_GL_FUNCDECL_SYS (ceill, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (ceill, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (ceill);
-#elif defined GNULIB_POSIXCHECK
-# undef ceill
-# if HAVE_RAW_DECL_CEILL
-_GL_WARN_ON_USE (ceill, "ceill is unportable - "
- "use gnulib module ceill for portability");
-# endif
-#endif
-
-
-#if @GNULIB_COPYSIGNF@
-# if !@HAVE_DECL_COPYSIGNF@
-_GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
-# endif
-_GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
-_GL_CXXALIASWARN (copysignf);
-#elif defined GNULIB_POSIXCHECK
-# undef copysignf
-# if HAVE_RAW_DECL_COPYSIGNF
-_GL_WARN_ON_USE (copysignf, "copysignf is unportable - "
- "use gnulib module copysignf for portability");
-# endif
-#endif
-
-#if @GNULIB_COPYSIGN@
-# if !@HAVE_COPYSIGN@
-_GL_FUNCDECL_SYS (copysign, double, (double x, double y));
-# endif
-_GL_CXXALIAS_SYS (copysign, double, (double x, double y));
-_GL_CXXALIASWARN (copysign);
-#elif defined GNULIB_POSIXCHECK
-# undef copysign
-# if HAVE_RAW_DECL_COPYSIGN
-_GL_WARN_ON_USE (copysign, "copysign is unportable - "
- "use gnulib module copysign for portability");
-# endif
-#endif
-
-#if @GNULIB_COPYSIGNL@
-# if !@HAVE_COPYSIGNL@
-_GL_FUNCDECL_SYS (copysignl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y));
-_GL_CXXALIASWARN (copysignl);
-#elif defined GNULIB_POSIXCHECK
-# undef copysignl
-# if HAVE_RAW_DECL_COPYSIGNL
-_GL_WARN_ON_USE (copysign, "copysignl is unportable - "
- "use gnulib module copysignl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_COSF@
-# if !@HAVE_COSF@
-# undef cosf
-_GL_FUNCDECL_SYS (cosf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (cosf, float, (float x));
-_GL_CXXALIASWARN (cosf);
-#elif defined GNULIB_POSIXCHECK
-# undef cosf
-# if HAVE_RAW_DECL_COSF
-_GL_WARN_ON_USE (cosf, "cosf is unportable - "
- "use gnulib module cosf for portability");
-# endif
-#endif
-
-#if @GNULIB_COSL@
-# if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
-# undef cosl
-_GL_FUNCDECL_SYS (cosl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (cosl, long double, (long double x));
-_GL_CXXALIASWARN (cosl);
-#elif defined GNULIB_POSIXCHECK
-# undef cosl
-# if HAVE_RAW_DECL_COSL
-_GL_WARN_ON_USE (cosl, "cosl is unportable - "
- "use gnulib module cosl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_COSHF@
-# if !@HAVE_COSHF@
-# undef coshf
-_GL_FUNCDECL_SYS (coshf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (coshf, float, (float x));
-_GL_CXXALIASWARN (coshf);
-#elif defined GNULIB_POSIXCHECK
-# undef coshf
-# if HAVE_RAW_DECL_COSHF
-_GL_WARN_ON_USE (coshf, "coshf is unportable - "
- "use gnulib module coshf for portability");
-# endif
-#endif
-
-
-#if @GNULIB_EXPF@
-# if !@HAVE_EXPF@
-# undef expf
-_GL_FUNCDECL_SYS (expf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (expf, float, (float x));
-_GL_CXXALIASWARN (expf);
-#elif defined GNULIB_POSIXCHECK
-# undef expf
-# if HAVE_RAW_DECL_EXPF
-_GL_WARN_ON_USE (expf, "expf is unportable - "
- "use gnulib module expf for portability");
-# endif
-#endif
-
-#if @GNULIB_EXPL@
-# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
-# undef expl
-_GL_FUNCDECL_SYS (expl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (expl, long double, (long double x));
-_GL_CXXALIASWARN (expl);
-#elif defined GNULIB_POSIXCHECK
-# undef expl
-# if HAVE_RAW_DECL_EXPL
-_GL_WARN_ON_USE (expl, "expl is unportable - "
- "use gnulib module expl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_EXP2F@
-# if !@HAVE_DECL_EXP2F@
-_GL_FUNCDECL_SYS (exp2f, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (exp2f, float, (float x));
-_GL_CXXALIASWARN (exp2f);
-#elif defined GNULIB_POSIXCHECK
-# undef exp2f
-# if HAVE_RAW_DECL_EXP2F
-_GL_WARN_ON_USE (exp2f, "exp2f is unportable - "
- "use gnulib module exp2f for portability");
-# endif
-#endif
-
-#if @GNULIB_EXP2@
-# if @REPLACE_EXP2@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef exp2
-# define exp2 rpl_exp2
-# endif
-_GL_FUNCDECL_RPL (exp2, double, (double x));
-_GL_CXXALIAS_RPL (exp2, double, (double x));
-# else
-# if !@HAVE_DECL_EXP2@
-_GL_FUNCDECL_SYS (exp2, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (exp2, double, (double x));
-# endif
-_GL_CXXALIASWARN (exp2);
-#elif defined GNULIB_POSIXCHECK
-# undef exp2
-# if HAVE_RAW_DECL_EXP2
-_GL_WARN_ON_USE (exp2, "exp2 is unportable - "
- "use gnulib module exp2 for portability");
-# endif
-#endif
-
-#if @GNULIB_EXP2L@
-# if @REPLACE_EXP2L@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef exp2l
-# define exp2l rpl_exp2l
-# endif
-_GL_FUNCDECL_RPL (exp2l, long double, (long double x));
-_GL_CXXALIAS_RPL (exp2l, long double, (long double x));
-# else
-# if !@HAVE_DECL_EXP2L@
-# undef exp2l
-_GL_FUNCDECL_SYS (exp2l, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (exp2l, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (exp2l);
-#elif defined GNULIB_POSIXCHECK
-# undef exp2l
-# if HAVE_RAW_DECL_EXP2L
-_GL_WARN_ON_USE (exp2l, "exp2l is unportable - "
- "use gnulib module exp2l for portability");
-# endif
-#endif
-
-
-#if @GNULIB_EXPM1F@
-# if @REPLACE_EXPM1F@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef expm1f
-# define expm1f rpl_expm1f
-# endif
-_GL_FUNCDECL_RPL (expm1f, float, (float x));
-_GL_CXXALIAS_RPL (expm1f, float, (float x));
-# else
-# if !@HAVE_EXPM1F@
-_GL_FUNCDECL_SYS (expm1f, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (expm1f, float, (float x));
-# endif
-_GL_CXXALIASWARN (expm1f);
-#elif defined GNULIB_POSIXCHECK
-# undef expm1f
-# if HAVE_RAW_DECL_EXPM1F
-_GL_WARN_ON_USE (expm1f, "expm1f is unportable - "
- "use gnulib module expm1f for portability");
-# endif
-#endif
-
-#if @GNULIB_EXPM1@
-# if @REPLACE_EXPM1@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef expm1
-# define expm1 rpl_expm1
-# endif
-_GL_FUNCDECL_RPL (expm1, double, (double x));
-_GL_CXXALIAS_RPL (expm1, double, (double x));
-# else
-# if !@HAVE_EXPM1@
-_GL_FUNCDECL_SYS (expm1, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (expm1, double, (double x));
-# endif
-_GL_CXXALIASWARN (expm1);
-#elif defined GNULIB_POSIXCHECK
-# undef expm1
-# if HAVE_RAW_DECL_EXPM1
-_GL_WARN_ON_USE (expm1, "expm1 is unportable - "
- "use gnulib module expm1 for portability");
-# endif
-#endif
-
-#if @GNULIB_EXPM1L@
-# if !@HAVE_DECL_EXPM1L@
-# undef expm1l
-_GL_FUNCDECL_SYS (expm1l, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (expm1l, long double, (long double x));
-_GL_CXXALIASWARN (expm1l);
-#elif defined GNULIB_POSIXCHECK
-# undef expm1l
-# if HAVE_RAW_DECL_EXPM1L
-_GL_WARN_ON_USE (expm1l, "expm1l is unportable - "
- "use gnulib module expm1l for portability");
-# endif
-#endif
-
-
-#if @GNULIB_FABSF@
-# if !@HAVE_FABSF@
-# undef fabsf
-_GL_FUNCDECL_SYS (fabsf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (fabsf, float, (float x));
-_GL_CXXALIASWARN (fabsf);
-#elif defined GNULIB_POSIXCHECK
-# undef fabsf
-# if HAVE_RAW_DECL_FABSF
-_GL_WARN_ON_USE (fabsf, "fabsf is unportable - "
- "use gnulib module fabsf for portability");
-# endif
-#endif
-
-#if @GNULIB_FABSL@
-# if @REPLACE_FABSL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fabsl
-# define fabsl rpl_fabsl
-# endif
-_GL_FUNCDECL_RPL (fabsl, long double, (long double x));
-_GL_CXXALIAS_RPL (fabsl, long double, (long double x));
-# else
-# if !@HAVE_FABSL@
-# undef fabsl
-_GL_FUNCDECL_SYS (fabsl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (fabsl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (fabsl);
-#elif defined GNULIB_POSIXCHECK
-# undef fabsl
-# if HAVE_RAW_DECL_FABSL
-_GL_WARN_ON_USE (fabsl, "fabsl is unportable - "
- "use gnulib module fabsl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_FLOORF@
-# if @REPLACE_FLOORF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef floorf
-# define floorf rpl_floorf
-# endif
-_GL_FUNCDECL_RPL (floorf, float, (float x));
-_GL_CXXALIAS_RPL (floorf, float, (float x));
-# else
-# if !@HAVE_DECL_FLOORF@
-# undef floorf
-_GL_FUNCDECL_SYS (floorf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (floorf, float, (float x));
-# endif
-_GL_CXXALIASWARN (floorf);
-#elif defined GNULIB_POSIXCHECK
-# undef floorf
-# if HAVE_RAW_DECL_FLOORF
-_GL_WARN_ON_USE (floorf, "floorf is unportable - "
- "use gnulib module floorf for portability");
-# endif
-#endif
-
-#if @GNULIB_FLOOR@
-# if @REPLACE_FLOOR@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define floor rpl_floor
-# endif
-_GL_FUNCDECL_RPL (floor, double, (double x));
-_GL_CXXALIAS_RPL (floor, double, (double x));
-# else
-_GL_CXXALIAS_SYS (floor, double, (double x));
-# endif
-_GL_CXXALIASWARN (floor);
-#endif
-
-#if @GNULIB_FLOORL@
-# if @REPLACE_FLOORL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef floorl
-# define floorl rpl_floorl
-# endif
-_GL_FUNCDECL_RPL (floorl, long double, (long double x));
-_GL_CXXALIAS_RPL (floorl, long double, (long double x));
-# else
-# if !@HAVE_DECL_FLOORL@
-# undef floorl
-_GL_FUNCDECL_SYS (floorl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (floorl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (floorl);
-#elif defined GNULIB_POSIXCHECK
-# undef floorl
-# if HAVE_RAW_DECL_FLOORL
-_GL_WARN_ON_USE (floorl, "floorl is unportable - "
- "use gnulib module floorl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_FMAF@
-# if @REPLACE_FMAF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fmaf
-# define fmaf rpl_fmaf
-# endif
-_GL_FUNCDECL_RPL (fmaf, float, (float x, float y, float z));
-_GL_CXXALIAS_RPL (fmaf, float, (float x, float y, float z));
-# else
-# if !@HAVE_FMAF@
-_GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
-# endif
-_GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z));
-# endif
-_GL_CXXALIASWARN (fmaf);
-#elif defined GNULIB_POSIXCHECK
-# undef fmaf
-# if HAVE_RAW_DECL_FMAF
-_GL_WARN_ON_USE (fmaf, "fmaf is unportable - "
- "use gnulib module fmaf for portability");
-# endif
-#endif
-
-#if @GNULIB_FMA@
-# if @REPLACE_FMA@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fma
-# define fma rpl_fma
-# endif
-_GL_FUNCDECL_RPL (fma, double, (double x, double y, double z));
-_GL_CXXALIAS_RPL (fma, double, (double x, double y, double z));
-# else
-# if !@HAVE_FMA@
-_GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
-# endif
-_GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
-# endif
-_GL_CXXALIASWARN (fma);
-#elif defined GNULIB_POSIXCHECK
-# undef fma
-# if HAVE_RAW_DECL_FMA
-_GL_WARN_ON_USE (fma, "fma is unportable - "
- "use gnulib module fma for portability");
-# endif
-#endif
-
-#if @GNULIB_FMAL@
-# if @REPLACE_FMAL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fmal
-# define fmal rpl_fmal
-# endif
-_GL_FUNCDECL_RPL (fmal, long double,
- (long double x, long double y, long double z));
-_GL_CXXALIAS_RPL (fmal, long double,
- (long double x, long double y, long double z));
-# else
-# if !@HAVE_FMAL@
-# undef fmal
-_GL_FUNCDECL_SYS (fmal, long double,
- (long double x, long double y, long double z));
-# endif
-_GL_CXXALIAS_SYS (fmal, long double,
- (long double x, long double y, long double z));
-# endif
-_GL_CXXALIASWARN (fmal);
-#elif defined GNULIB_POSIXCHECK
-# undef fmal
-# if HAVE_RAW_DECL_FMAL
-_GL_WARN_ON_USE (fmal, "fmal is unportable - "
- "use gnulib module fmal for portability");
-# endif
-#endif
-
-
-#if @GNULIB_FMODF@
-# if @REPLACE_FMODF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fmodf
-# define fmodf rpl_fmodf
-# endif
-_GL_FUNCDECL_RPL (fmodf, float, (float x, float y));
-_GL_CXXALIAS_RPL (fmodf, float, (float x, float y));
-# else
-# if !@HAVE_FMODF@
-# undef fmodf
-_GL_FUNCDECL_SYS (fmodf, float, (float x, float y));
-# endif
-_GL_CXXALIAS_SYS (fmodf, float, (float x, float y));
-# endif
-_GL_CXXALIASWARN (fmodf);
-#elif defined GNULIB_POSIXCHECK
-# undef fmodf
-# if HAVE_RAW_DECL_FMODF
-_GL_WARN_ON_USE (fmodf, "fmodf is unportable - "
- "use gnulib module fmodf for portability");
-# endif
-#endif
-
-#if @GNULIB_FMOD@
-# if @REPLACE_FMOD@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fmod
-# define fmod rpl_fmod
-# endif
-_GL_FUNCDECL_RPL (fmod, double, (double x, double y));
-_GL_CXXALIAS_RPL (fmod, double, (double x, double y));
-# else
-_GL_CXXALIAS_SYS (fmod, double, (double x, double y));
-# endif
-_GL_CXXALIASWARN (fmod);
-#elif defined GNULIB_POSIXCHECK
-# undef fmod
-# if HAVE_RAW_DECL_FMOD
-_GL_WARN_ON_USE (fmod, "fmod has portability problems - "
- "use gnulib module fmod for portability");
-# endif
-#endif
-
-#if @GNULIB_FMODL@
-# if @REPLACE_FMODL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef fmodl
-# define fmodl rpl_fmodl
-# endif
-_GL_FUNCDECL_RPL (fmodl, long double, (long double x, long double y));
-_GL_CXXALIAS_RPL (fmodl, long double, (long double x, long double y));
-# else
-# if !@HAVE_FMODL@
-# undef fmodl
-_GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIASWARN (fmodl);
-#elif defined GNULIB_POSIXCHECK
-# undef fmodl
-# if HAVE_RAW_DECL_FMODL
-_GL_WARN_ON_USE (fmodl, "fmodl is unportable - "
- "use gnulib module fmodl for portability");
-# endif
-#endif
-
-
-/* Write x as
- x = mantissa * 2^exp
- where
- If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
- If x is zero: mantissa = x, exp = 0.
- If x is infinite or NaN: mantissa = x, exp unspecified.
- Store exp in *EXPPTR and return mantissa. */
-#if @GNULIB_FREXPF@
-# if @REPLACE_FREXPF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef frexpf
-# define frexpf rpl_frexpf
-# endif
-_GL_FUNCDECL_RPL (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (frexpf, float, (float x, int *expptr));
-# else
-# if !@HAVE_FREXPF@
-# undef frexpf
-_GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
-# endif
-_GL_CXXALIASWARN (frexpf);
-#elif defined GNULIB_POSIXCHECK
-# undef frexpf
-# if HAVE_RAW_DECL_FREXPF
-_GL_WARN_ON_USE (frexpf, "frexpf is unportable - "
- "use gnulib module frexpf for portability");
-# endif
-#endif
-
-/* Write x as
- x = mantissa * 2^exp
- where
- If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
- If x is zero: mantissa = x, exp = 0.
- If x is infinite or NaN: mantissa = x, exp unspecified.
- Store exp in *EXPPTR and return mantissa. */
-#if @GNULIB_FREXP@
-# if @REPLACE_FREXP@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define frexp rpl_frexp
-# endif
-_GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
-# else
-_GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
-# endif
-_GL_CXXALIASWARN (frexp);
-#elif defined GNULIB_POSIXCHECK
-# undef frexp
-/* Assume frexp is always declared. */
-_GL_WARN_ON_USE (frexp, "frexp is unportable - "
- "use gnulib module frexp for portability");
-#endif
-
-/* Write x as
- x = mantissa * 2^exp
- where
- If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
- If x is zero: mantissa = x, exp = 0.
- If x is infinite or NaN: mantissa = x, exp unspecified.
- Store exp in *EXPPTR and return mantissa. */
-#if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef frexpl
-# define frexpl rpl_frexpl
-# endif
-_GL_FUNCDECL_RPL (frexpl, long double,
- (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
-#else
-# if !@HAVE_DECL_FREXPL@
-_GL_FUNCDECL_SYS (frexpl, long double,
- (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
-# endif
-# if @GNULIB_FREXPL@
-_GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
-# endif
-#endif
-#if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
-_GL_CXXALIASWARN (frexpl);
-#endif
-#if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
-# undef frexpl
-# if HAVE_RAW_DECL_FREXPL
-_GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
- "use gnulib module frexpl for portability");
-# endif
-#endif
-
-
-/* Return sqrt(x^2+y^2). */
-#if @GNULIB_HYPOTF@
-# if @REPLACE_HYPOTF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef hypotf
-# define hypotf rpl_hypotf
-# endif
-_GL_FUNCDECL_RPL (hypotf, float, (float x, float y));
-_GL_CXXALIAS_RPL (hypotf, float, (float x, float y));
-# else
-# if !@HAVE_HYPOTF@
-_GL_FUNCDECL_SYS (hypotf, float, (float x, float y));
-# endif
-_GL_CXXALIAS_SYS (hypotf, float, (float x, float y));
-# endif
-_GL_CXXALIASWARN (hypotf);
-#elif defined GNULIB_POSIXCHECK
-# undef hypotf
-# if HAVE_RAW_DECL_HYPOTF
-_GL_WARN_ON_USE (hypotf, "hypotf is unportable - "
- "use gnulib module hypotf for portability");
-# endif
-#endif
-
-/* Return sqrt(x^2+y^2). */
-#if @GNULIB_HYPOT@
-# if @REPLACE_HYPOT@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef hypot
-# define hypot rpl_hypot
-# endif
-_GL_FUNCDECL_RPL (hypot, double, (double x, double y));
-_GL_CXXALIAS_RPL (hypot, double, (double x, double y));
-# else
-_GL_CXXALIAS_SYS (hypot, double, (double x, double y));
-# endif
-_GL_CXXALIASWARN (hypot);
-#elif defined GNULIB_POSIXCHECK
-# undef hypot
-# if HAVE_RAW_DECL_HYPOT
-_GL_WARN_ON_USE (hypotf, "hypot has portability problems - "
- "use gnulib module hypot for portability");
-# endif
-#endif
-
-/* Return sqrt(x^2+y^2). */
-#if @GNULIB_HYPOTL@
-# if @REPLACE_HYPOTL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef hypotl
-# define hypotl rpl_hypotl
-# endif
-_GL_FUNCDECL_RPL (hypotl, long double, (long double x, long double y));
-_GL_CXXALIAS_RPL (hypotl, long double, (long double x, long double y));
-# else
-# if !@HAVE_HYPOTL@
-_GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIASWARN (hypotl);
-#elif defined GNULIB_POSIXCHECK
-# undef hypotl
-# if HAVE_RAW_DECL_HYPOTL
-_GL_WARN_ON_USE (hypotl, "hypotl is unportable - "
- "use gnulib module hypotl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_ILOGBF@
-# if @REPLACE_ILOGBF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef ilogbf
-# define ilogbf rpl_ilogbf
-# endif
-_GL_FUNCDECL_RPL (ilogbf, int, (float x));
-_GL_CXXALIAS_RPL (ilogbf, int, (float x));
-# else
-# if !@HAVE_ILOGBF@
-_GL_FUNCDECL_SYS (ilogbf, int, (float x));
-# endif
-_GL_CXXALIAS_SYS (ilogbf, int, (float x));
-# endif
-_GL_CXXALIASWARN (ilogbf);
-#elif defined GNULIB_POSIXCHECK
-# undef ilogbf
-# if HAVE_RAW_DECL_ILOGBF
-_GL_WARN_ON_USE (ilogbf, "ilogbf is unportable - "
- "use gnulib module ilogbf for portability");
-# endif
-#endif
-
-#if @GNULIB_ILOGB@
-# if @REPLACE_ILOGB@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef ilogb
-# define ilogb rpl_ilogb
-# endif
-_GL_FUNCDECL_RPL (ilogb, int, (double x));
-_GL_CXXALIAS_RPL (ilogb, int, (double x));
-# else
-# if !@HAVE_ILOGB@
-_GL_FUNCDECL_SYS (ilogb, int, (double x));
-# endif
-_GL_CXXALIAS_SYS (ilogb, int, (double x));
-# endif
-_GL_CXXALIASWARN (ilogb);
-#elif defined GNULIB_POSIXCHECK
-# undef ilogb
-# if HAVE_RAW_DECL_ILOGB
-_GL_WARN_ON_USE (ilogb, "ilogb is unportable - "
- "use gnulib module ilogb for portability");
-# endif
-#endif
-
-#if @GNULIB_ILOGBL@
-# if !@HAVE_ILOGBL@
-_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
-# endif
-_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
-_GL_CXXALIASWARN (ilogbl);
-#elif defined GNULIB_POSIXCHECK
-# undef ilogbl
-# if HAVE_RAW_DECL_ILOGBL
-_GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
- "use gnulib module ilogbl for portability");
-# endif
-#endif
-
-
-/* Return x * 2^exp. */
-#if @GNULIB_LDEXPF@
-# if !@HAVE_LDEXPF@
-# undef ldexpf
-_GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
-# endif
-_GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
-_GL_CXXALIASWARN (ldexpf);
-#elif defined GNULIB_POSIXCHECK
-# undef ldexpf
-# if HAVE_RAW_DECL_LDEXPF
-_GL_WARN_ON_USE (ldexpf, "ldexpf is unportable - "
- "use gnulib module ldexpf for portability");
-# endif
-#endif
-
-/* Return x * 2^exp. */
-#if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef ldexpl
-# define ldexpl rpl_ldexpl
-# endif
-_GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
-_GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
-#else
-# if !@HAVE_DECL_LDEXPL@
-_GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
-# endif
-# if @GNULIB_LDEXPL@
-_GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
-# endif
-#endif
-#if @GNULIB_LDEXPL@
-_GL_CXXALIASWARN (ldexpl);
-#endif
-#if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
-# undef ldexpl
-# if HAVE_RAW_DECL_LDEXPL
-_GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
- "use gnulib module ldexpl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_LOGF@
-# if @REPLACE_LOGF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef logf
-# define logf rpl_logf
-# endif
-_GL_FUNCDECL_RPL (logf, float, (float x));
-_GL_CXXALIAS_RPL (logf, float, (float x));
-# else
-# if !@HAVE_LOGF@
-# undef logf
-_GL_FUNCDECL_SYS (logf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (logf, float, (float x));
-# endif
-_GL_CXXALIASWARN (logf);
-#elif defined GNULIB_POSIXCHECK
-# undef logf
-# if HAVE_RAW_DECL_LOGF
-_GL_WARN_ON_USE (logf, "logf is unportable - "
- "use gnulib module logf for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG@
-# if @REPLACE_LOG@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log
-# define log rpl_log
-# endif
-_GL_FUNCDECL_RPL (log, double, (double x));
-_GL_CXXALIAS_RPL (log, double, (double x));
-# else
-_GL_CXXALIAS_SYS (log, double, (double x));
-# endif
-_GL_CXXALIASWARN (log);
-#elif defined GNULIB_POSIXCHECK
-# undef log
-# if HAVE_RAW_DECL_LOG
-_GL_WARN_ON_USE (log, "log has portability problems - "
- "use gnulib module log for portability");
-# endif
-#endif
-
-#if @GNULIB_LOGL@
-# if @REPLACE_LOGL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef logl
-# define logl rpl_logl
-# endif
-_GL_FUNCDECL_RPL (logl, long double, (long double x));
-_GL_CXXALIAS_RPL (logl, long double, (long double x));
-# else
-# if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
-# undef logl
-_GL_FUNCDECL_SYS (logl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (logl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (logl);
-#elif defined GNULIB_POSIXCHECK
-# undef logl
-# if HAVE_RAW_DECL_LOGL
-_GL_WARN_ON_USE (logl, "logl is unportable - "
- "use gnulib module logl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_LOG10F@
-# if @REPLACE_LOG10F@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log10f
-# define log10f rpl_log10f
-# endif
-_GL_FUNCDECL_RPL (log10f, float, (float x));
-_GL_CXXALIAS_RPL (log10f, float, (float x));
-# else
-# if !@HAVE_LOG10F@
-# undef log10f
-_GL_FUNCDECL_SYS (log10f, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (log10f, float, (float x));
-# endif
-_GL_CXXALIASWARN (log10f);
-#elif defined GNULIB_POSIXCHECK
-# undef log10f
-# if HAVE_RAW_DECL_LOG10F
-_GL_WARN_ON_USE (log10f, "log10f is unportable - "
- "use gnulib module log10f for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG10@
-# if @REPLACE_LOG10@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log10
-# define log10 rpl_log10
-# endif
-_GL_FUNCDECL_RPL (log10, double, (double x));
-_GL_CXXALIAS_RPL (log10, double, (double x));
-# else
-_GL_CXXALIAS_SYS (log10, double, (double x));
-# endif
-_GL_CXXALIASWARN (log10);
-#elif defined GNULIB_POSIXCHECK
-# undef log10
-# if HAVE_RAW_DECL_LOG10
-_GL_WARN_ON_USE (log10, "log10 has portability problems - "
- "use gnulib module log10 for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG10L@
-# if @REPLACE_LOG10L@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log10l
-# define log10l rpl_log10l
-# endif
-_GL_FUNCDECL_RPL (log10l, long double, (long double x));
-_GL_CXXALIAS_RPL (log10l, long double, (long double x));
-# else
-# if !@HAVE_LOG10L@ || !@HAVE_DECL_LOG10L@
-# undef log10l
-_GL_FUNCDECL_SYS (log10l, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (log10l, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (log10l);
-#elif defined GNULIB_POSIXCHECK
-# undef log10l
-# if HAVE_RAW_DECL_LOG10L
-_GL_WARN_ON_USE (log10l, "log10l is unportable - "
- "use gnulib module log10l for portability");
-# endif
-#endif
-
-
-#if @GNULIB_LOG1PF@
-# if @REPLACE_LOG1PF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log1pf
-# define log1pf rpl_log1pf
-# endif
-_GL_FUNCDECL_RPL (log1pf, float, (float x));
-_GL_CXXALIAS_RPL (log1pf, float, (float x));
-# else
-# if !@HAVE_LOG1PF@
-_GL_FUNCDECL_SYS (log1pf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (log1pf, float, (float x));
-# endif
-_GL_CXXALIASWARN (log1pf);
-#elif defined GNULIB_POSIXCHECK
-# undef log1pf
-# if HAVE_RAW_DECL_LOG1PF
-_GL_WARN_ON_USE (log1pf, "log1pf is unportable - "
- "use gnulib module log1pf for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG1P@
-# if @REPLACE_LOG1P@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log1p
-# define log1p rpl_log1p
-# endif
-_GL_FUNCDECL_RPL (log1p, double, (double x));
-_GL_CXXALIAS_RPL (log1p, double, (double x));
-# else
-# if !@HAVE_LOG1P@
-_GL_FUNCDECL_SYS (log1p, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (log1p, double, (double x));
-# endif
-_GL_CXXALIASWARN (log1p);
-#elif defined GNULIB_POSIXCHECK
-# undef log1p
-# if HAVE_RAW_DECL_LOG1P
-_GL_WARN_ON_USE (log1p, "log1p has portability problems - "
- "use gnulib module log1p for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG1PL@
-# if @REPLACE_LOG1PL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log1pl
-# define log1pl rpl_log1pl
-# endif
-_GL_FUNCDECL_RPL (log1pl, long double, (long double x));
-_GL_CXXALIAS_RPL (log1pl, long double, (long double x));
-# else
-# if !@HAVE_LOG1PL@
-_GL_FUNCDECL_SYS (log1pl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (log1pl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (log1pl);
-#elif defined GNULIB_POSIXCHECK
-# undef log1pl
-# if HAVE_RAW_DECL_LOG1PL
-_GL_WARN_ON_USE (log1pl, "log1pl has portability problems - "
- "use gnulib module log1pl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_LOG2F@
-# if @REPLACE_LOG2F@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log2f
-# define log2f rpl_log2f
-# endif
-_GL_FUNCDECL_RPL (log2f, float, (float x));
-_GL_CXXALIAS_RPL (log2f, float, (float x));
-# else
-# if !@HAVE_DECL_LOG2F@
-# undef log2f
-_GL_FUNCDECL_SYS (log2f, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (log2f, float, (float x));
-# endif
-_GL_CXXALIASWARN (log2f);
-#elif defined GNULIB_POSIXCHECK
-# undef log2f
-# if HAVE_RAW_DECL_LOG2F
-_GL_WARN_ON_USE (log2f, "log2f is unportable - "
- "use gnulib module log2f for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG2@
-# if @REPLACE_LOG2@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log2
-# define log2 rpl_log2
-# endif
-_GL_FUNCDECL_RPL (log2, double, (double x));
-_GL_CXXALIAS_RPL (log2, double, (double x));
-# else
-# if !@HAVE_DECL_LOG2@
-# undef log2
-_GL_FUNCDECL_SYS (log2, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (log2, double, (double x));
-# endif
-_GL_CXXALIASWARN (log2);
-#elif defined GNULIB_POSIXCHECK
-# undef log2
-# if HAVE_RAW_DECL_LOG2
-_GL_WARN_ON_USE (log2, "log2 is unportable - "
- "use gnulib module log2 for portability");
-# endif
-#endif
-
-#if @GNULIB_LOG2L@
-# if @REPLACE_LOG2L@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef log2l
-# define log2l rpl_log2l
-# endif
-_GL_FUNCDECL_RPL (log2l, long double, (long double x));
-_GL_CXXALIAS_RPL (log2l, long double, (long double x));
-# else
-# if !@HAVE_DECL_LOG2L@
-_GL_FUNCDECL_SYS (log2l, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (log2l, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (log2l);
-#elif defined GNULIB_POSIXCHECK
-# undef log2l
-# if HAVE_RAW_DECL_LOG2L
-_GL_WARN_ON_USE (log2l, "log2l is unportable - "
- "use gnulib module log2l for portability");
-# endif
-#endif
-
-
-#if @GNULIB_LOGBF@
-# if @REPLACE_LOGBF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef logbf
-# define logbf rpl_logbf
-# endif
-_GL_FUNCDECL_RPL (logbf, float, (float x));
-_GL_CXXALIAS_RPL (logbf, float, (float x));
-# else
-# if !@HAVE_LOGBF@
-_GL_FUNCDECL_SYS (logbf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (logbf, float, (float x));
-# endif
-_GL_CXXALIASWARN (logbf);
-#elif defined GNULIB_POSIXCHECK
-# undef logbf
-# if HAVE_RAW_DECL_LOGBF
-_GL_WARN_ON_USE (logbf, "logbf is unportable - "
- "use gnulib module logbf for portability");
-# endif
-#endif
-
-#if @GNULIB_LOGB@
-# if @REPLACE_LOGB@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef logb
-# define logb rpl_logb
-# endif
-_GL_FUNCDECL_RPL (logb, double, (double x));
-_GL_CXXALIAS_RPL (logb, double, (double x));
-# else
-# if !@HAVE_DECL_LOGB@
-_GL_FUNCDECL_SYS (logb, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (logb, double, (double x));
-# endif
-_GL_CXXALIASWARN (logb);
-#elif defined GNULIB_POSIXCHECK
-# undef logb
-# if HAVE_RAW_DECL_LOGB
-_GL_WARN_ON_USE (logb, "logb is unportable - "
- "use gnulib module logb for portability");
-# endif
-#endif
-
-#if @GNULIB_LOGBL@
-# if @REPLACE_LOGBL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef logbl
-# define logbl rpl_logbl
-# endif
-_GL_FUNCDECL_RPL (logbl, long double, (long double x));
-_GL_CXXALIAS_RPL (logbl, long double, (long double x));
-# else
-# if !@HAVE_LOGBL@
-_GL_FUNCDECL_SYS (logbl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (logbl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (logbl);
-#elif defined GNULIB_POSIXCHECK
-# undef logbl
-# if HAVE_RAW_DECL_LOGBL
-_GL_WARN_ON_USE (logbl, "logbl is unportable - "
- "use gnulib module logbl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_MODFF@
-# if @REPLACE_MODFF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef modff
-# define modff rpl_modff
-# endif
-_GL_FUNCDECL_RPL (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (modff, float, (float x, float *iptr));
-# else
-# if !@HAVE_MODFF@
-# undef modff
-_GL_FUNCDECL_SYS (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (modff, float, (float x, float *iptr));
-# endif
-_GL_CXXALIASWARN (modff);
-#elif defined GNULIB_POSIXCHECK
-# undef modff
-# if HAVE_RAW_DECL_MODFF
-_GL_WARN_ON_USE (modff, "modff is unportable - "
- "use gnulib module modff for portability");
-# endif
-#endif
-
-#if @GNULIB_MODF@
-# if @REPLACE_MODF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef modf
-# define modf rpl_modf
-# endif
-_GL_FUNCDECL_RPL (modf, double, (double x, double *iptr) _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (modf, double, (double x, double *iptr));
-# else
-_GL_CXXALIAS_SYS (modf, double, (double x, double *iptr));
-# endif
-_GL_CXXALIASWARN (modf);
-#elif defined GNULIB_POSIXCHECK
-# undef modf
-# if HAVE_RAW_DECL_MODF
-_GL_WARN_ON_USE (modf, "modf has portability problems - "
- "use gnulib module modf for portability");
-# endif
-#endif
-
-#if @GNULIB_MODFL@
-# if @REPLACE_MODFL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef modfl
-# define modfl rpl_modfl
-# endif
-_GL_FUNCDECL_RPL (modfl, long double, (long double x, long double *iptr)
- _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (modfl, long double, (long double x, long double *iptr));
-# else
-# if !@HAVE_MODFL@
-# undef modfl
-_GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr)
- _GL_ARG_NONNULL ((2)));
-# endif
-_GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr));
-# endif
-_GL_CXXALIASWARN (modfl);
-#elif defined GNULIB_POSIXCHECK
-# undef modfl
-# if HAVE_RAW_DECL_MODFL
-_GL_WARN_ON_USE (modfl, "modfl is unportable - "
- "use gnulib module modfl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_POWF@
-# if !@HAVE_POWF@
-# undef powf
-_GL_FUNCDECL_SYS (powf, float, (float x, float y));
-# endif
-_GL_CXXALIAS_SYS (powf, float, (float x, float y));
-_GL_CXXALIASWARN (powf);
-#elif defined GNULIB_POSIXCHECK
-# undef powf
-# if HAVE_RAW_DECL_POWF
-_GL_WARN_ON_USE (powf, "powf is unportable - "
- "use gnulib module powf for portability");
-# endif
-#endif
-
-
-#if @GNULIB_REMAINDERF@
-# if @REPLACE_REMAINDERF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef remainderf
-# define remainderf rpl_remainderf
-# endif
-_GL_FUNCDECL_RPL (remainderf, float, (float x, float y));
-_GL_CXXALIAS_RPL (remainderf, float, (float x, float y));
-# else
-# if !@HAVE_REMAINDERF@
-_GL_FUNCDECL_SYS (remainderf, float, (float x, float y));
-# endif
-_GL_CXXALIAS_SYS (remainderf, float, (float x, float y));
-# endif
-_GL_CXXALIASWARN (remainderf);
-#elif defined GNULIB_POSIXCHECK
-# undef remainderf
-# if HAVE_RAW_DECL_REMAINDERF
-_GL_WARN_ON_USE (remainderf, "remainderf is unportable - "
- "use gnulib module remainderf for portability");
-# endif
-#endif
-
-#if @GNULIB_REMAINDER@
-# if @REPLACE_REMAINDER@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef remainder
-# define remainder rpl_remainder
-# endif
-_GL_FUNCDECL_RPL (remainder, double, (double x, double y));
-_GL_CXXALIAS_RPL (remainder, double, (double x, double y));
-# else
-# if !@HAVE_REMAINDER@ || !@HAVE_DECL_REMAINDER@
-_GL_FUNCDECL_SYS (remainder, double, (double x, double y));
-# endif
-_GL_CXXALIAS_SYS (remainder, double, (double x, double y));
-# endif
-_GL_CXXALIASWARN (remainder);
-#elif defined GNULIB_POSIXCHECK
-# undef remainder
-# if HAVE_RAW_DECL_REMAINDER
-_GL_WARN_ON_USE (remainder, "remainder is unportable - "
- "use gnulib module remainder for portability");
-# endif
-#endif
-
-#if @GNULIB_REMAINDERL@
-# if @REPLACE_REMAINDERL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef remainderl
-# define remainderl rpl_remainderl
-# endif
-_GL_FUNCDECL_RPL (remainderl, long double, (long double x, long double y));
-_GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y));
-# else
-# if !@HAVE_DECL_REMAINDERL@
-# undef remainderl
-_GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
-# endif
-_GL_CXXALIASWARN (remainderl);
-#elif defined GNULIB_POSIXCHECK
-# undef remainderl
-# if HAVE_RAW_DECL_REMAINDERL
-_GL_WARN_ON_USE (remainderl, "remainderl is unportable - "
- "use gnulib module remainderl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_RINTF@
-# if !@HAVE_DECL_RINTF@
-_GL_FUNCDECL_SYS (rintf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (rintf, float, (float x));
-_GL_CXXALIASWARN (rintf);
-#elif defined GNULIB_POSIXCHECK
-# undef rintf
-# if HAVE_RAW_DECL_RINTF
-_GL_WARN_ON_USE (rintf, "rintf is unportable - "
- "use gnulib module rintf for portability");
-# endif
-#endif
-
-#if @GNULIB_RINT@
-# if !@HAVE_RINT@
-_GL_FUNCDECL_SYS (rint, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (rint, double, (double x));
-_GL_CXXALIASWARN (rint);
-#elif defined GNULIB_POSIXCHECK
-# undef rint
-# if HAVE_RAW_DECL_RINT
-_GL_WARN_ON_USE (rint, "rint is unportable - "
- "use gnulib module rint for portability");
-# endif
-#endif
-
-#if @GNULIB_RINTL@
-# if !@HAVE_RINTL@
-_GL_FUNCDECL_SYS (rintl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (rintl, long double, (long double x));
-_GL_CXXALIASWARN (rintl);
-#elif defined GNULIB_POSIXCHECK
-# undef rintl
-# if HAVE_RAW_DECL_RINTL
-_GL_WARN_ON_USE (rintl, "rintl is unportable - "
- "use gnulib module rintl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_ROUNDF@
-# if @REPLACE_ROUNDF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef roundf
-# define roundf rpl_roundf
-# endif
-_GL_FUNCDECL_RPL (roundf, float, (float x));
-_GL_CXXALIAS_RPL (roundf, float, (float x));
-# else
-# if !@HAVE_DECL_ROUNDF@
-_GL_FUNCDECL_SYS (roundf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (roundf, float, (float x));
-# endif
-_GL_CXXALIASWARN (roundf);
-#elif defined GNULIB_POSIXCHECK
-# undef roundf
-# if HAVE_RAW_DECL_ROUNDF
-_GL_WARN_ON_USE (roundf, "roundf is unportable - "
- "use gnulib module roundf for portability");
-# endif
-#endif
-
-#if @GNULIB_ROUND@
-# if @REPLACE_ROUND@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef round
-# define round rpl_round
-# endif
-_GL_FUNCDECL_RPL (round, double, (double x));
-_GL_CXXALIAS_RPL (round, double, (double x));
-# else
-# if !@HAVE_DECL_ROUND@
-_GL_FUNCDECL_SYS (round, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (round, double, (double x));
-# endif
-_GL_CXXALIASWARN (round);
-#elif defined GNULIB_POSIXCHECK
-# undef round
-# if HAVE_RAW_DECL_ROUND
-_GL_WARN_ON_USE (round, "round is unportable - "
- "use gnulib module round for portability");
-# endif
-#endif
-
-#if @GNULIB_ROUNDL@
-# if @REPLACE_ROUNDL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef roundl
-# define roundl rpl_roundl
-# endif
-_GL_FUNCDECL_RPL (roundl, long double, (long double x));
-_GL_CXXALIAS_RPL (roundl, long double, (long double x));
-# else
-# if !@HAVE_DECL_ROUNDL@
-# undef roundl
-_GL_FUNCDECL_SYS (roundl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (roundl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (roundl);
-#elif defined GNULIB_POSIXCHECK
-# undef roundl
-# if HAVE_RAW_DECL_ROUNDL
-_GL_WARN_ON_USE (roundl, "roundl is unportable - "
- "use gnulib module roundl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_SINF@
-# if !@HAVE_SINF@
-# undef sinf
-_GL_FUNCDECL_SYS (sinf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (sinf, float, (float x));
-_GL_CXXALIASWARN (sinf);
-#elif defined GNULIB_POSIXCHECK
-# undef sinf
-# if HAVE_RAW_DECL_SINF
-_GL_WARN_ON_USE (sinf, "sinf is unportable - "
- "use gnulib module sinf for portability");
-# endif
-#endif
-
-#if @GNULIB_SINL@
-# if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
-# undef sinl
-_GL_FUNCDECL_SYS (sinl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (sinl, long double, (long double x));
-_GL_CXXALIASWARN (sinl);
-#elif defined GNULIB_POSIXCHECK
-# undef sinl
-# if HAVE_RAW_DECL_SINL
-_GL_WARN_ON_USE (sinl, "sinl is unportable - "
- "use gnulib module sinl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_SINHF@
-# if !@HAVE_SINHF@
-# undef sinhf
-_GL_FUNCDECL_SYS (sinhf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (sinhf, float, (float x));
-_GL_CXXALIASWARN (sinhf);
-#elif defined GNULIB_POSIXCHECK
-# undef sinhf
-# if HAVE_RAW_DECL_SINHF
-_GL_WARN_ON_USE (sinhf, "sinhf is unportable - "
- "use gnulib module sinhf for portability");
-# endif
-#endif
-
-
-#if @GNULIB_SQRTF@
-# if !@HAVE_SQRTF@
-# undef sqrtf
-_GL_FUNCDECL_SYS (sqrtf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (sqrtf, float, (float x));
-_GL_CXXALIASWARN (sqrtf);
-#elif defined GNULIB_POSIXCHECK
-# undef sqrtf
-# if HAVE_RAW_DECL_SQRTF
-_GL_WARN_ON_USE (sqrtf, "sqrtf is unportable - "
- "use gnulib module sqrtf for portability");
-# endif
-#endif
-
-#if @GNULIB_SQRTL@
-# if @REPLACE_SQRTL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef sqrtl
-# define sqrtl rpl_sqrtl
-# endif
-_GL_FUNCDECL_RPL (sqrtl, long double, (long double x));
-_GL_CXXALIAS_RPL (sqrtl, long double, (long double x));
-# else
-# if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
-# undef sqrtl
-_GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (sqrtl);
-#elif defined GNULIB_POSIXCHECK
-# undef sqrtl
-# if HAVE_RAW_DECL_SQRTL
-_GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
- "use gnulib module sqrtl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_TANF@
-# if !@HAVE_TANF@
-# undef tanf
-_GL_FUNCDECL_SYS (tanf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (tanf, float, (float x));
-_GL_CXXALIASWARN (tanf);
-#elif defined GNULIB_POSIXCHECK
-# undef tanf
-# if HAVE_RAW_DECL_TANF
-_GL_WARN_ON_USE (tanf, "tanf is unportable - "
- "use gnulib module tanf for portability");
-# endif
-#endif
-
-#if @GNULIB_TANL@
-# if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
-# undef tanl
-_GL_FUNCDECL_SYS (tanl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (tanl, long double, (long double x));
-_GL_CXXALIASWARN (tanl);
-#elif defined GNULIB_POSIXCHECK
-# undef tanl
-# if HAVE_RAW_DECL_TANL
-_GL_WARN_ON_USE (tanl, "tanl is unportable - "
- "use gnulib module tanl for portability");
-# endif
-#endif
-
-
-#if @GNULIB_TANHF@
-# if !@HAVE_TANHF@
-# undef tanhf
-_GL_FUNCDECL_SYS (tanhf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (tanhf, float, (float x));
-_GL_CXXALIASWARN (tanhf);
-#elif defined GNULIB_POSIXCHECK
-# undef tanhf
-# if HAVE_RAW_DECL_TANHF
-_GL_WARN_ON_USE (tanhf, "tanhf is unportable - "
- "use gnulib module tanhf for portability");
-# endif
-#endif
-
-
-#if @GNULIB_TRUNCF@
-# if @REPLACE_TRUNCF@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define truncf rpl_truncf
-# endif
-_GL_FUNCDECL_RPL (truncf, float, (float x));
-_GL_CXXALIAS_RPL (truncf, float, (float x));
-# else
-# if !@HAVE_DECL_TRUNCF@
-_GL_FUNCDECL_SYS (truncf, float, (float x));
-# endif
-_GL_CXXALIAS_SYS (truncf, float, (float x));
-# endif
-_GL_CXXALIASWARN (truncf);
-#elif defined GNULIB_POSIXCHECK
-# undef truncf
-# if HAVE_RAW_DECL_TRUNCF
-_GL_WARN_ON_USE (truncf, "truncf is unportable - "
- "use gnulib module truncf for portability");
-# endif
-#endif
-
-#if @GNULIB_TRUNC@
-# if @REPLACE_TRUNC@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define trunc rpl_trunc
-# endif
-_GL_FUNCDECL_RPL (trunc, double, (double x));
-_GL_CXXALIAS_RPL (trunc, double, (double x));
-# else
-# if !@HAVE_DECL_TRUNC@
-_GL_FUNCDECL_SYS (trunc, double, (double x));
-# endif
-_GL_CXXALIAS_SYS (trunc, double, (double x));
-# endif
-_GL_CXXALIASWARN (trunc);
-#elif defined GNULIB_POSIXCHECK
-# undef trunc
-# if HAVE_RAW_DECL_TRUNC
-_GL_WARN_ON_USE (trunc, "trunc is unportable - "
- "use gnulib module trunc for portability");
-# endif
-#endif
-
-#if @GNULIB_TRUNCL@
-# if @REPLACE_TRUNCL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# undef truncl
-# define truncl rpl_truncl
-# endif
-_GL_FUNCDECL_RPL (truncl, long double, (long double x));
-_GL_CXXALIAS_RPL (truncl, long double, (long double x));
-# else
-# if !@HAVE_DECL_TRUNCL@
-_GL_FUNCDECL_SYS (truncl, long double, (long double x));
-# endif
-_GL_CXXALIAS_SYS (truncl, long double, (long double x));
-# endif
-_GL_CXXALIASWARN (truncl);
-#elif defined GNULIB_POSIXCHECK
-# undef truncl
-# if HAVE_RAW_DECL_TRUNCL
-_GL_WARN_ON_USE (truncl, "truncl is unportable - "
- "use gnulib module truncl for portability");
-# endif
-#endif
-
-
-/* Definitions of function-like macros come here, after the function
- declarations. */
-
-
-#if @GNULIB_ISFINITE@
-# if @REPLACE_ISFINITE@
-_GL_EXTERN_C int gl_isfinitef (float x);
-_GL_EXTERN_C int gl_isfinited (double x);
-_GL_EXTERN_C int gl_isfinitel (long double x);
-# undef isfinite
-# define isfinite(x) \
- (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
- sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
- gl_isfinitef (x))
-# endif
-# ifdef __cplusplus
-# ifdef isfinite
-_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
-# undef isfinite
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite)
-# endif
-# endif
-#elif defined GNULIB_POSIXCHECK
-# if defined isfinite
-_GL_WARN_REAL_FLOATING_DECL (isfinite);
-# undef isfinite
-# define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
-# endif
-#endif
-
-
-#if @GNULIB_ISINF@
-# if @REPLACE_ISINF@
-_GL_EXTERN_C int gl_isinff (float x);
-_GL_EXTERN_C int gl_isinfd (double x);
-_GL_EXTERN_C int gl_isinfl (long double x);
-# undef isinf
-# define isinf(x) \
- (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
- sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
- gl_isinff (x))
-# endif
-# ifdef __cplusplus
-# ifdef isinf
-_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
-# undef isinf
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf)
-# endif
-# endif
-#elif defined GNULIB_POSIXCHECK
-# if defined isinf
-_GL_WARN_REAL_FLOATING_DECL (isinf);
-# undef isinf
-# define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
-# endif
-#endif
-
-
-#if @GNULIB_ISNANF@
-/* Test for NaN for 'float' numbers. */
-# if @HAVE_ISNANF@
-/* The original <math.h> included above provides a declaration of isnan macro
- or (older) isnanf function. */
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
-# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
-# elif defined isnan
-# undef isnanf
-# define isnanf(x) isnan ((float)(x))
-# endif
-# else
-/* Test whether X is a NaN. */
-# undef isnanf
-# define isnanf rpl_isnanf
-_GL_EXTERN_C int isnanf (float x);
-# endif
-#endif
-
-#if @GNULIB_ISNAND@
-/* Test for NaN for 'double' numbers.
- This function is a gnulib extension, unlike isnan() which applied only
- to 'double' numbers earlier but now is a type-generic macro. */
-# if @HAVE_ISNAND@
-/* The original <math.h> included above provides a declaration of isnan
- macro. */
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
-# undef isnand
-# define isnand(x) __builtin_isnan ((double)(x))
-# else
-# undef isnand
-# define isnand(x) isnan ((double)(x))
-# endif
-# else
-/* Test whether X is a NaN. */
-# undef isnand
-# define isnand rpl_isnand
-_GL_EXTERN_C int isnand (double x);
-# endif
-#endif
-
-#if @GNULIB_ISNANL@
-/* Test for NaN for 'long double' numbers. */
-# if @HAVE_ISNANL@
-/* The original <math.h> included above provides a declaration of isnan
- macro or (older) isnanl function. */
-# if __GNUC__ >= 4
- /* GCC 4.0 and newer provides three built-ins for isnan. */
-# undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
-# elif defined isnan
-# undef isnanl
-# define isnanl(x) isnan ((long double)(x))
-# endif
-# else
-/* Test whether X is a NaN. */
-# undef isnanl
-# define isnanl rpl_isnanl
-_GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
-# endif
-#endif
-
-/* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */
-#if @GNULIB_ISNAN@
-# if @REPLACE_ISNAN@
-/* We can't just use the isnanf macro (e.g.) as exposed by
- isnanf.h (e.g.) here, because those may end up being macros
- that recursively expand back to isnan. So use the gnulib
- replacements for them directly. */
-# if @HAVE_ISNANF@ && __GNUC__ >= 4
-# define gl_isnan_f(x) __builtin_isnanf ((float)(x))
-# else
-_GL_EXTERN_C int rpl_isnanf (float x);
-# define gl_isnan_f(x) rpl_isnanf (x)
-# endif
-# if @HAVE_ISNAND@ && __GNUC__ >= 4
-# define gl_isnan_d(x) __builtin_isnan ((double)(x))
-# else
-_GL_EXTERN_C int rpl_isnand (double x);
-# define gl_isnan_d(x) rpl_isnand (x)
-# endif
-# if @HAVE_ISNANL@ && __GNUC__ >= 4
-# define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
-# else
-_GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
-# define gl_isnan_l(x) rpl_isnanl (x)
-# endif
-# undef isnan
-# define isnan(x) \
- (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
- sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
- gl_isnan_f (x))
-# elif __GNUC__ >= 4
-# undef isnan
-# define isnan(x) \
- (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
- sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
- __builtin_isnanf ((float)(x)))
-# endif
-# ifdef __cplusplus
-# ifdef isnan
-_GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
-# undef isnan
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan)
-# endif
-# else
-/* Ensure isnan is a macro. */
-# ifndef isnan
-# define isnan isnan
-# endif
-# endif
-#elif defined GNULIB_POSIXCHECK
-# if defined isnan
-_GL_WARN_REAL_FLOATING_DECL (isnan);
-# undef isnan
-# define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
-# endif
-#endif
-
-
-#if @GNULIB_SIGNBIT@
-# if @REPLACE_SIGNBIT_USING_GCC@
-# undef signbit
- /* GCC 4.0 and newer provides three built-ins for signbit. */
-# define signbit(x) \
- (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
- sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
- __builtin_signbitf (x))
-# endif
-# if @REPLACE_SIGNBIT@
-# undef signbit
-_GL_EXTERN_C int gl_signbitf (float arg);
-_GL_EXTERN_C int gl_signbitd (double arg);
-_GL_EXTERN_C int gl_signbitl (long double arg);
-# if __GNUC__ >= 2 && !defined __STRICT_ANSI__
-# define _GL_NUM_UINT_WORDS(type) \
- ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-# if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
-# define gl_signbitf_OPTIMIZED_MACRO
-# define gl_signbitf(arg) \
- ({ union { float _value; \
- unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
- } _m; \
- _m._value = (arg); \
- (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
- })
-# endif
-# if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
-# define gl_signbitd_OPTIMIZED_MACRO
-# define gl_signbitd(arg) \
- ({ union { double _value; \
- unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
- } _m; \
- _m._value = (arg); \
- (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
- })
-# endif
-# if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
-# define gl_signbitl_OPTIMIZED_MACRO
-# define gl_signbitl(arg) \
- ({ union { long double _value; \
- unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
- } _m; \
- _m._value = (arg); \
- (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
- })
-# endif
-# endif
-# define signbit(x) \
- (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
- sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
- gl_signbitf (x))
-# endif
-# ifdef __cplusplus
-# ifdef signbit
-_GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
-# undef signbit
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
-# endif
-# endif
-#elif defined GNULIB_POSIXCHECK
-# if defined signbit
-_GL_WARN_REAL_FLOATING_DECL (signbit);
-# undef signbit
-# define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
-# endif
-#endif
-
-_GL_INLINE_HEADER_END
-
-#endif /* _@GUARD_PREFIX@_MATH_H */
-#endif /* _@GUARD_PREFIX@_MATH_H */
diff --git a/gl/memchr.c b/gl/memchr.c
index 3db38a94cd..f01c5458df 100644
--- a/gl/memchr.c
+++ b/gl/memchr.c
@@ -11,16 +11,16 @@ NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
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 any
+under the terms of the GNU Lesser General Public License as published by the
+Free Software Foundation; either version 2.1 of the License, or 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.
+GNU Lesser General Public License for more details.
-You should have received a copy of the GNU General Public License
+You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBC
diff --git a/gl/memmem.c b/gl/memmem.c
index 99f3a674b8..56c8d567eb 100644
--- a/gl/memmem.c
+++ b/gl/memmem.c
@@ -3,16 +3,16 @@
This file is part of the GNU C Library.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This particular implementation was written by Eric Blake, 2008. */
diff --git a/gl/mempcpy.c b/gl/mempcpy.c
deleted file mode 100644
index 5582368ed4..0000000000
--- a/gl/mempcpy.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copy memory area and return pointer after last written byte.
- Copyright (C) 2003, 2007, 2009-2013 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, 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <string.h>
-
-/* Copy N bytes of SRC to DEST, return pointer to bytes after the
- last written byte. */
-void *
-mempcpy (void *dest, const void *src, size_t n)
-{
- return (char *) memcpy (dest, src, n) + n;
-}
diff --git a/gl/minmax.h b/gl/minmax.h
index dc649af7ea..1db43dc9f4 100644
--- a/gl/minmax.h
+++ b/gl/minmax.h
@@ -3,16 +3,16 @@
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _MINMAX_H
diff --git a/gl/msvc-inval.c b/gl/msvc-inval.c
index 396031e4c2..9773e7c38d 100644
--- a/gl/msvc-inval.c
+++ b/gl/msvc-inval.c
@@ -2,16 +2,16 @@
Copyright (C) 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/msvc-inval.h b/gl/msvc-inval.h
index dcb0353dcd..4889da6049 100644
--- a/gl/msvc-inval.h
+++ b/gl/msvc-inval.h
@@ -2,16 +2,16 @@
Copyright (C) 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _MSVC_INVAL_H
diff --git a/gl/msvc-nothrow.c b/gl/msvc-nothrow.c
index 8d65472a82..a52eada9c6 100644
--- a/gl/msvc-nothrow.c
+++ b/gl/msvc-nothrow.c
@@ -3,16 +3,16 @@
Copyright (C) 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/msvc-nothrow.h b/gl/msvc-nothrow.h
index 5f521813df..d335863401 100644
--- a/gl/msvc-nothrow.h
+++ b/gl/msvc-nothrow.h
@@ -3,16 +3,16 @@
Copyright (C) 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _MSVC_NOTHROW_H
diff --git a/gl/netdb.in.h b/gl/netdb.in.h
index 0da1800ad9..9bd39379f2 100644
--- a/gl/netdb.in.h
+++ b/gl/netdb.in.h
@@ -3,16 +3,16 @@
Written by Simon Josefsson.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This file is supposed to be used on platforms that lack <netdb.h>.
diff --git a/gl/netinet_in.in.h b/gl/netinet_in.in.h
index b456c4f991..e9a44065c4 100644
--- a/gl/netinet_in.in.h
+++ b/gl/netinet_in.in.h
@@ -2,16 +2,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_NETINET_IN_H
diff --git a/gl/opendir.c b/gl/opendir.c
deleted file mode 100644
index de0ea5a24f..0000000000
--- a/gl/opendir.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Start reading the entries of a directory.
- Copyright (C) 2006-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <dirent.h>
-
-#include <errno.h>
-#include <stddef.h>
-
-#if HAVE_OPENDIR
-
-/* Override opendir(), to keep track of the open file descriptors.
- Needed because there is a function dirfd(). */
-
-#else
-
-# include <stdlib.h>
-
-# include "dirent-private.h"
-# include "filename.h"
-
-#endif
-
-#if REPLACE_FCHDIR
-# include <unistd.h>
-#endif
-
-DIR *
-opendir (const char *dir_name)
-{
-#if HAVE_OPENDIR
-# undef opendir
- DIR *dirp;
-
- dirp = opendir (dir_name);
- if (dirp == NULL)
- return NULL;
-
-#else
-
- char dir_name_mask[MAX_PATH + 1 + 1 + 1];
- int status;
- HANDLE current;
- WIN32_FIND_DATA entry;
- struct gl_directory *dirp;
-
- if (dir_name[0] == '\0')
- {
- errno = ENOENT;
- return NULL;
- }
-
- /* Make the dir_name absolute, so that we continue reading the same
- directory if the current directory changed between this opendir()
- call and a subsequent rewinddir() call. */
- if (!GetFullPathName (dir_name, MAX_PATH, dir_name_mask, NULL))
- {
- errno = EINVAL;
- return NULL;
- }
-
- /* Append the mask.
- "*" and "*.*" appear to be equivalent. */
- {
- char *p;
-
- p = dir_name_mask + strlen (dir_name_mask);
- if (p > dir_name_mask && !ISSLASH (p[-1]))
- *p++ = '\\';
- *p++ = '*';
- *p = '\0';
- }
-
- /* Start searching the directory. */
- status = -1;
- current = FindFirstFile (dir_name_mask, &entry);
- if (current == INVALID_HANDLE_VALUE)
- {
- switch (GetLastError ())
- {
- case ERROR_FILE_NOT_FOUND:
- status = -2;
- break;
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- return NULL;
- case ERROR_DIRECTORY:
- errno = ENOTDIR;
- return NULL;
- case ERROR_ACCESS_DENIED:
- errno = EACCES;
- return NULL;
- default:
- errno = EIO;
- return NULL;
- }
- }
-
- /* Allocate the result. */
- dirp =
- (struct gl_directory *)
- malloc (offsetof (struct gl_directory, dir_name_mask[0])
- + strlen (dir_name_mask) + 1);
- if (dirp == NULL)
- {
- if (current != INVALID_HANDLE_VALUE)
- FindClose (current);
- errno = ENOMEM;
- return NULL;
- }
- dirp->status = status;
- dirp->current = current;
- if (status == -1)
- memcpy (&dirp->entry, &entry, sizeof (WIN32_FIND_DATA));
- strcpy (dirp->dir_name_mask, dir_name_mask);
-
-#endif
-
-#if REPLACE_FCHDIR
- {
- int fd = dirfd (dirp);
- if (0 <= fd && _gl_register_fd (fd, dir_name) != fd)
- {
- int saved_errno = errno;
- closedir (dirp);
- errno = saved_errno;
- return NULL;
- }
- }
-#endif
-
- return dirp;
-}
diff --git a/gl/printf-args.c b/gl/printf-args.c
index c27e6bc6b7..32d444a566 100644
--- a/gl/printf-args.c
+++ b/gl/printf-args.c
@@ -3,16 +3,16 @@
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This file can be parametrized with the following macros:
diff --git a/gl/printf-args.h b/gl/printf-args.h
index 2a9c2a3f87..e166cccab5 100644
--- a/gl/printf-args.h
+++ b/gl/printf-args.h
@@ -3,16 +3,16 @@
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _PRINTF_ARGS_H
diff --git a/gl/printf-frexp.c b/gl/printf-frexp.c
deleted file mode 100644
index 1a7b0c438e..0000000000
--- a/gl/printf-frexp.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* Split a double into fraction and mantissa, for hexadecimal printf.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#if ! defined USE_LONG_DOUBLE
-# include <config.h>
-#endif
-
-/* Specification. */
-#ifdef USE_LONG_DOUBLE
-# include "printf-frexpl.h"
-#else
-# include "printf-frexp.h"
-#endif
-
-#include <float.h>
-#include <math.h>
-#ifdef USE_LONG_DOUBLE
-# include "fpucw.h"
-#endif
-
-/* This file assumes FLT_RADIX = 2. If FLT_RADIX is a power of 2 greater
- than 2, or not even a power of 2, some rounding errors can occur, so that
- then the returned mantissa is only guaranteed to be <= 2.0, not < 2.0. */
-
-#ifdef USE_LONG_DOUBLE
-# define FUNC printf_frexpl
-# define DOUBLE long double
-# define MIN_EXP LDBL_MIN_EXP
-# if HAVE_FREXPL_IN_LIBC && HAVE_LDEXPL_IN_LIBC
-# define USE_FREXP_LDEXP
-# define FREXP frexpl
-# define LDEXP ldexpl
-# endif
-# define DECL_ROUNDING DECL_LONG_DOUBLE_ROUNDING
-# define BEGIN_ROUNDING() BEGIN_LONG_DOUBLE_ROUNDING ()
-# define END_ROUNDING() END_LONG_DOUBLE_ROUNDING ()
-# define L_(literal) literal##L
-#else
-# define FUNC printf_frexp
-# define DOUBLE double
-# define MIN_EXP DBL_MIN_EXP
-# if HAVE_FREXP_IN_LIBC && HAVE_LDEXP_IN_LIBC
-# define USE_FREXP_LDEXP
-# define FREXP frexp
-# define LDEXP ldexp
-# endif
-# define DECL_ROUNDING
-# define BEGIN_ROUNDING()
-# define END_ROUNDING()
-# define L_(literal) literal
-#endif
-
-DOUBLE
-FUNC (DOUBLE x, int *expptr)
-{
- int exponent;
- DECL_ROUNDING
-
- BEGIN_ROUNDING ();
-
-#ifdef USE_FREXP_LDEXP
- /* frexp and ldexp are usually faster than the loop below. */
- x = FREXP (x, &exponent);
-
- x = x + x;
- exponent -= 1;
-
- if (exponent < MIN_EXP - 1)
- {
- x = LDEXP (x, exponent - (MIN_EXP - 1));
- exponent = MIN_EXP - 1;
- }
-#else
- {
- /* Since the exponent is an 'int', it fits in 64 bits. Therefore the
- loops are executed no more than 64 times. */
- DOUBLE pow2[64]; /* pow2[i] = 2^2^i */
- DOUBLE powh[64]; /* powh[i] = 2^-2^i */
- int i;
-
- exponent = 0;
- if (x >= L_(1.0))
- {
- /* A nonnegative exponent. */
- {
- DOUBLE pow2_i; /* = pow2[i] */
- DOUBLE powh_i; /* = powh[i] */
-
- /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
- x * 2^exponent = argument, x >= 1.0. */
- for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
- ;
- i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
- {
- if (x >= pow2_i)
- {
- exponent += (1 << i);
- x *= powh_i;
- }
- else
- break;
-
- pow2[i] = pow2_i;
- powh[i] = powh_i;
- }
- }
- /* Here 1.0 <= x < 2^2^i. */
- }
- else
- {
- /* A negative exponent. */
- {
- DOUBLE pow2_i; /* = pow2[i] */
- DOUBLE powh_i; /* = powh[i] */
-
- /* Invariants: pow2_i = 2^2^i, powh_i = 2^-2^i,
- x * 2^exponent = argument, x < 1.0, exponent >= MIN_EXP - 1. */
- for (i = 0, pow2_i = L_(2.0), powh_i = L_(0.5);
- ;
- i++, pow2_i = pow2_i * pow2_i, powh_i = powh_i * powh_i)
- {
- if (exponent - (1 << i) < MIN_EXP - 1)
- break;
-
- exponent -= (1 << i);
- x *= pow2_i;
- if (x >= L_(1.0))
- break;
-
- pow2[i] = pow2_i;
- powh[i] = powh_i;
- }
- }
- /* Here either x < 1.0 and exponent - 2^i < MIN_EXP - 1 <= exponent,
- or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
-
- if (x < L_(1.0))
- /* Invariants: x * 2^exponent = argument, x < 1.0 and
- exponent - 2^i < MIN_EXP - 1 <= exponent. */
- while (i > 0)
- {
- i--;
- if (exponent - (1 << i) >= MIN_EXP - 1)
- {
- exponent -= (1 << i);
- x *= pow2[i];
- if (x >= L_(1.0))
- break;
- }
- }
-
- /* Here either x < 1.0 and exponent = MIN_EXP - 1,
- or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
- }
-
- /* Invariants: x * 2^exponent = argument, and
- either x < 1.0 and exponent = MIN_EXP - 1,
- or 1.0 <= x < 2^2^i and exponent >= MIN_EXP - 1. */
- while (i > 0)
- {
- i--;
- if (x >= pow2[i])
- {
- exponent += (1 << i);
- x *= powh[i];
- }
- }
- /* Here either x < 1.0 and exponent = MIN_EXP - 1,
- or 1.0 <= x < 2.0 and exponent >= MIN_EXP - 1. */
- }
-#endif
-
- END_ROUNDING ();
-
- *expptr = exponent;
- return x;
-}
diff --git a/gl/printf-frexp.h b/gl/printf-frexp.h
deleted file mode 100644
index 3976b73686..0000000000
--- a/gl/printf-frexp.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Split a double into fraction and mantissa, for hexadecimal printf.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Write a finite, positive number x as
- x = mantissa * 2^exp
- where exp >= DBL_MIN_EXP - 1,
- mantissa < 2.0,
- if x is not a denormalized number then mantissa >= 1.0.
- Store exp in *EXPPTR and return mantissa. */
-extern double printf_frexp (double x, int *expptr);
diff --git a/gl/printf-frexpl.c b/gl/printf-frexpl.c
deleted file mode 100644
index 26987a7bd1..0000000000
--- a/gl/printf-frexpl.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-
-/* Specification. */
-# include "printf-frexpl.h"
-
-# include "printf-frexp.h"
-
-long double
-printf_frexpl (long double x, int *expptr)
-{
- return printf_frexp (x, expptr);
-}
-
-#else
-
-# define USE_LONG_DOUBLE
-# include "printf-frexp.c"
-
-#endif
diff --git a/gl/printf-frexpl.h b/gl/printf-frexpl.h
deleted file mode 100644
index 3768b0915e..0000000000
--- a/gl/printf-frexpl.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Write a finite, positive number x as
- x = mantissa * 2^exp
- where exp >= LDBL_MIN_EXP - 1,
- mantissa < 2.0,
- if x is not a denormalized number then mantissa >= 1.0.
- Store exp in *EXPPTR and return mantissa. */
-extern long double printf_frexpl (long double x, int *expptr);
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index 23cacc1dab..4916dbd844 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -2,16 +2,16 @@
Copyright (C) 1999-2000, 2002-2003, 2006-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This file can be parametrized with the following macros:
diff --git a/gl/printf-parse.h b/gl/printf-parse.h
index d8474bee15..466aa45a59 100644
--- a/gl/printf-parse.h
+++ b/gl/printf-parse.h
@@ -3,16 +3,16 @@
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _PRINTF_PARSE_H
diff --git a/gl/progname.c b/gl/progname.c
deleted file mode 100644
index 0c195e521a..0000000000
--- a/gl/progname.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Program name management.
- Copyright (C) 2001-2003, 2005-2013 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2001.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-
-#include <config.h>
-
-/* Specification. */
-#undef ENABLE_RELOCATABLE /* avoid defining set_program_name as a macro */
-#include "progname.h"
-
-#include <errno.h> /* get program_invocation_name declaration */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-/* String containing name the program is called with.
- To be initialized by main(). */
-const char *program_name = NULL;
-
-/* Set program_name, based on argv[0].
- argv0 must be a string allocated with indefinite extent, and must not be
- modified after this call. */
-void
-set_program_name (const char *argv0)
-{
- /* libtool creates a temporary executable whose name is sometimes prefixed
- with "lt-" (depends on the platform). It also makes argv[0] absolute.
- But the name of the temporary executable is a detail that should not be
- visible to the end user and to the test suite.
- Remove this "<dirname>/.libs/" or "<dirname>/.libs/lt-" prefix here. */
- const char *slash;
- const char *base;
-
- /* Sanity check. POSIX requires the invoking process to pass a non-NULL
- argv[0]. */
- if (argv0 == NULL)
- {
- /* It's a bug in the invoking program. Help diagnosing it. */
- fputs ("A NULL argv[0] was passed through an exec system call.\n",
- stderr);
- abort ();
- }
-
- slash = strrchr (argv0, '/');
- base = (slash != NULL ? slash + 1 : argv0);
- if (base - argv0 >= 7 && strncmp (base - 7, "/.libs/", 7) == 0)
- {
- argv0 = base;
- if (strncmp (base, "lt-", 3) == 0)
- {
- argv0 = base + 3;
- /* On glibc systems, remove the "lt-" prefix from the variable
- program_invocation_short_name. */
-#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
- program_invocation_short_name = (char *) argv0;
-#endif
- }
- }
-
- /* But don't strip off a leading <dirname>/ in general, because when the user
- runs
- /some/hidden/place/bin/cp foo foo
- he should get the error message
- /some/hidden/place/bin/cp: `foo' and `foo' are the same file
- not
- cp: `foo' and `foo' are the same file
- */
-
- program_name = argv0;
-
- /* On glibc systems, the error() function comes from libc and uses the
- variable program_invocation_name, not program_name. So set this variable
- as well. */
-#if HAVE_DECL_PROGRAM_INVOCATION_NAME
- program_invocation_name = (char *) argv0;
-#endif
-}
diff --git a/gl/progname.h b/gl/progname.h
deleted file mode 100644
index b4f3c2778a..0000000000
--- a/gl/progname.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Program name management.
- Copyright (C) 2001-2004, 2006, 2009-2013 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2001.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _PROGNAME_H
-#define _PROGNAME_H
-
-/* Programs using this file should do the following in main():
- set_program_name (argv[0]);
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* String containing name the program is called with. */
-extern const char *program_name;
-
-/* Set program_name, based on argv[0].
- argv0 must be a string allocated with indefinite extent, and must not be
- modified after this call. */
-extern void set_program_name (const char *argv0);
-
-#if ENABLE_RELOCATABLE
-
-/* Set program_name, based on argv[0], and original installation prefix and
- directory, for relocatability. */
-extern void set_program_name_and_installdir (const char *argv0,
- const char *orig_installprefix,
- const char *orig_installdir);
-#undef set_program_name
-#define set_program_name(ARG0) \
- set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR)
-
-/* Return the full pathname of the current executable, based on the earlier
- call to set_program_name_and_installdir. Return NULL if unknown. */
-extern char *get_full_program_name (void);
-
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _PROGNAME_H */
diff --git a/gl/rawmemchr.c b/gl/rawmemchr.c
deleted file mode 100644
index a0298ce64e..0000000000
--- a/gl/rawmemchr.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Searching in a string.
- Copyright (C) 2008-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <string.h>
-
-/* Find the first occurrence of C in S. */
-void *
-rawmemchr (const void *s, int c_in)
-{
- /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
- long instead of a 64-bit uintmax_t tends to give better
- performance. On 64-bit hardware, unsigned long is generally 64
- bits already. Change this typedef to experiment with
- performance. */
- typedef unsigned long int longword;
-
- const unsigned char *char_ptr;
- const longword *longword_ptr;
- longword repeated_one;
- longword repeated_c;
- unsigned char c;
-
- c = (unsigned char) c_in;
-
- /* Handle the first few bytes by reading one byte at a time.
- Do this until CHAR_PTR is aligned on a longword boundary. */
- for (char_ptr = (const unsigned char *) s;
- (size_t) char_ptr % sizeof (longword) != 0;
- ++char_ptr)
- if (*char_ptr == c)
- return (void *) char_ptr;
-
- longword_ptr = (const longword *) char_ptr;
-
- /* All these elucidatory comments refer to 4-byte longwords,
- but the theory applies equally well to any size longwords. */
-
- /* Compute auxiliary longword values:
- repeated_one is a value which has a 1 in every byte.
- repeated_c has c in every byte. */
- repeated_one = 0x01010101;
- repeated_c = c | (c << 8);
- repeated_c |= repeated_c << 16;
- if (0xffffffffU < (longword) -1)
- {
- repeated_one |= repeated_one << 31 << 1;
- repeated_c |= repeated_c << 31 << 1;
- if (8 < sizeof (longword))
- {
- size_t i;
-
- for (i = 64; i < sizeof (longword) * 8; i *= 2)
- {
- repeated_one |= repeated_one << i;
- repeated_c |= repeated_c << i;
- }
- }
- }
-
- /* Instead of the traditional loop which tests each byte, we will
- test a longword at a time. The tricky part is testing if *any of
- the four* bytes in the longword in question are equal to NUL or
- c. We first use an xor with repeated_c. This reduces the task
- to testing whether *any of the four* bytes in longword1 is zero.
-
- We compute tmp =
- ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
- That is, we perform the following operations:
- 1. Subtract repeated_one.
- 2. & ~longword1.
- 3. & a mask consisting of 0x80 in every byte.
- Consider what happens in each byte:
- - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
- and step 3 transforms it into 0x80. A carry can also be propagated
- to more significant bytes.
- - If a byte of longword1 is nonzero, let its lowest 1 bit be at
- position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
- the byte ends in a single bit of value 0 and k bits of value 1.
- After step 2, the result is just k bits of value 1: 2^k - 1. After
- step 3, the result is 0. And no carry is produced.
- So, if longword1 has only non-zero bytes, tmp is zero.
- Whereas if longword1 has a zero byte, call j the position of the least
- significant zero byte. Then the result has a zero at positions 0, ...,
- j-1 and a 0x80 at position j. We cannot predict the result at the more
- significant bytes (positions j+1..3), but it does not matter since we
- already have a non-zero bit at position 8*j+7.
-
- The test whether any byte in longword1 is zero is equivalent
- to testing whether tmp is nonzero.
-
- This test can read beyond the end of a string, depending on where
- C_IN is encountered. However, this is considered safe since the
- initialization phase ensured that the read will be aligned,
- therefore, the read will not cross page boundaries and will not
- cause a fault. */
-
- while (1)
- {
- longword longword1 = *longword_ptr ^ repeated_c;
-
- if ((((longword1 - repeated_one) & ~longword1)
- & (repeated_one << 7)) != 0)
- break;
- longword_ptr++;
- }
-
- char_ptr = (const unsigned char *) longword_ptr;
-
- /* At this point, we know that one of the sizeof (longword) bytes
- starting at char_ptr is == c. On little-endian machines, we
- could determine the first such byte without any further memory
- accesses, just by looking at the tmp result from the last loop
- iteration. But this does not work on big-endian machines.
- Choose code that works in both cases. */
-
- char_ptr = (unsigned char *) longword_ptr;
- while (*char_ptr != c)
- char_ptr++;
- return (void *) char_ptr;
-}
diff --git a/gl/rawmemchr.valgrind b/gl/rawmemchr.valgrind
deleted file mode 100644
index 6363923680..0000000000
--- a/gl/rawmemchr.valgrind
+++ /dev/null
@@ -1,12 +0,0 @@
-# Suppress a valgrind message about use of uninitialized memory in rawmemchr().
-# This use is OK because it provides only a speedup.
-{
- rawmemchr-value4
- Memcheck:Value4
- fun:rawmemchr
-}
-{
- rawmemchr-value8
- Memcheck:Value8
- fun:rawmemchr
-}
diff --git a/gl/read-file.c b/gl/read-file.c
index bcc5a92f1d..880fc27ff8 100644
--- a/gl/read-file.c
+++ b/gl/read-file.c
@@ -3,16 +3,16 @@
Written by Simon Josefsson and Bruno Haible.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/read-file.h b/gl/read-file.h
index 507135f24b..ed4b37f0fc 100644
--- a/gl/read-file.h
+++ b/gl/read-file.h
@@ -3,16 +3,16 @@
Written by Simon Josefsson.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef READ_FILE_H
diff --git a/gl/readdir.c b/gl/readdir.c
deleted file mode 100644
index 3db00806db..0000000000
--- a/gl/readdir.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Read the next entry of a directory.
- Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <dirent.h>
-
-#include <errno.h>
-#include <stddef.h>
-
-#include "dirent-private.h"
-
-struct dirent *
-readdir (DIR *dirp)
-{
- char type;
- struct dirent *result;
-
- /* There is no need to add code to produce entries for "." and "..".
- According to the POSIX:2008 section "4.12 Pathname Resolution"
- <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html>
- "." and ".." are syntactic entities.
- POSIX also says:
- "If entries for dot or dot-dot exist, one entry shall be returned
- for dot and one entry shall be returned for dot-dot; otherwise,
- they shall not be returned." */
-
- switch (dirp->status)
- {
- case -2:
- /* End of directory already reached. */
- return NULL;
- case -1:
- break;
- case 0:
- if (!FindNextFile (dirp->current, &dirp->entry))
- {
- switch (GetLastError ())
- {
- case ERROR_NO_MORE_FILES:
- dirp->status = -2;
- return NULL;
- default:
- errno = EIO;
- return NULL;
- }
- }
- break;
- default:
- errno = dirp->status;
- return NULL;
- }
-
- dirp->status = 0;
-
- if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- type = DT_DIR;
- else if (dirp->entry.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
- type = DT_LNK;
- else if ((dirp->entry.dwFileAttributes
- & ~(FILE_ATTRIBUTE_READONLY
- | FILE_ATTRIBUTE_HIDDEN
- | FILE_ATTRIBUTE_SYSTEM
- | FILE_ATTRIBUTE_ARCHIVE
- | FILE_ATTRIBUTE_NORMAL
- | FILE_ATTRIBUTE_TEMPORARY
- | FILE_ATTRIBUTE_SPARSE_FILE
- | FILE_ATTRIBUTE_COMPRESSED
- | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
- | FILE_ATTRIBUTE_ENCRYPTED)) == 0)
- /* Devices like COM1, LPT1, NUL would also have the attributes 0x20 but
- they cannot occur here. */
- type = DT_REG;
- else
- type = DT_UNKNOWN;
-
- /* Reuse the memory of dirp->entry for the result. */
- result =
- (struct dirent *)
- ((char *) dirp->entry.cFileName - offsetof (struct dirent, d_name[0]));
- result->d_type = type;
-
- return result;
-}
diff --git a/gl/realloc.c b/gl/realloc.c
index b51010a621..91126f449c 100644
--- a/gl/realloc.c
+++ b/gl/realloc.c
@@ -4,16 +4,16 @@
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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* written by Jim Meyering and Bruno Haible */
diff --git a/gl/recv.c b/gl/recv.c
index 544f90d6ca..bb9040507a 100644
--- a/gl/recv.c
+++ b/gl/recv.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/recvfrom.c b/gl/recvfrom.c
index 891259e171..639ae49472 100644
--- a/gl/recvfrom.c
+++ b/gl/recvfrom.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/scandir.c b/gl/scandir.c
deleted file mode 100644
index d035400def..0000000000
--- a/gl/scandir.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Copyright (C) 1992-1998, 2000, 2002-2003, 2009-2013 Free Software
- Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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, 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include <dirent.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#if _LIBC
-# include <bits/libc-lock.h>
-#endif
-
-#if ! defined __builtin_expect && __GNUC__ < 3
-# define __builtin_expect(expr, expected) (expr)
-#endif
-
-#undef select
-
-#ifndef _D_EXACT_NAMLEN
-# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
-#endif
-#ifndef _D_ALLOC_NAMLEN
-# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
-#endif
-
-#if _LIBC
-# ifndef SCANDIR
-# define SCANDIR scandir
-# define READDIR __readdir
-# define DIRENT_TYPE struct dirent
-# endif
-#else
-# define SCANDIR scandir
-# define READDIR readdir
-# define DIRENT_TYPE struct dirent
-# define __opendir opendir
-# define __closedir closedir
-# define __set_errno(val) errno = (val)
-
-/* The results of opendir() in this file are not used with dirfd and fchdir,
- and we do not leak fds to any single-threaded code that could use stdio,
- therefore save some unnecessary recursion in fchdir.c and opendir_safer.c.
- FIXME - if the kernel ever adds support for multi-thread safety for
- avoiding standard fds, then we should use opendir_safer. */
-# undef opendir
-# undef closedir
-#endif
-
-#ifndef SCANDIR_CANCEL
-# define SCANDIR_CANCEL
-struct scandir_cancel_struct
-{
- DIR *dp;
- void *v;
- size_t cnt;
-};
-
-# if _LIBC
-static void
-cancel_handler (void *arg)
-{
- struct scandir_cancel_struct *cp = arg;
- size_t i;
- void **v = cp->v;
-
- for (i = 0; i < cp->cnt; ++i)
- free (v[i]);
- free (v);
- (void) __closedir (cp->dp);
-}
-# endif
-#endif
-
-
-int
-SCANDIR (const char *dir,
- DIRENT_TYPE ***namelist,
- int (*select) (const DIRENT_TYPE *),
- int (*cmp) (const DIRENT_TYPE **, const DIRENT_TYPE **))
-{
- DIR *dp = __opendir (dir);
- DIRENT_TYPE **v = NULL;
- size_t vsize = 0;
- struct scandir_cancel_struct c;
- DIRENT_TYPE *d;
- int save;
-
- if (dp == NULL)
- return -1;
-
- save = errno;
- __set_errno (0);
-
- c.dp = dp;
- c.v = NULL;
- c.cnt = 0;
-#if _LIBC
- __libc_cleanup_push (cancel_handler, &c);
-#endif
-
- while ((d = READDIR (dp)) != NULL)
- {
- int use_it = select == NULL;
-
- if (! use_it)
- {
- use_it = select (d);
- /* The select function might have changed errno. It was
- zero before and it need to be again to make the latter
- tests work. */
- __set_errno (0);
- }
-
- if (use_it)
- {
- DIRENT_TYPE *vnew;
- size_t dsize;
-
- /* Ignore errors from select or readdir */
- __set_errno (0);
-
- if (__builtin_expect (c.cnt == vsize, 0))
- {
- DIRENT_TYPE **new;
- if (vsize == 0)
- vsize = 10;
- else
- vsize *= 2;
- new = (DIRENT_TYPE **) realloc (v, vsize * sizeof (*v));
- if (new == NULL)
- break;
- v = new;
- c.v = (void *) v;
- }
-
- dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d;
- vnew = (DIRENT_TYPE *) malloc (dsize);
- if (vnew == NULL)
- break;
-
- v[c.cnt++] = (DIRENT_TYPE *) memcpy (vnew, d, dsize);
- }
- }
-
- if (__builtin_expect (errno, 0) != 0)
- {
- save = errno;
-
- while (c.cnt > 0)
- free (v[--c.cnt]);
- free (v);
- c.cnt = -1;
- }
- else
- {
- /* Sort the list if we have a comparison function to sort with. */
- if (cmp != NULL)
- qsort (v, c.cnt, sizeof (*v), (int (*) (const void *, const void *)) cmp);
-
- *namelist = v;
- }
-
-#if _LIBC
- __libc_cleanup_pop (0);
-#endif
-
- (void) __closedir (dp);
- __set_errno (save);
-
- return c.cnt;
-}
diff --git a/gl/select.c b/gl/select.c
index c02558e1a2..77263f4d38 100644
--- a/gl/select.c
+++ b/gl/select.c
@@ -6,16 +6,16 @@
This file is part of gnulib.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/send.c b/gl/send.c
index 293d65ead8..9ca6fe7a9b 100644
--- a/gl/send.c
+++ b/gl/send.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/sendto.c b/gl/sendto.c
index 10ed39c083..418fbf3b72 100644
--- a/gl/sendto.c
+++ b/gl/sendto.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/setsockopt.c b/gl/setsockopt.c
index 7865aaff45..429f29157d 100644
--- a/gl/setsockopt.c
+++ b/gl/setsockopt.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/shutdown.c b/gl/shutdown.c
index 343a0dbf05..ecbaa2252c 100644
--- a/gl/shutdown.c
+++ b/gl/shutdown.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/signal.in.h b/gl/signal.in.h
index 54849504d7..c14fb609d4 100644
--- a/gl/signal.in.h
+++ b/gl/signal.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2006-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#if __GNUC__ >= 3
diff --git a/gl/signbitd.c b/gl/signbitd.c
deleted file mode 100644
index 7a434f8eea..0000000000
--- a/gl/signbitd.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* signbit() macro: Determine the sign bit of a floating-point number.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <math.h>
-
-#include <string.h>
-#include "isnand-nolibm.h"
-#include "float+.h"
-
-#ifdef gl_signbitd_OPTIMIZED_MACRO
-# undef gl_signbitd
-#endif
-
-int
-gl_signbitd (double arg)
-{
-#if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT
- /* The use of a union to extract the bits of the representation of a
- 'long double' is safe in practice, despite of the "aliasing rules" of
- C99, because the GCC docs say
- "Even with '-fstrict-aliasing', type-punning is allowed, provided the
- memory is accessed through the union type."
- and similarly for other compilers. */
-# define NWORDS \
- ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- union { double value; unsigned int word[NWORDS]; } m;
- m.value = arg;
- return (m.word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;
-#elif HAVE_COPYSIGN_IN_LIBC
- return copysign (1.0, arg) < 0;
-#else
- /* This does not do the right thing for NaN, but this is irrelevant for
- most use cases. */
- if (isnand (arg))
- return 0;
- if (arg < 0.0)
- return 1;
- else if (arg == 0.0)
- {
- /* Distinguish 0.0 and -0.0. */
- static double plus_zero = 0.0;
- double arg_mem = arg;
- return (memcmp (&plus_zero, &arg_mem, SIZEOF_DBL) != 0);
- }
- else
- return 0;
-#endif
-}
diff --git a/gl/signbitf.c b/gl/signbitf.c
deleted file mode 100644
index f133be57f5..0000000000
--- a/gl/signbitf.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* signbit() macro: Determine the sign bit of a floating-point number.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <math.h>
-
-#include <string.h>
-#include "isnanf-nolibm.h"
-#include "float+.h"
-
-#ifdef gl_signbitf_OPTIMIZED_MACRO
-# undef gl_signbitf
-#endif
-
-int
-gl_signbitf (float arg)
-{
-#if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT
- /* The use of a union to extract the bits of the representation of a
- 'long double' is safe in practice, despite of the "aliasing rules" of
- C99, because the GCC docs say
- "Even with '-fstrict-aliasing', type-punning is allowed, provided the
- memory is accessed through the union type."
- and similarly for other compilers. */
-# define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- union { float value; unsigned int word[NWORDS]; } m;
- m.value = arg;
- return (m.word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;
-#elif HAVE_COPYSIGNF_IN_LIBC
- return copysignf (1.0f, arg) < 0;
-#else
- /* This does not do the right thing for NaN, but this is irrelevant for
- most use cases. */
- if (isnanf (arg))
- return 0;
- if (arg < 0.0f)
- return 1;
- else if (arg == 0.0f)
- {
- /* Distinguish 0.0f and -0.0f. */
- static float plus_zero = 0.0f;
- float arg_mem = arg;
- return (memcmp (&plus_zero, &arg_mem, SIZEOF_FLT) != 0);
- }
- else
- return 0;
-#endif
-}
diff --git a/gl/signbitl.c b/gl/signbitl.c
deleted file mode 100644
index 9e1e900e16..0000000000
--- a/gl/signbitl.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* signbit() macro: Determine the sign bit of a floating-point number.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <math.h>
-
-#include <string.h>
-#include "isnanl-nolibm.h"
-#include "float+.h"
-
-#ifdef gl_signbitl_OPTIMIZED_MACRO
-# undef gl_signbitl
-#endif
-
-int
-gl_signbitl (long double arg)
-{
-#if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT
- /* The use of a union to extract the bits of the representation of a
- 'long double' is safe in practice, despite of the "aliasing rules" of
- C99, because the GCC docs say
- "Even with '-fstrict-aliasing', type-punning is allowed, provided the
- memory is accessed through the union type."
- and similarly for other compilers. */
-# define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- union { long double value; unsigned int word[NWORDS]; } m;
- m.value = arg;
- return (m.word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1;
-#elif HAVE_COPYSIGNL_IN_LIBC
- return copysignl (1.0L, arg) < 0;
-#else
- /* This does not do the right thing for NaN, but this is irrelevant for
- most use cases. */
- if (isnanl (arg))
- return 0;
- if (arg < 0.0L)
- return 1;
- else if (arg == 0.0L)
- {
- /* Distinguish 0.0L and -0.0L. */
- static long double plus_zero = 0.0L;
- long double arg_mem = arg;
- return (memcmp (&plus_zero, &arg_mem, SIZEOF_LDBL) != 0);
- }
- else
- return 0;
-#endif
-}
diff --git a/gl/size_max.h b/gl/size_max.h
index 5f3312404b..92d7675c44 100644
--- a/gl/size_max.h
+++ b/gl/size_max.h
@@ -3,16 +3,16 @@
Written by Simon Josefsson.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef GNULIB_SIZE_MAX_H
diff --git a/gl/sleep.c b/gl/sleep.c
deleted file mode 100644
index 4c97d7dfa5..0000000000
--- a/gl/sleep.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Pausing execution of the current thread.
- Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2007.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <unistd.h>
-
-#include <limits.h>
-
-#include "verify.h"
-
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
-# define WIN32_LEAN_AND_MEAN /* avoid including junk */
-# include <windows.h>
-
-unsigned int
-sleep (unsigned int seconds)
-{
- unsigned int remaining;
-
- /* Sleep for 1 second many times, because
- 1. Sleep is not interruptible by Ctrl-C,
- 2. we want to avoid arithmetic overflow while multiplying with 1000. */
- for (remaining = seconds; remaining > 0; remaining--)
- Sleep (1000);
-
- return remaining;
-}
-
-#elif HAVE_SLEEP
-
-# undef sleep
-
-/* Guarantee unlimited sleep and a reasonable return value. Cygwin
- 1.5.x rejects attempts to sleep more than 49.7 days (2**32
- milliseconds), but uses uninitialized memory which results in a
- garbage answer. Similarly, Linux 2.6.9 with glibc 2.3.4 has a too
- small return value when asked to sleep more than 24.85 days. */
-unsigned int
-rpl_sleep (unsigned int seconds)
-{
- /* This requires int larger than 16 bits. */
- verify (UINT_MAX / 24 / 24 / 60 / 60);
- const unsigned int limit = 24 * 24 * 60 * 60;
- while (limit < seconds)
- {
- unsigned int result;
- seconds -= limit;
- result = sleep (limit);
- if (result)
- return seconds + result;
- }
- return sleep (seconds);
-}
-
-#else /* !HAVE_SLEEP */
-
- #error "Please port gnulib sleep.c to your platform, possibly using usleep() or select(), then report this to bug-gnulib."
-
-#endif
diff --git a/gl/snprintf.c b/gl/snprintf.c
index 9c4ab3f2b4..3da0343cfc 100644
--- a/gl/snprintf.c
+++ b/gl/snprintf.c
@@ -3,16 +3,16 @@
Written by Simon Josefsson and Paul Eggert.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/socket.c b/gl/socket.c
index dcbd07af6c..79dde83a50 100644
--- a/gl/socket.c
+++ b/gl/socket.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/sockets.c b/gl/sockets.c
index ae961482aa..5aa47124e4 100644
--- a/gl/sockets.c
+++ b/gl/sockets.c
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Simon Josefsson */
diff --git a/gl/sockets.h b/gl/sockets.h
index 1570ad8450..bdbbe8b06d 100644
--- a/gl/sockets.h
+++ b/gl/sockets.h
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Simon Josefsson */
diff --git a/gl/stdalign.in.h b/gl/stdalign.in.h
index 7254a3dec1..ffabfcc13f 100644
--- a/gl/stdalign.in.h
+++ b/gl/stdalign.in.h
@@ -3,16 +3,16 @@
Copyright 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert and Bruno Haible. */
diff --git a/gl/stdarg.in.h b/gl/stdarg.in.h
deleted file mode 100644
index 7484842dbd..0000000000
--- a/gl/stdarg.in.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Substitute for and wrapper around <stdarg.h>.
- Copyright (C) 2008-2013 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, 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _@GUARD_PREFIX@_STDARG_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-/* The include_next requires a split double-inclusion guard. */
-#@INCLUDE_NEXT@ @NEXT_STDARG_H@
-
-#ifndef _@GUARD_PREFIX@_STDARG_H
-#define _@GUARD_PREFIX@_STDARG_H
-
-#ifndef va_copy
-# define va_copy(a,b) ((a) = (b))
-#endif
-
-#endif /* _@GUARD_PREFIX@_STDARG_H */
-#endif /* _@GUARD_PREFIX@_STDARG_H */
diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h
index 7c1577277f..d0e4cffef8 100644
--- a/gl/stdbool.in.h
+++ b/gl/stdbool.in.h
@@ -2,16 +2,16 @@
Written by Bruno Haible <haible@clisp.cons.org>, 2001.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _GL_STDBOOL_H
diff --git a/gl/stddef.in.h b/gl/stddef.in.h
index 40f0536aae..51a308ae71 100644
--- a/gl/stddef.in.h
+++ b/gl/stddef.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 2db8b2e378..07a4b80644 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -3,16 +3,16 @@
This file is part of gnulib.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/*
diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h
index e00600a158..a80e4f3d46 100644
--- a/gl/stdio-impl.h
+++ b/gl/stdio-impl.h
@@ -2,16 +2,16 @@
Copyright (C) 2007-2008, 2010-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Many stdio implementations have the same logic and therefore can share
diff --git a/gl/stdio.in.h b/gl/stdio.in.h
index 06cbad00d3..9ae3f0a745 100644
--- a/gl/stdio.in.h
+++ b/gl/stdio.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2004, 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#if __GNUC__ >= 3
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index c9552480e5..03a7f1492e 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -3,16 +3,16 @@
Copyright (C) 1995, 2001-2004, 2006-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#if __GNUC__ >= 3
diff --git a/gl/str-two-way.h b/gl/str-two-way.h
index 707145dbdd..888781bda2 100644
--- a/gl/str-two-way.h
+++ b/gl/str-two-way.h
@@ -4,16 +4,16 @@
Written by Eric Blake <ebb9@byu.net>, 2008.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Before including this file, you need to include <config.h> and
diff --git a/gl/strcasecmp.c b/gl/strcasecmp.c
index 0f0a742ffe..8d7d43e4a1 100644
--- a/gl/strcasecmp.c
+++ b/gl/strcasecmp.c
@@ -2,16 +2,16 @@
Copyright (C) 1998-1999, 2005-2007, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/strchrnul.c b/gl/strchrnul.c
deleted file mode 100644
index f6b072274a..0000000000
--- a/gl/strchrnul.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Searching in a string.
- Copyright (C) 2003, 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <string.h>
-
-/* Find the first occurrence of C in S or the final NUL byte. */
-char *
-strchrnul (const char *s, int c_in)
-{
- /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
- long instead of a 64-bit uintmax_t tends to give better
- performance. On 64-bit hardware, unsigned long is generally 64
- bits already. Change this typedef to experiment with
- performance. */
- typedef unsigned long int longword;
-
- const unsigned char *char_ptr;
- const longword *longword_ptr;
- longword repeated_one;
- longword repeated_c;
- unsigned char c;
-
- c = (unsigned char) c_in;
- if (!c)
- return rawmemchr (s, 0);
-
- /* Handle the first few bytes by reading one byte at a time.
- Do this until CHAR_PTR is aligned on a longword boundary. */
- for (char_ptr = (const unsigned char *) s;
- (size_t) char_ptr % sizeof (longword) != 0;
- ++char_ptr)
- if (!*char_ptr || *char_ptr == c)
- return (char *) char_ptr;
-
- longword_ptr = (const longword *) char_ptr;
-
- /* All these elucidatory comments refer to 4-byte longwords,
- but the theory applies equally well to any size longwords. */
-
- /* Compute auxiliary longword values:
- repeated_one is a value which has a 1 in every byte.
- repeated_c has c in every byte. */
- repeated_one = 0x01010101;
- repeated_c = c | (c << 8);
- repeated_c |= repeated_c << 16;
- if (0xffffffffU < (longword) -1)
- {
- repeated_one |= repeated_one << 31 << 1;
- repeated_c |= repeated_c << 31 << 1;
- if (8 < sizeof (longword))
- {
- size_t i;
-
- for (i = 64; i < sizeof (longword) * 8; i *= 2)
- {
- repeated_one |= repeated_one << i;
- repeated_c |= repeated_c << i;
- }
- }
- }
-
- /* Instead of the traditional loop which tests each byte, we will
- test a longword at a time. The tricky part is testing if *any of
- the four* bytes in the longword in question are equal to NUL or
- c. We first use an xor with repeated_c. This reduces the task
- to testing whether *any of the four* bytes in longword1 or
- longword2 is zero.
-
- Let's consider longword1. We compute tmp =
- ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
- That is, we perform the following operations:
- 1. Subtract repeated_one.
- 2. & ~longword1.
- 3. & a mask consisting of 0x80 in every byte.
- Consider what happens in each byte:
- - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
- and step 3 transforms it into 0x80. A carry can also be propagated
- to more significant bytes.
- - If a byte of longword1 is nonzero, let its lowest 1 bit be at
- position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
- the byte ends in a single bit of value 0 and k bits of value 1.
- After step 2, the result is just k bits of value 1: 2^k - 1. After
- step 3, the result is 0. And no carry is produced.
- So, if longword1 has only non-zero bytes, tmp is zero.
- Whereas if longword1 has a zero byte, call j the position of the least
- significant zero byte. Then the result has a zero at positions 0, ...,
- j-1 and a 0x80 at position j. We cannot predict the result at the more
- significant bytes (positions j+1..3), but it does not matter since we
- already have a non-zero bit at position 8*j+7.
-
- The test whether any byte in longword1 or longword2 is zero is equivalent
- to testing whether tmp1 is nonzero or tmp2 is nonzero. We can combine
- this into a single test, whether (tmp1 | tmp2) is nonzero.
-
- This test can read more than one byte beyond the end of a string,
- depending on where the terminating NUL is encountered. However,
- this is considered safe since the initialization phase ensured
- that the read will be aligned, therefore, the read will not cross
- page boundaries and will not cause a fault. */
-
- while (1)
- {
- longword longword1 = *longword_ptr ^ repeated_c;
- longword longword2 = *longword_ptr;
-
- if (((((longword1 - repeated_one) & ~longword1)
- | ((longword2 - repeated_one) & ~longword2))
- & (repeated_one << 7)) != 0)
- break;
- longword_ptr++;
- }
-
- char_ptr = (const unsigned char *) longword_ptr;
-
- /* At this point, we know that one of the sizeof (longword) bytes
- starting at char_ptr is == 0 or == c. On little-endian machines,
- we could determine the first such byte without any further memory
- accesses, just by looking at the tmp result from the last loop
- iteration. But this does not work on big-endian machines.
- Choose code that works in both cases. */
-
- char_ptr = (unsigned char *) longword_ptr;
- while (*char_ptr && (*char_ptr != c))
- char_ptr++;
- return (char *) char_ptr;
-}
diff --git a/gl/strchrnul.valgrind b/gl/strchrnul.valgrind
deleted file mode 100644
index b14fa1304d..0000000000
--- a/gl/strchrnul.valgrind
+++ /dev/null
@@ -1,12 +0,0 @@
-# Suppress a valgrind message about use of uninitialized memory in strchrnul().
-# This use is OK because it provides only a speedup.
-{
- strchrnul-value4
- Memcheck:Value4
- fun:strchrnul
-}
-{
- strchrnul-value8
- Memcheck:Value8
- fun:strchrnul
-}
diff --git a/gl/strdup.c b/gl/strdup.c
index 5826ab02af..b46416fea1 100644
--- a/gl/strdup.c
+++ b/gl/strdup.c
@@ -4,16 +4,16 @@
This file is part of the GNU C Library.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBC
diff --git a/gl/string.in.h b/gl/string.in.h
index d7a6c9c923..ef25d3c7b3 100644
--- a/gl/string.in.h
+++ b/gl/string.in.h
@@ -3,16 +3,16 @@
Copyright (C) 1995-1996, 2001-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_STRING_H
diff --git a/gl/strings.in.h b/gl/strings.in.h
index 4469f86ca7..ec6147dfc0 100644
--- a/gl/strings.in.h
+++ b/gl/strings.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_STRINGS_H
diff --git a/gl/stripslash.c b/gl/stripslash.c
deleted file mode 100644
index 0e452a95ef..0000000000
--- a/gl/stripslash.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* stripslash.c -- remove redundant trailing slashes from a file name
-
- Copyright (C) 1990, 2001, 2003-2006, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "dirname.h"
-
-/* Remove trailing slashes from FILE. Return true if a trailing slash
- was removed. This is useful when using file name completion from a
- shell that adds a "/" after directory names (such as tcsh and
- bash), because on symlinks to directories, several system calls
- have different semantics according to whether a trailing slash is
- present. */
-
-bool
-strip_trailing_slashes (char *file)
-{
- char *base = last_component (file);
- char *base_lim;
- bool had_slash;
-
- /* last_component returns "" for file system roots, but we need to turn
- "///" into "/". */
- if (! *base)
- base = file;
- base_lim = base + base_len (base);
- had_slash = (*base_lim != '\0');
- *base_lim = '\0';
- return had_slash;
-}
diff --git a/gl/strncasecmp.c b/gl/strncasecmp.c
index 35840bc01b..d48201b21e 100644
--- a/gl/strncasecmp.c
+++ b/gl/strncasecmp.c
@@ -2,16 +2,16 @@
Copyright (C) 1998-1999, 2005-2007, 2009-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/strndup.c b/gl/strndup.c
index e60268b86e..667024bb52 100644
--- a/gl/strndup.c
+++ b/gl/strndup.c
@@ -4,16 +4,16 @@
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, or (at your option) any
+ under the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/strnlen.c b/gl/strnlen.c
index 57fdfe7700..d0d30c22b5 100644
--- a/gl/strnlen.c
+++ b/gl/strnlen.c
@@ -3,16 +3,16 @@
Written by Simon Josefsson.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/strtok_r.c b/gl/strtok_r.c
index 011cb280b8..5085f72477 100644
--- a/gl/strtok_r.c
+++ b/gl/strtok_r.c
@@ -4,16 +4,16 @@
This file is part of the GNU C Library.
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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
diff --git a/gl/strverscmp.c b/gl/strverscmp.c
index db4f1edc70..20915672eb 100644
--- a/gl/strverscmp.c
+++ b/gl/strverscmp.c
@@ -5,16 +5,16 @@
Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#if !_LIBC
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index 2af6bfe6f6..7fd0a0a1e6 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -2,16 +2,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
# if __GNUC__ >= 3
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index b4cf0c3933..368afe43ff 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -4,16 +4,16 @@
Written by Simon Josefsson.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This file is supposed to be used on platforms that lack <sys/socket.h>,
diff --git a/gl/sys_stat.in.h b/gl/sys_stat.in.h
index acc36947e3..87ec4c46e6 100644
--- a/gl/sys_stat.in.h
+++ b/gl/sys_stat.in.h
@@ -2,16 +2,16 @@
Copyright (C) 2005-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake, Paul Eggert, and Jim Meyering. */
diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
index 3dbf632066..ef39b837bd 100644
--- a/gl/sys_time.in.h
+++ b/gl/sys_time.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
diff --git a/gl/sys_types.in.h b/gl/sys_types.in.h
index d7da35623b..689ce50157 100644
--- a/gl/sys_types.in.h
+++ b/gl/sys_types.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#if __GNUC__ >= 3
diff --git a/gl/sys_uio.in.h b/gl/sys_uio.in.h
index fef19dc389..d44aab2e3a 100644
--- a/gl/sys_uio.in.h
+++ b/gl/sys_uio.in.h
@@ -2,16 +2,16 @@
Copyright (C) 2011-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
# if __GNUC__ >= 3
diff --git a/gl/sysexits.in.h b/gl/sysexits.in.h
deleted file mode 100644
index fa8db8386e..0000000000
--- a/gl/sysexits.in.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* exit() exit codes for some BSD system programs.
- Copyright (C) 2003, 2006-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Simon Josefsson based on sysexits(3) man page */
-
-#ifndef _@GUARD_PREFIX@_SYSEXITS_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-@PRAGMA_COLUMNS@
-
-#if @HAVE_SYSEXITS_H@
-
-/* IRIX 6.5 has an <unistd.h> that defines a macro EX_OK with a nonzero
- value. Override it. See
- <http://lists.gnu.org/archive/html/bug-gnulib/2007-03/msg00361.html> */
-# ifdef __sgi
-# include <unistd.h>
-# undef EX_OK
-# endif
-
-/* The include_next requires a split double-inclusion guard. */
-# @INCLUDE_NEXT@ @NEXT_SYSEXITS_H@
-
-/* HP-UX 11 <sysexits.h> ends at EX_NOPERM. */
-# ifndef EX_CONFIG
-# define EX_CONFIG 78
-# endif
-
-#endif
-
-#ifndef _@GUARD_PREFIX@_SYSEXITS_H
-#define _@GUARD_PREFIX@_SYSEXITS_H
-
-#if !@HAVE_SYSEXITS_H@
-
-# define EX_OK 0 /* same value as EXIT_SUCCESS */
-
-# define EX_USAGE 64
-# define EX_DATAERR 65
-# define EX_NOINPUT 66
-# define EX_NOUSER 67
-# define EX_NOHOST 68
-# define EX_UNAVAILABLE 69
-# define EX_SOFTWARE 70
-# define EX_OSERR 71
-# define EX_OSFILE 72
-# define EX_CANTCREAT 73
-# define EX_IOERR 74
-# define EX_TEMPFAIL 75
-# define EX_PROTOCOL 76
-# define EX_NOPERM 77
-# define EX_CONFIG 78
-
-#endif
-
-#endif /* _@GUARD_PREFIX@_SYSEXITS_H */
-#endif /* _@GUARD_PREFIX@_SYSEXITS_H */
diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am
index 387dac9135..f4c8b3df2a 100644
--- a/gl/tests/Makefile.am
+++ b/gl/tests/Makefile.am
@@ -76,15 +76,6 @@ EXTRA_DIST += test-alloca-opt.c
## end gnulib module alloca-opt-tests
-## begin gnulib module argp-tests
-
-TESTS += test-argp test-argp-2.sh
-check_PROGRAMS += test-argp
-test_argp_LDADD = $(LDADD) @LIBINTL@
-EXTRA_DIST += test-argp.c test-argp-2.sh
-
-## end gnulib module argp-tests
-
## begin gnulib module arpa_inet-tests
TESTS += test-arpa_inet
@@ -159,13 +150,12 @@ EXTRA_DIST += test-connect.c signature.h macros.h
## end gnulib module connect-tests
-## begin gnulib module dirent-tests
+## begin gnulib module dosname
+
-TESTS += test-dirent
-check_PROGRAMS += test-dirent
-EXTRA_DIST += test-dirent.c
+EXTRA_DIST += dosname.h
-## end gnulib module dirent-tests
+## end gnulib module dosname
## begin gnulib module dup2-tests
@@ -175,15 +165,6 @@ EXTRA_DIST += test-dup2.c signature.h macros.h
## end gnulib module dup2-tests
-## begin gnulib module environ-tests
-
-TESTS += test-environ
-check_PROGRAMS += test-environ
-
-EXTRA_DIST += test-environ.c
-
-## end gnulib module environ-tests
-
## begin gnulib module errno-tests
TESTS += test-errno
@@ -269,6 +250,13 @@ EXTRA_DIST += test-float.c macros.h
## end gnulib module float-tests
+## begin gnulib module fpucw
+
+
+EXTRA_DIST += fpucw.h
+
+## end gnulib module fpucw
+
## begin gnulib module fputc-tests
TESTS += test-fputc
@@ -285,24 +273,6 @@ EXTRA_DIST += test-fread.c signature.h macros.h
## end gnulib module fread-tests
-## begin gnulib module frexp-nolibm-tests
-
-TESTS += test-frexp-nolibm
-check_PROGRAMS += test-frexp-nolibm
-test_frexp_nolibm_SOURCES = test-frexp.c randomd.c
-EXTRA_DIST += test-frexp.c test-frexp.h minus-zero.h infinity.h nan.h signature.h macros.h randomd.c
-
-## end gnulib module frexp-nolibm-tests
-
-## begin gnulib module frexpl-nolibm-tests
-
-TESTS += test-frexpl-nolibm
-check_PROGRAMS += test-frexpl-nolibm
-test_frexpl_nolibm_SOURCES = test-frexpl.c randoml.c
-EXTRA_DIST += test-frexpl.c test-frexp.h minus-zero.h infinity.h nan.h signature.h macros.h randoml.c
-
-## end gnulib module frexpl-nolibm-tests
-
## begin gnulib module fseek-tests
TESTS += test-fseek.sh test-fseek2.sh
@@ -319,15 +289,6 @@ EXTRA_DIST += test-fseeko.c test-fseeko.sh test-fseeko2.sh test-fseeko3.c test-f
## end gnulib module fseeko-tests
-## begin gnulib module fseterr-tests
-
-TESTS += test-fseterr
-check_PROGRAMS += test-fseterr
-
-EXTRA_DIST += test-fseterr.c
-
-## end gnulib module fseterr-tests
-
## begin gnulib module fstat-tests
TESTS += test-fstat
@@ -449,15 +410,6 @@ EXTRA_DIST += test-getline.c signature.h macros.h
## end gnulib module getline-tests
-## begin gnulib module getopt-posix-tests
-
-TESTS += test-getopt
-check_PROGRAMS += test-getopt
-test_getopt_LDADD = $(LDADD) $(LIBINTL)
-EXTRA_DIST += macros.h signature.h test-getopt.c test-getopt.h test-getopt_long.h
-
-## end gnulib module getopt-posix-tests
-
## begin gnulib module getpagesize
@@ -528,6 +480,13 @@ EXTRA_DIST += test-inet_pton.c signature.h macros.h
## end gnulib module inet_pton-tests
+## begin gnulib module intprops
+
+
+EXTRA_DIST += intprops.h
+
+## end gnulib module intprops
+
## begin gnulib module intprops-tests
TESTS += test-intprops
@@ -605,33 +564,6 @@ EXTRA_DIST += test-ioctl.c signature.h macros.h
## end gnulib module ioctl-tests
-## begin gnulib module isnand-nolibm-tests
-
-TESTS += test-isnand-nolibm
-check_PROGRAMS += test-isnand-nolibm
-
-EXTRA_DIST += test-isnand-nolibm.c test-isnand.h minus-zero.h infinity.h nan.h macros.h
-
-## end gnulib module isnand-nolibm-tests
-
-## begin gnulib module isnanf-nolibm-tests
-
-TESTS += test-isnanf-nolibm
-check_PROGRAMS += test-isnanf-nolibm
-
-EXTRA_DIST += test-isnanf-nolibm.c test-isnanf.h minus-zero.h infinity.h nan.h macros.h
-
-## end gnulib module isnanf-nolibm-tests
-
-## begin gnulib module isnanl-nolibm-tests
-
-TESTS += test-isnanl-nolibm
-check_PROGRAMS += test-isnanl-nolibm
-
-EXTRA_DIST += test-isnanl-nolibm.c test-isnanl.h minus-zero.h infinity.h nan.h macros.h
-
-## end gnulib module isnanl-nolibm-tests
-
## begin gnulib module listen-tests
TESTS += test-listen
@@ -664,39 +596,6 @@ EXTRA_DIST += test-lstat.h test-lstat.c signature.h macros.h
## end gnulib module lstat-tests
-## begin gnulib module malloc-gnu-tests
-
-TESTS += test-malloc-gnu
-check_PROGRAMS += test-malloc-gnu
-EXTRA_DIST += test-malloc-gnu.c
-
-## end gnulib module malloc-gnu-tests
-
-## begin gnulib module malloca
-
-libtests_a_SOURCES += malloca.c
-
-EXTRA_DIST += malloca.h malloca.valgrind
-
-## end gnulib module malloca
-
-## begin gnulib module malloca-tests
-
-TESTS += test-malloca
-check_PROGRAMS += test-malloca
-
-EXTRA_DIST += test-malloca.c
-
-## end gnulib module malloca-tests
-
-## begin gnulib module math-tests
-
-TESTS += test-math
-check_PROGRAMS += test-math
-EXTRA_DIST += test-math.c macros.h
-
-## end gnulib module math-tests
-
## begin gnulib module memchr-tests
TESTS += test-memchr
@@ -787,39 +686,6 @@ EXTRA_DIST += test-pipe.c signature.h macros.h
## end gnulib module pipe-posix-tests
-## begin gnulib module printf-frexp-tests
-
-TESTS += test-printf-frexp
-check_PROGRAMS += test-printf-frexp
-EXTRA_DIST += test-printf-frexp.c macros.h
-
-## end gnulib module printf-frexp-tests
-
-## begin gnulib module printf-frexpl-tests
-
-TESTS += test-printf-frexpl
-check_PROGRAMS += test-printf-frexpl
-EXTRA_DIST += test-printf-frexpl.c macros.h
-
-## end gnulib module printf-frexpl-tests
-
-## begin gnulib module putenv
-
-
-EXTRA_DIST += putenv.c
-
-EXTRA_libtests_a_SOURCES += putenv.c
-
-## end gnulib module putenv
-
-## begin gnulib module rawmemchr-tests
-
-TESTS += test-rawmemchr
-check_PROGRAMS += test-rawmemchr
-EXTRA_DIST += test-rawmemchr.c zerosize-ptr.h signature.h macros.h
-
-## end gnulib module rawmemchr-tests
-
## begin gnulib module read-file-tests
TESTS += test-read-file
@@ -883,23 +749,6 @@ EXTRA_DIST += test-sendto.c signature.h macros.h
## end gnulib module sendto-tests
-## begin gnulib module setenv
-
-
-EXTRA_DIST += setenv.c
-
-EXTRA_libtests_a_SOURCES += setenv.c
-
-## end gnulib module setenv
-
-## begin gnulib module setenv-tests
-
-TESTS += test-setenv
-check_PROGRAMS += test-setenv
-EXTRA_DIST += test-setenv.c signature.h macros.h
-
-## end gnulib module setenv-tests
-
## begin gnulib module setsockopt-tests
TESTS += test-setsockopt
@@ -926,23 +775,6 @@ EXTRA_DIST += test-signal-h.c
## end gnulib module signal-h-tests
-## begin gnulib module signbit-tests
-
-TESTS += test-signbit
-check_PROGRAMS += test-signbit
-
-EXTRA_DIST += test-signbit.c minus-zero.h infinity.h macros.h
-
-## end gnulib module signbit-tests
-
-## begin gnulib module sleep-tests
-
-TESTS += test-sleep
-check_PROGRAMS += test-sleep
-EXTRA_DIST += test-sleep.c signature.h macros.h
-
-## end gnulib module sleep-tests
-
## begin gnulib module snippet/_Noreturn
# Because this Makefile snippet defines a variable used by other
@@ -1108,13 +940,23 @@ EXTRA_DIST += test-stdlib.c test-sys_wait.h
## end gnulib module stdlib-tests
-## begin gnulib module strchrnul-tests
+## begin gnulib module strerror
-TESTS += test-strchrnul
-check_PROGRAMS += test-strchrnul
-EXTRA_DIST += test-strchrnul.c signature.h macros.h
-## end gnulib module strchrnul-tests
+EXTRA_DIST += strerror.c
+
+EXTRA_libtests_a_SOURCES += strerror.c
+
+## end gnulib module strerror
+
+## begin gnulib module strerror-override
+
+
+EXTRA_DIST += strerror-override.c strerror-override.h
+
+EXTRA_libtests_a_SOURCES += strerror-override.c
+
+## end gnulib module strerror-override
## begin gnulib module strerror-tests
@@ -1278,14 +1120,6 @@ EXTRA_DIST += test-sys_uio.c
## end gnulib module sys_uio-tests
-## begin gnulib module sysexits-tests
-
-TESTS += test-sysexits
-check_PROGRAMS += test-sysexits
-EXTRA_DIST += test-sysexits.c
-
-## end gnulib module sysexits-tests
-
## begin gnulib module test-framework-sh-tests
TESTS += test-init.sh
@@ -1326,23 +1160,6 @@ EXTRA_DIST += test-unistd.c
## end gnulib module unistd-tests
-## begin gnulib module unsetenv
-
-
-EXTRA_DIST += unsetenv.c
-
-EXTRA_libtests_a_SOURCES += unsetenv.c
-
-## end gnulib module unsetenv
-
-## begin gnulib module unsetenv-tests
-
-TESTS += test-unsetenv
-check_PROGRAMS += test-unsetenv
-EXTRA_DIST += test-unsetenv.c signature.h macros.h
-
-## end gnulib module unsetenv-tests
-
## begin gnulib module vasnprintf-tests
TESTS += test-vasnprintf
@@ -1379,31 +1196,6 @@ EXTRA_DIST += test-verify.c test-verify.sh
## end gnulib module verify-tests
-## begin gnulib module version-etc-tests
-
-TESTS += test-version-etc.sh
-check_PROGRAMS += test-version-etc
-test_version_etc_LDADD = $(LDADD) @LIBINTL@
-EXTRA_DIST += test-version-etc.c test-version-etc.sh
-
-## end gnulib module version-etc-tests
-
-## begin gnulib module vfprintf-posix-tests
-
-TESTS += test-vfprintf-posix.sh
-check_PROGRAMS += test-vfprintf-posix
-EXTRA_DIST += test-vfprintf-posix.sh test-vfprintf-posix.c test-fprintf-posix.h test-printf-posix.output infinity.h signature.h macros.h
-
-## end gnulib module vfprintf-posix-tests
-
-## begin gnulib module vprintf-posix-tests
-
-TESTS += test-vprintf-posix.sh
-check_PROGRAMS += test-vprintf-posix
-EXTRA_DIST += test-vprintf-posix.sh test-vprintf-posix.c test-printf-posix.h test-printf-posix.output infinity.h signature.h macros.h
-
-## end gnulib module vprintf-posix-tests
-
## begin gnulib module vsnprintf-tests
TESTS += test-vsnprintf
diff --git a/gl/dosname.h b/gl/tests/dosname.h
index ba63ce4bd3..ba63ce4bd3 100644
--- a/gl/dosname.h
+++ b/gl/tests/dosname.h
diff --git a/gl/fpucw.h b/gl/tests/fpucw.h
index 0b7f5284a1..0b7f5284a1 100644
--- a/gl/fpucw.h
+++ b/gl/tests/fpucw.h
diff --git a/gl/tests/infinity.h b/gl/tests/infinity.h
deleted file mode 100644
index 9111289985..0000000000
--- a/gl/tests/infinity.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Macros for infinity.
- Copyright (C) 2011-2013 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 <http://www.gnu.org/licenses/>. */
-
-
-/* Infinityf () returns a 'float' +Infinity. */
-
-/* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. */
-#if defined _MSC_VER
-static float
-Infinityf ()
-{
- static float zero = 0.0f;
- return 1.0f / zero;
-}
-#else
-# define Infinityf() (1.0f / 0.0f)
-#endif
-
-
-/* Infinityd () returns a 'double' +Infinity. */
-
-/* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */
-#if defined _MSC_VER
-static double
-Infinityd ()
-{
- static double zero = 0.0;
- return 1.0 / zero;
-}
-#else
-# define Infinityd() (1.0 / 0.0)
-#endif
-
-
-/* Infinityl () returns a 'long double' +Infinity. */
-
-/* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. */
-#if defined _MSC_VER
-static double
-Infinityl ()
-{
- static long double zero = 0.0L;
- return 1.0L / zero;
-}
-#else
-# define Infinityl() (1.0L / 0.0L)
-#endif
diff --git a/gl/intprops.h b/gl/tests/intprops.h
index f57f9b4dda..f57f9b4dda 100644
--- a/gl/intprops.h
+++ b/gl/tests/intprops.h
diff --git a/gl/tests/malloca.c b/gl/tests/malloca.c
deleted file mode 100644
index 311be569bc..0000000000
--- a/gl/tests/malloca.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2013 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2003.
-
- 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, 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 <http://www.gnu.org/licenses/>. */
-
-#define _GL_USE_STDLIB_ALLOC 1
-#include <config.h>
-
-/* Specification. */
-#include "malloca.h"
-
-#include <stdint.h>
-
-#include "verify.h"
-
-/* The speed critical point in this file is freea() applied to an alloca()
- result: it must be fast, to match the speed of alloca(). The speed of
- mmalloca() and freea() in the other case are not critical, because they
- are only invoked for big memory sizes. */
-
-#if HAVE_ALLOCA
-
-/* Store the mmalloca() results in a hash table. This is needed to reliably
- distinguish a mmalloca() result and an alloca() result.
-
- Although it is possible that the same pointer is returned by alloca() and
- by mmalloca() at different times in the same application, it does not lead
- to a bug in freea(), because:
- - Before a pointer returned by alloca() can point into malloc()ed memory,
- the function must return, and once this has happened the programmer must
- not call freea() on it anyway.
- - Before a pointer returned by mmalloca() can point into the stack, it
- must be freed. The only function that can free it is freea(), and
- when freea() frees it, it also removes it from the hash table. */
-
-#define MAGIC_NUMBER 0x1415fb4a
-#define MAGIC_SIZE sizeof (int)
-/* This is how the header info would look like without any alignment
- considerations. */
-struct preliminary_header { void *next; int magic; };
-/* But the header's size must be a multiple of sa_alignment_max. */
-#define HEADER_SIZE \
- (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max)
-union header {
- void *next;
- struct {
- char room[HEADER_SIZE - MAGIC_SIZE];
- int word;
- } magic;
-};
-verify (HEADER_SIZE == sizeof (union header));
-/* We make the hash table quite big, so that during lookups the probability
- of empty hash buckets is quite high. There is no need to make the hash
- table resizable, because when the hash table gets filled so much that the
- lookup becomes slow, it means that the application has memory leaks. */
-#define HASH_TABLE_SIZE 257
-static void * mmalloca_results[HASH_TABLE_SIZE];
-
-#endif
-
-void *
-mmalloca (size_t n)
-{
-#if HAVE_ALLOCA
- /* Allocate one more word, that serves as an indicator for malloc()ed
- memory, so that freea() of an alloca() result is fast. */
- size_t nplus = n + HEADER_SIZE;
-
- if (nplus >= n)
- {
- void *p = malloc (nplus);
-
- if (p != NULL)
- {
- size_t slot;
- union header *h = p;
-
- p = h + 1;
-
- /* Put a magic number into the indicator word. */
- h->magic.word = MAGIC_NUMBER;
-
- /* Enter p into the hash table. */
- slot = (uintptr_t) p % HASH_TABLE_SIZE;
- h->next = mmalloca_results[slot];
- mmalloca_results[slot] = p;
-
- return p;
- }
- }
- /* Out of memory. */
- return NULL;
-#else
-# if !MALLOC_0_IS_NONNULL
- if (n == 0)
- n = 1;
-# endif
- return malloc (n);
-#endif
-}
-
-#if HAVE_ALLOCA
-void
-freea (void *p)
-{
- /* mmalloca() may have returned NULL. */
- if (p != NULL)
- {
- /* Attempt to quickly distinguish the mmalloca() result - which has
- a magic indicator word - and the alloca() result - which has an
- uninitialized indicator word. It is for this test that sa_increment
- additional bytes are allocated in the alloca() case. */
- if (((int *) p)[-1] == MAGIC_NUMBER)
- {
- /* Looks like a mmalloca() result. To see whether it really is one,
- perform a lookup in the hash table. */
- size_t slot = (uintptr_t) p % HASH_TABLE_SIZE;
- void **chain = &mmalloca_results[slot];
- for (; *chain != NULL;)
- {
- union header *h = p;
- if (*chain == p)
- {
- /* Found it. Remove it from the hash table and free it. */
- union header *p_begin = h - 1;
- *chain = p_begin->next;
- free (p_begin);
- return;
- }
- h = *chain;
- chain = &h[-1].next;
- }
- }
- /* At this point, we know it was not a mmalloca() result. */
- }
-}
-#endif
diff --git a/gl/tests/malloca.h b/gl/tests/malloca.h
deleted file mode 100644
index 6fbe45eab6..0000000000
--- a/gl/tests/malloca.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Safe automatic memory allocation.
- Copyright (C) 2003-2007, 2009-2013 Free Software Foundation, Inc.
- Written by Bruno Haible <bruno@clisp.org>, 2003.
-
- 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, 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 <http://www.gnu.org/licenses/>. */
-
-#ifndef _MALLOCA_H
-#define _MALLOCA_H
-
-#include <alloca.h>
-#include <stddef.h>
-#include <stdlib.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
- alloca(N); otherwise it returns NULL. It either returns N bytes of
- memory allocated on the stack, that lasts until the function returns,
- or NULL.
- Use of safe_alloca should be avoided:
- - inside arguments of function calls - undefined behaviour,
- - in inline functions - the allocation may actually last until the
- calling function returns.
-*/
-#if HAVE_ALLOCA
-/* The OS usually guarantees only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- allocate anything larger than 4096 bytes. Also care for the possibility
- of a few compiler-allocated temporary stack slots.
- This must be a macro, not a function. */
-# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
-#else
-# define safe_alloca(N) ((void) (N), NULL)
-#endif
-
-/* malloca(N) is a safe variant of alloca(N). It allocates N bytes of
- memory allocated on the stack, that must be freed using freea() before
- the function returns. Upon failure, it returns NULL. */
-#if HAVE_ALLOCA
-# define malloca(N) \
- ((N) < 4032 - sa_increment \
- ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
- : mmalloca (N))
-#else
-# define malloca(N) \
- mmalloca (N)
-#endif
-extern void * mmalloca (size_t n);
-
-/* Free a block of memory allocated through malloca(). */
-#if HAVE_ALLOCA
-extern void freea (void *p);
-#else
-# define freea free
-#endif
-
-/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
- It allocates an array of N objects, each with S bytes of memory,
- on the stack. S must be positive and N must be nonnegative.
- The array must be freed using freea() before the function returns. */
-#if 1
-/* Cf. the definition of xalloc_oversized. */
-# define nmalloca(n, s) \
- ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \
- ? NULL \
- : malloca ((n) * (s)))
-#else
-extern void * nmalloca (size_t n, size_t s);
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/* ------------------- Auxiliary, non-public definitions ------------------- */
-
-/* Determine the alignment of a type at compile time. */
-#if defined __GNUC__ || defined __IBM__ALIGNOF__
-# define sa_alignof __alignof__
-#elif defined __cplusplus
- template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
-# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
-#elif defined __hpux
- /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
- values. */
-# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
-#elif defined _AIX
- /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
- values. */
-# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
-#else
-# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
-#endif
-
-enum
-{
-/* The desired alignment of memory allocations is the maximum alignment
- among all elementary types. */
- sa_alignment_long = sa_alignof (long),
- sa_alignment_double = sa_alignof (double),
-#if HAVE_LONG_LONG_INT
- sa_alignment_longlong = sa_alignof (long long),
-#endif
- sa_alignment_longdouble = sa_alignof (long double),
- sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
-#if HAVE_LONG_LONG_INT
- | (sa_alignment_longlong - 1)
-#endif
- | (sa_alignment_longdouble - 1)
- ) + 1,
-/* The increment that guarantees room for a magic word must be >= sizeof (int)
- and a multiple of sa_alignment_max. */
- sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max
-};
-
-#endif /* _MALLOCA_H */
diff --git a/gl/tests/malloca.valgrind b/gl/tests/malloca.valgrind
deleted file mode 100644
index 52f0a50f57..0000000000
--- a/gl/tests/malloca.valgrind
+++ /dev/null
@@ -1,7 +0,0 @@
-# Suppress a valgrind message about use of uninitialized memory in freea().
-# This use is OK because it provides only a speedup.
-{
- freea
- Memcheck:Cond
- fun:freea
-}
diff --git a/gl/tests/minus-zero.h b/gl/tests/minus-zero.h
deleted file mode 100644
index 5882cbf757..0000000000
--- a/gl/tests/minus-zero.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Macros for floating-point negative zero.
- Copyright (C) 2010-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Keep in sync with m4/minus-zero.m4! */
-
-#include <float.h>
-
-
-/* minus_zerof represents the value -0.0f. */
-
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f.
- ICC 10.0 has a bug when optimizing the expression -zero.
- The expression -FLT_MIN * FLT_MIN does not work when cross-compiling
- to PowerPC on Mac OS X 10.5. */
-#if defined __hpux || defined __sgi || defined __ICC
-static float
-compute_minus_zerof (void)
-{
- return -FLT_MIN * FLT_MIN;
-}
-# define minus_zerof compute_minus_zerof ()
-#else
-float minus_zerof = -0.0f;
-#endif
-
-
-/* minus_zerod represents the value -0.0. */
-
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
- ICC 10.0 has a bug when optimizing the expression -zero.
- The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
- to PowerPC on Mac OS X 10.5. */
-#if defined __hpux || defined __sgi || defined __ICC
-static double
-compute_minus_zerod (void)
-{
- return -DBL_MIN * DBL_MIN;
-}
-# define minus_zerod compute_minus_zerod ()
-#else
-double minus_zerod = -0.0;
-#endif
-
-
-/* minus_zerol represents the value -0.0L. */
-
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0L.
- IRIX cc can't put -0.0L into .data, but can compute at runtime.
- ICC 10.0 has a bug when optimizing the expression -zero.
- The expression -LDBL_MIN * LDBL_MIN does not work when cross-compiling
- to PowerPC on Mac OS X 10.5. */
-#if defined __hpux || defined __sgi || defined __ICC
-static long double
-compute_minus_zerol (void)
-{
- return -LDBL_MIN * LDBL_MIN;
-}
-# define minus_zerol compute_minus_zerol ()
-#else
-long double minus_zerol = -0.0L;
-#endif
diff --git a/gl/tests/nan.h b/gl/tests/nan.h
deleted file mode 100644
index e95ceb96db..0000000000
--- a/gl/tests/nan.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Macros for not-a-number.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-
-/* NaNf () returns a 'float' not-a-number. */
-
-/* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
- on the expression 0.0 / 0.0. */
-#if defined __DECC || defined _MSC_VER
-static float
-NaNf ()
-{
- static float zero = 0.0f;
- return zero / zero;
-}
-#else
-# define NaNf() (0.0f / 0.0f)
-#endif
-
-
-/* NaNd () returns a 'double' not-a-number. */
-
-/* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
- on the expression 0.0 / 0.0. */
-#if defined __DECC || defined _MSC_VER
-static double
-NaNd ()
-{
- static double zero = 0.0;
- return zero / zero;
-}
-#else
-# define NaNd() (0.0 / 0.0)
-#endif
-
-
-/* NaNl () returns a 'long double' not-a-number. */
-
-/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
- runtime type conversion.
- The Microsoft MSVC 9 compiler chokes on the expression 0.0L / 0.0L. */
-#ifdef __sgi
-static long double NaNl ()
-{
- double zero = 0.0;
- return zero / zero;
-}
-#elif defined _MSC_VER
-static long double
-NaNl ()
-{
- static long double zero = 0.0L;
- return zero / zero;
-}
-#else
-# define NaNl() (0.0L / 0.0L)
-#endif
diff --git a/gl/tests/putenv.c b/gl/tests/putenv.c
deleted file mode 100644
index 5461273084..0000000000
--- a/gl/tests/putenv.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2013 Free Software
- Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C
- Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
- 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 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include <stdlib.h>
-
-#include <stddef.h>
-
-/* Include errno.h *after* sys/types.h to work around header problems
- on AIX 3.2.5. */
-#include <errno.h>
-#ifndef __set_errno
-# define __set_errno(ev) ((errno) = (ev))
-#endif
-
-#include <string.h>
-#include <unistd.h>
-
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#endif
-
-#if _LIBC
-# if HAVE_GNU_LD
-# define environ __environ
-# else
-extern char **environ;
-# endif
-#endif
-
-#if _LIBC
-/* This lock protects against simultaneous modifications of 'environ'. */
-# include <bits/libc-lock.h>
-__libc_lock_define_initialized (static, envlock)
-# define LOCK __libc_lock_lock (envlock)
-# define UNLOCK __libc_lock_unlock (envlock)
-#else
-# define LOCK
-# define UNLOCK
-#endif
-
-static int
-_unsetenv (const char *name)
-{
- size_t len;
-#if !HAVE_DECL__PUTENV
- char **ep;
-#endif
-
- if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- len = strlen (name);
-
-#if HAVE_DECL__PUTENV
- {
- int putenv_result, putenv_errno;
- char *name_ = malloc (len + 2);
- memcpy (name_, name, len);
- name_[len] = '=';
- name_[len + 1] = 0;
- putenv_result = _putenv (name_);
- putenv_errno = errno;
- free (name_);
- __set_errno (putenv_errno);
- return putenv_result;
- }
-#else
-
- LOCK;
-
- ep = environ;
- while (*ep != NULL)
- if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
- {
- /* Found it. Remove this pointer by moving later ones back. */
- char **dp = ep;
-
- do
- dp[0] = dp[1];
- while (*dp++);
- /* Continue the loop in case NAME appears again. */
- }
- else
- ++ep;
-
- UNLOCK;
-
- return 0;
-#endif
-}
-
-
-/* Put STRING, which is of the form "NAME=VALUE", in the environment.
- If STRING contains no '=', then remove STRING from the environment. */
-int
-putenv (char *string)
-{
- const char *name_end = strchr (string, '=');
- char **ep;
-
- if (name_end == NULL)
- {
- /* Remove the variable from the environment. */
- return _unsetenv (string);
- }
-
-#if HAVE_DECL__PUTENV
- /* Rely on _putenv to allocate the new environment. If other
- parts of the application use _putenv, the !HAVE_DECL__PUTENV code
- would fight over who owns the environ vector, causing a crash. */
- if (name_end[1])
- return _putenv (string);
- else
- {
- /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
- to allocate the environ vector and then replace the new
- entry with "NAME=". */
- int putenv_result, putenv_errno;
- char *name_x = malloc (name_end - string + sizeof "= ");
- if (!name_x)
- return -1;
- memcpy (name_x, string, name_end - string + 1);
- name_x[name_end - string + 1] = ' ';
- name_x[name_end - string + 2] = 0;
- putenv_result = _putenv (name_x);
- putenv_errno = errno;
- for (ep = environ; *ep; ep++)
- if (strcmp (*ep, name_x) == 0)
- {
- *ep = string;
- break;
- }
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- if (putenv_result == 0)
- {
- /* _putenv propagated "NAME= " into the subprocess environment;
- fix that by calling SetEnvironmentVariable directly. */
- name_x[name_end - string] = 0;
- putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
- putenv_errno = ENOMEM; /* ENOMEM is the only way to fail. */
- }
-# endif
- free (name_x);
- __set_errno (putenv_errno);
- return putenv_result;
- }
-#else
- for (ep = environ; *ep; ep++)
- if (strncmp (*ep, string, name_end - string) == 0
- && (*ep)[name_end - string] == '=')
- break;
-
- if (*ep)
- *ep = string;
- else
- {
- static char **last_environ = NULL;
- size_t size = ep - environ;
- char **new_environ = malloc ((size + 2) * sizeof *new_environ);
- if (! new_environ)
- return -1;
- new_environ[0] = string;
- memcpy (new_environ + 1, environ, (size + 1) * sizeof *new_environ);
- free (last_environ);
- last_environ = new_environ;
- environ = new_environ;
- }
-
- return 0;
-#endif
-}
diff --git a/gl/tests/randomd.c b/gl/tests/randomd.c
deleted file mode 100644
index a3097efb4d..0000000000
--- a/gl/tests/randomd.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/* Some random 'double' numbers used by gnulib tests.
- Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include "macros.h"
-
-/* Some numbers in the interval [0,1). */
-
-const double randomd[1000] =
-{
- /* Some not so random numbers at the beginning. */
- 0.0,
- /* Then some numbers generated by GNU clisp. */
- 0.89255299921822260894833866359,
- 0.56160033401164667976788987953,
- 0.51743003502243816003616725706,
- 0.78419011286685927826225711525,
- 0.64400370685467819470063888148,
- 0.38151255107934048933308886009,
- 0.279822118770531878839000163945,
- 0.51983544681375980919751125922,
- 0.314601557551148376372971500376,
- 0.44551938964685651088492647794,
- 0.44235192503793823441729544512,
- 0.0040120762636767874958681841509,
- 0.57608572759464216512285032474,
- 0.69151953350396585566714564265,
- 0.65634190642598148152780718322,
- 0.68520459394253807590733184567,
- 0.60728078832107635628786818115,
- 0.376679934380311318950949959986,
- 0.48893422455419005003224231708,
- 0.59664228319132670346209747371,
- 0.70162191594290728927555900075,
- 0.70981089000005327192380201706,
- 0.480574069305863387682360414433,
- 0.369264627455974856929910550376,
- 0.42224495444170593700839286742,
- 0.96974027194201320964041066537,
- 0.69950081092902694549973698004,
- 0.366921803754944985368022837045,
- 0.19460757354611588216534077527,
- 0.046437559879825520495822908204,
- 0.57694149138457596563075731094,
- 0.49632733844850578203860859535,
- 0.80735347459453553970910033766,
- 0.210271595033975357161360058967,
- 0.176539870249396534142059724214,
- 0.75320267419158828905982021879,
- 0.09535042912249636739069790414,
- 0.41433965906065337672703334968,
- 0.62189345390648146852641556292,
- 0.322595610794052908153116342595,
- 0.173860860827838938281708881865,
- 0.55258425878412963601205794028,
- 0.066559056629606284504735241978,
- 0.0193835990781649263368095562556,
- 0.127101629778251450428653553143,
- 0.9603475517586241593077319367,
- 0.68429794014738591042302507235,
- 0.0139808909843634026741151214975,
- 0.0036035679428138856395527711611,
- 0.072656401341518399752950821809,
- 0.229562863635014486626281702425,
- 0.88337277579960676546469424767,
- 0.88850212167800818244030104263,
- 0.208063225990716089095767541316,
- 0.268304917462565269805874454916,
- 0.3195427196271617997151392088,
- 0.59101407246003811289573881403,
- 0.972093867752368095080492689,
- 0.409246208960242309650511849637,
- 0.84250639316418167849010246997,
- 0.063842712141624332977179722113,
- 0.96470327141354888687046060373,
- 0.43109879978424216966175314888,
- 0.14551248610248934836482236208,
- 0.84819094513299136408788493212,
- 0.41166757935215520377191731704,
- 0.96020915727830366672170130175,
- 0.55313106883839046701902022583,
- 0.9796595451013758579218900134,
- 0.74222694300533435700276764516,
- 0.117294243075539310976051880564,
- 0.32216824750097146958151447387,
- 0.59090211400137031908131441,
- 0.116841680533127258304897076543,
- 0.83595865401141052310417569507,
- 0.249488155772987988074361149176,
- 0.67896015287499211280971531326,
- 0.72256498621401843299673078876,
- 0.327315362968271601258667297595,
- 0.37438214921868498405279953481,
- 0.76929694812658272272027330778,
- 0.44282297788821568912463681727,
- 0.59517407740270913902014268964,
- 0.346217547960702024419571713567,
- 0.68339868731911838904373225224,
- 0.057507087039986776837238366719,
- 0.1189343986186977384509521024,
- 0.65646666532916174831489781194,
- 0.80925124288745606089697795707,
- 0.61302937875769552609444313984,
- 0.64367434863387777107222872563,
- 0.059228300879437554416166010005,
- 0.76899237494115809397158171526,
- 0.335797991302131791511629123206,
- 0.72923178692628392090326699514,
- 0.79300056654108221012876564405,
- 0.58866760551158502690719665335,
- 0.65249222174748700395779659047,
- 0.79573528799715877963614353006,
- 0.101363067664632247385474166088,
- 0.392494669960902131436398643207,
- 0.37323453200630776302168616197,
- 0.29857554596542776498065634631,
- 0.9796202149626312305197715787,
- 0.58770219934833805722677794788,
- 0.126574575737099431915356308504,
- 0.51086682994362911961448609847,
- 0.26221303911946316754295166201,
- 0.87331402410090670707406246035,
- 0.08604799064198292716037672196,
- 0.77880380648915901962140523059,
- 0.34131646312914811415381942246,
- 0.422787222735822749759714960156,
- 0.16550478231620269333824890372,
- 0.84087065799129220871741135711,
- 0.96561976597443996963329538915,
- 0.059890627133354026356081805998,
- 0.09359839900604706997291172522,
- 0.61463026659668017286248279853,
- 0.220582135665522265733252389516,
- 0.30146695094150797543070759948,
- 0.406591688270652513808216198946,
- 0.206959751707199812083987569348,
- 0.71382992952779021033600406503,
- 0.98971690700151825984363090029,
- 0.86339958328134745391858859595,
- 0.70037828363249257457230217791,
- 0.97380974339470107231135690474,
- 0.9184635965630883290893011311,
- 0.418605216026507942885819265225,
- 0.61793227858714759711625818653,
- 0.67394880797682685081908511723,
- 0.98871101941805039780826467279,
- 0.65973593853137069988371349845,
- 0.93348525072186907424189028727,
- 0.59164378220465485142298641014,
- 0.95303768733773138214124075961,
- 0.88667310242538944858141870801,
- 0.83785319781204861623008709825,
- 0.54026788227426708201242457367,
- 0.74842599257855801522259951132,
- 0.286624102305531463268442510375,
- 0.41180484980938874161376712508,
- 0.22754664620316922947541651384,
- 0.62360609793949755240041318939,
- 0.3311618194042077047850111557,
- 0.315407885695867020730009836503,
- 0.215221706711430951961780213436,
- 0.168600630933631406101821024413,
- 0.62661489373200405241464923618,
- 0.95357070304277219756741072036,
- 0.5186418766697788447635039428,
- 0.70772930521061953327927296944,
- 0.410376884797056150221504703145,
- 0.39705302343406249619577860633,
- 0.79215885822696034431481699125,
- 0.157831717946112504384603002152,
- 0.26892306298536012837855426922,
- 0.15697088614321016223211167568,
- 0.41395315712905823355235182393,
- 0.043977876945327860015049914653,
- 0.91453495544799358550673657283,
- 0.46230093259088633973148827911,
- 0.79479146768024434444120965094,
- 0.1466704986407674407377422815,
- 0.093614591443204076599999803382,
- 0.66061870961706149406527099303,
- 0.087462146328394574476138187113,
- 0.79683664444310818297700615557,
- 0.39732728185755441060070738751,
- 0.141934473990413594291362391075,
- 0.63111751995951919258061547632,
- 0.78521985432793823024330967029,
- 0.53307346282606806792796696141,
- 0.61679109370763781010143645189,
- 0.40696293619387120891515025426,
- 0.68670343879278712242412028794,
- 0.0115112936831136012901340526452,
- 0.70866056737692430987650236649,
- 0.75378980574358943122474800795,
- 0.17133202766710894969283150847,
- 0.36771201738922655520549864974,
- 0.64614182581953931840374311331,
- 0.354495602088990708111406368474,
- 0.96418771817934443444348833491,
- 0.51633426669933834634574104246,
- 0.064671329812306055349433587193,
- 0.084335079914541732137341401384,
- 0.98578018340150609333535890283,
- 0.32988119060114570391488875477,
- 0.70568290443337103364762141207,
- 0.7501960060851696034137148851,
- 0.141312840936106004164373056114,
- 0.60721022154106372815080238296,
- 0.49179275887283771965744826261,
- 0.85530668893284708999269819019,
- 0.09730053915339358769067661488,
- 0.48817911888023094845428570434,
- 0.37116312252354470380676793579,
- 0.61870369881699387959990992873,
- 0.381874188039839457469043174076,
- 0.68193837613090719561872304949,
- 0.4773618313988618747215621251,
- 0.152383599292709764750406667286,
- 0.54317522808228983459963725598,
- 0.363848788591302782268887022354,
- 0.0105589810271147011378412305973,
- 0.55582445068669939957392951111,
- 0.99910376130213936748996659383,
- 0.90286867348280161480903197439,
- 0.48268382934936288156485037692,
- 0.0976084557356802030533675394,
- 0.29004949962481398455881920169,
- 0.99169758897256717005011514856,
- 0.20722895154834288274430061308,
- 0.50294863638464584121275744208,
- 0.71094033855350495714847377558,
- 0.94078709219520224551350834268,
- 0.48088262771516317628650315489,
- 0.80538698628980761175811796611,
- 0.83495029615293903361580945571,
- 0.67996381940825251937974905761,
- 0.57936805772275234468590364926,
- 0.41778137764942046281708286844,
- 0.161602687591454506771276482303,
- 0.093910625156097743113739432334,
- 0.45716763620641108625606409874,
- 0.96455075374827233820027584808,
- 0.5179966880512917274934448216,
- 0.046797382046060065926143985952,
- 0.83673567319931334127111064225,
- 0.44224504444533247245974476514,
- 0.73281179385894336737033582786,
- 0.5642490153724193432309549673,
- 0.83700200507325250303481208805,
- 0.152714941779871552944298597052,
- 0.38606607994977770238226473985,
- 0.0155140917516105439042442246577,
- 0.51621537013393688713546096688,
- 0.311969390991657895966526156064,
- 0.83890647777450698803932943984,
- 0.54370750820133482930695388638,
- 0.98636765788772465929756760473,
- 0.77334255661128878905675504339,
- 0.57070354296508751519811368688,
- 0.8365252076669013372866223481,
- 0.344601601940890721182485798794,
- 0.92658930620470543221158939208,
- 0.72724523363899270076210273102,
- 0.413672082025645586061788451734,
- 0.5132836422023222169840403333,
- 0.82135610583961360173883281975,
- 0.423835065039748889417547786563,
- 0.87083598844595488941471761572,
- 0.59009392451459866513886634656,
- 0.206124826643305920436961792363,
- 0.288685540685143988030522421633,
- 0.7944357933456167153993184889,
- 0.090945230657758780394996530608,
- 0.52981750421369669363095418817,
- 0.091368944984485824360107751981,
- 0.81824925769562351657564377069,
- 0.083315412912658535228751011063,
- 0.59602276778799576464600065047,
- 0.52258035262146456789454411102,
- 0.394692074165738897132014378974,
- 0.92031214264405188928824363967,
- 0.32812665356161216265971156268,
- 0.79754299890007289545033977389,
- 0.3029021512227565310021437326,
- 0.81425785760698537744367921928,
- 0.85199399843570233736733560413,
- 0.096629890212080240754541391968,
- 0.60643798959967098211181910285,
- 0.75368518979236587723780129098,
- 0.451368813651510369666120626045,
- 0.86189868235067352904955566961,
- 0.239506411296874624231401913963,
- 0.143392266376287906568670938457,
- 0.035585084401323981008798496622,
- 0.89407531932950775763701297226,
- 0.56699767164913732414312190205,
- 0.6107715946195223295493238966,
- 0.980870588312723808697191463,
- 0.37603666613089681502774907483,
- 0.19565477083291620146833762404,
- 0.70326913680165706368122461762,
- 0.98247770640436619202690080984,
- 0.54911931698472764719220618506,
- 0.96749331150477343995263612791,
- 0.9349501605275792139661332597,
- 0.067704019779021886031495084945,
- 0.52883185005352261786874768842,
- 0.03879817199556086106868125058,
- 0.011268895714104342862021635882,
- 0.86781395233112768504418642287,
- 0.73610697666830606371057497872,
- 0.22595829849389174304359852447,
- 0.95990840938724981323147621815,
- 0.5938079875208820675776232526,
- 0.78655922365792476391655372464,
- 0.51099073264725007373467108776,
- 0.66474884887866769539664215292,
- 0.88640025828226102852258218854,
- 0.39889893489572927635368967129,
- 0.76340426725003756852384366924,
- 0.485534753598641026618647825146,
- 0.55957578573824837450384728978,
- 0.50840543283094885180866842941,
- 0.0102415845792896532313226969615,
- 0.74666891036262398733922051708,
- 0.49044748088989431070743849791,
- 0.184017043174756439606592004597,
- 0.0225210121470402648790231578307,
- 0.096909683465740960387467976065,
- 0.0521874432095560437920256545446,
- 0.108114343037383115951564617563,
- 0.77430486784405922952977031491,
- 0.73286432949907824441702845144,
- 0.083559249182272369453587951223,
- 0.074541345541671560054508020717,
- 0.55130541064331728019681677403,
- 0.101450912226971008587146654246,
- 0.74564503962660370005995595861,
- 0.55903832180264925580029280922,
- 0.86098138284846671753408133719,
- 0.76146956314354797691373262733,
- 0.5569854467166466965564479865,
- 0.61138555623626762560168304163,
- 0.93778268377974305185411499629,
- 0.106728342608615813606903105742,
- 0.51139895550624845300079248199,
- 0.8826404150665399364200384063,
- 0.79849755952621824621632991954,
- 0.60058338183244813128378689372,
- 0.57271235605091257806409062354,
- 0.134476676178095582804914204515,
- 0.62710051406343298533266304307,
- 0.21517566131268423511744492316,
- 0.87763268502269127056352092234,
- 0.259516013975152388767641295316,
- 0.54026961752737864438921779715,
- 0.0321012344232942464157113655476,
- 0.047765687217921465801489989111,
- 0.17851281529041807770891682623,
- 0.67864372391481596436180177405,
- 0.27188630999531652193578141334,
- 0.76570352378902765382129471855,
- 0.55727605717645959087760838806,
- 0.40035295538031700787360193533,
- 0.65772683660586524086245866733,
- 0.87515739410383285146563935658,
- 0.51637173718066431535845791928,
- 0.32843440805452173782945632394,
- 0.46789250836790673252530282969,
- 0.153916136058705475580104911632,
- 0.38115724589238346986896925035,
- 0.96911901452270741576104655076,
- 0.327510878721849788805057952285,
- 0.52921188196053063832762822112,
- 0.357891066893689952162669812174,
- 0.8109495999496825638917226258,
- 0.87378695338223548954000159812,
- 0.071735687760291841872657613394,
- 0.22099818521305441851106524174,
- 0.61319403424123059973018445501,
- 0.49185069904977836269777464774,
- 0.8465618819298531473261910176,
- 0.88263955123256235889766657732,
- 0.264605739218701311737446373095,
- 0.157257748694727606809000832224,
- 0.61172692557424578980817509135,
- 0.89224381101792427145783648267,
- 0.049436313890546252030141534714,
- 0.78472068655126867546237630366,
- 0.94890896727672958163705440614,
- 0.61244719025309458330037069759,
- 0.69652639673616920270100103049,
- 0.82306805868313923466426022855,
- 0.4619352653236511042512479492,
- 0.248913888569715263431474781448,
- 0.64972077945521993267494748532,
- 0.058989138867897862567374093665,
- 0.97969837050674699927934092348,
- 0.112860503606029382332397067852,
- 0.9148268966080465389473749031,
- 0.80522292073416096202056634334,
- 0.80810563925192214527344776336,
- 0.082994810842601316055993203972,
- 0.58154183958194788097113770541,
- 0.91401321304178026032151961143,
- 0.064162440925738934087179609749,
- 0.15233762499249088696399602351,
- 0.05051666992337641462246832006,
- 0.138526581114846840617440323377,
- 0.3330645447918149831766264793,
- 0.217487368997014213919568641696,
- 0.61893770768550649722673903221,
- 0.48128956859001312165262121487,
- 0.67074178502738313699688470847,
- 0.74389636308055141796746779725,
- 0.78623735396470085242463142878,
- 0.74044466560335570728816983391,
- 0.44977042205766449238521848558,
- 0.04936658918716696558210777333,
- 0.46898154881467544198433735515,
- 0.86577421926732888331279455256,
- 0.351697801257336354285066689416,
- 0.44607679846684358775746123434,
- 0.68542184287580537292736482205,
- 0.044146424753083577398366558491,
- 0.84496717026871403905274974765,
- 0.20398318496314438897842101827,
- 0.75107700174605698650069666924,
- 0.178571061661964354577482608798,
- 0.67178502534981979941629966218,
- 0.90847842600882488644789391115,
- 0.073076683947302775918335357377,
- 0.33981323802799502107773228774,
- 0.88205531070102240708858032672,
- 0.52395959911163033140017417074,
- 0.339537812421755656306362620887,
- 0.54102447887624739438002987695,
- 0.99615637434542139613844677579,
- 0.91178029521112995461052949527,
- 0.75825739605806537625994927603,
- 0.20376049709427102495755901889,
- 0.414724980644126108685694310425,
- 0.33340705339227162790042902392,
- 0.63442350111338002489027718102,
- 0.79083735924049231993808201264,
- 0.7022290803727963570326957922,
- 0.073051026670174816217706335151,
- 0.50842348505687696224462184336,
- 0.32363091931107924009593033016,
- 0.097074638787613630803324174721,
- 0.79231345620836950165162896374,
- 0.46134517653790366185204412042,
- 0.87767180094474465071641454817,
- 0.30504377737897498569142680272,
- 0.96430402804903305707372788262,
- 0.58722709934909516402891605024,
- 0.36287829330987989626587492725,
- 0.341369045118572012709880807167,
- 0.18622546427505557603629823709,
- 0.71794779555885705340742601105,
- 0.098775720656078510422828040021,
- 0.94170390436210924588938028149,
- 0.6256516749208606216856038288,
- 0.84990648194056707180867958453,
- 0.24897158268824763099382644974,
- 0.67126976686560821454618204853,
- 0.18287142221906188751198231263,
- 0.58301735289988287890086250316,
- 0.39451451502323596545833498888,
- 0.64778726863510310777659172018,
- 0.344060647976610102257104623935,
- 0.8543225374577925606075052273,
- 0.41721025737118350088955048104,
- 0.346301150923723212219486824146,
- 0.430145349151890094004681136873,
- 0.083653676599147505357408467754,
- 0.89927285917733406113015320169,
- 0.87717630249665962395834008139,
- 0.114609060439245285884826496387,
- 0.19079403943711412757743782207,
- 0.095752662525740063245815699042,
- 0.79249438764728213221559489213,
- 0.36889557473162465630046043798,
- 0.076691690566591062968137595944,
- 0.82502767429905549906741868154,
- 0.7665582347663079379259164121,
- 0.40329445688627141530172819257,
- 0.76025417855373928649612014969,
- 0.67742016809536470259225177395,
- 0.56458198627250149175789836481,
- 0.78923506303765674533158921804,
- 0.242546191857944356752822856477,
- 0.5429792204847717222270173404,
- 0.7269010821579782458839227112,
- 0.68884017933657182784660476876,
- 0.037868346502260087811459749823,
- 0.5900507745679403546108564628,
- 0.2867946536016681954708929644,
- 0.47061390957475445523849010039,
- 0.51289737877965767076806069599,
- 0.422963220866519099525024712084,
- 0.056516063514784913538055836342,
- 0.77559606292381102490968685122,
- 0.44812023547000818124896526252,
- 0.8496368064876247362896528731,
- 0.272242276648834925536741986616,
- 0.21366791927514210787832263868,
- 0.458126557153035507756298880855,
- 0.59095285049337797286946531198,
- 0.41387171106200290943847880691,
- 0.040527832792286543640976926214,
- 0.84749051864346812142321430329,
- 0.6591922374100337646083630177,
- 0.30504037894556796180304594549,
- 0.69588062596190762407598122745,
- 0.54615362946297678668402889519,
- 0.27179536774730804380125320985,
- 0.16312965572910266758089041195,
- 0.60443803311418335000528681396,
- 0.76221957063947757300487766314,
- 0.0012561481228798307955579245318,
- 0.38477311712200424042679172286,
- 0.86336953839931184684851388121,
- 0.85132017314817690655384788334,
- 0.79741410166633177181313320738,
- 0.81142674213295830272567127246,
- 0.90095974521916505411272740187,
- 0.461262866736651478343958282766,
- 0.163149749038393754125992055513,
- 0.079563568933303239293664877234,
- 0.0076308467066608702534098522771,
- 0.74020408989686798939059759005,
- 0.68004244363120265645245845544,
- 0.99423282025586676895879517721,
- 0.256512790150101579655974619204,
- 0.15841489307390214447222985222,
- 0.53156533193583516285295078457,
- 0.51195175518666885397864463638,
- 0.2688502522458221215136352473,
- 0.290743998007688539265414246556,
- 0.375642431327791011131765421904,
- 0.73366824563603699669790620984,
- 0.89031055476039433366324605036,
- 0.63269458446317741594059410575,
- 0.79677646360837164675956632,
- 0.91096051787867659208019728176,
- 0.056411022047894420770349313174,
- 0.7117937367428418076554349793,
- 0.494496454398059649677550547185,
- 0.9944698091905991687808626336,
- 0.195654008095567563746040882677,
- 0.33245249703376584453346565181,
- 0.91671965905832444523554539619,
- 0.104159073216349402499760928077,
- 0.78250381705179599027513221262,
- 0.82221952254403323129879405024,
- 0.25404653774104883427079980313,
- 0.89334850648967094099280368977,
- 0.2721479244387740074938025269,
- 0.58627710421889854554604323774,
- 0.80740872172002770008164688167,
- 0.295213737773499230779293451686,
- 0.366266263469556210902410635735,
- 0.72189449997560167388059780325,
- 0.91339160960295327548014703572,
- 0.27978723834100283634925494393,
- 0.44312275285067091147157546317,
- 0.88264479919648468925459438057,
- 0.74860386620420068665117140949,
- 0.97534502025842784289380076051,
- 0.183653687608870314454061893335,
- 0.14143760686328530307343938507,
- 0.7794390875763962068165432699,
- 0.79988123088296718350409621263,
- 0.91344402454829897860268279997,
- 0.3003753710559256572305330721,
- 0.92236868180619898327118824659,
- 0.85128995509445007265453349716,
- 0.51226586850988855988005111668,
- 0.59328586801467434659081264762,
- 0.131543061349700789237108200816,
- 0.97962864281984756641024957818,
- 0.80003961712390827564285728721,
- 0.07332191035039234849987853587,
- 0.33710892945255754021249327366,
- 0.237798240512212115424045579506,
- 0.050628096786899757905464602857,
- 0.36368141580193860149061967396,
- 0.074547282281222729072803274018,
- 0.32013351651022219595136046535,
- 0.50087363542319392259892635316,
- 0.95534128322832584718763016378,
- 0.63089810554419660091974256912,
- 0.45937043591639452731937380837,
- 0.77794827072126710252068287081,
- 0.5833967217973934570703322242,
- 0.89948711130168823436943591707,
- 0.88448792344727137087709578749,
- 0.75774410588649351850782212564,
- 0.51545850808454807305763364038,
- 0.89535564141616759448334976604,
- 0.433876155086630438489414332084,
- 0.263145194001722566517185175524,
- 0.094513715303174637696079970882,
- 0.0067905149976316075236601623182,
- 0.3746548325271489972742277758,
- 0.81418012245523025207375976459,
- 0.7382555515800124086679648947,
- 0.71505454385778976492869269043,
- 0.7698698840252614242858413632,
- 0.53096667868591647121855295207,
- 0.5913146508318579789498085478,
- 0.82865413011200335887487636747,
- 0.246477924915753655378269255135,
- 0.7718625116939460952174295485,
- 0.33088224685104582360581424038,
- 0.077396220323469426942810035952,
- 0.399851739373243384531661374094,
- 0.74828949567652386217126904324,
- 0.55533476993642340021791702209,
- 0.475356366587838670689554086714,
- 0.99199926249299355831492581518,
- 0.60739053074816626181185925167,
- 0.94570422855790142383862352906,
- 0.67410117583869264525962136333,
- 0.99340016295179621471645098914,
- 0.30521664837678549625426072163,
- 0.82786899862234431119578444516,
- 0.0246054418785779831964997687095,
- 0.33057040500642957115284791089,
- 0.325865542252271051046671982904,
- 0.116469964535698881624567000313,
- 0.38792519202192930208550481713,
- 0.147033252049062199325747990948,
- 0.333360890210745561370686771174,
- 0.267717098935309378552279527125,
- 0.473606191830554736751491306975,
- 0.69379726024488030302072707274,
- 0.39866105325920152799379542147,
- 0.075996151521605600512218326895,
- 0.43692155239290098173990417979,
- 0.63183509185797834489905365016,
- 0.327726835190132824885685947736,
- 0.82769389015654780671213364517,
- 0.38036542617183448008870457384,
- 0.06416363778906221378580326597,
- 0.95989693996326393340364540321,
- 0.77473792948077472252492320019,
- 0.73353080354752465520384745159,
- 0.79531316211939777703706647305,
- 0.31887745411495362933791547194,
- 0.5504233366621661345254817397,
- 0.133841546560512334978343647306,
- 0.93323316393590598213508657757,
- 0.219534116905903225236593922786,
- 0.352227557302752346568799070044,
- 0.50699048681296139093781410327,
- 0.56063256677949754339755086295,
- 0.97859418495668224120337606178,
- 0.43217748779939454097021337034,
- 0.6118800794139137562939270606,
- 0.8826339041571606455078384688,
- 0.190654349423411314990846249777,
- 0.0272323818569649486990095499454,
- 0.13501820915175992368033644254,
- 0.34430252524220055863712676536,
- 0.135013324503164182485257894453,
- 0.83301344777287732687815180326,
- 0.71146270180847724757833953093,
- 0.059584725284656364940760846576,
- 0.124388342467555907606115942139,
- 0.86760011350010388002288781466,
- 0.43443235444248399222879725088,
- 0.62257025564267773540408523682,
- 0.42224480338939459869117553607,
- 0.122203729563367693705179104655,
- 0.86763329805228175173701751082,
- 0.61852711996472568821866689006,
- 0.9981036801779161471700405786,
- 0.177126618334123901292041594724,
- 0.37033568941002233661950847289,
- 0.81720705981865203019383851894,
- 0.194752883553301253160228353622,
- 0.5399475493930702257701115294,
- 0.21555050095259535717046390477,
- 0.031480898918419061738395489394,
- 0.0108626235742996694506893658131,
- 0.29439861659506237876675916168,
- 0.25969803792963051605662393213,
- 0.64305111681301349941082616522,
- 0.398301763391130971280749586885,
- 0.82959279528518208376169366062,
- 0.494452121232255582677051524076,
- 0.032046850110252624668328949032,
- 0.304808216164121089322038632124,
- 0.43743086801077933536332835933,
- 0.067635143022119684849606244687,
- 0.062601171413915686472972559687,
- 0.80704249768256597155262089974,
- 0.049090587901867220876053770281,
- 0.14290280489067737067786839775,
- 0.85153414385190808252068833198,
- 0.052035578866778404379096518691,
- 0.84803461110488710482683367176,
- 0.323391780352303842858779454674,
- 0.52713499343541339922976296515,
- 0.91034109375479019837692785976,
- 0.106146556890642346491650008212,
- 0.291532189474064930184344798145,
- 0.330494959183718721493342551525,
- 0.6236537208920888603043773443,
- 0.89122121355780761549659392994,
- 0.51799810738861013193016943087,
- 0.249256177739037963581221438965,
- 0.76322106809612787470242640888,
- 0.97852511972383831461233976406,
- 0.52255677693690499607690355455,
- 0.4450034860583097087122794844,
- 0.79114162250324775713725095404,
- 0.94756217345536380876998110362,
- 0.58677918818329126036021764787,
- 0.84845252924877884299669190981,
- 0.30081720041370757827674016113,
- 0.27920525653128846538023076229,
- 0.33471466998109052439193176801,
- 0.77432114969973711331784009482,
- 0.79975078898170550460312445454,
- 0.90029380309155505829673878957,
- 0.22735855793472972935624370264,
- 0.83917898101167717908999667914,
- 0.96001063929762371813642857618,
- 0.80557845129235602137075744771,
- 0.227828260252387705994553631692,
- 0.45514459312672738783331856798,
- 0.6996049090759249573037751274,
- 0.76407211467383802388153449844,
- 0.35750763601712374361686514082,
- 0.090157662209549066428683554241,
- 0.95043897530001474792481472865,
- 0.97262166470012788338731033975,
- 0.203045895422423613196589718133,
- 0.217437635156560627036179586425,
- 0.5222956932204809424910993278,
- 0.52865060708104384493756729767,
- 0.97715373213739469800445297208,
- 0.5740174414400501666597490431,
- 0.172348314420047937640907870932,
- 0.57197038071649167881433868039,
- 0.26289948915209002196358225729,
- 0.177903112174726341611524884074,
- 0.74917239660013094610681443816,
- 0.59837085384984040836442442706,
- 0.065070324689375259831989322427,
- 0.44807493892928848916566949155,
- 0.59027783360778386064107723777,
- 0.122058971772529617939528531479,
- 0.18965096763129552013799044806,
- 0.179455202785822708296801760066,
- 0.032170979041981235014758366854,
- 0.297222966386620738492021519056,
- 0.91323423393143490893801153646,
- 0.75998869946268189685327906564,
- 0.83934073246383862944110864099,
- 0.17898779712956184324621175982,
- 0.480986398855505957279379560397,
- 0.60860751560721289727164165043,
- 0.298927282590269088379100218673,
- 0.77935020447343759584143119835,
- 0.480545242963934573648858250607,
- 0.85619790637736236353631524289,
- 0.96488893882602300700764346564,
- 0.36351865634843046736230405883,
- 0.82895257550724293657223335349,
- 0.79749691055514662573933190753,
- 0.20106705267868388883102752272,
- 0.33623918491977977623116871123,
- 0.93256466340279772952587363977,
- 0.88648669501682764515636262464,
- 0.47662235152771500250187825963,
- 0.52659238455883068245922982067,
- 0.94111676559395948458425469814,
- 0.323317713690175795284098362026,
- 0.34796405933091263994264450729,
- 0.52445433363119391822452105405,
- 0.525140277317638922334264421,
- 0.64469482443585357444532895759,
- 0.33472685924872903603447879104,
- 0.42400458791646499703641118014,
- 0.8222662798441265944554029489,
- 0.75524567154228028735673060411,
- 0.90790601849806560799894333131,
- 0.75164241313793249434488428193,
- 0.38724602290468111557712203885,
- 0.36352513950081020449187506395,
- 0.078398790907179055722325452963,
- 0.5003676822199407758422514133,
- 0.86055044548361328714384972985,
- 0.66748567445598821900669819042,
- 0.95450644393912187127659765969,
- 0.9536501355878008523425355652,
- 0.56207573012593503802043957099,
- 0.99057795680550440527031916411,
- 0.056136908924222021770088579728,
- 0.89322960593560085272815946927,
- 0.19380351076299398770342941398,
- 0.036881975481577328074706357897,
- 0.38834900979665334617449710449,
- 0.77196507761008668275581490587,
- 0.87539115393397618421355963533,
- 0.9131721846286054396553858461,
- 0.62245648254908013430163665866,
- 0.56021174819199355559539089633,
- 0.86987294559046384230921358438,
- 0.474584307464076041054198211805,
- 0.37224942408757353492416873571,
- 0.198307276357215222087716993615,
- 0.81633548414328354008913860616,
- 0.071192681637945014051745371309,
- 0.227203421058334439883665388655,
- 0.50527083273847576806586104904,
- 0.25911353175247232791676189983,
- 0.103567996992606824957067451526,
- 0.98316826751311017109085781757,
- 0.99206610065531611133123425907,
- 0.63838444880264351660305680771,
- 0.90013304139719692321619239255,
- 0.541419881593941428911392944,
- 0.434681681520065487913409442927,
- 0.0277935905905462584654818408167,
- 0.28736085880215502013374946299,
- 0.204706679291990486471085620508,
- 0.29639415300325412139805373353,
- 0.316818074164048785111401123944,
- 0.58068268044073033182148412246,
- 0.137736206950094621238996907006,
- 0.80907996549523150166492783923,
- 0.73799561611209772635015717353,
- 0.84013433924397440368969968592,
- 0.46126521311414726401422152854,
- 0.78013716447507497359555980298,
- 0.83405708922951231042933175851,
- 0.6366367969739079258896472192,
- 0.77353748358406402598000037557,
- 0.17489624725635947111471117775,
- 0.80267952648428412026314875447,
- 0.80437106861315296029137160672,
- 0.62834462177566783487584779777,
- 0.31539602345858033626133832055,
- 0.50541890853061839219557074283,
- 0.0195874476781850222509795360627,
- 0.011676447193909007242643314705,
- 0.85675479754070644130150816794,
- 0.09391269154749661204040398199,
- 0.369625667102334643216258483376,
- 0.84311577046357953313746551837,
- 0.66438426715728382263582851036,
- 0.70530906415261448155650458603,
- 0.446783684004800041373395690117,
- 0.75627790284213576819810990131,
- 0.57190285913753158265774292274,
- 0.97785681370875218892539297465,
- 0.0244503386494348881614690746194,
- 0.48528430854909558202793141933,
- 0.89436155397807056672243211894,
- 0.40757489194485346255194449191,
- 0.91772837786834838909335779229,
- 0.28020326531649972709359017096,
- 0.28847822326776188982020803144,
- 0.93193769743225684077624356649,
- 0.58336147304815741644785105161,
- 0.4004241800179331174134885947,
- 0.265790823692672203607418801725,
- 0.4137092141145146388568879939,
- 0.0255090449126572366852573357318,
- 0.47601725598948555645487446626,
- 0.69141516452580797436419291497,
- 0.187709862166242786826507443003,
- 0.31177816288567708916778389045,
- 0.79635247302484103596788484137,
- 0.14648403361265752358955335086,
- 0.0088027047060531475573345163528,
- 0.90053967411241805345616039474,
- 0.373822238382428585287035417224,
- 0.94303097002109978273901800507,
- 0.037263906643698883423150604649,
- 0.98416823398276433881119247311,
- 0.257766562836474661728601317803,
- 0.09336855716941364387765222813,
- 0.057604551843195630210060755775,
- 0.37732024813036636644231432449,
- 0.437099108019093398068604946814,
- 0.0298274889889844501626534131975,
- 0.54161045457572229928359302347,
- 0.354192069739745951755754451894,
- 0.9952629304832433588789284291,
- 0.61362350596285189174752077338,
- 0.23176197923774029736185020682,
- 0.259000332877923815426717028414,
- 0.77171708810079063604185854121,
- 0.87278431247491539306511051532,
- 0.386310463821549823085972724515,
- 0.19043920209178263945663905422,
- 0.77200547833114724875436606573,
- 0.2683024354984293205497398925,
- 0.144270112550972640008446091075,
- 0.36996280314557984925474224612,
- 0.163548224543250866742712583905,
- 0.54541238293503241055380526708,
- 0.54270760938500008382580072956,
- 0.7374073253240524865446763851,
- 0.93470960326436177572863031654,
- 0.71417607213823278615975270201,
- 0.65837463356664939532769528292,
- 0.433323451649582925271830911365,
- 0.79664580661766246494864588315,
- 0.392079017934601610514677836005,
- 0.212454387416532999103471570235,
- 0.198678082418012501322802116335,
- 0.61525672800559338657275986197,
- 0.99339589895181138684928419014,
- 0.53563057949945927383392076793,
- 0.68817192513245948798192690082,
- 0.59671938169380086666866042956,
- 0.5686075254645125832635026196,
- 0.25860953535454698758704936914,
- 0.60779864941995215785819783969,
- 0.46515241662568547274625942204,
- 0.8756966078479474164213834749,
- 0.89153160343113076353740745469,
- 0.57055911159151577684982200009,
- 0.39366246576557783924065683256,
- 0.53789676931469921495851209609,
- 0.95842028586447684249630374944,
- 0.25218284880717367924827402845,
- 0.23718965807272971860203662735,
- 0.334222632819004380754702693406,
- 0.6370849366068287810411454729,
- 0.722665796162802454203702773,
- 0.50216248905279887048328225791,
- 0.34529823309520970630714708672,
- 0.45098892404492692601908443802,
- 0.64640019115293913591196874603,
- 0.137077316379736192931987264458,
- 0.29368115076039970149731521521,
- 0.20091822953913855557804069085,
- 0.066267083813833718511605782276,
- 0.88094596104423280074202839474,
- 0.071730322265966936504743175424,
- 0.69735904142296779896396736035,
- 0.91352594564083795862432502567,
- 0.13244220377041278512040316988,
- 0.6283911312781029516331064494,
- 0.34896540167805105781090114462,
- 0.6795367801751911186206756471,
- 0.74898526486791573083377925403,
- 0.71700182398199203349731046015,
- 0.121142833366516620257163901501,
- 0.32678002036857151533698078636,
- 0.327511655875027224450064555456,
- 0.0079152053645354575349489795814,
- 0.84748954479623021059675156738,
- 0.75041561033954009809301550159,
- 0.41101693712463238996746228193,
- 0.90155864029338267639417046915,
- 0.35464670537047753945618208157,
- 0.68848712573944472430623590326,
- 0.08893193373618063124738179594,
- 0.58932830480784385636485098641,
- 0.0501618828375381577588978271165,
- 0.9451968329901169788400753848,
- 0.074994725566097580721185016702,
- 0.191860088196691871607965261685,
- 0.67853841063536805868885844477,
- 0.179445375284033906887325905976,
- 0.84157620913886056000430779083,
- 0.7377942162322144186341324232,
- 0.231126715579023126062082806996,
- 0.127662509645324778320005407937,
- 0.63062414859560283674777403205,
- 0.55283326072907470543330204975,
- 0.81243486031688046850257374808,
- 0.299095175225750536694802628506,
- 0.34284433830834748530634854762,
- 0.92098838107935607957057329632,
- 0.6334432153537539286206936299,
- 0.49203336326915182548719200464,
- 0.70089872986754081776092540042,
- 0.410346112246289262244008861334,
- 0.689375704219352519232614571,
- 0.53543492718830214408075484368,
- 0.78985504761729292283075540625,
- 0.66802245726332267870092702429,
- 0.75600588548341120124374250114,
- 0.83217485519464083512235296359,
- 0.77758150309412736979136465746,
- 0.067382141804836913185384124002,
- 0.7289836962356747770023887674,
- 0.453434776313686590560640460504,
- 0.3160796148757468204057886796,
- 0.0098933475787107681104048511314,
- 0.3620064234142809735084479026,
- 0.85993179373877360456391909506,
- 0.90684883450763884954227285187,
- 0.75959171037325548903969803948,
- 0.91219881792279148536349496306,
- 0.97175430264940118917041244436,
- 0.292364544897748356834218017667,
- 0.126096590956329503351026499397,
- 0.058210669685805595156500555938,
- 0.207143479048534791976348255132,
- 0.202837039257860939456824357966,
- 0.459137240079351948795601640776,
- 0.65480905235794807223708347609
-};
diff --git a/gl/tests/randoml.c b/gl/tests/randoml.c
deleted file mode 100644
index 4e854ddac9..0000000000
--- a/gl/tests/randoml.c
+++ /dev/null
@@ -1,1028 +0,0 @@
-/* Some random 'long double' numbers used by gnulib tests.
- Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-/* Specification. */
-#include "macros.h"
-
-/* Some numbers in the interval [0,1). */
-
-const long double randoml[1000] =
-{
- /* Some not so random numbers at the beginning. */
- 0.0L,
- /* Then some numbers generated by GNU clisp. */
- 0.709874756135422554674614242046304686448L,
- 0.486497838502717923110029188864352615388L,
- 0.474019570990182753146861083750226106848L,
- 0.998821069612940336401792152067298257397L,
- 0.68230324395444341476284133813649237509L,
- 0.0812383212795450007980350531141537177532L,
- 0.43131112016001535977175708439191217567L,
- 0.1596337172541222285215378906083607753005L,
- 0.0447361192177328171952931546845870270203L,
- 0.669148550486018286115665314826153614017L,
- 0.398752708644620313955955676251505325896L,
- 0.600019492390024166744893736290881101244L,
- 0.78337397012688890834008412364808365851L,
- 0.747414410152603863408503379239564644402L,
- 0.550615721371501982864462175362996180322L,
- 0.0073983673767251687422683917248311760491L,
- 0.693846360902780799478892082407382699085L,
- 0.751592057901191172906159475240427353057L,
- 0.74000578784995401707243054106755282117L,
- 0.847264623235961908747497547605068838836L,
- 0.917431426585209425652777605148791919017L,
- 0.267532476015101748449269162884835638528L,
- 0.486834088208986505203048715784492259319L,
- 0.4580154564181484580770749178538567666L,
- 0.391521076582874764982597286237947922907L,
- 0.69173131929214083677828129436922728366L,
- 0.995268639187054867212755710743514657877L,
- 0.553189251912843822062196619876802699895L,
- 0.632300552505301947698796653386744186037L,
- 0.445572801006840927064646197943103543344L,
- 0.993634311396905276414701816228609517838L,
- 0.611582274481091436495638926486363711255L,
- 0.017611091105275929341544154464243038417L,
- 0.598936378040443270534796418637146416803L,
- 0.939730325871014729497001074244817030738L,
- 0.385712528561693907444911228190200940125L,
- 0.48796444333495738271693214259711532603L,
- 0.508634972895891442259656591497940133962L,
- 0.88453398179301716552318999435310293852L,
- 0.509099535482633468613040057130206639612L,
- 0.333677997666677081186230843198919594355L,
- 0.82715349353996770180499230535973424237L,
- 0.0372593663309767971914036990047894757662L,
- 0.932828780275931267421133064996449298348L,
- 0.486099261359133830842098860485004683725L,
- 0.987156392631551825781809767746170502002L,
- 0.824739790678073493124786291053674093535L,
- 0.671869573118280976952523743592826377585L,
- 0.48088844444394888967684860088619551899L,
- 0.017233021606613044454327510797750273989L,
- 0.988102711714879869326666071903065279145L,
- 0.091615081537455465573860363408517029583L,
- 0.0113278995312253231106729997476313183323L,
- 0.294349528513080028346115860151112891433L,
- 0.0097058790914280197566968241982258935964L,
- 0.715113281550035710673074854712220192465L,
- 0.739627170474553083453358265804562580162L,
- 0.588476045636558489860462119645353521893L,
- 0.91330346819098343970944232526748274664L,
- 0.281457572112513183673653575304242456425L,
- 0.784192391468991402261628322552430383283L,
- 0.504857923842698553133786835061714061812L,
- 0.230410937725986177704701374433825197397L,
- 0.535805811877939822805608704986961969659L,
- 0.0508287955596506952822240797812703550548L,
- 0.179399756999629053194209501169297540332L,
- 0.675837373242984020977236431747771655704L,
- 0.981496523455084073391380532008173135055L,
- 0.325845075647804753424852268729037997407L,
- 0.832630951427200447589084239299500129776L,
- 0.825354056334755646582091209610369762364L,
- 0.574731012869980895104127749738122205757L,
- 0.799028354294603017571131513193291020045L,
- 0.537721586879667191016369071169775496218L,
- 0.83846801885738807298552515294277869191L,
- 0.0922901597877978587435698953162723703674L,
- 0.434458505758559675954739433438496373717L,
- 0.308017320632506922735963882703835222897L,
- 0.0192693232310748837390370764187488626234L,
- 0.65275462537999797862908920689650691667L,
- 0.357130585286320841741290333260811815153L,
- 0.359562085720204868627653630044659240449L,
- 0.758320826841831017712067337815543048118L,
- 0.62169722559489484088614873429559348682L,
- 0.17335411409874538731529771306978631118L,
- 0.154077331752487118534287271363344964006L,
- 0.148559174998934930922746358844164455867L,
- 0.881316225913391098839630896554038163768L,
- 0.89289796752480477623907740261818685845L,
- 0.57786655574695620371527391411424563834L,
- 0.318175774295281868509200498351278930862L,
- 0.194978302204782205514236430086515458283L,
- 0.87084962252516402992532937666368998137L,
- 0.362113882465068209502300826516448793743L,
- 0.273446496762640462316848141032810658473L,
- 0.1471399192242189033406154289397228481905L,
- 0.937157507052090331728212622934524925056L,
- 0.600045430164287985733450402316667890373L,
- 0.794478865621258499047814379367829521507L,
- 0.889115878933706260333129391997704491913L,
- 0.631825206206982866021784416451887594472L,
- 0.966422225095067311240936396545408962515L,
- 0.676845470105427028205320649846678927664L,
- 0.671163783319728784750606328490914935783L,
- 0.213726274743505026386536996423761328083L,
- 0.99483340496284948345969144891145513965L,
- 0.362072360280863974302182899205431874295L,
- 0.89135316959373017710710890812308229361L,
- 0.861008403776277958081202417380537907424L,
- 0.518258469677886348298849030872657409393L,
- 0.74995117457421590827489329835282465567L,
- 0.141688060236646135992059548400562463963L,
- 0.231055693687838328234866575264314255906L,
- 0.128367320195147852998795956530756587271L,
- 0.735643745226188370911313880883935933086L,
- 0.481951681233521227023903083881246017963L,
- 0.29797778097740396719094352844253033076L,
- 0.259026843185033526978277511857498182853L,
- 0.76454793636766387350530239448634042225L,
- 0.921742101320371872828332060575170679558L,
- 0.135594574885855893452962438848740230435L,
- 0.249482789438500604376469100084029356821L,
- 0.447893460512394580798054060401740249162L,
- 0.841167533365717681130523968098862274883L,
- 0.063885342343669943206116658917625959392L,
- 0.49268569222220133343083683720155184169L,
- 0.0320364278163828327673837310979596079469L,
- 0.83067006037141488187036282222404336846L,
- 0.32687090604018629599351990634445890267L,
- 0.524229581985562678867475657633756672726L,
- 0.26442137331545990230136529620604338964L,
- 0.1804465247704923307363156457827584866855L,
- 0.219897692414720290686302976466475627349L,
- 0.657372240957848561373923532613997515665L,
- 0.94917951707325275578037456019158874452L,
- 0.999935336870950506894538846120127792282L,
- 0.334292387732229479489367107895450895382L,
- 0.519605753222230586160238890634421180626L,
- 0.2353320030331258205431171147281090084686L,
- 0.697837952881171466097464830413620278996L,
- 0.337355949172173312279209733133367570558L,
- 0.59624609578396787690174902306338541087L,
- 0.430566868363073838098964774826687118822L,
- 0.303143768470597821848720008902412356097L,
- 0.45566572082779255052299434804712613961L,
- 0.63651052470632278377988990008643926753L,
- 0.88355849548999550762491205909993278845L,
- 0.857627182143034336666679544569747793963L,
- 0.579654405386150422035981447661995358225L,
- 0.527551502180559045145630115424486189773L,
- 0.227798290812497436015108334865799792168L,
- 0.860285575656798735433746383563482660567L,
- 0.657434642899561800145850990323893418457L,
- 0.991915916857419346367596676050775541352L,
- 0.0299053482258395117883768309912517801074L,
- 0.494186962160200346319995839440170254278L,
- 0.795837941248740362154274095100822390282L,
- 0.213898349709271555518444444268604992712L,
- 0.635385838537788174234352352696939407706L,
- 0.1161960540496013767418067989853615145483L,
- 0.236636716576793997613161803474856412323L,
- 0.250257128320679509772248555959408855321L,
- 0.754809883956726591031066199439807350575L,
- 0.240047496212680591313028855365466345707L,
- 0.125918185384015376472834932789271923263L,
- 0.830761928512260978768305988740912711273L,
- 0.0833746595456954680423678981938324373477L,
- 0.993235018876045312632920249583820095078L,
- 0.74457886551486005017424251252790500917L,
- 0.904041666312003998553971236017433817041L,
- 0.99682247674917724207607173416904094376L,
- 0.778185258630194559195184600522592063632L,
- 0.617908428541966249479693433082678846704L,
- 0.034201434638706652764862810175677292771L,
- 0.1166825963578175046863759835887066398776L,
- 0.618184997077951045734597662867931774914L,
- 0.67223166229200793562043589747700629457L,
- 0.50367723015643325152991864733820551338L,
- 0.287805524504497224349445840278160308547L,
- 0.418530565562949537953621246456529701546L,
- 0.356577284504836083965140033686046682705L,
- 0.727797226876543100474285620953868682292L,
- 0.261158535215243995918166290296126543963L,
- 0.1233681715943113445590872776925938156L,
- 0.397342365090131218507373938120760734013L,
- 0.33651833905580176460704582099080050591L,
- 0.124851176251609572087737060478799388707L,
- 0.49869389018540295598691678028277690211L,
- 0.603921102513219725593707198424421456834L,
- 0.0288068305492076274901316515486696644854L,
- 0.27635950491121559708402485015430409745L,
- 0.0219820746750707161670181537628175322048L,
- 0.893266704905772978187424688068554761406L,
- 0.055131714446612192984065196401480701447L,
- 0.478917803887421452005543212818108274705L,
- 0.1089109338581245135310441557812062287244L,
- 0.451355129465699006367714322379179082201L,
- 0.933539696310061306235683130737189659555L,
- 0.295046527696521751967458467625754033345L,
- 0.657654030109877699469191835246373699585L,
- 0.699519422709288537538980841108763784234L,
- 0.754780411476609088293217972311402262028L,
- 0.940185229424181440596885768821586612845L,
- 0.641206442188302531301220212171259413504L,
- 0.483623421775598486212538785028426545698L,
- 0.1819507033406890598006456890391145571876L,
- 0.3493992184159313422014002142021878866L,
- 0.2282143482135155999703670773974654680736L,
- 0.65404355620292102948676570623901452325L,
- 0.000126697620991797753719907018394969483701L,
- 0.000128697615694221449450257101713351917085L,
- 0.66277677565136622936757573048183355679L,
- 0.954427508631091518542647272554320259L,
- 0.821452416615550557725422642536361482673L,
- 0.783949133156224682132225528942727293192L,
- 0.883688268329322182794294084718215227776L,
- 0.887198477924019626901140168907684736036L,
- 0.301153686936585019868640358522761168745L,
- 0.97031160152938862140377079439908121466L,
- 0.613591225576913510391808189718881180802L,
- 0.973773801885628446394837963774216539007L,
- 0.969946092528631153860793542995840284225L,
- 0.0552318705490405481104532089875456066346L,
- 0.398506652226642658353465649824893657953L,
- 0.577466681084525459648007205600389579233L,
- 0.538305717497527581210294472297571817608L,
- 0.0378969572225333661087665511893845011475L,
- 0.82821208446292402852221418490682507414L,
- 0.207039760611344134455359310666092356869L,
- 0.278071434395492049592363658721835175976L,
- 0.418157919791356829061560807874478279737L,
- 0.917935426878916775097393966246600470752L,
- 0.968879316988430839484738642933327229065L,
- 0.836847484003257581736597938908686488306L,
- 0.95787762740618523171012745852536482523L,
- 0.381833463284092269744674988738521423563L,
- 0.585758801118634412354899474049588357203L,
- 0.590675098878457580254555486356030743515L,
- 0.999102261786447498899644398829003134788L,
- 0.278723779765613710807952395929736248799L,
- 0.150160483677965826860533794972733497469L,
- 0.39044191915595120943090707935299688844L,
- 0.882025297705744570797306391637391855587L,
- 0.26053886056730883704893455389142056588L,
- 0.530123960707389279621444598593626923328L,
- 0.307497951588709795568291546230129131789L,
- 0.755712717002473210112772528495042985208L,
- 0.403971099596680128749039001982260210321L,
- 0.0955902605698226580325595772471302440213L,
- 0.733946822526846681865131682504158670327L,
- 0.824558199580936798107294631591949429405L,
- 0.355777480091076251706346214380424670616L,
- 0.183210308747040172107746729630689571628L,
- 0.943081072447366944673610412439697363267L,
- 0.823437046917209496498923793615721213912L,
- 0.272212671889142468847791216625072718846L,
- 0.467586497114075237282436742306271250655L,
- 0.965430243779957305809196327799423550657L,
- 0.264527585376739963287684763043832918263L,
- 0.78305929918791974277407705060017330726L,
- 0.1569161089271269079867408493909342109635L,
- 0.385890512318945048667111881493883277209L,
- 0.748768801714747310036929893375463390286L,
- 0.9607241213632062657075501565333113635L,
- 0.681005349771442926258254424282975745535L,
- 0.417404611754855157969846623218352380733L,
- 0.384922954690351156114438668003273806442L,
- 0.0248688875333777009659560293287195312336L,
- 0.289622732329138351547499030028075517487L,
- 0.356660798938142089830284922931103513564L,
- 0.1092119220339924538904809107210351902013L,
- 0.263044604533896828574983495057823392153L,
- 0.72916056882229781356884933113775509031L,
- 0.277279616044198734111166028359400949283L,
- 0.448496025651349045553194567962243478962L,
- 0.397797975606664545700620422788810306397L,
- 0.915573317477921170464219734057440942223L,
- 0.565957191780698852582910000301549192135L,
- 0.0199640867363067059474765492007910956547L,
- 0.380718754942963039702539139065633248878L,
- 0.271561535356661429325107452975658450244L,
- 0.65703383768996023094650337496290243735L,
- 0.810303462640169412310932301780031244584L,
- 0.34389677270659068303923976829417662132L,
- 0.1459701849396526086771469906702178205394L,
- 0.0709566883230581731990192048699199874356L,
- 0.0273188133279639766234319338307950998466L,
- 0.189257375093862859152281617127963424911L,
- 0.483370049027267515091110020077746913052L,
- 0.6121051307445822901845022667347352688L,
- 0.0669683489197768142011855877890933175548L,
- 0.0462440353376468071116256899031962430102L,
- 0.66179099750239749196171922709429044667L,
- 0.331447780875915347204488922360787127231L,
- 0.88878630766137716878808504113561041651L,
- 0.57831688009568937419273238575083437733L,
- 0.1665758643537997337473156606765968668944L,
- 0.609499751553850514507525575752744468325L,
- 0.842660412678850878529299409778020570114L,
- 0.868735885617006579468607975714721515953L,
- 0.518323673739076029376626898444587264186L,
- 0.465048961779768578307935679739067346325L,
- 0.739933063031511059934522150792493137138L,
- 0.366097491036976922528977805725731033037L,
- 0.622890978255856721366594654155975719428L,
- 0.945120241233001881267096151974150875442L,
- 0.711795000549305806399598132955701848342L,
- 0.120093380051693652573317820347038096902L,
- 0.461420048084338423641881546847056927696L,
- 0.201645977777376722385295339631509175754L,
- 0.1479402104137110360277226090924965371445L,
- 0.287960179369955828242600303166176042591L,
- 0.788362667534075941033937374958276358103L,
- 0.610312055398887641020833805884097007991L,
- 0.758450801974187424825814780682156814865L,
- 0.64208882693968320907867911523798381855L,
- 0.255468285690834138126389042932304445888L,
- 0.0370478385689831649949675007793815537737L,
- 0.551880617631056560992613768623601574096L,
- 0.559262357532227558112085482526038868046L,
- 0.129705275018847798920129782613409588523L,
- 0.1076289463968801831500602693982998566697L,
- 0.272506325706516323678193293634687081578L,
- 0.721990855538151706841764025895777805643L,
- 0.523084042169573467351077180119310086396L,
- 0.0858615712848179826840482241961243288956L,
- 0.589714739430299853251893655400362103563L,
- 0.512412326166823937685402214713910254025L,
- 0.802350747297003067442509635888112412853L,
- 0.715817091619681167941132068164905209087L,
- 0.0824951218034037355816988555328185436778L,
- 0.829228234554153070848595829448989414728L,
- 0.59652037694553054648270061009002150308L,
- 0.133585725647906582691822880117773950377L,
- 0.812005216254498654412124509257882599085L,
- 0.808142463854396488512203093936737654517L,
- 0.570217922503074432494487309472855783614L,
- 0.704017977813333280013384719294741845102L,
- 0.0251797587779118690185681150429720019843L,
- 0.676272439608475367571481578590700290242L,
- 0.880796414989798318500723261307937258554L,
- 0.387922631107753361553377889431536170676L,
- 0.282350224157064849683455744598629321323L,
- 0.721001172978128539392551761867898599807L,
- 0.98720056526474911920598612334425157851L,
- 0.9951900286811655251775209231187451065L,
- 0.051844546479017627818996668613208776283L,
- 0.103738972117399718145836730690615155693L,
- 0.228544758674525285763674099492074936604L,
- 0.429309402103194762341587536897342160049L,
- 0.564535575507982971760351294178163523416L,
- 0.999063571593237112671743187500362701266L,
- 0.340374156369508513494787137157934959152L,
- 0.778748988242111504661479799747122556733L,
- 0.471307010869691772647781526213794708743L,
- 0.289707428078962269353959639691462373973L,
- 0.826577651264033230456965284610788939828L,
- 0.860667694131974131835140122175480202008L,
- 0.596405567348984902495263677852931818947L,
- 0.79786093770390728560184577433203234578L,
- 0.85492142888696693237980696048371212203L,
- 0.57242705004809831263405538576519171441L,
- 0.829648119655355629047392239460860046016L,
- 0.783260316181642610272420809845230036294L,
- 0.0941718863377651336163202407301145871807L,
- 0.156372209579300482444127671309443664823L,
- 0.95045258077372510217507306087908380692L,
- 0.1885289021059534081345247308001373861575L,
- 0.660776653890123229320677431688026234587L,
- 0.2333507388961794003755022400755269739225L,
- 0.926661255852332295794894190183342387092L,
- 0.862240624886232672002503279536846219655L,
- 0.093072473040365648693897225471155002338L,
- 0.210437952956145192084247103889970459783L,
- 0.98112543168220233380555460117617724093L,
- 0.740174391774267645790688716222038485627L,
- 0.0209886798500615011013258311339617682421L,
- 0.41833754096087514377582590206105535614L,
- 0.469019942905167330505858885046130048223L,
- 0.715228143253914303084091910768414947468L,
- 0.949215045400946624794326433082702896278L,
- 0.0839262379919984011512905346130401074556L,
- 0.358856470231875479544116669678510859691L,
- 0.676461324144301815445903930221360844898L,
- 0.321802718137104975636543941512529575137L,
- 0.993411285955596090334951526803325817472L,
- 0.860164319140927797258503749506400508873L,
- 0.94773452678939638468420772776729628408L,
- 0.786167026315331965750413583155691260173L,
- 0.45156944204188755542678210840170293585L,
- 0.490807428869058127589400400723875752095L,
- 0.1064150484458768919266881304357565451445L,
- 0.324460881496927069927267886879512784128L,
- 0.892536276084459403262968666925514247957L,
- 0.626906362142556286375622503025155623158L,
- 0.912617117728752553677432546319200457076L,
- 0.670287539555608481364011494943625670644L,
- 0.247614513279178220157281399165275150246L,
- 0.328334024179281412037962820247065990969L,
- 0.829445540957824174480776183273738605512L,
- 0.1787214688659462728637669907628671276175L,
- 0.925570168885833135397413435137754040344L,
- 0.98275386432184844551191217367555375122L,
- 0.364711512670624901280733420446798813805L,
- 0.0676060703890593392691073615176801081634L,
- 0.01088522590112897075539168583333589679446L,
- 0.0611693052224598303672047526429160913973L,
- 0.214589347780615411637055343786045569195L,
- 0.698097005257153990899739747284349971478L,
- 0.0354356066334430559162358810601367856981L,
- 0.0279531560831790454930326667914520406377L,
- 0.939682879995515407044885888120427639943L,
- 0.312419879113847025637130107480365284706L,
- 0.429063186024752762548549652686423948472L,
- 0.198325752893057589388425455067795077316L,
- 0.653970278037364931023007417819508007502L,
- 0.396811027519564931158159336303275106925L,
- 0.50451059823222344440248588902992099958L,
- 0.0862505815838354201964323759027263746603L,
- 0.957096030216378795442646824371057760147L,
- 0.587610162738417619467784731999441435863L,
- 0.582187586992416238476426545279573456436L,
- 0.535716130421670802716666237861890374707L,
- 0.090478847153957807764386571203708454605L,
- 0.788473620511487574655894325144660477707L,
- 0.610237648835883657058234607228408957708L,
- 0.678372723016422015853594971922211368707L,
- 0.0477042323920128297852928999674240977938L,
- 0.916676966783686851658830754268116450562L,
- 0.385373716764729378193009393283577714611L,
- 0.51049308234047313597601380814795899816L,
- 0.1196704708003806819299545192341910042065L,
- 0.446475706132336496196697021305914636716L,
- 0.22995164195921866005337396330755244987L,
- 0.632225374693904589951305492826903497058L,
- 0.1049567841702419598059377515889392050297L,
- 0.66749284825574584532432314559877621928L,
- 0.730750212627697291852996268443402535667L,
- 0.44210748459007730373853303409845654876L,
- 0.165882407048533464405922485111215401752L,
- 0.326102079042974476137893383568312181916L,
- 0.894926469777796621626659556932174565354L,
- 0.829811268916354531033773068150153342864L,
- 0.0607253283595596933368529290946492114805L,
- 0.0677752868787034912813695724240479638585L,
- 0.82861506635734784945473366382511846348L,
- 0.160085543323090657960949278634908144601L,
- 0.232569451519550129004668131405568301759L,
- 0.848363194546104528297512566450812116666L,
- 0.793640414525406609723674517332020118566L,
- 0.0908665486135344605492576594616215607582L,
- 0.98524892289773367881284955458176900047L,
- 0.232277847265217861619371474795084074907L,
- 0.2478103820537262599906715455471023544214L,
- 0.518524645780409202282547691600231775584L,
- 0.726858378884955244314303315523158335615L,
- 0.245545705017836867827662773158398435754L,
- 0.2242602776132220616213985660229694803996L,
- 0.69321599409749039262414070240230983052L,
- 0.0112978587458533729787299027903363211672L,
- 0.201700091442640051051557572594860881596L,
- 0.1553158804742445432796353137546288871905L,
- 0.297307958467221836656545818754009116053L,
- 0.858321137590160233755873079497950982112L,
- 0.66848174756798322137180974713907803341L,
- 0.996344263106353369755981871581860505522L,
- 0.0298469963581545313060582891253178820216L,
- 0.5825562269883888340326171333296281312L,
- 0.493316240919863194534203651249074989694L,
- 0.25506115557073666386519530923416434445L,
- 0.990037777634583670683401168871182857585L,
- 0.111966792328779238876716387539738843995L,
- 0.555536981182848652400091282463345207445L,
- 0.281763605895317871765768390877174374161L,
- 0.902702281907817546029803311979267829958L,
- 0.526223239446627547666226037912343453756L,
- 0.663322588876953268851644820272004691035L,
- 0.925956679854174995001911256195736125327L,
- 0.978687628923344717267490649565202182013L,
- 0.295452218109470204949110043833472171496L,
- 0.763317372768444290934585368155544717374L,
- 0.41484295515622153189510360412010755096L,
- 0.95319138766107113957717501566306191772L,
- 0.449833295238493367386837134824022661087L,
- 0.380903660964162496124546078818966824203L,
- 0.0591435603332779390763767398658188273838L,
- 0.594973116752510574186847848340951992488L,
- 0.66051154347057943107777082783767373976L,
- 0.9590947364014878778361002605613544034L,
- 0.141719503437180601174660143271258240733L,
- 0.72942088503531365739564056985302156428L,
- 0.96229479992042091317494337141213026865L,
- 0.51401712994901482942061876482808737646L,
- 0.09446204537625467018781365109090483186L,
- 0.568441523568450417056301286402539600564L,
- 0.598604342726174263070596195546293250945L,
- 0.774951017988365558347613104226790833317L,
- 0.81892086730816467017537310019875247387L,
- 0.890143355483709851496792149649550808793L,
- 0.2191477338352410954693547610221317715285L,
- 0.726897475480314385643181203422499653L,
- 0.756138778886812022822443490226271392144L,
- 0.36128016023552084266898937740898271179L,
- 0.410782581318000192446155911986931996913L,
- 0.223641334296034708685419059866928946095L,
- 0.0611617201563377229556630546893173872466L,
- 0.0454251140845604672274274573289906520655L,
- 0.292039969549662442463090760177927466818L,
- 0.0892783972345646734854765244000589132126L,
- 0.98769280749877429524697464655962686569L,
- 0.889843464657722517503667653048728011052L,
- 0.651776307404858375062718114948328477704L,
- 0.87617575855504123004785690824244025026L,
- 0.338359170956885135997817905734588127076L,
- 0.734032684330295341291816774804886223887L,
- 0.862422342223053851459695185679195132964L,
- 0.197333977370262353727756586852240555633L,
- 0.586060335783457129849055206578505427124L,
- 0.132898852938756538479400358451026471607L,
- 0.548298096092246267871555639877296879195L,
- 0.301119859270324657077136364646995297056L,
- 0.02186689635349189676964089313754648484195L,
- 0.037538023766844046167768352700498359816L,
- 0.739462465806194132819844936199304370748L,
- 0.306338591475158278790432712666553704959L,
- 0.0349382326130091592369352494672121905505L,
- 0.12659131714329909411210854142389581492L,
- 0.991566243159047696662802015340988687108L,
- 0.265613985138476447081523915107505113653L,
- 0.379928020809782559672193104868857287448L,
- 0.3311424971073397473661763760151895103L,
- 0.702177302636984264408758773725210449873L,
- 0.975045571615360787500646118846671455125L,
- 0.0373462862349996603561237755410350012631L,
- 0.846126776062337124521510357150131165153L,
- 0.604046707233534456382774833817964498043L,
- 0.1981113045697699450375369418161865703455L,
- 0.0223467484405979164693956414316536174577L,
- 0.67121960182601511325776586363807504696L,
- 0.165784481427263519151726479123968726022L,
- 0.721784618575898210943875783221281669927L,
- 0.247408211201465904622132596487935205602L,
- 0.474174174442367430962454680799704832459L,
- 0.38041380356189313505762491005159753494L,
- 0.412834591083812886132307610186713638625L,
- 0.294378742681402760124595985235966036022L,
- 0.319576442623415298744966071520183847465L,
- 0.17227236515412864866186439447886640924L,
- 0.19227796294349462194111033545303573433L,
- 0.701351402612222654905938605774127547107L,
- 0.55598633289035034815584162421930015865L,
- 0.402729648554369906881359212431684355721L,
- 0.595951760748834493622338584190905994085L,
- 0.119840257870361007206544525046135477756L,
- 0.90443395581066590152525534589406902782L,
- 0.205188871300477881549673944463237196075L,
- 0.339175278174772519132232276502457660768L,
- 0.447725444308107151040888910769680233742L,
- 0.541239546708188153505885726785683096117L,
- 0.12984235126732767588700711245028426254L,
- 0.0534701599183773436559514525508752846737L,
- 0.793436019832695131646422778046763975325L,
- 0.718125883729211211336344362949260539072L,
- 0.328649037343445105052694618356980072933L,
- 0.113307342739499399477248133420602576291L,
- 0.87683936228301044929749768481864525904L,
- 0.212591937265603187751611886807532831791L,
- 0.761002958456888912899646497131654914807L,
- 0.220849601519164170820922984026707209176L,
- 0.222305857213559738578093188054272365062L,
- 0.651516500020930005107266726995614198887L,
- 0.1505613416188572288472651067305496894266L,
- 0.166658450989632252583252879193540688162L,
- 0.249417632511505538283736333645627460544L,
- 0.50096054904291170172998992288713266662L,
- 0.173701146801321486346972068110605414347L,
- 0.93433415280052265881674202089278791561L,
- 0.1167900820460300938880016624066890278452L,
- 0.265137084235229705213901240937609442947L,
- 0.110072770364904306470596762714108445086L,
- 0.0670575770615268870829070207384379655213L,
- 0.92447493539224566948960065689964970346L,
- 0.187517201307673207566548753071237315229L,
- 0.935719666366703749433556454391358561756L,
- 0.964002672100646458888742916175546552353L,
- 0.6304136194377902875122727617639812134L,
- 0.497041144725381002743104205240568050483L,
- 0.589232636183711897405482721407549359295L,
- 0.524588285641300028631908965527617181296L,
- 0.786409662511483672510756944887012261427L,
- 0.9924030873238807048291154748671174581L,
- 0.891407534733792276848059682970952672076L,
- 0.308538095910260975496982224956384014562L,
- 0.949088891149549225900320967233005245566L,
- 0.507378396004105004571665876613293881214L,
- 0.348875146873077771786031143309488031474L,
- 0.129717394366372388305812826098578876617L,
- 0.371316171885006633822161450072014737125L,
- 0.550162123072752251266003313454007126843L,
- 0.822171979807031777641565545578299345138L,
- 0.75171547658293988559512988487590040284L,
- 0.329537443635543385256682239450819107475L,
- 0.159687481361602477899361671181005148163L,
- 0.788720723813465707294018605642035752394L,
- 0.1031423865826241581828274573741444954832L,
- 0.1925157943560383416361499973635531049876L,
- 0.771893047929845637497166550933789470487L,
- 0.681189132819106369246924892765206195007L,
- 0.180608768713011918428603967211913698036L,
- 0.0869303304414286810402604783458783443746L,
- 0.63890744831302111307395023326393791462L,
- 0.531696069328179766265158866360885671855L,
- 0.557357572478102464274432325432400878297L,
- 0.765306589402879669413870462450921612475L,
- 0.0941202729911292570046371838018359372082L,
- 0.902333472113108821746674873990738636997L,
- 0.165516366160118370026922089795742876131L,
- 0.0317472434880413278821576585103363607157L,
- 0.706107972335163251316361316043030620453L,
- 0.832472986392763388669796997227437520663L,
- 0.769939001736494466971306881365718899207L,
- 0.83093185023987157595917781461722256739L,
- 0.1143834825195292986705373579359335590854L,
- 0.283326017120251162360393258571085609729L,
- 0.301605389836836671045912951769199753359L,
- 0.855854391727628505548518803309296566532L,
- 0.089938332734139699450960989316391404434L,
- 0.310225946153425747793112265736973169299L,
- 0.96854812596413627994714291059983626441L,
- 0.279767360423571836833858253122290577619L,
- 0.113545981876279916290815278422648489865L,
- 0.943101270554056170747004305255027939268L,
- 0.812274724978801470221644756549524210083L,
- 0.9678011347395447510273023981530290554L,
- 0.514795136336602722878788704708053145966L,
- 0.50560840616487841567055789750974674943L,
- 0.127654209842819812026603428361923670116L,
- 0.273727399985085036497076514726791191553L,
- 0.964821797874257789566527793136425594082L,
- 0.853392912197074096341317268954834390727L,
- 0.914236806849585335611299422695886165192L,
- 0.277335361137281076359079507288838688219L,
- 0.865708792613433194377422367016717680172L,
- 0.761947879929658945814013586634774725302L,
- 0.276975494384441865188273120642155257808L,
- 0.0678895000408079241574268817560335475378L,
- 0.929521528875748672899760603996998763144L,
- 0.44453824299955605846877126958322272066L,
- 0.444318159420536625223816052640621069982L,
- 0.42913762214779045597457741573009821738L,
- 0.98994873802399078252493194985812582986L,
- 0.93065975343157446755652147574743540714L,
- 0.821639107980128580428385838275355600123L,
- 0.031337950421787684669360817154012683829L,
- 0.839516942888416107002513723437531514126L,
- 0.785501376812531727571251496474527490183L,
- 0.247978681554054401906203846371863203863L,
- 0.985774009303654108868853196421131421187L,
- 0.635347409930173147315815281304257764708L,
- 0.40087985483327734740658289294086718422L,
- 0.374059729085540852289174052767716446502L,
- 0.367226053686019780853702834825808619761L,
- 0.166424328898161772576167906091392715805L,
- 0.838115185925303343477055122060982270143L,
- 0.829549684532006011608856001441012324216L,
- 0.059867788238866724897690318151639504149L,
- 0.0253429734563284738087263277549928280781L,
- 0.953315773263436653713242828719775352192L,
- 0.597536998796130884349662459732857817956L,
- 0.0320571321493587106457025626624408278814L,
- 0.477506594803204144826488443400695434979L,
- 0.285541992141868221897101891229394096707L,
- 0.764190678950226854486968785768647879005L,
- 0.895489776830293129781335242249167913705L,
- 0.570740793029533496018083006013191540077L,
- 0.938316924714444954315906773563465846538L,
- 0.56157168133328941481074926451373503549L,
- 0.354184283860505415751320741296599995231L,
- 0.778294119283540721552919906619543293274L,
- 0.434953011661757598127924745629053141294L,
- 0.37156491156117895854194599593687697796L,
- 0.898767478977082606651667259049374990828L,
- 0.21819365919403129548458400006737057993L,
- 0.278163373548978939704874687746089548269L,
- 0.1089005781457343817756962209721573336768L,
- 0.85152888717082537570752846642305937149L,
- 0.2419243481761527583754399630924438738944L,
- 0.69442654829377168239365980152821108287L,
- 0.1512336533453368944625038813397779875445L,
- 0.617712962492924013140729661730350287525L,
- 0.935400762900002313827620435729493050175L,
- 0.79357339902161958573967958515254111256L,
- 0.734250188990467683521536859220675412636L,
- 0.748517858206364295837674601491185485078L,
- 0.82520014781239194590337105462135253912L,
- 0.1240649365160101108753438662971422995014L,
- 0.479769236133748631678854875312914195598L,
- 0.171269492636258554036912204801376697988L,
- 0.833025419245729049117746814929956940986L,
- 0.354429813451205200141830318428840891828L,
- 0.474809123369344367691189422128776480146L,
- 0.692239655770541262287308180705629028608L,
- 0.271366901464125731413801963807240905363L,
- 0.561330233800121182669429172066686942393L,
- 0.0695868383638479426233449148171168522655L,
- 0.627576910684655924911125045007979454546L,
- 0.423331542652214907262628326674848471962L,
- 0.354725031694671387579309719042578580595L,
- 0.312419264533145363169359084710774849388L,
- 0.167819037053563697473931127337972350099L,
- 0.99960836112225007722014049168024866743L,
- 0.820598666739967434549389339457492152643L,
- 0.689495024741546551592649728378054973272L,
- 0.831455766750164249604246627812180304754L,
- 0.515538871956858025876039391193370146897L,
- 0.011724889011994886395520178564059346913L,
- 0.587485679650311054946861235938601293477L,
- 0.113010564497810081892271654273794311467L,
- 0.381261245177928587613552004600730320213L,
- 0.466933821322235841488251157296771536952L,
- 0.646965031311287534221872388017990968767L,
- 0.1811101995014685369939482409137380098995L,
- 0.247896943912780884738461558340983142645L,
- 0.989351208835640462928338658234638846217L,
- 0.924605283008839688813842975338096967047L,
- 0.232010860908797395869871518793187418799L,
- 0.90274859050487649728273938229764570199L,
- 0.664078588165617572819884867627266650356L,
- 0.532118803501055886836301096658125012493L,
- 0.854049566634563277356849166147057535436L,
- 0.756477818237029394317820041473365538516L,
- 0.84578312219074068824832318394711642503L,
- 0.169914247711153055959592721695068126213L,
- 0.50848961455796310913779527189620088788L,
- 0.715231849280217810525151667911662744854L,
- 0.59666585539439202929452535210623694053L,
- 0.72343578283497935670188130618697814035L,
- 0.982228826906846431195861293729527133844L,
- 0.98068755339273420823366752414155272462L,
- 0.805277135157133623039231303778838094716L,
- 0.840154168539481858495551656699708834713L,
- 0.41783933695481411993780663692806809771L,
- 0.070981740672048589027432942629842679319L,
- 0.96664795205679820656636930925268162457L,
- 0.155178444292580006807274171645675417735L,
- 0.276407670358590477524508525465318694191L,
- 0.1054964292635286397825421772930229411286L,
- 0.354205947516472098240472076653525679013L,
- 0.583456972150065135260312420865576513532L,
- 0.338643867118430587299252775116788065723L,
- 0.146467849593879827355466951871059968293L,
- 0.0639448405747942007938896940026153617467L,
- 0.846536583732599902600485371566229612512L,
- 0.599728399399342923058515558777947417833L,
- 0.140387922890235239162309673093379598453L,
- 0.1613160217694973394489944660056369626715L,
- 0.151848582163159668039725770584081620756L,
- 0.663365628518336712743995463098831995163L,
- 0.752166976367665534193146852225632451022L,
- 0.911311062532571765386023433215793121138L,
- 0.692490353635171096989434518397248623866L,
- 0.990512559245857089458980255962574316578L,
- 0.135026433195284768293027372762691869458L,
- 0.82220389984592453325084678614092535756L,
- 0.385471328555065081327630832374267955206L,
- 0.108251633446048989722318564345306848022L,
- 0.429090236713339412878596384043906547999L,
- 0.983421429305507423332481562450757515935L,
- 0.0163920521681887489391607174895946079877L,
- 0.634276319224952361916496263299135133978L,
- 0.53164375434562160610011793242431018808L,
- 0.92801127390978303506935520414803575609L,
- 0.708525110316144414918831897015500504675L,
- 0.722458240987313977092360928226487539067L,
- 0.432028911017122242491499522489684865593L,
- 0.0001754664935299182587224394863719217640876L,
- 0.384266658709383389800969077999970411222L,
- 0.284964603427904715461598563563830112021L,
- 0.1541443027599544245798778784933517572175L,
- 0.958338802063400795313378181913830622686L,
- 0.636927309395779701122460610729048286624L,
- 0.0963946603295477475541191401069719222887L,
- 0.0995190436935072136624400787867889652226L,
- 0.294220607618706451139091631947946466958L,
- 0.180831121994104393794487526888221966969L,
- 0.635403971764105414766318934434540385347L,
- 0.333929089029202997624323059191296321991L,
- 0.498378678845335358166419186432789231466L,
- 0.79769145046274241777533636404451138797L,
- 0.269285209299779365433012558225847643041L,
- 0.110524792990169183853219228066613162975L,
- 0.252694136970632381193559370648931722998L,
- 0.447232396115786457656991370803052298542L,
- 0.136974250599080636030665381278567779455L,
- 0.67243844394695156696032636816317618716L,
- 0.280265952023932940327982570523639258968L,
- 0.960024614746466668963206103951264089396L,
- 0.83595031847062668345135859090890188348L,
- 0.127840531352213174558502027846545305518L,
- 0.333183884044346150282363573006579940787L,
- 0.480504229384957927069515726093850498988L,
- 0.768498913093287331615443023486434378468L,
- 0.940413493411219283289136687423264928073L,
- 0.548648592555019577089750862504091661273L,
- 0.57814360039222917342516307696519676185L,
- 0.752806287004316513987155718410926624384L,
- 0.328211694133870995310455637563825433641L,
- 0.153907665030571878436793446358668488233L,
- 0.694742699178286984320321272531890059073L,
- 0.25435421168640709608520313542078743933L,
- 0.61387638208113240104328972389071498415L,
- 0.250476311300881635346483832554226742174L,
- 0.345809836897231980069633800588202859833L,
- 0.343083789419841923142937785323119943136L,
- 0.319174378869537109008405333721782689566L,
- 0.158111477528301687597604325494967120237L,
- 0.244000500810322900960285910812181460829L,
- 0.23179705702278726416861948783067588642L,
- 0.54682924846605062799436489677774333716L,
- 0.549008127982055819651521103931442895238L,
- 0.262583044663608129412956518168777449925L,
- 0.00126513153702681878410946802239924274583L,
- 0.942613696151881635585127791325641506562L,
- 0.352686443706689559388572818776843215083L,
- 0.90689998425792029984240460273113807702L,
- 0.867511650419363872431681377574762734184L,
- 0.280671949468087158951852027769013272607L,
- 0.162038690615698843560500386213858514888L,
- 0.71179364933082197276587611716632482938L,
- 0.0967402545497599384082792036477527703823L,
- 0.465040868275334873151726613879001199556L,
- 0.621004503662486553272117361134036130264L,
- 0.732964940483576253705474121238830973672L,
- 0.423374863473223783721502627532544136435L,
- 0.490338535425760290944218064913112069833L,
- 0.0243433415988311460557576165617657963508L,
- 0.0502339423891456566961808478207103394328L,
- 0.57668149339841029115236469576085057193L,
- 0.654589079253818313716855283653923913987L,
- 0.1099728579252794893221972017964445810946L,
- 0.95067113980240197864048876003001477344L,
- 0.271440369581834169312179003284604198334L,
- 0.067152474145377434478612939162576726923L,
- 0.77434193893477314687843638736266814713L,
- 0.2095679937785625400917773512669417520444L,
- 0.7681370807102749183539277908648691358L,
- 0.24472807400083103884984122018932641814L,
- 0.191307162486577428460074174309309551616L,
- 0.637215617752531571162184184570005111405L,
- 0.858141525396878877938747690015117846998L,
- 0.338400625200720062249435065450813258281L,
- 0.564981422008979753676981861330327611986L,
- 0.809460314261206431741632790718777271837L,
- 0.879343403409393604462128113991125533726L,
- 0.284697509116613252542034824007026845569L,
- 0.497023470648395180497606069099534119801L,
- 0.650004713241995983979792197286941523L,
- 0.1177129995341492896184329340448111002318L,
- 0.923625966014428778639333261268345799732L,
- 0.698837131343914189577155394009532120604L,
- 0.28242326745092132457477019796509942259L,
- 0.70025600885251684699238650783454037429L,
- 0.876659050276528114198964471020380705343L,
- 0.52914892693002332233566353042454639365L,
- 0.319860854431864688430502078275989809115L,
- 0.83483115610648557287441551698147898778L,
- 0.727639064249568383685922880431792837046L,
- 0.58743287662861037184349933549802687836L,
- 0.510383231616356949495559076196319035197L,
- 0.00229935944348919214521608305418404052343L,
- 0.799567224020488433652933994297769381902L,
- 0.343651210821093611687224166251624444254L,
- 0.405948097827175151257603419529941300798L,
- 0.456473183882957921169800992232941517586L,
- 0.570248304776860782392105323292264026118L,
- 0.534779754769153667870756893044557559557L,
- 0.472965511839676757434979299779809656808L,
- 0.137335340499076127280155831169214403285L,
- 0.51975901660926295231312276736119435645L,
- 0.8085867293332018994761547260739912451L,
- 0.812416413241484848007226874256949892893L,
- 0.852994977709961112714176162016389410712L,
- 0.95270886248643660114015239563660004248L,
- 0.845133719240648570417568652136630304138L,
- 0.4074980021816323645978397907609428101L,
- 0.335850514497730546494305840184055599972L,
- 0.0882622233237065445998153436898044995127L,
- 0.936467561027640943446178111237050277205L,
- 0.56676472173638044722431698799123577376L,
- 0.528427769051008704179988533062745663408L,
- 0.460890427579778855697205646060084318038L,
- 0.754971897131798313468797543428083655928L,
- 0.980733597969419782109470537306886067907L,
- 0.204362127415649555111877580124343815074L,
- 0.424822548090499017266619697426652494042L,
- 0.790847149074521364262028407892114384257L,
- 0.559922683392730473870877613727301497865L,
- 0.779993507158626042106006393237738208875L,
- 0.30516368089713691312418593599115685319L,
- 0.68918765842229398168455844072311006826L,
- 0.972291357858071465096079542885284602882L,
- 0.92204286423973856982373873105566928589L,
- 0.488649453783638471576482476648021023315L,
- 0.467124744623849284659862825278549932824L,
- 0.548051233865943557014854568009331816852L,
- 0.306838990296265483205551142903402056051L,
- 0.497005516835688988273805238236922199451L,
- 0.341504433884138135798086132528045458722L,
- 0.969816416247460790089503289400709886528L,
- 0.63656435610220447227337751650167349487L,
- 0.83588076122262875881859751942918794857L,
- 0.647568600604975972308348018018445212894L,
- 0.916061870307308870029862807808332479077L,
- 0.767988745496844638880672392122527991445L,
- 0.1623230195628039449666927123215281227666L,
- 0.0791082835859634251558587844284289799848L,
- 0.575858643610197202634665099752882990844L,
- 0.559159434263749620344702466000799724913L,
- 0.063765998380760211208741798736948488376L,
- 0.230557913975359017084357477142151415967L,
- 0.702854691657277602758421942319022953845L,
- 0.789516660466782621905392733079230211954L,
- 0.491496186820051632244513986127898500904L,
- 0.171499215418269578563458417238340672634L,
- 0.626470061831746666081979158043673024967L,
- 0.258903137813870706268979320963343541457L,
- 0.64156850108405218894694811301875120511L,
- 0.534043520260340661507140771088018906496L,
- 0.388275182018399247097875416106759899469L,
- 0.920936363560998030495046998224168162945L,
- 0.826139404694006088220407338888245165242L,
- 0.343561253523163451528918423980552161597L,
- 0.921521003270491194867019217479780072647L,
- 0.656212467754097185125864111703195343744L,
- 0.628186262290474398328350301885606581942L,
- 0.573227336542237665153422986363073650388L,
- 0.94178975003001342039795597242477049832L,
- 0.0408103561362355768975182155847755354614L,
- 0.382581672073273072487550945526454964287L,
- 0.152851256046525520308098129538613498254L,
- 0.966735024597183045592313880114075824298L,
- 0.215564894798334550271993595018433286244L,
- 0.776491530531523589201618375156272004616L,
- 0.912460554179311241821569665648929177608L,
- 0.632880016212040018958086886452474382272L,
- 0.711577891112709305169603082360885583086L,
- 0.1120655756066491784920471129299439607153L,
- 0.691106483958832651050573402690448368687L,
- 0.227442567846797646970770128970529357636L,
- 0.837435613090485891584882062239924101455L,
- 0.524389161590691896070067767400758142565L,
- 0.591360583466508186135247682666313136762L,
- 0.103155847462960450706124014839446958843L,
- 0.98360160577671960281465138408293984545L,
- 0.197665014114674630647437622579741018817L,
- 0.1099709194312379594014239398842185159354L,
- 0.394053373921474751303577685990936074485L,
- 0.94945354787200894450508557094182436657L,
- 0.372593716084661547440393809983835348274L,
- 0.62514674616343692328572382301636412566L,
- 0.2001871481416310130073795585638383984926L,
- 0.148432902421401306477690922498335475507L,
- 0.687921673269487018193347305425182239764L,
- 0.470940334348984370262797433659013738143L,
- 0.1592476430730276812200821020958787823795L,
- 0.296776110696565927524970058176467314578L,
- 0.1491253105142218631726813695413369166796L,
- 0.579194717868638955003571989739802264354L,
- 0.0730543936466744761440131951539370917776L,
- 0.941296077873340797733875467209629660594L,
- 0.76720024949523806992504865943580486187L,
- 0.419526107681583337049761526455092560735L,
- 0.00688594806937144144337797612615981618743L,
- 0.931682704636487927763651991274577493318L,
- 0.660524215847727125058815911433184924133L,
- 0.71780972384903067744609138100002205676L,
- 0.02961791918271995070621856302848439458175L,
- 0.692791206212428997136050006631240567502L,
- 0.162762426697948445642880183096693062538L,
- 0.183637795551464341949019870428026949035L,
- 0.51263789620316407488619761125039609046L,
- 0.90238698122728366178818828411640824056L,
- 0.229784208410123517024401367798925386038L,
- 0.227218480059027721044118324890061381517L,
- 0.6555059570778176955459672492237825867L,
- 0.929815767583615624563413584598741896834L,
- 0.188559597559312695774663933876436875041L,
- 0.396184448063913762028147791554346199354L,
- 0.656329540957568516760105602115555736073L,
- 0.1410678455413176345310401990667063246115L,
- 0.621004667838855651847651367745487628637L,
- 0.01277988784767030635209958407461792778387L,
- 0.69482142276844418673788732511112265014L,
- 0.925705031133221932065307191539105635005L,
- 0.925744341385232535963050430363763081603L,
- 0.24189467813699258571134382505828701386L,
- 0.646009544609703485845605410919901799L,
- 0.051119212999532673562206731603906295406L,
- 0.85076142804383409765024452942896578158L
-};
diff --git a/gl/tests/setenv.c b/gl/tests/setenv.c
deleted file mode 100644
index 995a0f26a1..0000000000
--- a/gl/tests/setenv.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#if !_LIBC
-/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
- optimizes away the name == NULL test below. */
-# define _GL_ARG_NONNULL(params)
-
-# define _GL_USE_STDLIB_ALLOC 1
-# include <config.h>
-#endif
-
-#include <alloca.h>
-
-/* Specification. */
-#include <stdlib.h>
-
-#include <errno.h>
-#ifndef __set_errno
-# define __set_errno(ev) ((errno) = (ev))
-#endif
-
-#include <string.h>
-#if _LIBC || HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#if !_LIBC
-# include "malloca.h"
-#endif
-
-#if _LIBC || !HAVE_SETENV
-
-#if !_LIBC
-# define __environ environ
-#endif
-
-#if _LIBC
-/* This lock protects against simultaneous modifications of 'environ'. */
-# include <bits/libc-lock.h>
-__libc_lock_define_initialized (static, envlock)
-# define LOCK __libc_lock_lock (envlock)
-# define UNLOCK __libc_lock_unlock (envlock)
-#else
-# define LOCK
-# define UNLOCK
-#endif
-
-/* In the GNU C library we must keep the namespace clean. */
-#ifdef _LIBC
-# define setenv __setenv
-# define clearenv __clearenv
-# define tfind __tfind
-# define tsearch __tsearch
-#endif
-
-/* In the GNU C library implementation we try to be more clever and
- allow arbitrarily many changes of the environment given that the used
- values are from a small set. Outside glibc this will eat up all
- memory after a while. */
-#if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
- && defined __GNUC__)
-# define USE_TSEARCH 1
-# include <search.h>
-typedef int (*compar_fn_t) (const void *, const void *);
-
-/* This is a pointer to the root of the search tree with the known
- values. */
-static void *known_values;
-
-# define KNOWN_VALUE(Str) \
- ({ \
- void *value = tfind (Str, &known_values, (compar_fn_t) strcmp); \
- value != NULL ? *(char **) value : NULL; \
- })
-# define STORE_VALUE(Str) \
- tsearch (Str, &known_values, (compar_fn_t) strcmp)
-
-#else
-# undef USE_TSEARCH
-
-# define KNOWN_VALUE(Str) NULL
-# define STORE_VALUE(Str) do { } while (0)
-
-#endif
-
-
-/* If this variable is not a null pointer we allocated the current
- environment. */
-static char **last_environ;
-
-
-/* This function is used by 'setenv' and 'putenv'. The difference between
- the two functions is that for the former must create a new string which
- is then placed in the environment, while the argument of 'putenv'
- must be used directly. This is all complicated by the fact that we try
- to reuse values once generated for a 'setenv' call since we can never
- free the strings. */
-int
-__add_to_environ (const char *name, const char *value, const char *combined,
- int replace)
-{
- char **ep;
- size_t size;
- const size_t namelen = strlen (name);
- const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
-
- LOCK;
-
- /* We have to get the pointer now that we have the lock and not earlier
- since another thread might have created a new environment. */
- ep = __environ;
-
- size = 0;
- if (ep != NULL)
- {
- for (; *ep != NULL; ++ep)
- if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
- break;
- else
- ++size;
- }
-
- if (ep == NULL || *ep == NULL)
- {
- char **new_environ;
-#ifdef USE_TSEARCH
- char *new_value;
-#endif
-
- /* We allocated this space; we can extend it. */
- new_environ =
- (char **) (last_environ == NULL
- ? malloc ((size + 2) * sizeof (char *))
- : realloc (last_environ, (size + 2) * sizeof (char *)));
- if (new_environ == NULL)
- {
- /* It's easier to set errno to ENOMEM than to rely on the
- 'malloc-posix' and 'realloc-posix' gnulib modules. */
- __set_errno (ENOMEM);
- UNLOCK;
- return -1;
- }
-
- /* If the whole entry is given add it. */
- if (combined != NULL)
- /* We must not add the string to the search tree since it belongs
- to the user. */
- new_environ[size] = (char *) combined;
- else
- {
- /* See whether the value is already known. */
-#ifdef USE_TSEARCH
-# ifdef _LIBC
- new_value = (char *) alloca (namelen + 1 + vallen);
- __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
- value, vallen);
-# else
- new_value = (char *) malloca (namelen + 1 + vallen);
- if (new_value == NULL)
- {
- __set_errno (ENOMEM);
- UNLOCK;
- return -1;
- }
- memcpy (new_value, name, namelen);
- new_value[namelen] = '=';
- memcpy (&new_value[namelen + 1], value, vallen);
-# endif
-
- new_environ[size] = KNOWN_VALUE (new_value);
- if (new_environ[size] == NULL)
-#endif
- {
- new_environ[size] = (char *) malloc (namelen + 1 + vallen);
- if (new_environ[size] == NULL)
- {
-#if defined USE_TSEARCH && !defined _LIBC
- freea (new_value);
-#endif
- __set_errno (ENOMEM);
- UNLOCK;
- return -1;
- }
-
-#ifdef USE_TSEARCH
- memcpy (new_environ[size], new_value, namelen + 1 + vallen);
-#else
- memcpy (new_environ[size], name, namelen);
- new_environ[size][namelen] = '=';
- memcpy (&new_environ[size][namelen + 1], value, vallen);
-#endif
- /* And save the value now. We cannot do this when we remove
- the string since then we cannot decide whether it is a
- user string or not. */
- STORE_VALUE (new_environ[size]);
- }
-#if defined USE_TSEARCH && !defined _LIBC
- freea (new_value);
-#endif
- }
-
- if (__environ != last_environ)
- memcpy ((char *) new_environ, (char *) __environ,
- size * sizeof (char *));
-
- new_environ[size + 1] = NULL;
-
- last_environ = __environ = new_environ;
- }
- else if (replace)
- {
- char *np;
-
- /* Use the user string if given. */
- if (combined != NULL)
- np = (char *) combined;
- else
- {
-#ifdef USE_TSEARCH
- char *new_value;
-# ifdef _LIBC
- new_value = alloca (namelen + 1 + vallen);
- __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
- value, vallen);
-# else
- new_value = malloca (namelen + 1 + vallen);
- if (new_value == NULL)
- {
- __set_errno (ENOMEM);
- UNLOCK;
- return -1;
- }
- memcpy (new_value, name, namelen);
- new_value[namelen] = '=';
- memcpy (&new_value[namelen + 1], value, vallen);
-# endif
-
- np = KNOWN_VALUE (new_value);
- if (np == NULL)
-#endif
- {
- np = (char *) malloc (namelen + 1 + vallen);
- if (np == NULL)
- {
-#if defined USE_TSEARCH && !defined _LIBC
- freea (new_value);
-#endif
- __set_errno (ENOMEM);
- UNLOCK;
- return -1;
- }
-
-#ifdef USE_TSEARCH
- memcpy (np, new_value, namelen + 1 + vallen);
-#else
- memcpy (np, name, namelen);
- np[namelen] = '=';
- memcpy (&np[namelen + 1], value, vallen);
-#endif
- /* And remember the value. */
- STORE_VALUE (np);
- }
-#if defined USE_TSEARCH && !defined _LIBC
- freea (new_value);
-#endif
- }
-
- *ep = np;
- }
-
- UNLOCK;
-
- return 0;
-}
-
-int
-setenv (const char *name, const char *value, int replace)
-{
- if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- return __add_to_environ (name, value, NULL, replace);
-}
-
-/* The 'clearenv' was planned to be added to POSIX.1 but probably
- never made it. Nevertheless the POSIX.9 standard (POSIX bindings
- for Fortran 77) requires this function. */
-int
-clearenv (void)
-{
- LOCK;
-
- if (__environ == last_environ && __environ != NULL)
- {
- /* We allocated this environment so we can free it. */
- free (__environ);
- last_environ = NULL;
- }
-
- /* Clear the environment pointer removes the whole environment. */
- __environ = NULL;
-
- UNLOCK;
-
- return 0;
-}
-
-#ifdef _LIBC
-static void
-free_mem (void)
-{
- /* Remove all traces. */
- clearenv ();
-
- /* Now remove the search tree. */
- __tdestroy (known_values, free);
- known_values = NULL;
-}
-text_set_element (__libc_subfreeres, free_mem);
-
-
-# undef setenv
-# undef clearenv
-weak_alias (__setenv, setenv)
-weak_alias (__clearenv, clearenv)
-#endif
-
-#endif /* _LIBC || !HAVE_SETENV */
-
-/* The rest of this file is called into use when replacing an existing
- but buggy setenv. Known bugs include failure to diagnose invalid
- name, and consuming a leading '=' from value. */
-#if HAVE_SETENV
-
-# undef setenv
-# if !HAVE_DECL_SETENV
-extern int setenv (const char *, const char *, int);
-# endif
-# define STREQ(a, b) (strcmp (a, b) == 0)
-
-int
-rpl_setenv (const char *name, const char *value, int replace)
-{
- int result;
- if (!name || !*name || strchr (name, '='))
- {
- errno = EINVAL;
- return -1;
- }
- /* Call the real setenv even if replace is 0, in case implementation
- has underlying data to update, such as when environ changes. */
- result = setenv (name, value, replace);
- if (result == 0 && replace && *value == '=')
- {
- char *tmp = getenv (name);
- if (!STREQ (tmp, value))
- {
- int saved_errno;
- size_t len = strlen (value);
- tmp = malloca (len + 2);
- /* Since leading '=' is eaten, double it up. */
- *tmp = '=';
- memcpy (tmp + 1, value, len + 1);
- result = setenv (name, tmp, replace);
- saved_errno = errno;
- freea (tmp);
- errno = saved_errno;
- }
- }
- return result;
-}
-
-#endif /* HAVE_SETENV */
diff --git a/gl/strerror-override.c b/gl/tests/strerror-override.c
index d0ed2fb86a..d0ed2fb86a 100644
--- a/gl/strerror-override.c
+++ b/gl/tests/strerror-override.c
diff --git a/gl/strerror-override.h b/gl/tests/strerror-override.h
index 3b8f24b995..3b8f24b995 100644
--- a/gl/strerror-override.h
+++ b/gl/tests/strerror-override.h
diff --git a/gl/strerror.c b/gl/tests/strerror.c
index 80a2f2eea4..80a2f2eea4 100644
--- a/gl/strerror.c
+++ b/gl/tests/strerror.c
diff --git a/gl/tests/test-argp-2.sh b/gl/tests/test-argp-2.sh
deleted file mode 100755
index cd6cd499b1..0000000000
--- a/gl/tests/test-argp-2.sh
+++ /dev/null
@@ -1,113 +0,0 @@
-#! /bin/sh
-# Test suite for argp.
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
-# This file is part of the GNUlib Library.
-#
-# 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 <http://www.gnu.org/licenses/>. */
-
-TMP=argp.$$
-
-unset ARGP_HELP_FMT
-ERR=0
-
-func_compare() {
-# If argp was compiled without base_name, it will display full program name.
-# If run on mingw, it will display the program name with a .exe suffix.
- sed '1{
- s,: [^ ]*/test-argp,: test-argp,
- s,: test-argp\.exe,: test-argp,
- }' | LC_ALL=C tr -d '\r' | diff -c $TMP -
-}
-
-####
-# Test --usage output
-cat > $TMP <<EOT
-Usage: test-argp [-tvCSOlp?V] [-f FILE] [-r FILE] [-o[ARG]] [--test]
- [--file=FILE] [--input=FILE] [--read=FILE] [--verbose] [--cantiga]
- [--sonet] [--option] [--optional[=ARG]] [--limerick] [--poem]
- [--help] [--usage] [--version] ARGS...
-EOT
-
-./test-argp$EXEEXT --usage | func_compare || ERR=1
-
-####
-# Test working usage-indent format
-
-cat > $TMP <<EOT
-Usage: test-argp [-tvCSOlp?V] [-f FILE] [-r FILE] [-o[ARG]] [--test]
-[--file=FILE] [--input=FILE] [--read=FILE] [--verbose] [--cantiga] [--sonet]
-[--option] [--optional[=ARG]] [--limerick] [--poem] [--help] [--usage]
-[--version] ARGS...
-EOT
-
-ARGP_HELP_FMT='usage-indent=0' ./test-argp$EXEEXT --usage | func_compare || ERR=1
-
-####
-# Test --help output
-cat >$TMP <<EOT
-Usage: test-argp [OPTION...] ARGS...
-documentation string
-
- Main options
- -t, --test
-
- Option Group 1
- -f, -r, --file=FILE, --input=FILE, --read=FILE
- Option with a mandatory argument
- -v, --verbose Simple option without arguments
-
- Option Group 1.1
- -C, --cantiga create a cantiga
- -S, --sonet create a sonet
-
- Option Group 2
- -O, --option An option
-
- -o, --optional[=ARG] Option with an optional argument. ARG is one of
- the following:
-
- many many units
- one one unit
- two two units
-
- Option Group 2.1
- -l, --limerick create a limerick
- -p, --poem create a poem
-
- -?, --help give this help list
- --usage give a short usage message
- -V, --version print program version
-
-Mandatory or optional arguments to long options are also mandatory or optional
-for any corresponding short options.
-
-Report bugs to <>.
-EOT
-
-# Compare --help output, but filter out any bug-reporting email address.
-./test-argp$EXEEXT --help \
- | sed 's/^\(Report bugs to \)<[^>]*>.$/\1<>./' | func_compare || ERR=1
-
-####
-# Test ambiguous option handling
-
-./test-argp$EXEEXT --optio 2>/dev/null && ERR=1
-
-####
-# Run built-in tests
-./test-argp$EXEEXT || ERR=1
-
-rm $TMP
-
-exit $ERR
diff --git a/gl/tests/test-argp.c b/gl/tests/test-argp.c
deleted file mode 100644
index a96dee86a1..0000000000
--- a/gl/tests/test-argp.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/* Test suite for argp.
- Copyright (C) 2006-2007, 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNUlib Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "argp.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#include "progname.h"
-
-struct test_args
-{
- int test;
- int verbose;
- char *file;
- int read;
- char *hidden;
- int opt;
- char *optional;
- int optional_set;
- int group_2_1_option;
- int group_1_1_option;
-};
-
-static struct argp_option group1_option[] = {
- { NULL, 0, NULL, 0, "Option Group 1", 0 },
- { "verbose", 'v', NULL, 0, "Simple option without arguments", 1 },
- { "file", 'f', "FILE", 0, "Option with a mandatory argument", 1 },
- { "input", 0, NULL, OPTION_ALIAS, NULL, 1 },
- { "read", 'r', NULL, OPTION_ALIAS, NULL, 1 },
- { "hidden", 'H', "FILE", OPTION_HIDDEN, "Hidden option", 1 },
- { NULL, 0, NULL, 0, NULL, 0 }
-};
-
-static error_t
-group1_parser (int key, char *arg, struct argp_state *state)
-{
- struct test_args *args = state->input;
-
- switch (key)
- {
- case 'v':
- args->verbose++;
- break;
-
- case 'r':
- args->read = 1;
- /* fall through */
- case 'f':
- args->file = arg;
- break;
-
- case 'H':
- args->hidden = arg;
- break;
-
- default:
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
-}
-
-struct argp group1_argp = {
- group1_option,
- group1_parser
-};
-
-struct argp_child group1_child = {
- &group1_argp,
- 0,
- "",
- 1
-};
-
-
-static struct argp_option group1_1_option[] = {
- { NULL, 0, NULL, 0, "Option Group 1.1", 0 },
- { "cantiga", 'C', NULL, 0, "create a cantiga" },
- { "sonet", 'S', NULL, 0, "create a sonet" },
- { NULL, 0, NULL, 0, NULL, 0 }
-};
-
-static error_t
-group1_1_parser (int key, char *arg, struct argp_state *state)
-{
- struct test_args *args = state->input;
- switch (key)
- {
- case 'C':
- case 'S':
- args->group_1_1_option = key;
- break;
- default:
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
-}
-
-struct argp group1_1_argp = {
- group1_1_option,
- group1_1_parser
-};
-
-struct argp_child group1_1_child = {
- &group1_1_argp,
- 0,
- "",
- 2
-};
-
-
-static struct argp_option group2_option[] = {
- { NULL, 0, NULL, 0, "Option Group 2", 0 },
- { "option", 'O', NULL, 0, "An option", 1 },
- { "optional", 'o', "ARG", OPTION_ARG_OPTIONAL,
- "Option with an optional argument. ARG is one of the following:", 2 },
- { "one", 0, NULL, OPTION_DOC | OPTION_NO_TRANS, "one unit", 3 },
- { "two", 0, NULL, OPTION_DOC | OPTION_NO_TRANS, "two units", 3 },
- { "many", 0, NULL, OPTION_DOC | OPTION_NO_TRANS, "many units", 3 },
- { NULL, 0, NULL, 0, NULL, 0 }
-};
-
-static error_t
-group2_parser (int key, char *arg, struct argp_state *state)
-{
- struct test_args *args = state->input;
-
- switch (key)
- {
- case 'O':
- args->opt = 1;
- break;
-
- case 'o':
- args->optional_set = 1;
- args->optional = arg;
- break;
-
- default:
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
-}
-
-struct argp group2_argp = {
- group2_option,
- group2_parser
-};
-
-struct argp_child group2_child = {
- &group2_argp,
- 0,
- "",
- 2
-};
-
-
-static struct argp_option group2_1_option[] = {
- { NULL, 0, NULL, 0, "Option Group 2.1", 0 },
- { "poem", 'p', NULL, 0, "create a poem" },
- { "limerick", 'l', NULL, 0, "create a limerick" },
- { NULL, 0, NULL, 0, NULL, 0 }
-};
-
-static error_t
-group2_1_parser (int key, char *arg, struct argp_state *state)
-{
- struct test_args *args = state->input;
- switch (key)
- {
- case 'p':
- case 'e':
- args->group_2_1_option = key;
- break;
- default:
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
-}
-
-struct argp group2_1_argp = {
- group2_1_option,
- group2_1_parser
-};
-
-struct argp_child group2_1_child = {
- &group2_1_argp,
- 0,
- "",
- 2
-};
-
-
-static struct argp_option main_options[] = {
- { NULL, 0, NULL, 0, "Main options", 0 },
- { "test", 't', NULL, 0, NULL, 1 },
- { NULL, 0, NULL, 0, NULL, 0 }
-};
-
-static error_t
-parse_opt (int key, char *arg, struct argp_state *state)
-{
- struct test_args *args = state->input;
- int i;
-
- switch (key)
- {
- case ARGP_KEY_INIT:
- for (i = 0; state->root_argp->children[i].argp; i++)
- state->child_inputs[i] = args;
- break;
-
- case 't':
- args->test = 1;
- break;
-
- default:
- return ARGP_ERR_UNKNOWN;
- }
- return 0;
-}
-
-const char *argp_program_version = "test_argp (" PACKAGE_NAME ") " VERSION;
-const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
-static char doc[] = "documentation string";
-
-struct argp test_argp = {
- main_options,
- parse_opt,
- "ARGS...",
- doc,
- NULL,
- NULL,
- NULL
-};
-
-#define NARGS(a) (sizeof(a) / sizeof((a)[0]) - 1)
-#define ARGV0 "test-argp"
-#define init_args(a) memset (&(a), 0, sizeof (a));
-
-#define INIT_TEST_COMMON(n) \
- int argc = NARGS (argv); \
- struct test_args test_args; \
- init_args (test_args); \
- test_number = n;
-
-#define INIT_TEST1(n, arg1) \
- char *argv[] = { ARGV0, arg1, NULL }; \
- INIT_TEST_COMMON (n)
-
-#define INIT_TEST2(n, arg1, arg2) \
- char *argv[] = { ARGV0, arg1, arg2, NULL }; \
- INIT_TEST_COMMON (n)
-
-#define INIT_TEST3(n, arg1, arg2, arg3) \
- char *argv[] = { ARGV0, arg1, arg2, arg3, NULL }; \
- INIT_TEST_COMMON (n)
-
-int test_number;
-unsigned failure_count = 0;
-
-void
-fail (const char *msg)
-{
- fprintf (stderr, "Test %d: %s\n", test_number, msg);
- failure_count++;
-}
-
-void
-test1 (struct argp *argp)
-{
- INIT_TEST1 (1, "--test");
- if (argp_parse (argp, argc, argv, 0, NULL, &test_args))
- fail ("argp_parse failed");
- else if (test_args.test != 1)
- fail ("option not processed");
-}
-
-void
-test2 (struct argp *argp)
-{
- INIT_TEST1 (2, "-t");
- if (argp_parse (argp, argc, argv, 0, NULL, &test_args))
- fail ("argp_parse failed");
- else if (test_args.test != 1)
- fail ("option not processed");
-}
-
-void
-test_file (struct argp *argp, int argc, char **argv, struct test_args *args)
-{
- if (argp_parse (argp, argc, argv, 0, NULL, args))
- fail ("argp_parse failed");
- else if (!args->file)
- fail ("option not processed");
- else if (strcmp (args->file, "FILE"))
- fail ("option processed incorrectly");
-}
-
-void
-test3 (struct argp *argp)
-{
- INIT_TEST1 (3, "--file=FILE");
- test_file (argp, argc, argv, &test_args);
-}
-
-void
-test4 (struct argp *argp)
-{
- INIT_TEST2 (4, "--file", "FILE");
- test_file (argp, argc, argv, &test_args);
-}
-
-void
-test5 (struct argp *argp)
-{
- INIT_TEST1 (5, "--input=FILE");
- test_file (argp, argc, argv, &test_args);
-}
-
-void
-test6 (struct argp *argp)
-{
- INIT_TEST2 (6, "--input", "FILE");
- test_file (argp, argc, argv, &test_args);
-}
-
-void
-test_optional (struct argp *argp, int argc, char **argv,
- struct test_args *args, const char *val, const char *a)
-{
- int index;
- if (argp_parse (argp, argc, argv, 0, &index, args))
- fail ("argp_parse failed");
- else if (!args->optional_set)
- fail ("option not processed");
-
- if (!val)
- {
- if (args->optional)
- fail ("option processed incorrectly");
- }
- else if (strcmp (args->optional, val))
- fail ("option processed incorrectly");
-
- if (a)
- {
- if (index == argc)
- fail ("expected command line argument not found");
- else if (strcmp (argv[index], a))
- fail ("expected command line argument does not match");
- }
-}
-
-void
-test7 (struct argp *argp)
-{
- INIT_TEST1 (7, "-oARG");
- test_optional (argp, argc, argv, &test_args, "ARG", NULL);
-}
-
-void
-test8 (struct argp *argp)
-{
- INIT_TEST2 (8, "-o", "ARG");
- test_optional (argp, argc, argv, &test_args, NULL, "ARG");
-}
-
-void
-test9 (struct argp *argp)
-{
- INIT_TEST1 (9, "--optional=ARG");
- test_optional (argp, argc, argv, &test_args, "ARG", NULL);
-}
-
-void
-test10 (struct argp *argp)
-{
- INIT_TEST2 (10, "--optional", "ARG");
- test_optional (argp, argc, argv, &test_args, NULL, "ARG");
-}
-
-void
-test11 (struct argp *argp)
-{
- INIT_TEST1 (11, "--optiona=ARG");
- test_optional (argp, argc, argv, &test_args, "ARG", NULL);
-}
-
-void
-test12 (struct argp *argp)
-{
- INIT_TEST3 (12, "--option", "--optional=OPT", "FILE");
- test_optional (argp, argc, argv, &test_args, "OPT", "FILE");
-}
-
-void
-test13 (struct argp *argp)
-{
- INIT_TEST1 (1, "--cantiga");
- if (argp_parse (argp, argc, argv, 0, NULL, &test_args))
- fail ("argp_parse failed");
- else if (test_args.group_1_1_option != 'C')
- fail ("option not processed");
-}
-
-void
-test14 (struct argp *argp)
-{
- INIT_TEST1 (1, "--limerick");
- if (argp_parse (argp, argc, argv, 0, NULL, &test_args))
- fail ("argp_parse failed");
- else if (test_args.group_2_1_option != 'l')
- fail ("option not processed");
-}
-
-void
-test15 (struct argp *argp)
-{
- INIT_TEST2 (1, "-r", "FILE");
- test_file (argp, argc, argv, &test_args);
- if (!test_args.read)
- fail ("short alias not recognized properly");
-}
-
-
-typedef void (*test_fp) (struct argp *argp);
-
-test_fp test_fun[] = {
- test1, test2, test3, test4,
- test5, test6, test7, test8,
- test9, test10, test11, test12,
- test13, test14, test15,
- NULL
-};
-
-int
-main (int argc, char **argv)
-{
- struct argp_child argp_children[3], group1_children[2], group2_children[2];
- test_fp *fun;
-
- set_program_name (argv[0]);
-
- group1_children[0] = group1_1_child;
- group1_children[1].argp = NULL;
- group1_argp.children = group1_children;
-
- group2_children[0] = group2_1_child;
- group2_children[1].argp = NULL;
- group2_argp.children = group2_children;
-
- argp_children[0] = group1_child;
- argp_children[1] = group2_child;
- argp_children[2].argp = NULL;
- test_argp.children = argp_children;
-
- if (argc > 0)
- {
- struct test_args test_args;
- init_args (test_args);
- return argp_parse (&test_argp, argc, argv, 0, NULL, &test_args);
- }
-
- for (fun = test_fun; *fun; fun++)
- (*fun) (&test_argp);
-
- if (failure_count)
- return 1;
-
- return 0;
-}
diff --git a/gl/tests/test-dirent.c b/gl/tests/test-dirent.c
deleted file mode 100644
index 34ef5d94e6..0000000000
--- a/gl/tests/test-dirent.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Test of <dirent.h> substitute.
- Copyright (C) 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Eric Blake <ebb9@byu.net>, 2009. */
-
-#include <config.h>
-
-#include <dirent.h>
-
-/* Check for existence of required types. */
-static DIR *dir _GL_UNUSED;
-static struct dirent d;
-static ino_t i;
-
-int
-main (void)
-{
- return d.d_name[0] + i;
-}
diff --git a/gl/tests/test-environ.c b/gl/tests/test-environ.c
deleted file mode 100644
index cb3d9f6021..0000000000
--- a/gl/tests/test-environ.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Test of environ variable.
- Copyright (C) 2008-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include <string.h>
-
-int
-main ()
-{
- /* The environment variables that are set even in the weirdest situations
- are HOME and PATH.
- POSIX says that HOME is initialized by the system, and that PATH may be
- unset. But in practice it's more frequent to see HOME unset and PATH
- set. So we test the presence of PATH. */
- char **remaining_variables = environ;
- char *string;
-
- for (; (string = *remaining_variables) != NULL; remaining_variables++)
- {
- if (strncmp (string, "PATH=", 5) == 0)
- /* Found the PATH environment variable. */
- return 0;
- }
- /* Failed to find the PATH environment variable. */
- return 1;
-}
diff --git a/gl/tests/test-fprintf-posix.h b/gl/tests/test-fprintf-posix.h
deleted file mode 100644
index a5b72c781a..0000000000
--- a/gl/tests/test-fprintf-posix.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Test of POSIX compatible vsprintf() and sprintf() functions.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include "infinity.h"
-
-static void
-test_function (int (*my_fprintf) (FILE *, const char *, ...))
-{
- /* Here we don't test output that may be platform dependent.
- The bulk of the tests is done as part of the 'vasnprintf-posix' module. */
-
- /* Test support of size specifiers as in C99. */
-
- my_fprintf (stdout, "%ju %d\n", (uintmax_t) 12345671, 33, 44, 55);
-
- my_fprintf (stdout, "%zu %d\n", (size_t) 12345672, 33, 44, 55);
-
- my_fprintf (stdout, "%tu %d\n", (ptrdiff_t) 12345673, 33, 44, 55);
-
- /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
- output of floating-point numbers. */
-
- /* Positive zero. */
- my_fprintf (stdout, "%a %d\n", 0.0, 33, 44, 55);
-
- /* Positive infinity. */
- my_fprintf (stdout, "%a %d\n", Infinityd (), 33, 44, 55);
-
- /* Negative infinity. */
- my_fprintf (stdout, "%a %d\n", - Infinityd (), 33, 44, 55);
-
- /* FLAG_ZERO with infinite number. */
- my_fprintf (stdout, "%010a %d\n", Infinityd (), 33, 44, 55);
-
- /* Test the support of the %f format directive. */
-
- /* A positive number. */
- my_fprintf (stdout, "%f %d\n", 12.75, 33, 44, 55);
-
- /* A larger positive number. */
- my_fprintf (stdout, "%f %d\n", 1234567.0, 33, 44, 55);
-
- /* A negative number. */
- my_fprintf (stdout, "%f %d\n", -0.03125, 33, 44, 55);
-
- /* Positive zero. */
- my_fprintf (stdout, "%f %d\n", 0.0, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_fprintf (stdout, "%015f %d\n", 1234.0, 33, 44, 55);
-
- /* Precision. */
- my_fprintf (stdout, "%.f %d\n", 1234.0, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_fprintf (stdout, "%.2f %d\n", 999.95, 33, 44, 55);
-
- /* Precision with rounding. */
- my_fprintf (stdout, "%.2f %d\n", 999.996, 33, 44, 55);
-
- /* A positive number. */
- my_fprintf (stdout, "%Lf %d\n", 12.75L, 33, 44, 55);
-
- /* A larger positive number. */
- my_fprintf (stdout, "%Lf %d\n", 1234567.0L, 33, 44, 55);
-
- /* A negative number. */
- my_fprintf (stdout, "%Lf %d\n", -0.03125L, 33, 44, 55);
-
- /* Positive zero. */
- my_fprintf (stdout, "%Lf %d\n", 0.0L, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_fprintf (stdout, "%015Lf %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision. */
- my_fprintf (stdout, "%.Lf %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_fprintf (stdout, "%.2Lf %d\n", 999.95L, 33, 44, 55);
-
- /* Precision with rounding. */
- my_fprintf (stdout, "%.2Lf %d\n", 999.996L, 33, 44, 55);
-
- /* Test the support of the %F format directive. */
-
- /* A positive number. */
- my_fprintf (stdout, "%F %d\n", 12.75, 33, 44, 55);
-
- /* A larger positive number. */
- my_fprintf (stdout, "%F %d\n", 1234567.0, 33, 44, 55);
-
- /* A negative number. */
- my_fprintf (stdout, "%F %d\n", -0.03125, 33, 44, 55);
-
- /* Positive zero. */
- my_fprintf (stdout, "%F %d\n", 0.0, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_fprintf (stdout, "%015F %d\n", 1234.0, 33, 44, 55);
-
- /* Precision. */
- my_fprintf (stdout, "%.F %d\n", 1234.0, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_fprintf (stdout, "%.2F %d\n", 999.95, 33, 44, 55);
-
- /* Precision with rounding. */
- my_fprintf (stdout, "%.2F %d\n", 999.996, 33, 44, 55);
-
- /* A positive number. */
- my_fprintf (stdout, "%LF %d\n", 12.75L, 33, 44, 55);
-
- /* A larger positive number. */
- my_fprintf (stdout, "%LF %d\n", 1234567.0L, 33, 44, 55);
-
- /* A negative number. */
- my_fprintf (stdout, "%LF %d\n", -0.03125L, 33, 44, 55);
-
- /* Positive zero. */
- my_fprintf (stdout, "%LF %d\n", 0.0L, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_fprintf (stdout, "%015LF %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision. */
- my_fprintf (stdout, "%.LF %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_fprintf (stdout, "%.2LF %d\n", 999.95L, 33, 44, 55);
-
- /* Precision with rounding. */
- my_fprintf (stdout, "%.2LF %d\n", 999.996L, 33, 44, 55);
-
- /* Test the support of the POSIX/XSI format strings with positions. */
-
- my_fprintf (stdout, "%2$d %1$d\n", 33, 55);
-}
diff --git a/gl/tests/test-frexp.c b/gl/tests/test-frexp.c
deleted file mode 100644
index 6e3e000931..0000000000
--- a/gl/tests/test-frexp.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Test of splitting a double into fraction and mantissa.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <math.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (frexp, double, (double, int *));
-
-#include <float.h>
-
-#include "isnand-nolibm.h"
-#include "minus-zero.h"
-#include "infinity.h"
-#include "nan.h"
-#include "macros.h"
-
-/* Avoid some warnings from "gcc -Wshadow".
- This file doesn't use the exp() function. */
-#undef exp
-#define exp exponent
-
-#undef INFINITY
-#undef NAN
-
-#define DOUBLE double
-/* The use of 'volatile' guarantees that excess precision bits are dropped
- when dealing with denormalized numbers. It is necessary on x86 systems
- where double-floats are not IEEE compliant by default, to avoid that the
- results become platform and compiler option dependent. 'volatile' is a
- portable alternative to gcc's -ffloat-store option. */
-#define VOLATILE volatile
-#define ISNAN isnand
-#define INFINITY Infinityd ()
-#define NAN NaNd ()
-#define L_(literal) literal
-#define MINUS_ZERO minus_zerod
-#define MAX_EXP DBL_MAX_EXP
-#define MIN_EXP DBL_MIN_EXP
-#define MIN_NORMAL_EXP DBL_MIN_EXP
-#define FREXP frexp
-#define RANDOM randomd
-#include "test-frexp.h"
-
-int
-main ()
-{
- test_function ();
-
- return 0;
-}
diff --git a/gl/tests/test-frexp.h b/gl/tests/test-frexp.h
deleted file mode 100644
index e50be148ae..0000000000
--- a/gl/tests/test-frexp.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Test of splitting a double into fraction and mantissa.
- Copyright (C) 2012-2013 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 <http://www.gnu.org/licenses/>. */
-
-static DOUBLE
-my_ldexp (DOUBLE x, int d)
-{
- for (; d > 0; d--)
- x *= L_(2.0);
- for (; d < 0; d++)
- x *= L_(0.5);
- return x;
-}
-
-static void
-test_function (void)
-{
- int i;
- VOLATILE DOUBLE x;
-
- { /* NaN. */
- int exp = -9999;
- DOUBLE mantissa;
- x = NAN;
- mantissa = FREXP (x, &exp);
- ASSERT (ISNAN (mantissa));
- }
-
- { /* Positive infinity. */
- int exp = -9999;
- DOUBLE mantissa;
- x = INFINITY;
- mantissa = FREXP (x, &exp);
- ASSERT (mantissa == x);
- }
-
- { /* Negative infinity. */
- int exp = -9999;
- DOUBLE mantissa;
- x = - INFINITY;
- mantissa = FREXP (x, &exp);
- ASSERT (mantissa == x);
- }
-
- { /* Positive zero. */
- int exp = -9999;
- DOUBLE mantissa;
- x = L_(0.0);
- mantissa = FREXP (x, &exp);
- ASSERT (exp == 0);
- ASSERT (mantissa == x);
- ASSERT (!signbit (mantissa));
- }
-
- { /* Negative zero. */
- int exp = -9999;
- DOUBLE mantissa;
- x = MINUS_ZERO;
- mantissa = FREXP (x, &exp);
- ASSERT (exp == 0);
- ASSERT (mantissa == x);
- ASSERT (signbit (mantissa));
- }
-
- for (i = 1, x = L_(1.0); i <= MAX_EXP; i++, x *= L_(2.0))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.5));
- }
- for (i = 1, x = L_(1.0); i >= MIN_NORMAL_EXP; i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.5));
- }
- for (; i >= MIN_EXP - 100 && x > L_(0.0); i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.5));
- }
-
- for (i = 1, x = - L_(1.0); i <= MAX_EXP; i++, x *= L_(2.0))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == - L_(0.5));
- }
- for (i = 1, x = - L_(1.0); i >= MIN_NORMAL_EXP; i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == - L_(0.5));
- }
- for (; i >= MIN_EXP - 100 && x < L_(0.0); i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == - L_(0.5));
- }
-
- for (i = 1, x = L_(1.01); i <= MAX_EXP; i++, x *= L_(2.0))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.505));
- }
- for (i = 1, x = L_(1.01); i >= MIN_NORMAL_EXP; i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.505));
- }
- for (; i >= MIN_EXP - 100 && x > L_(0.0); i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa >= L_(0.5));
- ASSERT (mantissa < L_(1.0));
- ASSERT (mantissa == my_ldexp (x, - exp));
- }
-
- for (i = 1, x = L_(1.73205); i <= MAX_EXP; i++, x *= L_(2.0))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.866025));
- }
- for (i = 1, x = L_(1.73205); i >= MIN_NORMAL_EXP; i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i);
- ASSERT (mantissa == L_(0.866025));
- }
- for (; i >= MIN_EXP - 100 && x > L_(0.0); i--, x *= L_(0.5))
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (exp == i || exp == i + 1);
- ASSERT (mantissa >= L_(0.5));
- ASSERT (mantissa < L_(1.0));
- ASSERT (mantissa == my_ldexp (x, - exp));
- }
-
- /* Randomized tests. */
- for (i = 0; i < SIZEOF (RANDOM); i++)
- {
- x = L_(20.0) * RANDOM[i] - L_(10.0); /* -10.0 <= x <= 10.0 */
- {
- int exp = -9999;
- DOUBLE mantissa = FREXP (x, &exp);
- ASSERT (x == my_ldexp (mantissa, exp));
- }
- }
-}
diff --git a/gl/tests/test-frexpl.c b/gl/tests/test-frexpl.c
deleted file mode 100644
index 5a5eae52c4..0000000000
--- a/gl/tests/test-frexpl.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Test of splitting a 'long double' into fraction and mantissa.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <math.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (frexpl, long double, (long double, int *));
-
-#include <float.h>
-
-#include "fpucw.h"
-#include "isnanl-nolibm.h"
-#include "minus-zero.h"
-#include "infinity.h"
-#include "nan.h"
-#include "macros.h"
-
-/* Avoid some warnings from "gcc -Wshadow".
- This file doesn't use the exp() function. */
-#undef exp
-#define exp exponent
-
-#undef INFINITY
-#undef NAN
-
-#define DOUBLE long double
-#define VOLATILE
-#define ISNAN isnanl
-#define INFINITY Infinityl ()
-#define NAN NaNl ()
-#define L_(literal) literal##L
-#define MINUS_ZERO minus_zerol
-#define MAX_EXP LDBL_MAX_EXP
-#define MIN_EXP LDBL_MIN_EXP
-/* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
- exponent for 'long double' is -964. Similarly, on PowerPC machines,
- LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double'
- is -968. For exponents below that, the precision may be truncated to the
- precision used for 'double'. */
-#ifdef __sgi
-# define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57)
-#elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__
-# define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53)
-#else
-# define MIN_NORMAL_EXP LDBL_MIN_EXP
-#endif
-#define FREXP frexpl
-#define RANDOM randoml
-#include "test-frexp.h"
-
-int
-main ()
-{
- DECL_LONG_DOUBLE_ROUNDING
-
- BEGIN_LONG_DOUBLE_ROUNDING ();
-
- test_function ();
-
- return 0;
-}
diff --git a/gl/tests/test-fseterr.c b/gl/tests/test-fseterr.c
deleted file mode 100644
index 7390b46638..0000000000
--- a/gl/tests/test-fseterr.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Test setting the error indicator of a stream.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include "fseterr.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
- /* All streams are initially created with the error indicator cleared. */
- if (ferror (stdout))
- abort ();
-
- /* Verify that fseterr() works. */
- fseterr (stdout);
- if (!ferror (stdout))
- abort ();
-
- /* Verify fseterr's effect can be undone by clearerr(). */
- clearerr (stdout);
- if (ferror (stdout))
- abort ();
-
- return 0;
-}
diff --git a/gl/tests/test-getopt.c b/gl/tests/test-getopt.c
deleted file mode 100644
index 7caf0273fd..0000000000
--- a/gl/tests/test-getopt.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Test of command line argument processing.
- Copyright (C) 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
-
-#include <config.h>
-
-/* None of the files accessed by this test are large, so disable the
- ftell link warning if we are not using the gnulib ftell module. */
-#define _GL_NO_LARGE_FILES
-
-#if GNULIB_TEST_GETOPT_GNU
-# include <getopt.h>
-
-# ifndef __getopt_argv_const
-# define __getopt_argv_const const
-# endif
-# include "signature.h"
-SIGNATURE_CHECK (getopt_long, int, (int, char *__getopt_argv_const *,
- char const *, struct option const *,
- int *));
-SIGNATURE_CHECK (getopt_long_only, int, (int, char *__getopt_argv_const *,
- char const *, struct option const *,
- int *));
-
-#endif
-
-#include <unistd.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (getopt, int, (int, char * const[], char const *));
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* This test intentionally remaps stderr. So, we arrange to have fd 10
- (outside the range of interesting fd's during the test) set up to
- duplicate the original stderr. */
-
-#define BACKUP_STDERR_FILENO 10
-#define ASSERT_STREAM myerr
-#include "macros.h"
-
-static FILE *myerr;
-
-#include "test-getopt.h"
-#if GNULIB_TEST_GETOPT_GNU
-# include "test-getopt_long.h"
-#endif
-
-int
-main (void)
-{
- /* This test validates that stderr is used correctly, so move the
- original into fd 10. */
- if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO
- || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL)
- return 2;
-
- ASSERT (freopen ("test-getopt.tmp", "w", stderr) == stderr);
-
- /* These default values are required by POSIX. */
- ASSERT (optind == 1);
- ASSERT (opterr != 0);
-
- setenv ("POSIXLY_CORRECT", "1", 1);
- test_getopt ();
-
-#if GNULIB_TEST_GETOPT_GNU
- test_getopt_long_posix ();
-#endif
-
- unsetenv ("POSIXLY_CORRECT");
- test_getopt ();
-
-#if GNULIB_TEST_GETOPT_GNU
- test_getopt_long ();
- test_getopt_long_only ();
-#endif
-
- ASSERT (fclose (stderr) == 0);
- ASSERT (remove ("test-getopt.tmp") == 0);
-
- return 0;
-}
diff --git a/gl/tests/test-getopt.h b/gl/tests/test-getopt.h
deleted file mode 100644
index 450cf0d31a..0000000000
--- a/gl/tests/test-getopt.h
+++ /dev/null
@@ -1,1391 +0,0 @@
-/* Test of command line argument processing.
- Copyright (C) 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
-
-#include <stdbool.h>
-
-/* The glibc/gnulib implementation of getopt supports setting optind =
- 0, but not all other implementations do. This matters for getopt.
- But for getopt_long, we require GNU compatibility. */
-#if defined __GETOPT_PREFIX || (__GLIBC__ >= 2 && !defined __UCLIBC__)
-# define OPTIND_MIN 0
-#elif HAVE_DECL_OPTRESET
-# define OPTIND_MIN (optreset = 1)
-#else
-# define OPTIND_MIN 1
-#endif
-
-static void
-getopt_loop (int argc, const char **argv,
- const char *options,
- int *a_seen, int *b_seen,
- const char **p_value, const char **q_value,
- int *non_options_count, const char **non_options,
- int *unrecognized, bool *message_issued)
-{
- int c;
- int pos = ftell (stderr);
-
- while ((c = getopt (argc, (char **) argv, options)) != -1)
- {
- switch (c)
- {
- case 'a':
- (*a_seen)++;
- break;
- case 'b':
- (*b_seen)++;
- break;
- case 'p':
- *p_value = optarg;
- break;
- case 'q':
- *q_value = optarg;
- break;
- case '\1':
- /* Must only happen with option '-' at the beginning. */
- ASSERT (options[0] == '-');
- non_options[(*non_options_count)++] = optarg;
- break;
- case ':':
- /* Must only happen with option ':' at the beginning. */
- ASSERT (options[0] == ':'
- || ((options[0] == '-' || options[0] == '+')
- && options[1] == ':'));
- /* fall through */
- case '?':
- *unrecognized = optopt;
- break;
- default:
- *unrecognized = c;
- break;
- }
- }
-
- *message_issued = pos < ftell (stderr);
-}
-
-static void
-test_getopt (void)
-{
- int start;
- bool posixly = !!getenv ("POSIXLY_CORRECT");
- /* See comment in getopt.c:
- glibc gets a LSB-compliant getopt.
- Standalone applications get a POSIX-compliant getopt. */
-#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
- /* Using getopt from gnulib or from a non-glibc system. */
- posixly = true;
-#endif
-
- /* Test processing of boolean options. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "ab",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-b";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "ab",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-ba";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "ab",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-ab";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "ab",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 2);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- ASSERT (!output);
- }
-
- /* Test processing of options with arguments. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-pfoo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "p:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "p:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-ab";
- argv[argc++] = "-q";
- argv[argc++] = "baz";
- argv[argc++] = "-pfoo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- ASSERT (!output);
- }
-
-#if GNULIB_TEST_GETOPT_GNU
- /* Test processing of options with optional arguments. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-pfoo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "p::q::",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "p::q::",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp::q::",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- ASSERT (!output);
- }
-#endif /* GNULIB_TEST_GETOPT_GNU */
-
- /* Check that invalid options are recognized; and that both opterr
- and leading ':' can silence output. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-x";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 42;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'x');
- ASSERT (optind == 5);
- ASSERT (output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-x";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 0;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'x');
- ASSERT (optind == 5);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-x";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, ":abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'x');
- ASSERT (optind == 5);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-:";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 42;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == ':');
- ASSERT (optind == 5);
- ASSERT (output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-:";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 0;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == ':');
- ASSERT (optind == 5);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-:";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, ":abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == ':');
- ASSERT (optind == 5);
- ASSERT (!output);
- }
-
- /* Check for missing argument behavior. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-ap";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'p');
- ASSERT (optind == 2);
- ASSERT (output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-ap";
- argv[argc] = NULL;
- optind = start;
- opterr = 0;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'p');
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-ap";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, ":abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'p');
- ASSERT (optind == 2);
- ASSERT (!output);
- }
-
- /* Check that by default, non-options arguments are moved to the end. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- if (posixly)
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
- else
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "donald") == 0);
- ASSERT (strcmp (argv[5], "duck") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- ASSERT (!output);
- }
- }
-
- /* Check that '--' ends the argument processing. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[20];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "--";
- argv[argc++] = "-b";
- argv[argc++] = "foo";
- argv[argc++] = "-q";
- argv[argc++] = "johnny";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- if (posixly)
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "--") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
- else
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "--") == 0);
- ASSERT (strcmp (argv[5], "donald") == 0);
- ASSERT (strcmp (argv[6], "duck") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- ASSERT (!output);
- }
- }
-
-#if GNULIB_TEST_GETOPT_GNU
- /* Check that the '-' flag causes non-options to be returned in order. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "-abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 3);
- ASSERT (strcmp (non_options[0], "donald") == 0);
- ASSERT (strcmp (non_options[1], "duck") == 0);
- ASSERT (strcmp (non_options[2], "bar") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 7);
- ASSERT (!output);
- }
-
- /* Check that '--' ends the argument processing. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[20];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "--";
- argv[argc++] = "-b";
- argv[argc++] = "foo";
- argv[argc++] = "-q";
- argv[argc++] = "johnny";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "-abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "--") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (!output);
- if (non_options_count == 2)
- {
- /* glibc behaviour. */
- ASSERT (non_options_count == 2);
- ASSERT (strcmp (non_options[0], "donald") == 0);
- ASSERT (strcmp (non_options[1], "duck") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 7);
- }
- else
- {
- /* Another valid behaviour. */
- ASSERT (non_options_count == 7);
- ASSERT (strcmp (non_options[0], "donald") == 0);
- ASSERT (strcmp (non_options[1], "duck") == 0);
- ASSERT (strcmp (non_options[2], "-b") == 0);
- ASSERT (strcmp (non_options[3], "foo") == 0);
- ASSERT (strcmp (non_options[4], "-q") == 0);
- ASSERT (strcmp (non_options[5], "johnny") == 0);
- ASSERT (strcmp (non_options[6], "bar") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 12);
- }
- }
-
- /* Check that the '-' flag has to come first. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp:q:-",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- if (posixly)
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
- else
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "donald") == 0);
- ASSERT (strcmp (argv[5], "duck") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- ASSERT (!output);
- }
- }
-
- /* Check that the '+' flag causes the first non-option to terminate the
- loop. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "+abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-+";
- argv[argc] = NULL;
- optind = start;
- getopt_loop (argc, argv, "+abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == '+');
- ASSERT (optind == 2);
- ASSERT (output);
- }
-
- /* Check that '--' ends the argument processing. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[20];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "--";
- argv[argc++] = "-b";
- argv[argc++] = "foo";
- argv[argc++] = "-q";
- argv[argc++] = "johnny";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "+abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "--") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
-#endif /* GNULIB_TEST_GETOPT_GNU */
-
- /* Check that the '+' flag has to come first. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "abp:q:+",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- if (posixly)
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
- else
- {
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "donald") == 0);
- ASSERT (strcmp (argv[5], "duck") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- ASSERT (!output);
- }
- }
-
-#if GNULIB_TEST_GETOPT_GNU
- /* If GNU extensions are supported, require compliance with POSIX
- interpretation on leading '+' behavior.
- http://austingroupbugs.net/view.php?id=191 */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- getopt_loop (argc, argv, "+:abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc] = NULL;
- optind = start;
- getopt_loop (argc, argv, "+:abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'p');
- ASSERT (optind == 2);
- ASSERT (!output);
- }
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int a_seen = 0;
- int b_seen = 0;
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- bool output;
- int argc = 0;
- const char *argv[10];
-
- argv[argc++] = "program";
- argv[argc++] = "-b";
- argv[argc++] = "-p";
- argv[argc] = NULL;
- optind = start;
- getopt_loop (argc, argv, "+:abp:q:",
- &a_seen, &b_seen, &p_value, &q_value,
- &non_options_count, non_options, &unrecognized, &output);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'p');
- ASSERT (optind == 3);
- ASSERT (!output);
- }
-
- /* Check that 'W' does not dump core:
- http://sourceware.org/bugzilla/show_bug.cgi?id=12922
- Technically, POSIX says the presence of ';' in the opt-string
- gives unspecified behavior, so we only test this when GNU compliance
- is desired. */
- for (start = OPTIND_MIN; start <= 1; start++)
- {
- int argc = 0;
- const char *argv[10];
- int pos = ftell (stderr);
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "dummy";
- argv[argc] = NULL;
- optind = start;
- opterr = 1;
- ASSERT (getopt (argc, (char **) argv, "W;") == 'W');
- ASSERT (ftell (stderr) == pos);
- ASSERT (optind == 2);
- }
-#endif /* GNULIB_TEST_GETOPT_GNU */
-}
diff --git a/gl/tests/test-getopt_long.h b/gl/tests/test-getopt_long.h
deleted file mode 100644
index 345a796ad4..0000000000
--- a/gl/tests/test-getopt_long.h
+++ /dev/null
@@ -1,2144 +0,0 @@
-/* Test of command line argument processing.
- Copyright (C) 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2009. */
-
-static int a_seen;
-static int b_seen;
-static int q_seen;
-
-static const struct option long_options_required[] =
- {
- { "alpha", no_argument, NULL, 'a' },
- { "beta", no_argument, &b_seen, 1 },
- { "prune", required_argument, NULL, 'p' },
- { "quetsche", required_argument, &q_seen, 1 },
- { "xtremely-",no_argument, NULL, 1003 },
- { "xtra", no_argument, NULL, 1001 },
- { "xtreme", no_argument, NULL, 1002 },
- { "xtremely", no_argument, NULL, 1003 },
- { NULL, 0, NULL, 0 }
- };
-
-static const struct option long_options_optional[] =
- {
- { "alpha", no_argument, NULL, 'a' },
- { "beta", no_argument, &b_seen, 1 },
- { "prune", optional_argument, NULL, 'p' },
- { "quetsche", optional_argument, &q_seen, 1 },
- { NULL, 0, NULL, 0 }
- };
-
-static void
-getopt_long_loop (int argc, const char **argv,
- const char *options, const struct option *long_options,
- const char **p_value, const char **q_value,
- int *non_options_count, const char **non_options,
- int *unrecognized)
-{
- int option_index = -1;
- int c;
-
- opterr = 0;
- q_seen = 0;
- while ((c = getopt_long (argc, (char **) argv, options, long_options,
- &option_index))
- != -1)
- {
- switch (c)
- {
- case 0:
- /* An option with a non-NULL flag pointer was processed. */
- if (q_seen)
- *q_value = optarg;
- break;
- case 'a':
- a_seen++;
- break;
- case 'b':
- b_seen = 1;
- break;
- case 'p':
- *p_value = optarg;
- break;
- case 'q':
- *q_value = optarg;
- break;
- case '\1':
- /* Must only happen with option '-' at the beginning. */
- ASSERT (options[0] == '-');
- non_options[(*non_options_count)++] = optarg;
- break;
- case ':':
- /* Must only happen with option ':' at the beginning. */
- ASSERT (options[0] == ':'
- || ((options[0] == '-' || options[0] == '+')
- && options[1] == ':'));
- /* fall through */
- case '?':
- *unrecognized = optopt;
- break;
- default:
- *unrecognized = c;
- break;
- }
- }
-}
-
-/* Reduce casting, so we can use string literals elsewhere.
- getopt_long takes an array of char*, but luckily does not modify
- those elements, so we can pass const char*. */
-static int
-do_getopt_long (int argc, const char **argv, const char *shortopts,
- const struct option *longopts, int *longind)
-{
- return getopt_long (argc, (char **) argv, shortopts, longopts, longind);
-}
-
-static void
-test_getopt_long (void)
-{
- int start;
-
- /* Test disambiguation of options. */
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--x";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xt";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtr";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtra";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == 1001);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtre";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtrem";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtreme";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == 1002);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtremel";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == 1003);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--xtremely";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "ab", long_options_required, &option_index);
- ASSERT (c == 1003);
- }
-
- /* Check that -W handles unknown options. */
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 'W');
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-Wunknown";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index);
- /* glibc and BSD behave differently here, but for now, we allow
- both behaviors since W support is not frequently used. */
- if (c == '?')
- {
- ASSERT (optopt == 0);
- ASSERT (optarg == NULL);
- }
- else
- {
- ASSERT (c == 'W');
- ASSERT (strcmp (optarg, "unknown") == 0);
- }
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "unknown";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "W;", long_options_required, &option_index);
- /* glibc and BSD behave differently here, but for now, we allow
- both behaviors since W support is not frequently used. */
- if (c == '?')
- {
- ASSERT (optopt == 0);
- ASSERT (optarg == NULL);
- }
- else
- {
- ASSERT (c == 'W');
- ASSERT (strcmp (optarg, "unknown") == 0);
- }
- }
-
- /* Test that 'W' does not dump core:
- http://sourceware.org/bugzilla/show_bug.cgi?id=12922 */
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "dummy";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long (argc, argv, "W;", NULL, &option_index);
- ASSERT (c == 'W');
- ASSERT (optind == 2);
- }
-
- /* Test processing of boolean short options. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-b";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-ba";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-ab";
- argv[argc++] = "-a";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 2);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
-
- /* Test processing of boolean long options. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--alpha";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--beta";
- argv[argc++] = "--alpha";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--alpha";
- argv[argc++] = "--beta";
- argv[argc++] = "--alpha";
- argv[argc++] = "--beta";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 2);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- }
-
- /* Test processing of boolean long options via -W. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-Walpha";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abW;", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "beta";
- argv[argc++] = "-W";
- argv[argc++] = "alpha";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "aW;b", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-Walpha";
- argv[argc++] = "-Wbeta";
- argv[argc++] = "-Walpha";
- argv[argc++] = "-Wbeta";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "W;ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 2);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- }
-
- /* Test processing of short options with arguments. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-pfoo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-ab";
- argv[argc++] = "-q";
- argv[argc++] = "baz";
- argv[argc++] = "-pfoo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- }
-
- /* Test processing of long options with arguments. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--p=foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-ab";
- argv[argc++] = "--q";
- argv[argc++] = "baz";
- argv[argc++] = "--p=foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- }
-
- /* Test processing of long options with arguments via -W. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-Wp=foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p:q:W;", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p:W;q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-ab";
- argv[argc++] = "-Wq";
- argv[argc++] = "baz";
- argv[argc++] = "-W";
- argv[argc++] = "p=foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "W;abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value != NULL && strcmp (q_value, "baz") == 0);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 6);
- }
-
- /* Test processing of short options with optional arguments. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-pfoo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
-
- /* Test processing of long options with optional arguments. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--p=foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--p";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--p=";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && *p_value == '\0');
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "--p";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
-
- /* Test processing of long options with optional arguments via -W. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-Wp=foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::W;", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-Wp";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::q::W;", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-Wp=";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "W;p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && *p_value == '\0');
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "p=";
- argv[argc++] = "foo";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "W;p::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && *p_value == '\0');
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 3);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-W";
- argv[argc++] = "p";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "W;abp::q::", long_options_optional,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- /* ASSERT (p_value == NULL); */
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- }
-
- /* Check that invalid options are recognized. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-x";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'x');
- ASSERT (optind == 5);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "-:";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == ':');
- ASSERT (optind == 5);
- }
-
- /* Check that unexpected arguments are recognized. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "--a=";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 'a');
- ASSERT (optind == 4);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "foo";
- argv[argc++] = "--b=";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "foo") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- /* When flag is non-zero, glibc sets optopt anyway, but BSD
- leaves optopt unchanged. */
- ASSERT (unrecognized == 1 || unrecognized == 0);
- ASSERT (optind == 4);
- }
-
- /* Check that by default, non-options arguments are moved to the end. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "donald") == 0);
- ASSERT (strcmp (argv[5], "duck") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- }
-
- /* Check that '--' ends the argument processing. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[20];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "--";
- argv[argc++] = "-b";
- argv[argc++] = "foo";
- argv[argc++] = "-q";
- argv[argc++] = "johnny";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "--") == 0);
- ASSERT (strcmp (argv[5], "donald") == 0);
- ASSERT (strcmp (argv[6], "duck") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 5);
- }
-
- /* Check that the '-' flag causes non-options to be returned in order. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "-abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 3);
- ASSERT (strcmp (non_options[0], "donald") == 0);
- ASSERT (strcmp (non_options[1], "duck") == 0);
- ASSERT (strcmp (non_options[2], "bar") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 7);
- }
-
- /* Check that '--' ends the argument processing. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[20];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "--";
- argv[argc++] = "-b";
- argv[argc++] = "foo";
- argv[argc++] = "-q";
- argv[argc++] = "johnny";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "-abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "--") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- if (non_options_count == 2)
- {
- /* glibc behaviour. */
- ASSERT (non_options_count == 2);
- ASSERT (strcmp (non_options[0], "donald") == 0);
- ASSERT (strcmp (non_options[1], "duck") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 7);
- }
- else
- {
- /* Another valid behaviour. */
- ASSERT (non_options_count == 7);
- ASSERT (strcmp (non_options[0], "donald") == 0);
- ASSERT (strcmp (non_options[1], "duck") == 0);
- ASSERT (strcmp (non_options[2], "-b") == 0);
- ASSERT (strcmp (non_options[3], "foo") == 0);
- ASSERT (strcmp (non_options[4], "-q") == 0);
- ASSERT (strcmp (non_options[5], "johnny") == 0);
- ASSERT (strcmp (non_options[6], "bar") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 12);
- }
- }
-
- /* Check that the '-' flag has to come first. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:-", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "donald") == 0);
- ASSERT (strcmp (argv[5], "duck") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- }
-
- /* Check that the '+' flag causes the first non-option to terminate the
- loop. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- }
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-+";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == '+');
- ASSERT (optind == 2);
- }
-
- /* Check that '--' ends the argument processing. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[20];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "--";
- argv[argc++] = "-b";
- argv[argc++] = "foo";
- argv[argc++] = "-q";
- argv[argc++] = "johnny";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "+abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "--") == 0);
- ASSERT (strcmp (argv[7], "-b") == 0);
- ASSERT (strcmp (argv[8], "foo") == 0);
- ASSERT (strcmp (argv[9], "-q") == 0);
- ASSERT (strcmp (argv[10], "johnny") == 0);
- ASSERT (strcmp (argv[11], "bar") == 0);
- ASSERT (argv[12] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- }
-
- /* Check that the '+' flag has to come first. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:+", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "-p") == 0);
- ASSERT (strcmp (argv[2], "billy") == 0);
- ASSERT (strcmp (argv[3], "-a") == 0);
- ASSERT (strcmp (argv[4], "donald") == 0);
- ASSERT (strcmp (argv[5], "duck") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 0);
- ASSERT (p_value != NULL && strcmp (p_value, "billy") == 0);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- }
-}
-
-/* Test behavior of getopt_long when POSIXLY_CORRECT is set in the
- environment. Options with optional arguments should not change
- behavior just because of an environment variable.
- http://lists.gnu.org/archive/html/bug-m4/2006-09/msg00028.html */
-static void
-test_getopt_long_posix (void)
-{
- int start;
-
- /* Check that POSIXLY_CORRECT stops parsing the same as leading '+'. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "donald";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc++] = "duck";
- argv[argc++] = "-a";
- argv[argc++] = "bar";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "abp:q:", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (strcmp (argv[0], "program") == 0);
- ASSERT (strcmp (argv[1], "donald") == 0);
- ASSERT (strcmp (argv[2], "-p") == 0);
- ASSERT (strcmp (argv[3], "billy") == 0);
- ASSERT (strcmp (argv[4], "duck") == 0);
- ASSERT (strcmp (argv[5], "-a") == 0);
- ASSERT (strcmp (argv[6], "bar") == 0);
- ASSERT (argv[7] == NULL);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 1);
- }
-
- /* Check that POSIXLY_CORRECT doesn't change optional arguments. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-p";
- argv[argc++] = "billy";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "p::", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 0);
- ASSERT (b_seen == 0);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 2);
- }
-
- /* Check that leading - still sees options after non-options. */
- for (start = 0; start <= 1; start++)
- {
- const char *p_value = NULL;
- const char *q_value = NULL;
- int non_options_count = 0;
- const char *non_options[10];
- int unrecognized = 0;
- int argc = 0;
- const char *argv[10];
- a_seen = 0;
- b_seen = 0;
-
- argv[argc++] = "program";
- argv[argc++] = "-a";
- argv[argc++] = "billy";
- argv[argc++] = "-b";
- argv[argc] = NULL;
- optind = start;
- getopt_long_loop (argc, argv, "-ab", long_options_required,
- &p_value, &q_value,
- &non_options_count, non_options, &unrecognized);
- ASSERT (a_seen == 1);
- ASSERT (b_seen == 1);
- ASSERT (p_value == NULL);
- ASSERT (q_value == NULL);
- ASSERT (non_options_count == 1);
- ASSERT (strcmp (non_options[0], "billy") == 0);
- ASSERT (unrecognized == 0);
- ASSERT (optind == 4);
- }
-}
-
-/* Reduce casting, so we can use string literals elsewhere.
- getopt_long_only takes an array of char*, but luckily does not
- modify those elements, so we can pass const char*. */
-static int
-do_getopt_long_only (int argc, const char **argv, const char *shortopts,
- const struct option *longopts, int *longind)
-{
- return getopt_long_only (argc, (char **) argv, shortopts, longopts, longind);
-}
-
-static void
-test_getopt_long_only (void)
-{
- /* Test disambiguation of options. */
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-x";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "ab", long_options_required,
- &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-x";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "abx", long_options_required,
- &option_index);
- ASSERT (c == 'x');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--x";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "abx", long_options_required,
- &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-b";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- b_seen = 0;
- c = do_getopt_long_only (argc, argv, "abx", long_options_required,
- &option_index);
- ASSERT (c == 'b');
- ASSERT (b_seen == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "--b";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- b_seen = 0;
- c = do_getopt_long_only (argc, argv, "abx", long_options_required,
- &option_index);
- ASSERT (c == 0);
- ASSERT (b_seen == 1);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xt";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "ab", long_options_required,
- &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xt";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "abx", long_options_required,
- &option_index);
- ASSERT (c == '?');
- ASSERT (optopt == 0);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xtra";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "ab", long_options_required,
- &option_index);
- ASSERT (c == 1001);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xtreme";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "abx:", long_options_required,
- &option_index);
- ASSERT (c == 1002);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xtremel";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "ab", long_options_required,
- &option_index);
- /* glibc getopt_long_only is intentionally different from
- getopt_long when handling a prefix that is common to two
- spellings, when both spellings have the same option directives.
- BSD getopt_long_only treats both cases the same. */
- ASSERT (c == 1003 || c == '?');
- ASSERT (optind == 2);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xtremel";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "abx::", long_options_required,
- &option_index);
- /* glibc getopt_long_only is intentionally different from
- getopt_long when handling a prefix that is common to two
- spellings, when both spellings have the same option directives.
- BSD getopt_long_only treats both cases the same. */
- ASSERT (c == 1003 || c == '?');
- ASSERT (optind == 2);
- ASSERT (optarg == NULL);
- }
- {
- int argc = 0;
- const char *argv[10];
- int option_index;
- int c;
-
- argv[argc++] = "program";
- argv[argc++] = "-xtras";
- argv[argc] = NULL;
- optind = 1;
- opterr = 0;
- c = do_getopt_long_only (argc, argv, "abx::", long_options_required,
- &option_index);
- ASSERT (c == 'x');
- ASSERT (strcmp (optarg, "tras") == 0);
- }
-}
diff --git a/gl/tests/test-isnand-nolibm.c b/gl/tests/test-isnand-nolibm.c
deleted file mode 100644
index 2d57d079cd..0000000000
--- a/gl/tests/test-isnand-nolibm.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Test of isnand() substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "isnand-nolibm.h"
-
-#include "test-isnand.h"
diff --git a/gl/tests/test-isnand.h b/gl/tests/test-isnand.h
deleted file mode 100644
index 7ea72e98a3..0000000000
--- a/gl/tests/test-isnand.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Test of isnand() substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <limits.h>
-
-#include "minus-zero.h"
-#include "infinity.h"
-#include "nan.h"
-#include "macros.h"
-
-int
-main ()
-{
- /* Finite values. */
- ASSERT (!isnand (3.141));
- ASSERT (!isnand (3.141e30));
- ASSERT (!isnand (3.141e-30));
- ASSERT (!isnand (-2.718));
- ASSERT (!isnand (-2.718e30));
- ASSERT (!isnand (-2.718e-30));
- ASSERT (!isnand (0.0));
- ASSERT (!isnand (minus_zerod));
- /* Infinite values. */
- ASSERT (!isnand (Infinityd ()));
- ASSERT (!isnand (- Infinityd ()));
- /* Quiet NaN. */
- ASSERT (isnand (NaNd ()));
-#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
- /* Signalling NaN. */
- {
- #define NWORDS \
- ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { double value; unsigned int word[NWORDS]; } memory_double;
- memory_double m;
- m.value = NaNd ();
-# if DBL_EXPBIT0_BIT > 0
- m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
-# else
- m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
- ASSERT (isnand (m.value));
- }
-#endif
- return 0;
-}
diff --git a/gl/tests/test-isnanf-nolibm.c b/gl/tests/test-isnanf-nolibm.c
deleted file mode 100644
index 924dccb37a..0000000000
--- a/gl/tests/test-isnanf-nolibm.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Test of isnanf() substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "isnanf-nolibm.h"
-
-#include "test-isnanf.h"
diff --git a/gl/tests/test-isnanf.h b/gl/tests/test-isnanf.h
deleted file mode 100644
index 60499b5732..0000000000
--- a/gl/tests/test-isnanf.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Test of isnanf() substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <limits.h>
-
-#include "minus-zero.h"
-#include "infinity.h"
-#include "nan.h"
-#include "macros.h"
-
-int
-main ()
-{
- /* Finite values. */
- ASSERT (!isnanf (3.141f));
- ASSERT (!isnanf (3.141e30f));
- ASSERT (!isnanf (3.141e-30f));
- ASSERT (!isnanf (-2.718f));
- ASSERT (!isnanf (-2.718e30f));
- ASSERT (!isnanf (-2.718e-30f));
- ASSERT (!isnanf (0.0f));
- ASSERT (!isnanf (minus_zerof));
- /* Infinite values. */
- ASSERT (!isnanf (Infinityf ()));
- ASSERT (!isnanf (- Infinityf ()));
- /* Quiet NaN. */
- ASSERT (isnanf (NaNf ()));
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
- /* Signalling NaN. */
- {
- #define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { float value; unsigned int word[NWORDS]; } memory_float;
- memory_float m;
- m.value = NaNf ();
-# if FLT_EXPBIT0_BIT > 0
- m.word[FLT_EXPBIT0_WORD] ^= (unsigned int) 1 << (FLT_EXPBIT0_BIT - 1);
-# else
- m.word[FLT_EXPBIT0_WORD + (FLT_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- if (FLT_EXPBIT0_WORD < NWORDS / 2)
- m.word[FLT_EXPBIT0_WORD + 1] |= (unsigned int) 1 << FLT_EXPBIT0_BIT;
- else
- m.word[0] |= (unsigned int) 1;
- ASSERT (isnanf (m.value));
- }
-#endif
- return 0;
-}
diff --git a/gl/tests/test-isnanl-nolibm.c b/gl/tests/test-isnanl-nolibm.c
deleted file mode 100644
index 8f44de2fd6..0000000000
--- a/gl/tests/test-isnanl-nolibm.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Test of isnanl() substitute.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include "isnanl-nolibm.h"
-
-#include "test-isnanl.h"
diff --git a/gl/tests/test-isnanl.h b/gl/tests/test-isnanl.h
deleted file mode 100644
index 06e6a7cefa..0000000000
--- a/gl/tests/test-isnanl.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Test of isnanl() substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <float.h>
-#include <limits.h>
-
-#include "minus-zero.h"
-#include "infinity.h"
-#include "nan.h"
-#include "macros.h"
-
-int
-main ()
-{
- #define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { unsigned int word[NWORDS]; long double value; }
- memory_long_double;
-
- /* Finite values. */
- ASSERT (!isnanl (3.141L));
- ASSERT (!isnanl (3.141e30L));
- ASSERT (!isnanl (3.141e-30L));
- ASSERT (!isnanl (-2.718L));
- ASSERT (!isnanl (-2.718e30L));
- ASSERT (!isnanl (-2.718e-30L));
- ASSERT (!isnanl (0.0L));
- ASSERT (!isnanl (minus_zerol));
- /* Infinite values. */
- ASSERT (!isnanl (Infinityl ()));
- ASSERT (!isnanl (- Infinityl ()));
- /* Quiet NaN. */
- ASSERT (isnanl (NaNl ()));
-
-#if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT
- /* A bit pattern that is different from a Quiet NaN. With a bit of luck,
- it's a Signalling NaN. */
- {
- memory_long_double m;
- m.value = NaNl ();
-# if LDBL_EXPBIT0_BIT > 0
- m.word[LDBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (LDBL_EXPBIT0_BIT - 1);
-# else
- m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- |= (unsigned int) 1 << LDBL_EXPBIT0_BIT;
- ASSERT (isnanl (m.value));
- }
-#endif
-
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-/* Representation of an 80-bit 'long double' as an initializer for a sequence
- of 'unsigned int' words. */
-# ifdef WORDS_BIGENDIAN
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
- ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
- (unsigned int) (mantlo) << 16 \
- }
-# else
-# define LDBL80_WORDS(exponent,manthi,mantlo) \
- { mantlo, manthi, exponent }
-# endif
- { /* Quiet NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
- {
- /* Signalling NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
- /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities,
- Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
- Intel IA-64 Architecture Software Developer's Manual, Volume 1:
- Application Architecture.
- Table 5-2 "Floating-Point Register Encodings"
- Figure 5-6 "Memory to Floating-Point Register Data Translation"
- */
- { /* Pseudo-NaN. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
- { /* Pseudo-Infinity. */
- static memory_long_double x =
- { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
- { /* Pseudo-Zero. */
- static memory_long_double x =
- { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
- { /* Unnormalized number. */
- static memory_long_double x =
- { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
- { /* Pseudo-Denormal. */
- static memory_long_double x =
- { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
- ASSERT (isnanl (x.value));
- }
-#endif
-
- return 0;
-}
diff --git a/gl/tests/test-malloc-gnu.c b/gl/tests/test-malloc-gnu.c
deleted file mode 100644
index ca0eafa479..0000000000
--- a/gl/tests/test-malloc-gnu.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Test of malloc function.
- Copyright (C) 2010-2013 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include <stdlib.h>
-
-int
-main ()
-{
- /* Check that malloc (0) is not a NULL pointer. */
- if (malloc (0) == NULL)
- return 1;
-
- return 0;
-}
diff --git a/gl/tests/test-malloca.c b/gl/tests/test-malloca.c
deleted file mode 100644
index 7d5e62e87a..0000000000
--- a/gl/tests/test-malloca.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Test of safe automatic memory allocation.
- Copyright (C) 2005, 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
-
-#include <config.h>
-
-#include "malloca.h"
-
-#include <stdlib.h>
-
-static void
-do_allocation (int n)
-{
- void *ptr = malloca (n);
- freea (ptr);
- safe_alloca (n);
-}
-
-void (*func) (int) = do_allocation;
-
-int
-main ()
-{
- int i;
-
- /* This slows down malloc a lot. */
- unsetenv ("MALLOC_PERTURB_");
-
- /* Repeat a lot of times, to make sure there's no memory leak. */
- for (i = 0; i < 50000; i++)
- {
- /* Try various values.
- n = 0 gave a crash on Alpha with gcc-2.5.8.
- Some versions of Mac OS X have a stack size limit of 512 KB. */
- func (34);
- func (134);
- func (399);
- func (510823);
- func (129321);
- func (0);
- func (4070);
- func (4095);
- func (1);
- func (16582);
- }
-
- return 0;
-}
diff --git a/gl/tests/test-math.c b/gl/tests/test-math.c
deleted file mode 100644
index f7d944cbf8..0000000000
--- a/gl/tests/test-math.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* Test of <math.h> substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <math.h>
-
-#ifndef NAN
-# error NAN should be defined
-choke me
-#endif
-
-#ifndef HUGE_VALF
-# error HUGE_VALF should be defined
-choke me
-#endif
-
-#ifndef HUGE_VAL
-# error HUGE_VAL should be defined
-choke me
-#endif
-
-#ifndef HUGE_VALL
-# error HUGE_VALL should be defined
-choke me
-#endif
-
-#ifndef FP_ILOGB0
-# error FP_ILOGB0 should be defined
-choke me
-#endif
-
-#ifndef FP_ILOGBNAN
-# error FP_ILOGBNAN should be defined
-choke me
-#endif
-
-#include <limits.h>
-
-#include "macros.h"
-
-#if 0
-/* Check that NAN expands into a constant expression. */
-static float n = NAN;
-#endif
-
-/* Compare two numbers with ==.
- This is a separate function because IRIX 6.5 "cc -O" miscompiles an
- 'x == x' test. */
-static int
-numeric_equalf (float x, float y)
-{
- return x == y;
-}
-static int
-numeric_equald (double x, double y)
-{
- return x == y;
-}
-static int
-numeric_equall (long double x, long double y)
-{
- return x == y;
-}
-
-int
-main (void)
-{
- double d = NAN;
- double zero = 0.0;
- ASSERT (!numeric_equald (d, d));
-
- d = HUGE_VAL;
- ASSERT (numeric_equald (d, 1.0 / zero));
-
- ASSERT (numeric_equalf (HUGE_VALF, HUGE_VALF + HUGE_VALF));
-
- ASSERT (numeric_equald (HUGE_VAL, HUGE_VAL + HUGE_VAL));
-
- ASSERT (numeric_equall (HUGE_VALL, HUGE_VALL + HUGE_VALL));
-
- /* Check the value of FP_ILOGB0. */
- ASSERT (FP_ILOGB0 == INT_MIN || FP_ILOGB0 == - INT_MAX);
-
- /* Check the value of FP_ILOGBNAN. */
- ASSERT (FP_ILOGBNAN == INT_MIN || FP_ILOGBNAN == INT_MAX);
-
- return 0;
-}
diff --git a/gl/tests/test-printf-frexp.c b/gl/tests/test-printf-frexp.c
deleted file mode 100644
index 5ecf198555..0000000000
--- a/gl/tests/test-printf-frexp.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Test of splitting a double into fraction and mantissa.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include "printf-frexp.h"
-
-#include <float.h>
-
-#include "macros.h"
-
-static double
-my_ldexp (double x, int d)
-{
- for (; d > 0; d--)
- x *= 2.0;
- for (; d < 0; d++)
- x *= 0.5;
- return x;
-}
-
-int
-main ()
-{
- int i;
- /* The use of 'volatile' guarantees that excess precision bits are dropped
- when dealing with denormalized numbers. It is necessary on x86 systems
- where double-floats are not IEEE compliant by default, to avoid that the
- results become platform and compiler option dependent. 'volatile' is a
- portable alternative to gcc's -ffloat-store option. */
- volatile double x;
-
- for (i = 1, x = 1.0; i <= DBL_MAX_EXP; i++, x *= 2.0)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.0);
- }
- for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.0);
- }
- for (; i >= DBL_MIN_EXP - 100 && x > 0.0; i--, x *= 0.5)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == DBL_MIN_EXP - 1);
- ASSERT (mantissa == my_ldexp (1.0, i - DBL_MIN_EXP));
- }
-
- for (i = 1, x = 1.01; i <= DBL_MAX_EXP; i++, x *= 2.0)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.01);
- }
- for (i = 1, x = 1.01; i >= DBL_MIN_EXP; i--, x *= 0.5)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.01);
- }
- for (; i >= DBL_MIN_EXP - 100 && x > 0.0; i--, x *= 0.5)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == DBL_MIN_EXP - 1);
- ASSERT (mantissa >= my_ldexp (1.0, i - DBL_MIN_EXP));
- ASSERT (mantissa <= my_ldexp (2.0, i - DBL_MIN_EXP));
- ASSERT (mantissa == my_ldexp (x, - exp));
- }
-
- for (i = 1, x = 1.73205; i <= DBL_MAX_EXP; i++, x *= 2.0)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.73205);
- }
- for (i = 1, x = 1.73205; i >= DBL_MIN_EXP; i--, x *= 0.5)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.73205);
- }
- for (; i >= DBL_MIN_EXP - 100 && x > 0.0; i--, x *= 0.5)
- {
- int exp = -9999;
- double mantissa = printf_frexp (x, &exp);
- ASSERT (exp == DBL_MIN_EXP - 1);
- ASSERT (mantissa >= my_ldexp (1.0, i - DBL_MIN_EXP));
- ASSERT (mantissa <= my_ldexp (2.0, i - DBL_MIN_EXP));
- ASSERT (mantissa == my_ldexp (x, - exp));
- }
-
- return 0;
-}
diff --git a/gl/tests/test-printf-frexpl.c b/gl/tests/test-printf-frexpl.c
deleted file mode 100644
index 0aa3d18bed..0000000000
--- a/gl/tests/test-printf-frexpl.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Test of splitting a 'long double' into fraction and mantissa.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include "printf-frexpl.h"
-
-#include <float.h>
-
-#include "fpucw.h"
-#include "macros.h"
-
-/* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
- exponent for 'long double' is -964. Similarly, on PowerPC machines,
- LDBL_MIN_EXP is -1021, but the smallest reliable exponent for 'long double'
- is -968. For exponents below that, the precision may be truncated to the
- precision used for 'double'. */
-#ifdef __sgi
-# define MIN_NORMAL_EXP (LDBL_MIN_EXP + 57)
-# define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP
-#elif defined __ppc || defined __ppc__ || defined __powerpc || defined __powerpc__
-# define MIN_NORMAL_EXP (LDBL_MIN_EXP + 53)
-# define MIN_SUBNORMAL_EXP MIN_NORMAL_EXP
-#else
-# define MIN_NORMAL_EXP LDBL_MIN_EXP
-# define MIN_SUBNORMAL_EXP (LDBL_MIN_EXP - 100)
-#endif
-
-static long double
-my_ldexp (long double x, int d)
-{
- for (; d > 0; d--)
- x *= 2.0L;
- for (; d < 0; d++)
- x *= 0.5L;
- return x;
-}
-
-int
-main ()
-{
- int i;
- long double x;
- DECL_LONG_DOUBLE_ROUNDING
-
- BEGIN_LONG_DOUBLE_ROUNDING ();
-
- for (i = 1, x = 1.0L; i <= LDBL_MAX_EXP; i++, x *= 2.0L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.0L);
- }
- for (i = 1, x = 1.0L; i >= MIN_NORMAL_EXP; i--, x *= 0.5L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.0L);
- }
- for (; i >= MIN_SUBNORMAL_EXP && x > 0.0L; i--, x *= 0.5L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == LDBL_MIN_EXP - 1);
- ASSERT (mantissa == my_ldexp (1.0L, i - LDBL_MIN_EXP));
- }
-
- for (i = 1, x = 1.01L; i <= LDBL_MAX_EXP; i++, x *= 2.0L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.01L);
- }
- for (i = 1, x = 1.01L; i >= MIN_NORMAL_EXP; i--, x *= 0.5L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.01L);
- }
- for (; i >= MIN_SUBNORMAL_EXP && x > 0.0L; i--, x *= 0.5L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == LDBL_MIN_EXP - 1);
- ASSERT (mantissa >= my_ldexp (1.0L, i - LDBL_MIN_EXP));
- ASSERT (mantissa <= my_ldexp (2.0L, i - LDBL_MIN_EXP));
- ASSERT (mantissa == my_ldexp (x, - exp));
- }
-
- for (i = 1, x = 1.73205L; i <= LDBL_MAX_EXP; i++, x *= 2.0L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.73205L);
- }
- for (i = 1, x = 1.73205L; i >= MIN_NORMAL_EXP; i--, x *= 0.5L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == i - 1);
- ASSERT (mantissa == 1.73205L);
- }
- for (; i >= MIN_SUBNORMAL_EXP && x > 0.0L; i--, x *= 0.5L)
- {
- int exp = -9999;
- long double mantissa = printf_frexpl (x, &exp);
- ASSERT (exp == LDBL_MIN_EXP - 1);
- ASSERT (mantissa >= my_ldexp (1.0L, i - LDBL_MIN_EXP));
- ASSERT (mantissa <= my_ldexp (2.0L, i - LDBL_MIN_EXP));
- ASSERT (mantissa == my_ldexp (x, - exp));
- }
-
- return 0;
-}
diff --git a/gl/tests/test-printf-posix.h b/gl/tests/test-printf-posix.h
deleted file mode 100644
index eca40051e6..0000000000
--- a/gl/tests/test-printf-posix.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Test of POSIX compatible vsprintf() and sprintf() functions.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include "infinity.h"
-
-static void
-test_function (int (*my_printf) (const char *, ...))
-{
- /* Here we don't test output that may be platform dependent.
- The bulk of the tests is done as part of the 'vasnprintf-posix' module. */
-
- /* Test support of size specifiers as in C99. */
-
- my_printf ("%ju %d\n", (uintmax_t) 12345671, 33, 44, 55);
-
- my_printf ("%zu %d\n", (size_t) 12345672, 33, 44, 55);
-
- my_printf ("%tu %d\n", (ptrdiff_t) 12345673, 33, 44, 55);
-
- /* Test the support of the 'a' and 'A' conversion specifier for hexadecimal
- output of floating-point numbers. */
-
- /* Positive zero. */
- my_printf ("%a %d\n", 0.0, 33, 44, 55);
-
- /* Positive infinity. */
- my_printf ("%a %d\n", Infinityd (), 33, 44, 55);
-
- /* Negative infinity. */
- my_printf ("%a %d\n", - Infinityd (), 33, 44, 55);
-
- /* FLAG_ZERO with infinite number. */
- /* "0000000inf 33" is not a valid result; see
- <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
- my_printf ("%010a %d\n", Infinityd (), 33, 44, 55);
-
- /* Test the support of the %f format directive. */
-
- /* A positive number. */
- my_printf ("%f %d\n", 12.75, 33, 44, 55);
-
- /* A larger positive number. */
- my_printf ("%f %d\n", 1234567.0, 33, 44, 55);
-
- /* A negative number. */
- my_printf ("%f %d\n", -0.03125, 33, 44, 55);
-
- /* Positive zero. */
- my_printf ("%f %d\n", 0.0, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_printf ("%015f %d\n", 1234.0, 33, 44, 55);
-
- /* Precision. */
- my_printf ("%.f %d\n", 1234.0, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_printf ("%.2f %d\n", 999.95, 33, 44, 55);
-
- /* Precision with rounding. */
- my_printf ("%.2f %d\n", 999.996, 33, 44, 55);
-
- /* A positive number. */
- my_printf ("%Lf %d\n", 12.75L, 33, 44, 55);
-
- /* A larger positive number. */
- my_printf ("%Lf %d\n", 1234567.0L, 33, 44, 55);
-
- /* A negative number. */
- my_printf ("%Lf %d\n", -0.03125L, 33, 44, 55);
-
- /* Positive zero. */
- my_printf ("%Lf %d\n", 0.0L, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_printf ("%015Lf %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision. */
- my_printf ("%.Lf %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_printf ("%.2Lf %d\n", 999.95L, 33, 44, 55);
-
- /* Precision with rounding. */
- my_printf ("%.2Lf %d\n", 999.996L, 33, 44, 55);
-
- /* Test the support of the %F format directive. */
-
- /* A positive number. */
- my_printf ("%F %d\n", 12.75, 33, 44, 55);
-
- /* A larger positive number. */
- my_printf ("%F %d\n", 1234567.0, 33, 44, 55);
-
- /* A negative number. */
- my_printf ("%F %d\n", -0.03125, 33, 44, 55);
-
- /* Positive zero. */
- my_printf ("%F %d\n", 0.0, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_printf ("%015F %d\n", 1234.0, 33, 44, 55);
-
- /* Precision. */
- my_printf ("%.F %d\n", 1234.0, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_printf ("%.2F %d\n", 999.95, 33, 44, 55);
-
- /* Precision with rounding. */
- my_printf ("%.2F %d\n", 999.996, 33, 44, 55);
-
- /* A positive number. */
- my_printf ("%LF %d\n", 12.75L, 33, 44, 55);
-
- /* A larger positive number. */
- my_printf ("%LF %d\n", 1234567.0L, 33, 44, 55);
-
- /* A negative number. */
- my_printf ("%LF %d\n", -0.03125L, 33, 44, 55);
-
- /* Positive zero. */
- my_printf ("%LF %d\n", 0.0L, 33, 44, 55);
-
- /* FLAG_ZERO. */
- my_printf ("%015LF %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision. */
- my_printf ("%.LF %d\n", 1234.0L, 33, 44, 55);
-
- /* Precision with no rounding. */
- my_printf ("%.2LF %d\n", 999.95L, 33, 44, 55);
-
- /* Precision with rounding. */
- my_printf ("%.2LF %d\n", 999.996L, 33, 44, 55);
-
- /* Test the support of the POSIX/XSI format strings with positions. */
-
- my_printf ("%2$d %1$d\n", 33, 55);
-}
diff --git a/gl/tests/test-printf-posix.output b/gl/tests/test-printf-posix.output
deleted file mode 100644
index 618825bb7b..0000000000
--- a/gl/tests/test-printf-posix.output
+++ /dev/null
@@ -1,40 +0,0 @@
-12345671 33
-12345672 33
-12345673 33
-0x0p+0 33
-inf 33
--inf 33
- inf 33
-12.750000 33
-1234567.000000 33
--0.031250 33
-0.000000 33
-00001234.000000 33
-1234 33
-999.95 33
-1000.00 33
-12.750000 33
-1234567.000000 33
--0.031250 33
-0.000000 33
-00001234.000000 33
-1234 33
-999.95 33
-1000.00 33
-12.750000 33
-1234567.000000 33
--0.031250 33
-0.000000 33
-00001234.000000 33
-1234 33
-999.95 33
-1000.00 33
-12.750000 33
-1234567.000000 33
--0.031250 33
-0.000000 33
-00001234.000000 33
-1234 33
-999.95 33
-1000.00 33
-55 33
diff --git a/gl/tests/test-rawmemchr.c b/gl/tests/test-rawmemchr.c
deleted file mode 100644
index e31104a98c..0000000000
--- a/gl/tests/test-rawmemchr.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2008-2013 Free Software Foundation, Inc.
- * Written by Eric Blake and Bruno Haible
- *
- * 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include <string.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (rawmemchr, void *, (void const *, int));
-
-#include <stdlib.h>
-
-#include "zerosize-ptr.h"
-#include "macros.h"
-
-/* Calculating void * + int is not portable, so this wrapper converts
- to char * to make the tests easier to write. */
-#define RAWMEMCHR (char *) rawmemchr
-
-int
-main (void)
-{
- size_t n = 0x100000;
- char *input = malloc (n + 1);
- ASSERT (input);
-
- input[0] = 'a';
- input[1] = 'b';
- memset (input + 2, 'c', 1024);
- memset (input + 1026, 'd', n - 1028);
- input[n - 2] = 'e';
- input[n - 1] = 'a';
- input[n] = '\0';
-
- /* Basic behavior tests. */
- ASSERT (RAWMEMCHR (input, 'a') == input);
- ASSERT (RAWMEMCHR (input, 'b') == input + 1);
- ASSERT (RAWMEMCHR (input, 'c') == input + 2);
- ASSERT (RAWMEMCHR (input, 'd') == input + 1026);
-
- ASSERT (RAWMEMCHR (input + 1, 'a') == input + n - 1);
- ASSERT (RAWMEMCHR (input + 1, 'e') == input + n - 2);
- ASSERT (RAWMEMCHR (input + 1, 0x789abc00 | 'e') == input + n - 2);
-
- ASSERT (RAWMEMCHR (input, '\0') == input + n);
-
- /* Alignment tests. */
- {
- int i, j;
- for (i = 0; i < 32; i++)
- {
- for (j = 0; j < 256; j++)
- input[i + j] = j;
- for (j = 0; j < 256; j++)
- {
- ASSERT (RAWMEMCHR (input + i, j) == input + i + j);
- }
- }
- }
-
- /* Ensure that no unaligned oversized reads occur. */
- {
- char *page_boundary = (char *) zerosize_ptr ();
- size_t i;
-
- if (!page_boundary)
- page_boundary = input + 4096;
- memset (page_boundary - 512, '1', 511);
- page_boundary[-1] = '2';
- for (i = 1; i <= 512; i++)
- ASSERT (RAWMEMCHR (page_boundary - i, (i * 0x01010100) | '2')
- == page_boundary - 1);
- }
-
- free (input);
-
- return 0;
-}
diff --git a/gl/tests/test-setenv.c b/gl/tests/test-setenv.c
deleted file mode 100644
index 0a53ac4644..0000000000
--- a/gl/tests/test-setenv.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Tests of setenv.
- Copyright (C) 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Eric Blake <ebb9@byu.net>, 2009. */
-
-#include <config.h>
-
-#include <stdlib.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (setenv, int, (char const *, char const *, int));
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "macros.h"
-
-int
-main (void)
-{
- /* Test overwriting. */
- ASSERT (setenv ("a", "==", -1) == 0);
- ASSERT (setenv ("a", "2", 0) == 0);
- ASSERT (strcmp (getenv ("a"), "==") == 0);
-
- /* Required to fail with EINVAL. */
- errno = 0;
- ASSERT (setenv ("", "", 1) == -1);
- ASSERT (errno == EINVAL);
- errno = 0;
- ASSERT (setenv ("a=b", "", 0) == -1);
- ASSERT (errno == EINVAL);
-#if 0
- /* glibc and gnulib's implementation guarantee this, but POSIX no
- longer requires it: http://austingroupbugs.net/view.php?id=185 */
- errno = 0;
- ASSERT (setenv (NULL, "", 0) == -1);
- ASSERT (errno == EINVAL);
-#endif
-
- return 0;
-}
diff --git a/gl/tests/test-signbit.c b/gl/tests/test-signbit.c
deleted file mode 100644
index e8ea097ce4..0000000000
--- a/gl/tests/test-signbit.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Test of signbit() substitute.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <math.h>
-
-/* signbit must be a macro. */
-#ifndef signbit
-# error missing declaration
-#endif
-
-#include <float.h>
-#include <limits.h>
-
-#include "minus-zero.h"
-#include "infinity.h"
-#include "macros.h"
-
-float zerof = 0.0f;
-double zerod = 0.0;
-long double zerol = 0.0L;
-
-static void
-test_signbitf ()
-{
- /* Finite values. */
- ASSERT (!signbit (3.141f));
- ASSERT (!signbit (3.141e30f));
- ASSERT (!signbit (3.141e-30f));
- ASSERT (signbit (-2.718f));
- ASSERT (signbit (-2.718e30f));
- ASSERT (signbit (-2.718e-30f));
- /* Zeros. */
- ASSERT (!signbit (0.0f));
- if (1.0f / minus_zerof < 0)
- ASSERT (signbit (minus_zerof));
- else
- ASSERT (!signbit (minus_zerof));
- /* Infinite values. */
- ASSERT (!signbit (Infinityf ()));
- ASSERT (signbit (- Infinityf ()));
- /* Quiet NaN. */
- (void) signbit (zerof / zerof);
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
- /* Signalling NaN. */
- {
- #define NWORDS \
- ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { float value; unsigned int word[NWORDS]; } memory_float;
- memory_float m;
- m.value = zerof / zerof;
-# if FLT_EXPBIT0_BIT > 0
- m.word[FLT_EXPBIT0_WORD] ^= (unsigned int) 1 << (FLT_EXPBIT0_BIT - 1);
-# else
- m.word[FLT_EXPBIT0_WORD + (FLT_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- if (FLT_EXPBIT0_WORD < NWORDS / 2)
- m.word[FLT_EXPBIT0_WORD + 1] |= (unsigned int) 1 << FLT_EXPBIT0_BIT;
- else
- m.word[0] |= (unsigned int) 1;
- (void) signbit (m.value);
- #undef NWORDS
- }
-#endif
-}
-
-static void
-test_signbitd ()
-{
- /* Finite values. */
- ASSERT (!signbit (3.141));
- ASSERT (!signbit (3.141e30));
- ASSERT (!signbit (3.141e-30));
- ASSERT (signbit (-2.718));
- ASSERT (signbit (-2.718e30));
- ASSERT (signbit (-2.718e-30));
- /* Zeros. */
- ASSERT (!signbit (0.0));
- if (1.0 / minus_zerod < 0)
- ASSERT (signbit (minus_zerod));
- else
- ASSERT (!signbit (minus_zerod));
- /* Infinite values. */
- ASSERT (!signbit (Infinityd ()));
- ASSERT (signbit (- Infinityd ()));
- /* Quiet NaN. */
- (void) signbit (zerod / zerod);
-#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
- /* Signalling NaN. */
- {
- #define NWORDS \
- ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { double value; unsigned int word[NWORDS]; } memory_double;
- memory_double m;
- m.value = zerod / zerod;
-# if DBL_EXPBIT0_BIT > 0
- m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
-# else
- m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
- (void) signbit (m.value);
- #undef NWORDS
- }
-#endif
-}
-
-static void
-test_signbitl ()
-{
- /* Finite values. */
- ASSERT (!signbit (3.141L));
- ASSERT (!signbit (3.141e30L));
- ASSERT (!signbit (3.141e-30L));
- ASSERT (signbit (-2.718L));
- ASSERT (signbit (-2.718e30L));
- ASSERT (signbit (-2.718e-30L));
- /* Zeros. */
- ASSERT (!signbit (0.0L));
- if (1.0L / minus_zerol < 0)
- ASSERT (signbit (minus_zerol));
- else
- ASSERT (!signbit (minus_zerol));
- /* Infinite values. */
- ASSERT (!signbit (Infinityl ()));
- ASSERT (signbit (- Infinityl ()));
- /* Quiet NaN. */
- (void) signbit (zerol / zerol);
-#if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT
- /* Signalling NaN. */
- {
- #define NWORDS \
- ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
- typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double;
- memory_long_double m;
- m.value = zerol / zerol;
-# if LDBL_EXPBIT0_BIT > 0
- m.word[LDBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (LDBL_EXPBIT0_BIT - 1);
-# else
- m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
- m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
- |= (unsigned int) 1 << LDBL_EXPBIT0_BIT;
- (void) signbit (m.value);
- #undef NWORDS
- }
-#endif
-}
-
-int
-main ()
-{
- test_signbitf ();
- test_signbitd ();
- test_signbitl ();
- return 0;
-}
diff --git a/gl/tests/test-sleep.c b/gl/tests/test-sleep.c
deleted file mode 100644
index d232cd0a97..0000000000
--- a/gl/tests/test-sleep.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Test of sleep() function.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <unistd.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (sleep, unsigned int, (unsigned int));
-
-#include <signal.h>
-
-#include "macros.h"
-
-#if HAVE_DECL_ALARM
-static void
-handle_alarm (int sig)
-{
- if (sig != SIGALRM)
- _exit (1);
-}
-#endif
-
-int
-main (void)
-{
- ASSERT (sleep (1) <= 1);
-
- ASSERT (sleep (0) == 0);
-
-#if HAVE_DECL_ALARM
- {
- const unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days. */
- unsigned int remaining;
- signal (SIGALRM, handle_alarm);
- alarm (1);
- remaining = sleep (pentecost);
- ASSERT (pentecost - 10 < remaining && remaining <= pentecost);
- }
-#endif
-
- return 0;
-}
diff --git a/gl/tests/test-strchrnul.c b/gl/tests/test-strchrnul.c
deleted file mode 100644
index ac3b3dd8e4..0000000000
--- a/gl/tests/test-strchrnul.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2008-2013 Free Software Foundation, Inc.
- * Written by Eric Blake and Bruno Haible
- *
- * 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include <string.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (strchrnul, char *, (char const *, int));
-
-#include <stdlib.h>
-
-#include "macros.h"
-
-int
-main (void)
-{
- size_t n = 0x100000;
- char *input = malloc (n + 1);
- ASSERT (input);
-
- input[0] = 'a';
- input[1] = 'b';
- memset (input + 2, 'c', 1024);
- memset (input + 1026, 'd', n - 1028);
- input[n - 2] = 'e';
- input[n - 1] = 'a';
- input[n] = '\0';
-
- /* Basic behavior tests. */
- ASSERT (strchrnul (input, 'a') == input);
- ASSERT (strchrnul (input, 'b') == input + 1);
- ASSERT (strchrnul (input, 'c') == input + 2);
- ASSERT (strchrnul (input, 'd') == input + 1026);
-
- ASSERT (strchrnul (input + 1, 'a') == input + n - 1);
- ASSERT (strchrnul (input + 1, 'e') == input + n - 2);
-
- ASSERT (strchrnul (input, 'f') == input + n);
- ASSERT (strchrnul (input, '\0') == input + n);
-
- /* Check that a very long haystack is handled quickly if the byte is
- found near the beginning. */
- {
- size_t repeat = 10000;
- for (; repeat > 0; repeat--)
- {
- ASSERT (strchrnul (input, 'c') == input + 2);
- }
- }
-
- /* Alignment tests. */
- {
- int i, j;
- for (i = 0; i < 32; i++)
- {
- for (j = 0; j < 256; j++)
- input[i + j] = (j + 1) & 0xff;
- for (j = 1; j < 256; j++)
- {
- ASSERT (strchrnul (input + i, j) == input + i + j - 1);
- input[i + j - 1] = (j == 1 ? 2 : 1);
- ASSERT (strchrnul (input + i, j) == input + i + 255);
- input[i + j - 1] = j;
- }
- }
- }
-
- free (input);
-
- return 0;
-}
diff --git a/gl/tests/test-sysexits.c b/gl/tests/test-sysexits.c
deleted file mode 100644
index 1d3d24d472..0000000000
--- a/gl/tests/test-sysexits.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Test of <sysexits.h> substitute.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <sysexits.h>
-
-int exitcode;
-
-int
-main ()
-{
- /* Check that all EX_* symbols are defined to integer constant expressions
- with mutually different values. */
- switch (exitcode)
- {
- case EX_OK:
- case EX_USAGE:
- case EX_DATAERR:
- case EX_NOINPUT:
- case EX_NOUSER:
- case EX_NOHOST:
- case EX_UNAVAILABLE:
- case EX_SOFTWARE:
- case EX_OSERR:
- case EX_OSFILE:
- case EX_CANTCREAT:
- case EX_IOERR:
- case EX_TEMPFAIL:
- case EX_PROTOCOL:
- case EX_NOPERM:
- case EX_CONFIG:
- break;
- }
-
- return 0;
-}
diff --git a/gl/tests/test-unsetenv.c b/gl/tests/test-unsetenv.c
deleted file mode 100644
index c369e2afc8..0000000000
--- a/gl/tests/test-unsetenv.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Tests of unsetenv.
- Copyright (C) 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Eric Blake <ebb9@byu.net>, 2009. */
-
-#include <config.h>
-
-#include <stdlib.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (unsetenv, int, (char const *));
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "macros.h"
-
-int
-main (void)
-{
- char entry[] = "b=2";
-
- /* Test removal when multiple entries present. */
- ASSERT (putenv ((char *) "a=1") == 0);
- ASSERT (putenv (entry) == 0);
- entry[0] = 'a'; /* Unspecified what getenv("a") would be at this point. */
- ASSERT (unsetenv ("a") == 0); /* Both entries will be removed. */
- ASSERT (getenv ("a") == NULL);
- ASSERT (unsetenv ("a") == 0);
-
- /* Required to fail with EINVAL. */
- errno = 0;
- ASSERT (unsetenv ("") == -1);
- ASSERT (errno == EINVAL);
- errno = 0;
- ASSERT (unsetenv ("a=b") == -1);
- ASSERT (errno == EINVAL);
-#if 0
- /* glibc and gnulib's implementation guarantee this, but POSIX no
- longer requires it: http://austingroupbugs.net/view.php?id=185 */
- errno = 0;
- ASSERT (unsetenv (NULL) == -1);
- ASSERT (errno == EINVAL);
-#endif
-
- return 0;
-}
diff --git a/gl/tests/test-version-etc.c b/gl/tests/test-version-etc.c
deleted file mode 100644
index 66027f3190..0000000000
--- a/gl/tests/test-version-etc.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test suite for version-etc.
- Copyright (C) 2009-2013 Free Software Foundation, Inc.
- This file is part of the GNUlib Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-#include <config.h>
-
-#include "version-etc.h"
-
-#include "progname.h"
-
-#define AUTHORS "Sergey Poznyakoff", "Eric Blake"
-
-int
-main (int argc _GL_UNUSED, char **argv)
-{
- set_program_name (argv[0]);
- version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS,
- (const char *) NULL);
- return 0;
-}
diff --git a/gl/tests/test-version-etc.sh b/gl/tests/test-version-etc.sh
deleted file mode 100755
index 466c959208..0000000000
--- a/gl/tests/test-version-etc.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/sh
-# Test suite for version-etc.
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
-# This file is part of the GNUlib Library.
-#
-# 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 <http://www.gnu.org/licenses/>.
-
-TMP=ve-expected.tmp
-LC_ALL=C
-export LC_ALL
-ERR=0
-
-cat > $TMP <<EOT
-test-version-etc (PROJECT) VERSION
-COPYRIGHT Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
-
-Written by Sergey Poznyakoff and Eric Blake.
-EOT
-
-./test-version-etc${EXEEXT} --version |
- sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/
- /^Packaged by/d
- 2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' |
- tr -d '\015' |
- diff -c $TMP - || ERR=1
-
-rm $TMP
-
-exit $ERR
diff --git a/gl/tests/test-vfprintf-posix.c b/gl/tests/test-vfprintf-posix.c
deleted file mode 100644
index 53f951c034..0000000000
--- a/gl/tests/test-vfprintf-posix.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Test of POSIX compatible vfprintf() function.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (vfprintf, int, (FILE *, char const *, va_list));
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-fprintf-posix.h"
-
-static int
-my_fprintf (FILE *fp, const char *format, ...)
-{
- va_list args;
- int ret;
-
- va_start (args, format);
- ret = vfprintf (fp, format, args);
- va_end (args);
- return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
- test_function (my_fprintf);
- return 0;
-}
diff --git a/gl/tests/test-vfprintf-posix.sh b/gl/tests/test-vfprintf-posix.sh
deleted file mode 100755
index 74339ba080..0000000000
--- a/gl/tests/test-vfprintf-posix.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles t-vfprintf-posix.tmp t-vfprintf-posix.out"
-./test-vfprintf-posix${EXEEXT} > t-vfprintf-posix.tmp || exit 1
-LC_ALL=C tr -d '\r' < t-vfprintf-posix.tmp > t-vfprintf-posix.out || exit 1
-
-: ${DIFF=diff}
-${DIFF} "${srcdir}/test-printf-posix.output" t-vfprintf-posix.out
-result=$?
-
-rm -fr $tmpfiles
-
-exit $result
diff --git a/gl/tests/test-vprintf-posix.c b/gl/tests/test-vprintf-posix.c
deleted file mode 100644
index 3593b1dbff..0000000000
--- a/gl/tests/test-vprintf-posix.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Test of POSIX compatible vfprintf() function.
- Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include "signature.h"
-SIGNATURE_CHECK (vprintf, int, (char const *, va_list));
-
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-
-#include "macros.h"
-
-#include "test-printf-posix.h"
-
-static int
-my_printf (const char *format, ...)
-{
- va_list args;
- int ret;
-
- va_start (args, format);
- ret = vprintf (format, args);
- va_end (args);
- return ret;
-}
-
-int
-main (int argc, char *argv[])
-{
- test_function (my_printf);
- return 0;
-}
diff --git a/gl/tests/test-vprintf-posix.sh b/gl/tests/test-vprintf-posix.sh
deleted file mode 100755
index 968a8b2a8d..0000000000
--- a/gl/tests/test-vprintf-posix.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles t-vprintf-posix.tmp t-vprintf-posix.out"
-./test-vprintf-posix${EXEEXT} > t-vprintf-posix.tmp || exit 1
-LC_ALL=C tr -d '\r' < t-vprintf-posix.tmp > t-vprintf-posix.out || exit 1
-
-: ${DIFF=diff}
-${DIFF} "${srcdir}/test-printf-posix.output" t-vprintf-posix.out
-result=$?
-
-rm -fr $tmpfiles
-
-exit $result
diff --git a/gl/tests/unsetenv.c b/gl/tests/unsetenv.c
deleted file mode 100644
index c58c82f4f4..0000000000
--- a/gl/tests/unsetenv.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2013 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- 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 <http://www.gnu.org/licenses/>. */
-
-/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
- optimizes away the name == NULL test below. */
-#define _GL_ARG_NONNULL(params)
-
-#include <config.h>
-
-/* Specification. */
-#include <stdlib.h>
-
-#include <errno.h>
-#if !_LIBC
-# define __set_errno(ev) ((errno) = (ev))
-#endif
-
-#include <string.h>
-#include <unistd.h>
-
-#if !_LIBC
-# define __environ environ
-#endif
-
-#if _LIBC
-/* This lock protects against simultaneous modifications of 'environ'. */
-# include <bits/libc-lock.h>
-__libc_lock_define_initialized (static, envlock)
-# define LOCK __libc_lock_lock (envlock)
-# define UNLOCK __libc_lock_unlock (envlock)
-#else
-# define LOCK
-# define UNLOCK
-#endif
-
-/* In the GNU C library we must keep the namespace clean. */
-#ifdef _LIBC
-# define unsetenv __unsetenv
-#endif
-
-#if _LIBC || !HAVE_UNSETENV
-
-int
-unsetenv (const char *name)
-{
- size_t len;
- char **ep;
-
- if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
- {
- __set_errno (EINVAL);
- return -1;
- }
-
- len = strlen (name);
-
- LOCK;
-
- ep = __environ;
- while (*ep != NULL)
- if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
- {
- /* Found it. Remove this pointer by moving later ones back. */
- char **dp = ep;
-
- do
- dp[0] = dp[1];
- while (*dp++);
- /* Continue the loop in case NAME appears again. */
- }
- else
- ++ep;
-
- UNLOCK;
-
- return 0;
-}
-
-#ifdef _LIBC
-# undef unsetenv
-weak_alias (__unsetenv, unsetenv)
-#endif
-
-#else /* HAVE_UNSETENV */
-
-# undef unsetenv
-# if !HAVE_DECL_UNSETENV
-# if VOID_UNSETENV
-extern void unsetenv (const char *);
-# else
-extern int unsetenv (const char *);
-# endif
-# endif
-
-/* Call the underlying unsetenv, in case there is hidden bookkeeping
- that needs updating beyond just modifying environ. */
-int
-rpl_unsetenv (const char *name)
-{
- int result = 0;
- if (!name || !*name || strchr (name, '='))
- {
- errno = EINVAL;
- return -1;
- }
- while (getenv (name))
-# if !VOID_UNSETENV
- result =
-# endif
- unsetenv (name);
- return result;
-}
-
-#endif /* HAVE_UNSETENV */
diff --git a/gl/time.in.h b/gl/time.in.h
index 8ced794744..56da703370 100644
--- a/gl/time.in.h
+++ b/gl/time.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#if __GNUC__ >= 3
diff --git a/gl/time_r.c b/gl/time_r.c
index 9866299856..a4c2c53e41 100644
--- a/gl/time_r.c
+++ b/gl/time_r.c
@@ -3,16 +3,16 @@
Copyright (C) 2003, 2006-2007, 2010-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
diff --git a/gl/u64.h b/gl/u64.h
index d8009ad391..11946d4510 100644
--- a/gl/u64.h
+++ b/gl/u64.h
@@ -3,16 +3,16 @@
Copyright (C) 2006, 2009-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 2ea9af4365..69c94cce90 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -2,16 +2,16 @@
Copyright (C) 2003-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_UNISTD_H
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 5267b1bb5e..d0f57a63c2 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -2,16 +2,16 @@
Copyright (C) 1999, 2002-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
/* This file can be parametrized with the following macros:
diff --git a/gl/vasnprintf.h b/gl/vasnprintf.h
index 7658f505e5..4c4799bb6c 100644
--- a/gl/vasnprintf.h
+++ b/gl/vasnprintf.h
@@ -2,16 +2,16 @@
Copyright (C) 2002-2004, 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _VASNPRINTF_H
diff --git a/gl/vasprintf.c b/gl/vasprintf.c
index d0d4a11bf7..302f28aa63 100644
--- a/gl/vasprintf.c
+++ b/gl/vasprintf.c
@@ -2,16 +2,16 @@
Copyright (C) 1999, 2002, 2006-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
diff --git a/gl/verify.h b/gl/verify.h
index d42d0750ee..950cfa191b 100644
--- a/gl/verify.h
+++ b/gl/verify.h
@@ -3,16 +3,16 @@
Copyright (C) 2005-2006, 2009-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
diff --git a/gl/version-etc-fsf.c b/gl/version-etc-fsf.c
deleted file mode 100644
index e1c69da94a..0000000000
--- a/gl/version-etc-fsf.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Variable with FSF copyright information, for version-etc.
- Copyright (C) 1999-2006, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Jim Meyering. */
-
-#include <config.h>
-
-/* Specification. */
-#include "version-etc.h"
-
-/* Default copyright goes to the FSF. */
-
-const char version_etc_copyright[] =
- /* Do *not* mark this string for translation. %s is a copyright
- symbol suitable for this locale, and %d is the copyright
- year. */
- "Copyright %s %d Free Software Foundation, Inc.";
diff --git a/gl/version-etc.c b/gl/version-etc.c
deleted file mode 100644
index b7d23ab597..0000000000
--- a/gl/version-etc.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/* Print --version and bug-reporting information in a consistent format.
- Copyright (C) 1999-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Jim Meyering. */
-
-#include <config.h>
-
-/* Specification. */
-#include "version-etc.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#if USE_UNLOCKED_IO
-# include "unlocked-io.h"
-#endif
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-
-/* If you use AM_INIT_AUTOMAKE's no-define option,
- PACKAGE is not defined. Use PACKAGE_TARNAME instead. */
-#if ! defined PACKAGE && defined PACKAGE_TARNAME
-# define PACKAGE PACKAGE_TARNAME
-#endif
-
-enum { COPYRIGHT_YEAR = 2013 };
-
-/* The three functions below display the --version information the
- standard way.
-
- If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
- the program. The formats are therefore:
-
- PACKAGE VERSION
-
- or
-
- COMMAND_NAME (PACKAGE) VERSION.
-
- The functions differ in the way they are passed author names. */
-
-/* Display the --version information the standard way.
-
- Author names are given in the array AUTHORS. N_AUTHORS is the
- number of elements in the array. */
-void
-version_etc_arn (FILE *stream,
- const char *command_name, const char *package,
- const char *version,
- const char * const * authors, size_t n_authors)
-{
- if (command_name)
- fprintf (stream, "%s (%s) %s\n", command_name, package, version);
- else
- fprintf (stream, "%s %s\n", package, version);
-
-#ifdef PACKAGE_PACKAGER
-# ifdef PACKAGE_PACKAGER_VERSION
- fprintf (stream, _("Packaged by %s (%s)\n"), PACKAGE_PACKAGER,
- PACKAGE_PACKAGER_VERSION);
-# else
- fprintf (stream, _("Packaged by %s\n"), PACKAGE_PACKAGER);
-# endif
-#endif
-
- /* TRANSLATORS: Translate "(C)" to the copyright symbol
- (C-in-a-circle), if this symbol is available in the user's
- locale. Otherwise, do not translate "(C)"; leave it as-is. */
- fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
-
- fputs (_("\
-\n\
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
-This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n\
-\n\
-"),
- stream);
-
- switch (n_authors)
- {
- case 0:
- /* The caller must provide at least one author name. */
- abort ();
- case 1:
- /* TRANSLATORS: %s denotes an author name. */
- fprintf (stream, _("Written by %s.\n"), authors[0]);
- break;
- case 2:
- /* TRANSLATORS: Each %s denotes an author name. */
- fprintf (stream, _("Written by %s and %s.\n"), authors[0], authors[1]);
- break;
- case 3:
- /* TRANSLATORS: Each %s denotes an author name. */
- fprintf (stream, _("Written by %s, %s, and %s.\n"),
- authors[0], authors[1], authors[2]);
- break;
- case 4:
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"),
- authors[0], authors[1], authors[2], authors[3]);
- break;
- case 5:
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"),
- authors[0], authors[1], authors[2], authors[3], authors[4]);
- break;
- case 6:
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
- authors[0], authors[1], authors[2], authors[3], authors[4],
- authors[5]);
- break;
- case 7:
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
- authors[0], authors[1], authors[2], authors[3], authors[4],
- authors[5], authors[6]);
- break;
- case 8:
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("\
-Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
- authors[0], authors[1], authors[2], authors[3], authors[4],
- authors[5], authors[6], authors[7]);
- break;
- case 9:
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("\
-Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
- authors[0], authors[1], authors[2], authors[3], authors[4],
- authors[5], authors[6], authors[7], authors[8]);
- break;
- default:
- /* 10 or more authors. Use an abbreviation, since the human reader
- will probably not want to read the entire list anyway. */
- /* TRANSLATORS: Each %s denotes an author name.
- You can use line breaks, estimating that each author name occupies
- ca. 16 screen columns and that a screen line has ca. 80 columns. */
- fprintf (stream, _("\
-Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
- authors[0], authors[1], authors[2], authors[3], authors[4],
- authors[5], authors[6], authors[7], authors[8]);
- break;
- }
-}
-
-/* Display the --version information the standard way. See the initial
- comment to this module, for more information.
-
- Author names are given in the NULL-terminated array AUTHORS. */
-void
-version_etc_ar (FILE *stream,
- const char *command_name, const char *package,
- const char *version, const char * const * authors)
-{
- size_t n_authors;
-
- for (n_authors = 0; authors[n_authors]; n_authors++)
- ;
- version_etc_arn (stream, command_name, package, version, authors, n_authors);
-}
-
-/* Display the --version information the standard way. See the initial
- comment to this module, for more information.
-
- Author names are given in the NULL-terminated va_list AUTHORS. */
-void
-version_etc_va (FILE *stream,
- const char *command_name, const char *package,
- const char *version, va_list authors)
-{
- size_t n_authors;
- const char *authtab[10];
-
- for (n_authors = 0;
- n_authors < 10
- && (authtab[n_authors] = va_arg (authors, const char *)) != NULL;
- n_authors++)
- ;
- version_etc_arn (stream, command_name, package, version,
- authtab, n_authors);
-}
-
-
-/* Display the --version information the standard way.
-
- If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
- the program. The formats are therefore:
-
- PACKAGE VERSION
-
- or
-
- COMMAND_NAME (PACKAGE) VERSION.
-
- The authors names are passed as separate arguments, with an additional
- NULL argument at the end. */
-void
-version_etc (FILE *stream,
- const char *command_name, const char *package,
- const char *version, /* const char *author1, ...*/ ...)
-{
- va_list authors;
-
- va_start (authors, version);
- version_etc_va (stream, command_name, package, version, authors);
- va_end (authors);
-}
-
-void
-emit_bug_reporting_address (void)
-{
- /* TRANSLATORS: The placeholder indicates the bug-reporting address
- for this package. Please add _another line_ saying
- "Report translation bugs to <...>\n" with the address for translation
- bugs (typically your translation team's web or email address). */
- printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT);
-#ifdef PACKAGE_PACKAGER_BUG_REPORTS
- printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
- PACKAGE_PACKAGER_BUG_REPORTS);
-#endif
-#ifdef PACKAGE_URL
- printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
-#else
- printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"),
- PACKAGE_NAME, PACKAGE);
-#endif
- fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),
- stdout);
-}
diff --git a/gl/version-etc.h b/gl/version-etc.h
deleted file mode 100644
index 6c3d08431c..0000000000
--- a/gl/version-etc.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Print --version and bug-reporting information in a consistent format.
- Copyright (C) 1999, 2003, 2005, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-/* Written by Jim Meyering. */
-
-#ifndef VERSION_ETC_H
-# define VERSION_ETC_H 1
-
-# include <stdarg.h>
-# include <stdio.h>
-
-/* The 'sentinel' attribute was added in gcc 4.0. */
-#ifndef _GL_ATTRIBUTE_SENTINEL
-# if 4 <= __GNUC__
-# define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
-# else
-# define _GL_ATTRIBUTE_SENTINEL /* empty */
-# endif
-#endif
-
-extern const char version_etc_copyright[];
-
-/* The three functions below display the --version information in the
- standard way: command and package names, package version, followed
- by a short GPLv3+ notice and a list of up to 10 author names.
-
- If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
- the program. The formats are therefore:
-
- PACKAGE VERSION
-
- or
-
- COMMAND_NAME (PACKAGE) VERSION.
-
- The functions differ in the way they are passed author names: */
-
-/* N_AUTHORS names are supplied in array AUTHORS. */
-extern void version_etc_arn (FILE *stream,
- const char *command_name, const char *package,
- const char *version,
- const char * const * authors, size_t n_authors);
-
-/* Names are passed in the NULL-terminated array AUTHORS. */
-extern void version_etc_ar (FILE *stream,
- const char *command_name, const char *package,
- const char *version, const char * const * authors);
-
-/* Names are passed in the NULL-terminated va_list. */
-extern void version_etc_va (FILE *stream,
- const char *command_name, const char *package,
- const char *version, va_list authors);
-
-/* Names are passed as separate arguments, with an additional
- NULL argument at the end. */
-extern void version_etc (FILE *stream,
- const char *command_name, const char *package,
- const char *version,
- /* const char *author1, ..., NULL */ ...)
- _GL_ATTRIBUTE_SENTINEL;
-
-/* Display the usual "Report bugs to" stanza. */
-extern void emit_bug_reporting_address (void);
-
-#endif /* VERSION_ETC_H */
diff --git a/gl/vfprintf.c b/gl/vfprintf.c
deleted file mode 100644
index fbcd0043d1..0000000000
--- a/gl/vfprintf.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Formatted output to a stream.
- Copyright (C) 2004, 2006-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include <stdio.h>
-
-#include <errno.h>
-#include <limits.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
-#include "fseterr.h"
-#include "vasnprintf.h"
-
-/* Print formatted output to the stream FP.
- Return string length of formatted string. On error, return a negative
- value. */
-int
-vfprintf (FILE *fp, const char *format, va_list args)
-{
- char buf[2000];
- char *output;
- size_t len;
- size_t lenbuf = sizeof (buf);
-
- output = vasnprintf (buf, &lenbuf, format, args);
- len = lenbuf;
-
- if (!output)
- {
- fseterr (fp);
- return -1;
- }
-
- if (fwrite (output, 1, len, fp) < len)
- {
- if (output != buf)
- {
- int saved_errno = errno;
- free (output);
- errno = saved_errno;
- }
- return -1;
- }
-
- if (output != buf)
- free (output);
-
- if (len > INT_MAX)
- {
- errno = EOVERFLOW;
- fseterr (fp);
- return -1;
- }
-
- return len;
-}
diff --git a/gl/vprintf.c b/gl/vprintf.c
deleted file mode 100644
index 8a748ea001..0000000000
--- a/gl/vprintf.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Formatted output to a stream.
- Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification. */
-#include <stdio.h>
-
-#include <stdarg.h>
-
-/* Print formatted output to standard output.
- Return string length of formatted string. On error, return a negative
- value. */
-int
-vprintf (const char *format, va_list args)
-{
- return vfprintf (stdout, format, args);
-}
diff --git a/gl/vsnprintf.c b/gl/vsnprintf.c
index 7d4dfbed98..82676a282c 100644
--- a/gl/vsnprintf.c
+++ b/gl/vsnprintf.c
@@ -3,16 +3,16 @@
Written by Simon Josefsson and Yoann Vandoorselaere <yoann@prelude-ids.org>.
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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License along
+ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
diff --git a/gl/w32sock.h b/gl/w32sock.h
index 44f3a1a0f6..dd49ad7f08 100644
--- a/gl/w32sock.h
+++ b/gl/w32sock.h
@@ -3,16 +3,16 @@
Copyright (C) 2008-2013 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
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Paolo Bonzini */
diff --git a/gl/wchar.in.h b/gl/wchar.in.h
index b6e4362792..676b01af10 100644
--- a/gl/wchar.in.h
+++ b/gl/wchar.in.h
@@ -3,16 +3,16 @@
Copyright (C) 2007-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
diff --git a/gl/xsize.h b/gl/xsize.h
index 2922f35305..aa08ef4885 100644
--- a/gl/xsize.h
+++ b/gl/xsize.h
@@ -3,16 +3,16 @@
Copyright (C) 2003, 2008-2013 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, or (at your option)
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, 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.
+ GNU Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _XSIZE_H