]> Savannah Git Hosting - gnulib/maint-tools.git/commitdiff
gnulib-tool-tests: Fix test-coreutils-1 test.
authorBruno Haible <bruno@clisp.org>
Sun, 24 Mar 2024 10:56:07 +0000 (11:56 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 24 Mar 2024 10:56:07 +0000 (11:56 +0100)
77 files changed:
gnulib-tool-tests/import-tests/test-coreutils-1.err
gnulib-tool-tests/import-tests/test-coreutils-1.out
gnulib-tool-tests/import-tests/test-coreutils-1.result/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/build-aux/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/doc/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/glthread/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/gnulib.mk
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-fadvise.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-rand-isaac.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod1.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod1.sh [new file with mode: 0755]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold1.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold1.sh [new file with mode: 0755]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unicase/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unictype/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unistr/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/uniwidth/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/buffer-lcm.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/buffer-lcm.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtod.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtod.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtold.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtod.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtod.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtold.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fadvise.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fadvise.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fd-reopen.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fd-reopen.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/glthread/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/gnulib.mk
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/heap.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/heap.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/malloc/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/rand-isaac.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/rand-isaac.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randint.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randint.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randperm.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randperm.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randread.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randread.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/root-dev-ino.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/root-dev-ino.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/skipchars.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/skipchars.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/smack.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strintcmp.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp-in.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strtod.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strtold.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/targetdir.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/targetdir.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unicase/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unictype/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unistr/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/uniwidth/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoimax.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoint.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoint.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoumax.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xfts.c [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xfts.h [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/.gitignore [deleted file]
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/c-strtod.m4 [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/gnulib-cache.m4
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/gnulib-comp.m4
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/ldexp.m4 [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/strtod.m4 [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/strtold.m4 [new file with mode: 0644]
gnulib-tool-tests/import-tests/test-coreutils-1.sh

index 69160c8345bb4a512456faf5fb1996b0e695c29a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,30 +0,0 @@
-gnulib-tool: warning: module buffer-lcm doesn't exist
-gnulib-tool: warning: module cl-strtod doesn't exist
-gnulib-tool: warning: module cl-strtold doesn't exist
-gnulib-tool: warning: module fadvise doesn't exist
-gnulib-tool: warning: module fd-reopen doesn't exist
-gnulib-tool: warning: module heap doesn't exist
-gnulib-tool: warning: module randint doesn't exist
-gnulib-tool: warning: module randperm doesn't exist
-gnulib-tool: warning: module root-dev-ino doesn't exist
-gnulib-tool: warning: module skipchars doesn't exist
-gnulib-tool: warning: module smack doesn't exist
-gnulib-tool: warning: module strnumcmp doesn't exist
-gnulib-tool: warning: module targetdir doesn't exist
-gnulib-tool: warning: module xdectoint doesn't exist
-gnulib-tool: warning: module xfts doesn't exist
-gnulib-tool: warning: module buffer-lcm doesn't exist
-gnulib-tool: warning: module cl-strtod doesn't exist
-gnulib-tool: warning: module cl-strtold doesn't exist
-gnulib-tool: warning: module fadvise doesn't exist
-gnulib-tool: warning: module fd-reopen doesn't exist
-gnulib-tool: warning: module heap doesn't exist
-gnulib-tool: warning: module randint doesn't exist
-gnulib-tool: warning: module randperm doesn't exist
-gnulib-tool: warning: module root-dev-ino doesn't exist
-gnulib-tool: warning: module skipchars doesn't exist
-gnulib-tool: warning: module smack doesn't exist
-gnulib-tool: warning: module strnumcmp doesn't exist
-gnulib-tool: warning: module targetdir doesn't exist
-gnulib-tool: warning: module xdectoint doesn't exist
-gnulib-tool: warning: module xfts doesn't exist
index 5092359be0f575def59caaac8372a810143ed46b..a8e9a74963c2578e4c69705f9ef603dbbea0af7e 100644 (file)
@@ -60,6 +60,7 @@ Module list with included dependencies (indented):
     btoc32-tests
     btowc
     btowc-tests
+  buffer-lcm
     builtin-expect
   byteswap
     byteswap-tests
@@ -71,6 +72,8 @@ Module list with included dependencies (indented):
     c-strcaseeq
     c-strcasestr
     c-strcasestr-tests
+    c-strtod
+    c-strtold
     c32_apply_type_test
     c32_apply_type_test-tests
     c32_get_type_test
@@ -123,6 +126,8 @@ Module list with included dependencies (indented):
   chown
     chown-tests
   chownat
+  cl-strtod
+  cl-strtold
     clock-time
     cloexec
     cloexec-tests
@@ -206,6 +211,8 @@ Module list with included dependencies (indented):
     extern-inline
   faccessat
     faccessat-tests
+  fadvise
+    fadvise-tests
   fchdir
     fchdir-tests
   fchmodat
@@ -221,6 +228,7 @@ Module list with included dependencies (indented):
     fcntl-safer-tests
     fcntl-tests
     fd-hook
+  fd-reopen
     fd-safer-flag
   fdatasync
     fdatasync-tests
@@ -374,6 +382,7 @@ Module list with included dependencies (indented):
   hash-triple
     hash-triple-simple
     havelib
+  heap
   host-os
     hostent
   human
@@ -614,10 +623,14 @@ Module list with included dependencies (indented):
     quotearg-simple-tests
     raise
     raise-tests
+  randint
     random
     random-tests
     random_r
     random_r-tests
+  randperm
+    randread
+    randread-tests
   rawmemchr
     rawmemchr-tests
     read
@@ -652,6 +665,7 @@ Module list with included dependencies (indented):
     rewinddir
   rmdir
     rmdir-tests
+  root-dev-ino
     root-uid
     rpmatch
   safe-read
@@ -691,8 +705,10 @@ Module list with included dependencies (indented):
     sigprocmask
     sigprocmask-tests
     size_max
+  skipchars
     sleep
     sleep-tests
+  smack
     snan
     snippet/_Noreturn
     snippet/arg-nonnull
@@ -741,11 +757,16 @@ Module list with included dependencies (indented):
   strnlen
     strnlen-tests
     strnlen1
+  strnumcmp
   strsignal
     strsignal-tests
     strstr-simple
+    strtod
+    strtod-tests
   strtoimax
     strtoimax-tests
+    strtold
+    strtold-tests
     strtoll
     strtoll-tests
     strtoull
@@ -778,6 +799,7 @@ Module list with included dependencies (indented):
     sys_utsname-tests
   sys_wait
     sys_wait-tests
+  targetdir
   tempname
   termios
     termios-tests
@@ -948,6 +970,8 @@ Module list with included dependencies (indented):
     xalloc-die-tests
     xalloc-oversized
   xbinary-io
+  xdectoint
+  xfts
   xgetcwd
   xgetgroups
   xgethostname
@@ -1044,6 +1068,8 @@ File list:
   lib/boot-time-aux.h
   lib/btoc32.c
   lib/btowc.c
+  lib/buffer-lcm.c
+  lib/buffer-lcm.h
   lib/byteswap.in.h
   lib/c++defs.h
   lib/c-ctype.c
@@ -1053,6 +1079,9 @@ File list:
   lib/c-strcasecmp.c
   lib/c-strcaseeq.h
   lib/c-strncasecmp.c
+  lib/c-strtod.c
+  lib/c-strtod.h
+  lib/c-strtold.c
   lib/c32_apply_type_test.c
   lib/c32_get_type_test.c
   lib/c32is-impl.h
@@ -1085,6 +1114,9 @@ File list:
   lib/chmodat.c
   lib/chown.c
   lib/chownat.c
+  lib/cl-strtod.c
+  lib/cl-strtod.h
+  lib/cl-strtold.c
   lib/cloexec.c
   lib/cloexec.h
   lib/close-stream.c
@@ -1134,6 +1166,8 @@ File list:
   lib/exitfail.h
   lib/explicit_bzero.c
   lib/faccessat.c
+  lib/fadvise.c
+  lib/fadvise.h
   lib/fchdir.c
   lib/fchmodat.c
   lib/fchown-stub.c
@@ -1145,6 +1179,8 @@ File list:
   lib/fcntl.in.h
   lib/fd-hook.c
   lib/fd-hook.h
+  lib/fd-reopen.c
+  lib/fd-reopen.h
   lib/fd-safer-flag.c
   lib/fd-safer.c
   lib/fdatasync.c
@@ -1268,6 +1304,8 @@ File list:
   lib/hash-triple.h
   lib/hash.c
   lib/hash.h
+  lib/heap.c
+  lib/heap.h
   lib/human.c
   lib/human.h
   lib/i-ring.c
@@ -1488,6 +1526,14 @@ File list:
   lib/quotearg.c
   lib/quotearg.h
   lib/raise.c
+  lib/rand-isaac.c
+  lib/rand-isaac.h
+  lib/randint.c
+  lib/randint.h
+  lib/randperm.c
+  lib/randperm.h
+  lib/randread.c
+  lib/randread.h
   lib/rawmemchr.c
   lib/rawmemchr.valgrind
   lib/read-file.c
@@ -1517,6 +1563,8 @@ File list:
   lib/renameatu.h
   lib/rewinddir.c
   lib/rmdir.c
+  lib/root-dev-ino.c
+  lib/root-dev-ino.h
   lib/root-uid.h
   lib/rpmatch.c
   lib/safe-read.c
@@ -1573,9 +1621,12 @@ File list:
   lib/signbitl.c
   lib/sigprocmask.c
   lib/size_max.h
+  lib/skipchars.c
+  lib/skipchars.h
   lib/sm3-stream.c
   lib/sm3.c
   lib/sm3.h
+  lib/smack.h
   lib/snprintf.c
   lib/sockets.c
   lib/sockets.h
@@ -1608,14 +1659,20 @@ File list:
   lib/strerror.c
   lib/strftime.h
   lib/string.in.h
+  lib/strintcmp.c
   lib/stripslash.c
   lib/strnlen.c
   lib/strnlen1.c
   lib/strnlen1.h
+  lib/strnumcmp-in.h
+  lib/strnumcmp.c
+  lib/strnumcmp.h
   lib/strsignal.c
   lib/strstr.c
+  lib/strtod.c
   lib/strtoimax.c
   lib/strtol.c
+  lib/strtold.c
   lib/strtoll.c
   lib/strtoul.c
   lib/strtoull.c
@@ -1635,6 +1692,8 @@ File list:
   lib/sys_uio.in.h
   lib/sys_utsname.in.h
   lib/sys_wait.in.h
+  lib/targetdir.c
+  lib/targetdir.h
   lib/tempname.c
   lib/tempname.h
   lib/termios.in.h
@@ -1778,6 +1837,12 @@ File list:
   lib/xasprintf.c
   lib/xbinary-io.c
   lib/xbinary-io.h
+  lib/xdectoimax.c
+  lib/xdectoint.c
+  lib/xdectoint.h
+  lib/xdectoumax.c
+  lib/xfts.c
+  lib/xfts.h
   lib/xgetaname-impl.h
   lib/xgetcwd.c
   lib/xgetcwd.h
@@ -1833,6 +1898,7 @@ File list:
   m4/builtin-expect.m4
   m4/byteswap.m4
   m4/c-bool.m4
+  m4/c-strtod.m4
   m4/c32rtomb.m4
   m4/calloc.m4
   m4/canon-host.m4
@@ -1977,6 +2043,7 @@ File list:
   m4/lchmod.m4
   m4/lchown.m4
   m4/lcmessage.m4
+  m4/ldexp.m4
   m4/ldexpl.m4
   m4/lib-ignore.m4
   m4/lib-ld.m4
@@ -2161,7 +2228,9 @@ File list:
   m4/strnlen.m4
   m4/strsignal.m4
   m4/strstr.m4
+  m4/strtod.m4
   m4/strtoimax.m4
+  m4/strtold.m4
   m4/strtoll.m4
   m4/strtoull.m4
   m4/strtoumax.m4
@@ -2392,6 +2461,7 @@ File list:
   tests/test-exclude8.sh
   tests/test-explicit_bzero.c
   tests/test-faccessat.c
+  tests/test-fadvise.c
   tests/test-fchdir.c
   tests/test-fchmodat.c
   tests/test-fchownat.c
@@ -2677,6 +2747,7 @@ File list:
   tests/test-quotearg-simple.c
   tests/test-quotearg.h
   tests/test-raise.c
+  tests/test-rand-isaac.c
   tests/test-random-mt.c
   tests/test-random.c
   tests/test-random_r.c
@@ -2748,7 +2819,13 @@ File list:
   tests/test-string.c
   tests/test-strnlen.c
   tests/test-strsignal.c
+  tests/test-strtod.c
+  tests/test-strtod1.c
+  tests/test-strtod1.sh
   tests/test-strtoimax.c
+  tests/test-strtold.c
+  tests/test-strtold1.c
+  tests/test-strtold1.sh
   tests/test-strtoll.c
   tests/test-strtoull.c
   tests/test-strtoumax.c
@@ -3135,6 +3212,7 @@ Copying file gnulib-tests/test-exclude7.sh
 Copying file gnulib-tests/test-exclude8.sh
 Copying file gnulib-tests/test-explicit_bzero.c
 Copying file gnulib-tests/test-faccessat.c
+Copying file gnulib-tests/test-fadvise.c
 Copying file gnulib-tests/test-fchdir.c
 Copying file gnulib-tests/test-fchmodat.c
 Copying file gnulib-tests/test-fchownat.c
@@ -3420,6 +3498,7 @@ Copying file gnulib-tests/test-qsort_r.c
 Copying file gnulib-tests/test-quotearg-simple.c
 Copying file gnulib-tests/test-quotearg.h
 Copying file gnulib-tests/test-raise.c
+Copying file gnulib-tests/test-rand-isaac.c
 Copying file gnulib-tests/test-random-mt.c
 Copying file gnulib-tests/test-random.c
 Copying file gnulib-tests/test-random_r.c
@@ -3491,7 +3570,13 @@ Copying file gnulib-tests/test-strerror_r.c
 Copying file gnulib-tests/test-string.c
 Copying file gnulib-tests/test-strnlen.c
 Copying file gnulib-tests/test-strsignal.c
+Copying file gnulib-tests/test-strtod.c
+Copying file gnulib-tests/test-strtod1.c
+Copying file gnulib-tests/test-strtod1.sh
 Copying file gnulib-tests/test-strtoimax.c
+Copying file gnulib-tests/test-strtold.c
+Copying file gnulib-tests/test-strtold1.c
+Copying file gnulib-tests/test-strtold1.sh
 Copying file gnulib-tests/test-strtoll.c
 Copying file gnulib-tests/test-strtoull.c
 Copying file gnulib-tests/test-strtoumax.c
@@ -3687,6 +3772,8 @@ Copying file lib/bitrotate.h
 Copying file lib/boot-time-aux.h
 Copying file lib/btoc32.c
 Copying file lib/btowc.c
+Copying file lib/buffer-lcm.c
+Copying file lib/buffer-lcm.h
 Copying file lib/byteswap.in.h
 Copying file lib/c++defs.h
 Copying file lib/c-ctype.c
@@ -3696,6 +3783,9 @@ Copying file lib/c-strcase.h
 Copying file lib/c-strcasecmp.c
 Copying file lib/c-strcaseeq.h
 Copying file lib/c-strncasecmp.c
+Copying file lib/c-strtod.c
+Copying file lib/c-strtod.h
+Copying file lib/c-strtold.c
 Copying file lib/c32_apply_type_test.c
 Copying file lib/c32_get_type_test.c
 Copying file lib/c32is-impl.h
@@ -3728,6 +3818,9 @@ Copying file lib/chmod.c
 Copying file lib/chmodat.c
 Copying file lib/chown.c
 Copying file lib/chownat.c
+Copying file lib/cl-strtod.c
+Copying file lib/cl-strtod.h
+Copying file lib/cl-strtold.c
 Copying file lib/cloexec.c
 Copying file lib/cloexec.h
 Copying file lib/close-stream.c
@@ -3777,6 +3870,8 @@ Copying file lib/exitfail.c
 Copying file lib/exitfail.h
 Copying file lib/explicit_bzero.c
 Copying file lib/faccessat.c
+Copying file lib/fadvise.c
+Copying file lib/fadvise.h
 Copying file lib/fchdir.c
 Copying file lib/fchmodat.c
 Copying file lib/fchown-stub.c
@@ -3788,6 +3883,8 @@ Copying file lib/fcntl.c
 Copying file lib/fcntl.in.h
 Copying file lib/fd-hook.c
 Copying file lib/fd-hook.h
+Copying file lib/fd-reopen.c
+Copying file lib/fd-reopen.h
 Copying file lib/fd-safer-flag.c
 Copying file lib/fd-safer.c
 Copying file lib/fdatasync.c
@@ -3911,6 +4008,8 @@ Copying file lib/hash-triple.c
 Copying file lib/hash-triple.h
 Copying file lib/hash.c
 Copying file lib/hash.h
+Copying file lib/heap.c
+Copying file lib/heap.h
 Copying file lib/human.c
 Copying file lib/human.h
 Copying file lib/i-ring.c
@@ -4131,6 +4230,14 @@ Copying file lib/quote.h
 Copying file lib/quotearg.c
 Copying file lib/quotearg.h
 Copying file lib/raise.c
+Copying file lib/rand-isaac.c
+Copying file lib/rand-isaac.h
+Copying file lib/randint.c
+Copying file lib/randint.h
+Copying file lib/randperm.c
+Copying file lib/randperm.h
+Copying file lib/randread.c
+Copying file lib/randread.h
 Copying file lib/rawmemchr.c
 Copying file lib/rawmemchr.valgrind
 Copying file lib/read-file.c
@@ -4160,6 +4267,8 @@ Copying file lib/renameatu.c
 Copying file lib/renameatu.h
 Copying file lib/rewinddir.c
 Copying file lib/rmdir.c
+Copying file lib/root-dev-ino.c
+Copying file lib/root-dev-ino.h
 Copying file lib/root-uid.h
 Copying file lib/rpmatch.c
 Copying file lib/safe-read.c
@@ -4216,9 +4325,12 @@ Copying file lib/signbitf.c
 Copying file lib/signbitl.c
 Copying file lib/sigprocmask.c
 Copying file lib/size_max.h
+Copying file lib/skipchars.c
+Copying file lib/skipchars.h
 Copying file lib/sm3-stream.c
 Copying file lib/sm3.c
 Copying file lib/sm3.h
+Copying file lib/smack.h
 Copying file lib/snprintf.c
 Copying file lib/sockets.c
 Copying file lib/sockets.h
@@ -4251,14 +4363,20 @@ Copying file lib/strerror-override.h
 Copying file lib/strerror.c
 Copying file lib/strftime.h
 Copying file lib/string.in.h
+Copying file lib/strintcmp.c
 Copying file lib/stripslash.c
 Copying file lib/strnlen.c
 Copying file lib/strnlen1.c
 Copying file lib/strnlen1.h
+Copying file lib/strnumcmp-in.h
+Copying file lib/strnumcmp.c
+Copying file lib/strnumcmp.h
 Copying file lib/strsignal.c
 Copying file lib/strstr.c
+Copying file lib/strtod.c
 Copying file lib/strtoimax.c
 Copying file lib/strtol.c
+Copying file lib/strtold.c
 Copying file lib/strtoll.c
 Copying file lib/strtoul.c
 Copying file lib/strtoull.c
@@ -4278,6 +4396,8 @@ Copying file lib/sys_types.in.h
 Copying file lib/sys_uio.in.h
 Copying file lib/sys_utsname.in.h
 Copying file lib/sys_wait.in.h
+Copying file lib/targetdir.c
+Copying file lib/targetdir.h
 Copying file lib/tempname.c
 Copying file lib/tempname.h
 Copying file lib/termios.in.h
@@ -4421,6 +4541,12 @@ Copying file lib/xalloc.h
 Copying file lib/xasprintf.c
 Copying file lib/xbinary-io.c
 Copying file lib/xbinary-io.h
+Copying file lib/xdectoimax.c
+Copying file lib/xdectoint.c
+Copying file lib/xdectoint.h
+Copying file lib/xdectoumax.c
+Copying file lib/xfts.c
+Copying file lib/xfts.h
 Copying file lib/xgetaname-impl.h
 Copying file lib/xgetcwd.c
 Copying file lib/xgetcwd.h
@@ -4476,6 +4602,7 @@ Copying file m4/build-to-host.m4
 Copying file m4/builtin-expect.m4
 Copying file m4/byteswap.m4
 Copying file m4/c-bool.m4
+Copying file m4/c-strtod.m4
 Copying file m4/c32rtomb.m4
 Copying file m4/calloc.m4
 Copying file m4/canon-host.m4
@@ -4621,6 +4748,7 @@ Copying file m4/largefile.m4
 Copying file m4/lchmod.m4
 Copying file m4/lchown.m4
 Copying file m4/lcmessage.m4
+Copying file m4/ldexp.m4
 Copying file m4/ldexpl.m4
 Copying file m4/lib-ignore.m4
 Copying file m4/lib-ld.m4
@@ -4805,7 +4933,9 @@ Copying file m4/string_h.m4
 Copying file m4/strnlen.m4
 Copying file m4/strsignal.m4
 Copying file m4/strstr.m4
+Copying file m4/strtod.m4
 Copying file m4/strtoimax.m4
+Copying file m4/strtold.m4
 Copying file m4/strtoll.m4
 Copying file m4/strtoull.m4
 Copying file m4/strtoumax.m4
@@ -4960,9 +5090,11 @@ You may need to add #include directives for the following .h files.
   #include "backupfile.h"
   #include "base32.h"
   #include "base64.h"
+  #include "buffer-lcm.h"
   #include "c-strcase.h"
   #include "canon-host.h"
   #include "canonicalize.h"
+  #include "cl-strtod.h"
   #include "closein.h"
   #include "closeout.h"
   #include "configmake.h"
@@ -4972,7 +5104,9 @@ You may need to add #include directives for the following .h files.
   #include "dirname.h"
   #include "exclude.h"
   #include "exitfail.h"
+  #include "fadvise.h"
   #include "fcntl-safer.h"
+  #include "fd-reopen.h"
   #include "file-type.h"
   #include "filemode.h"
   #include "filenamecat.h"
@@ -4989,6 +5123,7 @@ You may need to add #include directives for the following .h files.
   #include "hard-locale.h"
   #include "hash-triple.h"
   #include "hash.h"
+  #include "heap.h"
   #include "human.h"
   #include "idcache.h"
   #include "idx.h"
@@ -5021,11 +5156,14 @@ You may need to add #include directives for the following .h files.
   #include "propername.h"
   #include "quote.h"
   #include "quotearg.h"
+  #include "randint.h"
+  #include "randperm.h"
   #include "read-file.h"
   #include "readtokens.h"
   #include "readtokens0.h"
   #include "readutmp.h"
   #include "renameatu.h"
+  #include "root-dev-ino.h"
   #include "safe-read.h"
   #include "same.h"
   #include "save-cwd.h"
@@ -5036,13 +5174,17 @@ You may need to add #include directives for the following .h files.
   #include "sha256.h"
   #include "sha512.h"
   #include "sig2str.h"
+  #include "skipchars.h"
   #include "sm3.h"
+  #include "smack.h"
   #include "stat-macros.h"
   #include "stat-size.h"
   #include "stat-time.h"
   #include "stdio-safer.h"
   #include "stdlib-safer.h"
   #include "strftime.h"
+  #include "strnumcmp.h"
+  #include "targetdir.h"
   #include "tempname.h"
   #include "timespec.h"
   #include "tmpdir.h"
@@ -5059,6 +5201,8 @@ You may need to add #include directives for the following .h files.
   #include "write-any-file.h"
   #include "xalloc.h"
   #include "xbinary-io.h"
+  #include "xdectoint.h"
+  #include "xfts.h"
   #include "xgetcwd.h"
   #include "xgethostname.h"
   #include "xmemcoll.h"
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/.gitignore
deleted file mode 100644 (file)
index bbff9ac..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-*.I[12]
-*.[EIOXao]
-*.bak
-*.gcda
-*.gcno
-._bootmp
-.deps
-.gdb-history
-.kludge-stamp
-.version
-/*.patch
-/.Tpo
-/.am*
-/.re-list
-/.sc-start-*
-/ABOUT-NLS
-/ChangeLog
-/INSTALL
-/THANKS-to-translators
-/aclocal.m4
-/autom4te.cache
-/build-aux/ar-lib
-/build-aux/compile
-/build-aux/config.guess
-/build-aux/config.sub
-/build-aux/depcomp
-/build-aux/install-sh
-/build-aux/mdate-sh
-/build-aux/missing
-/build-aux/texinfo.tex
-/build-aux/ylwrap
-/confdefs*
-/config.cache
-/config.log
-/config.status
-/configure
-/conftest*
-/coreutils-*.tar.gz
-/coreutils-*.tar.gz.sig
-/coreutils-*.tar.xz
-/coreutils-*.tar.xz.sig
-/doc/coverage
-/doc/manual
-/lib/.dirstamp
-/m4/.cvsignore
-/man/*.1
-/po/*.gmo
-/po/*.po
-/po/.gitignore
-/po/.reference
-/po/LINGUAS
-/po/Makefile.in
-/po/Makefile.in.in
-/po/Makevars
-/po/Makevars.template
-/po/POTFILES
-/po/Rules-quot
-/po/boldquot.sed
-/po/checksums
-/po/coreutils.pot
-/po/en@boldquot.header
-/po/en@quot.header
-/po/insert-header.sin
-/po/quot.sed
-/po/remove-potcdate.sed
-/po/remove-potcdate.sin
-/po/stamp-po
-/src/coreutils.h
-/src/coreutils_shebangs
-/src/coreutils_symlinks
-/src/cu-progs.mk
-/src/fs-def
-/src/fs-kernel-magic
-/src/fs-latest-magic.h
-/src/fs-magic
-/src/make-prime-list
-/src/primes.h
-/src/single-binary.mk
-/src/version.c
-/src/version.h
-/stamp-h1
-/tests/*/*.log
-/tests/*/*.trs
-/tests/.built-programs
-/tests/factor/t[0-9][0-9].sh
-/tests/t?
-/tests/test-suite.log
-/tight-scope.mk
-ID
-Makefile
-Makefile.in
-TAGS
-THANKS
-THANKS-to-translators
-/GNUmakefile
-/maint.mk
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/build-aux/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/build-aux/.gitignore
deleted file mode 100644 (file)
index 6634665..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/announce-gen
-/config.rpath
-/do-release-commit-and-tag
-/gendocs.sh
-/git-version-gen
-/gitlog-to-changelog
-/gnu-web-doc-update
-/gnupload
-/update-copyright
-/useless-if-before-free
-/vc-list-files
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/doc/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/doc/.gitignore
deleted file mode 100644 (file)
index cf41366..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/gendocs_template
-/gendocs_template_min
-/parse-datetime.texi
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/.gitignore
deleted file mode 100644 (file)
index c92b7ef..0000000
+++ /dev/null
@@ -1,640 +0,0 @@
-/_Noreturn.h
-/accept.c
-/arg-nonnull.h
-/array-mergesort.h
-/atoll.c
-/atomic-int-gnulib.h
-/atomic-int-posix.h
-/bench-digest.h
-/bench-md5.c
-/bench-sha1.c
-/bench-sha224.c
-/bench-sha256.c
-/bench-sha384.c
-/bench-sha512.c
-/bench.h
-/bind.c
-/c++defs.h
-/c-strcasestr.c
-/c-strcasestr.h
-/c32rtomb.c
-/c32tob.c
-/connect.c
-/creat.c
-/getrusage.c
-/gnulib.mk
-/inet_pton.c
-/infinity.h
-/init.sh
-/ioctl.c
-/listen.c
-/locale.c
-/localename-table.c
-/localename-table.h
-/localename.c
-/localename.h
-/macros.h
-/minus-zero.h
-/nan.h
-/nap.h
-/null-ptr.h
-/perror.c
-/qemu.h
-/random.c
-/random_r.c
-/randomd.c
-/randoml.c
-/sched_yield.c
-/setlocale.c
-/setsockopt.c
-/signature.h
-/signed-nan.h
-/signed-snan.h
-/sleep.c
-/snan.h
-/socket.c
-/str-two-way.h
-/strerror_r.c
-/test-accept.c
-/test-access.c
-/test-access.h
-/test-alignalloc.c
-/test-alignasof.c
-/test-alignof.c
-/test-alloca-opt.c
-/test-areadlink-with-size.c
-/test-areadlink.c
-/test-areadlink.h
-/test-areadlinkat-with-size.c
-/test-areadlinkat.c
-/test-argmatch.c
-/test-argv-iter.c
-/test-arpa_inet.c
-/test-array-mergesort.c
-/test-assert.c
-/test-base32.c
-/test-base64.c
-/test-binary-io.c
-/test-binary-io.sh
-/test-bind.c
-/test-bitrotate.c
-/test-btoc32-1.sh
-/test-btoc32-2.sh
-/test-btoc32-3.sh
-/test-btoc32.c
-/test-btowc-1.sh
-/test-btowc-2.sh
-/test-btowc-3.sh
-/test-btowc.c
-/test-byteswap.c
-/test-c-ctype.c
-/test-c-strcase.sh
-/test-c-strcasecmp.c
-/test-c-strcasestr.c
-/test-c-strncasecmp.c
-/test-c32_apply_type_test.c
-/test-c32_get_type_test.c
-/test-c32isalnum.c
-/test-c32isalnum.sh
-/test-c32isalpha.c
-/test-c32isalpha.sh
-/test-c32isblank.c
-/test-c32isblank.sh
-/test-c32iscntrl.c
-/test-c32iscntrl.sh
-/test-c32isdigit.c
-/test-c32isdigit.sh
-/test-c32isgraph.c
-/test-c32isgraph.sh
-/test-c32islower.c
-/test-c32islower.sh
-/test-c32isprint.c
-/test-c32isprint.sh
-/test-c32ispunct.c
-/test-c32ispunct.sh
-/test-c32isspace.c
-/test-c32isspace.sh
-/test-c32isupper.c
-/test-c32isupper.sh
-/test-c32isxdigit.c
-/test-c32isxdigit.sh
-/test-c32rtomb-w32-2.sh
-/test-c32rtomb-w32-3.sh
-/test-c32rtomb-w32-4.sh
-/test-c32rtomb-w32-5.sh
-/test-c32rtomb-w32-6.sh
-/test-c32rtomb-w32-7.sh
-/test-c32rtomb-w32-8.sh
-/test-c32rtomb-w32.c
-/test-c32rtomb.c
-/test-c32rtomb.sh
-/test-c32tolower.c
-/test-c32tolower.sh
-/test-c32width.c
-/test-calloc-gnu.c
-/test-canonicalize.c
-/test-chdir.c
-/test-chmod.c
-/test-chown.c
-/test-chown.h
-/test-cloexec.c
-/test-close.c
-/test-closein.c
-/test-closein.sh
-/test-connect.c
-/test-copy-acl-1.sh
-/test-copy-acl-2.sh
-/test-copy-acl.c
-/test-copy-acl.sh
-/test-count-leading-zeros.c
-/test-creat.c
-/test-ctype.c
-/test-di-set.c
-/test-digest.h
-/test-dirent-safer.c
-/test-dirent.c
-/test-dirfd.c
-/test-dirname.c
-/test-dup-safer.c
-/test-dup.c
-/test-dup2.c
-/test-dynarray.c
-/test-environ.c
-/test-errno.c
-/test-error.c
-/test-error.sh
-/test-euidaccess.c
-/test-exclude.c
-/test-exclude1.sh
-/test-exclude2.sh
-/test-exclude3.sh
-/test-exclude4.sh
-/test-exclude5.sh
-/test-exclude6.sh
-/test-exclude7.sh
-/test-exclude8.sh
-/test-explicit_bzero.c
-/test-faccessat.c
-/test-fchdir.c
-/test-fchmodat.c
-/test-fchownat.c
-/test-fclose.c
-/test-fcntl-h.c
-/test-fcntl-safer.c
-/test-fcntl.c
-/test-fdatasync.c
-/test-fdopen.c
-/test-fdopendir.c
-/test-fdutimensat.c
-/test-fflush.c
-/test-fflush2.c
-/test-fflush2.sh
-/test-fgetc.c
-/test-file-has-acl-1.sh
-/test-file-has-acl-2.sh
-/test-file-has-acl.c
-/test-file-has-acl.sh
-/test-filenamecat.c
-/test-filevercmp.c
-/test-float.c
-/test-fnmatch-1.sh
-/test-fnmatch-2.sh
-/test-fnmatch-3.sh
-/test-fnmatch-4.sh
-/test-fnmatch-5.sh
-/test-fnmatch-h.c
-/test-fnmatch-w32-2.sh
-/test-fnmatch-w32-3.sh
-/test-fnmatch-w32-4.sh
-/test-fnmatch-w32-5.sh
-/test-fnmatch-w32-6.sh
-/test-fnmatch-w32-7.sh
-/test-fnmatch-w32-8.sh
-/test-fnmatch-w32.c
-/test-fnmatch.c
-/test-fopen-gnu.c
-/test-fopen-safer.c
-/test-fopen.c
-/test-fopen.h
-/test-fpending.c
-/test-fpending.sh
-/test-fprintf-posix.h
-/test-fpurge.c
-/test-fputc.c
-/test-fread.c
-/test-freadahead.c
-/test-freadahead.sh
-/test-freading.c
-/test-freadptr.c
-/test-freadptr.sh
-/test-freadptr2.c
-/test-freadptr2.sh
-/test-freadseek.c
-/test-freadseek.sh
-/test-free.c
-/test-freopen-safer.c
-/test-freopen.c
-/test-frexp.c
-/test-frexp.h
-/test-frexpl.c
-/test-fseek.c
-/test-fseek.sh
-/test-fseek2.sh
-/test-fseeko.c
-/test-fseeko.sh
-/test-fseeko2.sh
-/test-fseeko3.c
-/test-fseeko3.sh
-/test-fseeko4.c
-/test-fseeko4.sh
-/test-fseterr.c
-/test-fstat.c
-/test-fstatat.c
-/test-fsync.c
-/test-ftell.c
-/test-ftell.sh
-/test-ftell2.sh
-/test-ftell3.c
-/test-ftello.c
-/test-ftello.sh
-/test-ftello2.sh
-/test-ftello3.c
-/test-ftello4.c
-/test-ftello4.sh
-/test-ftruncate.c
-/test-ftruncate.sh
-/test-futimens.c
-/test-futimens.h
-/test-fwrite.c
-/test-getaddrinfo.c
-/test-getcwd-lgpl.c
-/test-getcwd.c
-/test-getcwd.sh
-/test-getdelim.c
-/test-getdtablesize.c
-/test-getgroups.c
-/test-gethostname.c
-/test-getline.c
-/test-getloadavg.c
-/test-getlogin.c
-/test-getlogin.h
-/test-getndelim2.c
-/test-getopt-gnu.c
-/test-getopt-main.h
-/test-getopt-posix.c
-/test-getopt.h
-/test-getopt_long.h
-/test-getprogname.c
-/test-getrandom.c
-/test-getrusage.c
-/test-gettime-res.c
-/test-gettimeofday.c
-/test-hard-locale.c
-/test-hash.c
-/test-i-ring.c
-/test-iconv-h.c
-/test-iconv.c
-/test-ignore-value.c
-/test-inet_ntop.c
-/test-inet_pton.c
-/test-init.sh
-/test-ino-map.c
-/test-intprops.c
-/test-inttostr.c
-/test-inttypes.c
-/test-ioctl.c
-/test-isatty.c
-/test-isblank.c
-/test-isnand-nolibm.c
-/test-isnand.h
-/test-isnanf-nolibm.c
-/test-isnanf.h
-/test-isnanl-nolibm.c
-/test-isnanl.h
-/test-iswblank.c
-/test-iswctype.c
-/test-iswdigit.c
-/test-iswdigit.sh
-/test-iswpunct.c
-/test-iswpunct.sh
-/test-iswxdigit.c
-/test-iswxdigit.sh
-/test-langinfo.c
-/test-largefile.c
-/test-lchmod.c
-/test-lchown.c
-/test-lchown.h
-/test-libgmp.c
-/test-limits-h.c
-/test-link.c
-/test-link.h
-/test-linkat.c
-/test-listen.c
-/test-localcharset.c
-/test-locale.c
-/test-localeconv.c
-/test-localename.c
-/test-lock.c
-/test-lseek.c
-/test-lseek.sh
-/test-lstat.c
-/test-lstat.h
-/test-lutimens.h
-/test-malloc-gnu.c
-/test-malloca.c
-/test-math.c
-/test-mbrlen-1.sh
-/test-mbrlen-2.sh
-/test-mbrlen-3.sh
-/test-mbrlen-4.sh
-/test-mbrlen-5.sh
-/test-mbrlen-w32-2.sh
-/test-mbrlen-w32-3.sh
-/test-mbrlen-w32-4.sh
-/test-mbrlen-w32-5.sh
-/test-mbrlen-w32-6.sh
-/test-mbrlen-w32-7.sh
-/test-mbrlen-w32-8.sh
-/test-mbrlen-w32.c
-/test-mbrlen.c
-/test-mbrtoc32-1.sh
-/test-mbrtoc32-2.sh
-/test-mbrtoc32-3.sh
-/test-mbrtoc32-4.sh
-/test-mbrtoc32-5.sh
-/test-mbrtoc32-w32-2.sh
-/test-mbrtoc32-w32-3.sh
-/test-mbrtoc32-w32-4.sh
-/test-mbrtoc32-w32-5.sh
-/test-mbrtoc32-w32-6.sh
-/test-mbrtoc32-w32-7.sh
-/test-mbrtoc32-w32-8.sh
-/test-mbrtoc32-w32.c
-/test-mbrtoc32.c
-/test-mbrtowc-1.sh
-/test-mbrtowc-2.sh
-/test-mbrtowc-3.sh
-/test-mbrtowc-4.sh
-/test-mbrtowc-5.sh
-/test-mbrtowc-w32-2.sh
-/test-mbrtowc-w32-3.sh
-/test-mbrtowc-w32-4.sh
-/test-mbrtowc-w32-5.sh
-/test-mbrtowc-w32-6.sh
-/test-mbrtowc-w32-7.sh
-/test-mbrtowc-w32-8.sh
-/test-mbrtowc-w32.c
-/test-mbrtowc.c
-/test-mbscasecmp.c
-/test-mbscasecmp.sh
-/test-mbschr.c
-/test-mbschr.sh
-/test-mbsinit.c
-/test-mbsinit.sh
-/test-mbsrtoc32s-1.sh
-/test-mbsrtoc32s-2.sh
-/test-mbsrtoc32s-3.sh
-/test-mbsrtoc32s-4.sh
-/test-mbsrtoc32s-5.sh
-/test-mbsrtoc32s.c
-/test-mbsrtowcs-1.sh
-/test-mbsrtowcs-2.sh
-/test-mbsrtowcs-3.sh
-/test-mbsrtowcs-4.sh
-/test-mbsrtowcs-5.sh
-/test-mbsrtowcs.c
-/test-mcel.c
-/test-md5-buffer.c
-/test-md5-stream.c
-/test-memcasecmp.c
-/test-memchr.c
-/test-memchr2.c
-/test-memcoll.c
-/test-memrchr.c
-/test-memset_explicit.c
-/test-mkdir.c
-/test-mkdir.h
-/test-mkdirat.c
-/test-mkfifo.c
-/test-mkfifo.h
-/test-mkfifoat.c
-/test-mknod.c
-/test-nanosleep.c
-/test-netdb.c
-/test-netinet_in.c
-/test-nl_langinfo-mt.c
-/test-nl_langinfo1.c
-/test-nl_langinfo1.sh
-/test-nl_langinfo2.c
-/test-nl_langinfo2.sh
-/test-nstrftime.c
-/test-nullptr.c
-/test-once.c
-/test-open.c
-/test-open.h
-/test-openat-safer.c
-/test-openat.c
-/test-parse-datetime.c
-/test-pathmax.c
-/test-perror.c
-/test-perror.sh
-/test-perror2.c
-/test-physmem.c
-/test-pipe.c
-/test-pipe2.c
-/test-posix_memalign.c
-/test-posixtm.c
-/test-printf-frexp.c
-/test-printf-frexpl.c
-/test-printf-posix.h
-/test-printf-posix.output
-/test-priv-set.c
-/test-pselect.c
-/test-pthread-cond.c
-/test-pthread-mutex.c
-/test-pthread-thread.c
-/test-pthread.c
-/test-pthread_sigmask1.c
-/test-pthread_sigmask2.c
-/test-qsort_r.c
-/test-quotearg-simple.c
-/test-quotearg.h
-/test-raise.c
-/test-random-mt.c
-/test-random.c
-/test-random_r.c
-/test-rawmemchr.c
-/test-read-file.c
-/test-read.c
-/test-readlink.c
-/test-readlink.h
-/test-readlinkat.c
-/test-readtokens.c
-/test-readtokens.sh
-/test-readutmp.c
-/test-realloc-gnu.c
-/test-reallocarray.c
-/test-regex.c
-/test-remove.c
-/test-rename.c
-/test-rename.h
-/test-renameat.c
-/test-renameatu.c
-/test-rmdir.c
-/test-rmdir.h
-/test-rwlock1.c
-/test-sameacls.c
-/test-sched.c
-/test-scratch-buffer.c
-/test-select-fd.c
-/test-select-in.sh
-/test-select-out.sh
-/test-select-stdin.c
-/test-select.c
-/test-select.h
-/test-set-mode-acl-1.sh
-/test-set-mode-acl-2.sh
-/test-set-mode-acl.c
-/test-set-mode-acl.sh
-/test-setenv.c
-/test-setlocale1.c
-/test-setlocale1.sh
-/test-setlocale2.c
-/test-setlocale2.sh
-/test-setlocale_null-mt-all.c
-/test-setlocale_null-mt-one.c
-/test-setlocale_null.c
-/test-setsockopt.c
-/test-sha1-buffer.c
-/test-sha1-stream.c
-/test-sha256-stream.c
-/test-sha512-stream.c
-/test-sigaction.c
-/test-signal-h.c
-/test-signbit.c
-/test-sigprocmask.c
-/test-sleep.c
-/test-sm3-buffer.c
-/test-snprintf.c
-/test-sockets.c
-/test-stat-time.c
-/test-stat.c
-/test-stat.h
-/test-stdbool.c
-/test-stdckdint.c
-/test-stddef.c
-/test-stdint.c
-/test-stdio.c
-/test-stdlib.c
-/test-strerror.c
-/test-strerror_r.c
-/test-string.c
-/test-strnlen.c
-/test-strsignal.c
-/test-strtoimax.c
-/test-strtoll.c
-/test-strtoull.c
-/test-strtoumax.c
-/test-symlink.c
-/test-symlink.h
-/test-symlinkat.c
-/test-sys_ioctl.c
-/test-sys_random.c
-/test-sys_resource.c
-/test-sys_select.c
-/test-sys_socket.c
-/test-sys_stat.c
-/test-sys_time.c
-/test-sys_types.c
-/test-sys_uio.c
-/test-sys_utsname.c
-/test-sys_wait.c
-/test-sys_wait.h
-/test-termios.c
-/test-thread_create.c
-/test-thread_self.c
-/test-time-h.c
-/test-time.c
-/test-timespec.c
-/test-tls.c
-/test-u64.c
-/test-uchar.c
-/test-uname.c
-/test-unicodeio.c
-/test-unicodeio1.sh
-/test-unicodeio2.sh
-/test-unicodeio3.sh
-/test-unistd.c
-/test-unlink.c
-/test-unlink.h
-/test-unlinkat.c
-/test-unsetenv.c
-/test-update-copyright.sh
-/test-userspec.c
-/test-usleep.c
-/test-utime-h.c
-/test-utime.c
-/test-utimens-common.h
-/test-utimens.c
-/test-utimens.h
-/test-utimensat.c
-/test-vasnprintf.c
-/test-vasprintf-posix.c
-/test-vasprintf.c
-/test-vc-list-files-cvs.sh
-/test-vc-list-files-git.sh
-/test-verify-try.c
-/test-verify.c
-/test-verify.sh
-/test-verror.c
-/test-verror.sh
-/test-version-etc.c
-/test-version-etc.sh
-/test-vfprintf-posix.c
-/test-vfprintf-posix.sh
-/test-vprintf-posix.c
-/test-vprintf-posix.sh
-/test-wchar.c
-/test-wcrtomb-w32-2.sh
-/test-wcrtomb-w32-3.sh
-/test-wcrtomb-w32-4.sh
-/test-wcrtomb-w32-5.sh
-/test-wcrtomb-w32-6.sh
-/test-wcrtomb-w32-7.sh
-/test-wcrtomb-w32-8.sh
-/test-wcrtomb-w32.c
-/test-wcrtomb.c
-/test-wcrtomb.sh
-/test-wctype-h.c
-/test-wctype.c
-/test-wcwidth.c
-/test-write.c
-/test-xalloc-die.c
-/test-xalloc-die.sh
-/test-xfprintf-posix.c
-/test-xprintf-posix.c
-/test-xprintf-posix.sh
-/test-xstrtoimax.c
-/test-xstrtoimax.sh
-/test-xstrtol.c
-/test-xstrtol.sh
-/test-xstrtoul.c
-/test-xstrtoumax.c
-/test-xstrtoumax.sh
-/test-xvasprintf.c
-/test-year2038.c
-/test-yesno.c
-/test-yesno.sh
-/thread-optim.h
-/timespec-add.c
-/timespec-sub.c
-/tmpfile.c
-/usleep.c
-/vma-iter.c
-/vma-iter.h
-/w32sock.h
-/warn-on-use.h
-/wctob.c
-/wctomb-impl.h
-/wctomb.c
-/zerosize-ptr.h
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/glthread/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/glthread/.gitignore
deleted file mode 100644 (file)
index 1b9c24f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/thread.c
-/thread.h
-/yield.h
index 79186c63ee4b43f81f6b28326aa741c7fed30ce4..698866ff99ac82316a8a84c519ca95372ce58146 100644 (file)
@@ -52,7 +52,7 @@ AM_CPPFLAGS = \
   -I.. -I$(srcdir)/.. \
   -I../lib -I$(srcdir)/../lib
 
-LDADD = libtests.a ../lib/libgnu.a libtests.a ../lib/libgnu.a libtests.a $(LIBTESTS_LIBDEPS)
+LDADD = libtests.a ../lib/libcoreutils.a libtests.a ../lib/libcoreutils.a libtests.a $(LIBTESTS_LIBDEPS)
 
 libtests_a_SOURCES =
 libtests_a_LIBADD = $(gltests_LIBOBJS)
@@ -926,6 +926,14 @@ EXTRA_DIST += test-faccessat.c signature.h macros.h
 
 ## end   gnulib module faccessat-tests
 
+## begin gnulib module fadvise-tests
+
+TESTS += test-fadvise
+check_PROGRAMS += test-fadvise
+EXTRA_DIST += test-fadvise.c
+
+## end   gnulib module fadvise-tests
+
 ## begin gnulib module fchdir-tests
 
 TESTS += test-fchdir
@@ -1826,6 +1834,7 @@ EXTRA_DIST += test-limits-h.c
 
 TESTS += test-link
 check_PROGRAMS += test-link
+test_link_LDADD = $(LDADD) @LIBINTL@
 EXTRA_DIST += test-link.h test-link.c signature.h macros.h
 
 ## end   gnulib module link-tests
@@ -2468,6 +2477,14 @@ EXTRA_DIST += test-random_r.c signature.h macros.h
 
 ## end   gnulib module random_r-tests
 
+## begin gnulib module randread-tests
+
+TESTS += test-rand-isaac
+check_PROGRAMS += test-rand-isaac
+EXTRA_DIST += test-rand-isaac.c macros.h
+
+## end   gnulib module randread-tests
+
 ## begin gnulib module rawmemchr-tests
 
 TESTS += test-rawmemchr
@@ -2564,6 +2581,7 @@ EXTRA_DIST += test-remove.c signature.h macros.h
 
 TESTS += test-rename
 check_PROGRAMS += test-rename
+test_rename_LDADD = $(LDADD) @LIBINTL@
 EXTRA_DIST += test-rename.h test-rename.c signature.h macros.h
 
 ## end   gnulib module rename-tests
@@ -2948,6 +2966,22 @@ EXTRA_DIST += test-strsignal.c signature.h macros.h
 
 ## end   gnulib module strsignal-tests
 
+## begin gnulib module strtod-tests
+
+TESTS += test-strtod
+check_PROGRAMS += test-strtod
+
+TESTS += test-strtod1.sh
+TESTS_ENVIRONMENT += \
+  LOCALE_FR='@LOCALE_FR@' \
+  LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+  LC_NUMERIC_IMPLEMENTED='@LC_NUMERIC_IMPLEMENTED@'
+check_PROGRAMS += test-strtod1
+test_strtod1_LDADD = $(LDADD) $(SETLOCALE_LIB)
+EXTRA_DIST += test-strtod.c test-strtod1.sh test-strtod1.c signature.h minus-zero.h macros.h
+
+## end   gnulib module strtod-tests
+
 ## begin gnulib module strtoimax-tests
 
 TESTS += test-strtoimax
@@ -2956,6 +2990,22 @@ EXTRA_DIST += test-strtoimax.c signature.h macros.h
 
 ## end   gnulib module strtoimax-tests
 
+## begin gnulib module strtold-tests
+
+TESTS += test-strtold
+check_PROGRAMS += test-strtold
+
+TESTS += test-strtold1.sh
+TESTS_ENVIRONMENT += \
+  LOCALE_FR='@LOCALE_FR@' \
+  LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+  LC_NUMERIC_IMPLEMENTED='@LC_NUMERIC_IMPLEMENTED@'
+check_PROGRAMS += test-strtold1
+test_strtold1_LDADD = $(LDADD) $(SETLOCALE_LIB)
+EXTRA_DIST += test-strtold.c test-strtold1.sh test-strtold1.c signature.h minus-zero.h macros.h
+
+## end   gnulib module strtold-tests
+
 ## begin gnulib module strtoll-tests
 
 TESTS += test-strtoll
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-fadvise.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-fadvise.c
new file mode 100644 (file)
index 0000000..a18c928
--- /dev/null
@@ -0,0 +1,50 @@
+/* Test that fadvise works as advertised.
+   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Pádraig Brady.  */
+
+#include <config.h>
+#include <stdio.h>
+
+#include "fadvise.h"
+
+/* We ignore any errors as these hints are only advisory.
+ * There is the chance one can pass invalid ADVICE, which will
+ * not be indicated, but given the simplicity of the interface
+ * this is unlikely.  Also not returning errors allows the
+ * unconditional passing of descriptors to non standard files,
+ * which will just be ignored if unsupported.  */
+
+int
+main (void)
+{
+  /* Valid.  */
+  fadvise (stdin, FADVISE_SEQUENTIAL);
+  fdadvise (fileno (stdin), 0, 0, FADVISE_RANDOM);
+
+  /* Ignored.  */
+  fadvise (nullptr, FADVISE_RANDOM);
+
+  /* Invalid.  */
+  fdadvise (42, 0, 0, FADVISE_RANDOM);
+  /* Unfortunately C enums are not types.
+     One could hack type safety by wrapping in a struct,
+     but it's probably not worth the complexity in this case.  */
+  fadvise (stdin, FADVISE_SEQUENTIAL + FADVISE_RANDOM);
+  fadvise (stdin, 4242);
+
+  return 0;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-rand-isaac.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-rand-isaac.c
new file mode 100644 (file)
index 0000000..b5aa16a
--- /dev/null
@@ -0,0 +1,591 @@
+/* Test the ISAAC or ISAAC64 pseudorandom number generator.
+
+   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "rand-isaac.h"
+
+#include <fcntl.h>
+#include <stdint.h>
+#include <string.h>
+
+#include "macros.h"
+
+/* This expected output was generated by running the programs in
+   <https://burtleburtle.net/bob/rand/isaacafa.html>, as last modified
+   on 2010-01-22. The 32-bit numbers were output by rand.c, and the
+   64-bit by isaac64.c, both on x86, as those programs are not
+   portable to 64-bit platforms.  */
+
+static isaac_word const expected[2][ISAAC_WORDS] =
+  {
+   #if ISAAC_BITS == 32
+    {
+      UINT32_C (0xf650e4c8), UINT32_C (0xe448e96d),
+      UINT32_C (0x98db2fb4), UINT32_C (0xf5fad54f),
+      UINT32_C (0x433f1afb), UINT32_C (0xedec154a),
+      UINT32_C (0xd8370487), UINT32_C (0x46ca4f9a),
+      UINT32_C (0x5de3743e), UINT32_C (0x88381097),
+      UINT32_C (0xf1d444eb), UINT32_C (0x823cedb6),
+      UINT32_C (0x6a83e1e0), UINT32_C (0x4a5f6355),
+      UINT32_C (0xc7442433), UINT32_C (0x25890e2e),
+      UINT32_C (0x7452e319), UINT32_C (0x57161df6),
+      UINT32_C (0x38a824f3), UINT32_C (0x002ed713),
+      UINT32_C (0x29f55449), UINT32_C (0x51c08d83),
+      UINT32_C (0xd78cb99e), UINT32_C (0xa0cc74f3),
+      UINT32_C (0x8f651659), UINT32_C (0xcbc8b7c2),
+      UINT32_C (0xf5f71c69), UINT32_C (0x12ad6419),
+      UINT32_C (0xe5792e1b), UINT32_C (0x860536b8),
+      UINT32_C (0x09b3ce98), UINT32_C (0xd45d6d81),
+      UINT32_C (0xf3b26129), UINT32_C (0x17e38f85),
+      UINT32_C (0x29cf72ce), UINT32_C (0x349947b0),
+      UINT32_C (0xc998f9ff), UINT32_C (0xb5e13dae),
+      UINT32_C (0x32ae2a2b), UINT32_C (0xf7cf814c),
+      UINT32_C (0x8ebfa303), UINT32_C (0xcf22e064),
+      UINT32_C (0x0b923200), UINT32_C (0xeca4d58a),
+      UINT32_C (0xef53cec4), UINT32_C (0xd0f7b37d),
+      UINT32_C (0x9c411a2a), UINT32_C (0xffdf8a80),
+      UINT32_C (0xb40e27bc), UINT32_C (0xb4d2f976),
+      UINT32_C (0x44b89b08), UINT32_C (0xf37c71d5),
+      UINT32_C (0x1a70e7e9), UINT32_C (0x0bdb9c30),
+      UINT32_C (0x60dc5207), UINT32_C (0xb3c3f24b),
+      UINT32_C (0xd7386806), UINT32_C (0x229749b5),
+      UINT32_C (0x4e232cd0), UINT32_C (0x91dabc65),
+      UINT32_C (0xa70e1101), UINT32_C (0x8b87437e),
+      UINT32_C (0x5781414f), UINT32_C (0xcdbc62e2),
+      UINT32_C (0x8107c9ff), UINT32_C (0x69d2e4ae),
+      UINT32_C (0x3b18e752), UINT32_C (0xb143b688),
+      UINT32_C (0x6f4e0772), UINT32_C (0x95138769),
+      UINT32_C (0x943c3c74), UINT32_C (0xafc17a97),
+      UINT32_C (0x0fd43963), UINT32_C (0x6a529b0b),
+      UINT32_C (0xd8c58a6a), UINT32_C (0xa8bcc22d),
+      UINT32_C (0x2db35dfe), UINT32_C (0xa7a2f402),
+      UINT32_C (0x6cb167db), UINT32_C (0x538e1f4e),
+      UINT32_C (0x7275e277), UINT32_C (0x1d3b8e97),
+      UINT32_C (0xecc5dc91), UINT32_C (0x15e3a5b9),
+      UINT32_C (0x03696614), UINT32_C (0x30ab93ec),
+      UINT32_C (0xac9fe69d), UINT32_C (0x7bc76811),
+      UINT32_C (0x60eda8da), UINT32_C (0x28833522),
+      UINT32_C (0xd5295ebc), UINT32_C (0x5adb60e7),
+      UINT32_C (0xf7e1cdd0), UINT32_C (0x97166d14),
+      UINT32_C (0xb67ec13a), UINT32_C (0x210f3925),
+      UINT32_C (0x64af0fef), UINT32_C (0x0d028684),
+      UINT32_C (0x3aea3dec), UINT32_C (0xb058bafb),
+      UINT32_C (0xb8b0ccfc), UINT32_C (0xf2b5cc05),
+      UINT32_C (0xe3a662d9), UINT32_C (0x814bc24c),
+      UINT32_C (0x2364a1aa), UINT32_C (0x37c0ed05),
+      UINT32_C (0x2b36505c), UINT32_C (0x451e7ec8),
+      UINT32_C (0x5d2a542f), UINT32_C (0xe43d0fbb),
+      UINT32_C (0x91c8d925), UINT32_C (0x60d4d5f8),
+      UINT32_C (0x12a0594b), UINT32_C (0x9e8a51da),
+      UINT32_C (0xcd49ebdb), UINT32_C (0x1b0dcdc1),
+      UINT32_C (0xcd57c7f7), UINT32_C (0xe6344451),
+      UINT32_C (0x7ded386f), UINT32_C (0x2f36fa86),
+      UINT32_C (0xa6d12101), UINT32_C (0x33bc405d),
+      UINT32_C (0xb388d96c), UINT32_C (0xdb6dbe96),
+      UINT32_C (0xfe29661c), UINT32_C (0x13edc0cb),
+      UINT32_C (0xcb0eee4a), UINT32_C (0x70cc94ae),
+      UINT32_C (0xde11ed34), UINT32_C (0x0606cf9f),
+      UINT32_C (0x3a6ce389), UINT32_C (0x23d74f4e),
+      UINT32_C (0xa37f63ff), UINT32_C (0x917bdec2),
+      UINT32_C (0xd73f72d4), UINT32_C (0x0e7e0e67),
+      UINT32_C (0x3d77d9a2), UINT32_C (0x13add922),
+      UINT32_C (0x8891b3db), UINT32_C (0x01a9bd70),
+      UINT32_C (0x56a001e3), UINT32_C (0xd51f093d),
+      UINT32_C (0xcc033ce3), UINT32_C (0x5ad0d3b0),
+      UINT32_C (0x34105a8c), UINT32_C (0x6a123f57),
+      UINT32_C (0xbd2e5024), UINT32_C (0x7364944b),
+      UINT32_C (0xe89b1a3b), UINT32_C (0x21835c4d),
+      UINT32_C (0x9f39e2d9), UINT32_C (0xd405ded8),
+      UINT32_C (0x294d37e5), UINT32_C (0xbccaaeed),
+      UINT32_C (0x35a124b5), UINT32_C (0x6708a2bc),
+      UINT32_C (0xb00960ba), UINT32_C (0x2a98121a),
+      UINT32_C (0x4d8fae82), UINT32_C (0x0bb3263f),
+      UINT32_C (0x12595a19), UINT32_C (0x6a107589),
+      UINT32_C (0x0809e494), UINT32_C (0x21c171ec),
+      UINT32_C (0x884d6825), UINT32_C (0x14c8009b),
+      UINT32_C (0xb0b84e7b), UINT32_C (0x03fb88f4),
+      UINT32_C (0x28e7cb78), UINT32_C (0x9388b13b),
+      UINT32_C (0xdd2dc1d5), UINT32_C (0x848f520a),
+      UINT32_C (0x07c28cd1), UINT32_C (0x68a39358),
+      UINT32_C (0x72c9137d), UINT32_C (0x127dd430),
+      UINT32_C (0xc613f157), UINT32_C (0x8c2f0d55),
+      UINT32_C (0xf7d3f39f), UINT32_C (0x309bfb78),
+      UINT32_C (0x8406b137), UINT32_C (0x46c0a6f5),
+      UINT32_C (0x3718d597), UINT32_C (0x08607f04),
+      UINT32_C (0x76904b6d), UINT32_C (0x04db4e13),
+      UINT32_C (0xcd7411a7), UINT32_C (0xb510ce0e),
+      UINT32_C (0xbfc7f7cc), UINT32_C (0xb83f957a),
+      UINT32_C (0xfdfef62d), UINT32_C (0xc35e4580),
+      UINT32_C (0x3ff1e524), UINT32_C (0x4112d96c),
+      UINT32_C (0x02c9b944), UINT32_C (0xd5990dfb),
+      UINT32_C (0xe7e26581), UINT32_C (0x0d9c7e7e),
+      UINT32_C (0x826dfa89), UINT32_C (0x66f1e0ab),
+      UINT32_C (0x30bcc764), UINT32_C (0xeadebeac),
+      UINT32_C (0xed35e5ee), UINT32_C (0x0c571a7d),
+      UINT32_C (0xe4f3a26a), UINT32_C (0xf7f58f7b),
+      UINT32_C (0xadf6bc23), UINT32_C (0x5d023e65),
+      UINT32_C (0x1ed3ff4e), UINT32_C (0xec46b0b6),
+      UINT32_C (0xd2a93b51), UINT32_C (0xe75b41c9),
+      UINT32_C (0x7e315aeb), UINT32_C (0x61119a5a),
+      UINT32_C (0x53245b79), UINT32_C (0x33f6d7b1),
+      UINT32_C (0xcae8deba), UINT32_C (0x50fc8194),
+      UINT32_C (0xafa92a6d), UINT32_C (0xc87c8006),
+      UINT32_C (0x4188bfcd), UINT32_C (0x8bace62e),
+      UINT32_C (0x78ffa568), UINT32_C (0x5597ec0f),
+      UINT32_C (0xb4415f7d), UINT32_C (0x08294766),
+      UINT32_C (0xad567643), UINT32_C (0x09c36f90),
+      UINT32_C (0x3dde9f39), UINT32_C (0x4a0a283c),
+      UINT32_C (0x18080c8e), UINT32_C (0x080c79ec),
+      UINT32_C (0x79ae4c10), UINT32_C (0xcb9e1563),
+      UINT32_C (0x7cdd662f), UINT32_C (0x62d31911),
+      UINT32_C (0xa4ca0cf1), UINT32_C (0x5cf824cd),
+      UINT32_C (0x3b708f99), UINT32_C (0x1e16614c),
+      UINT32_C (0xb6b9d766), UINT32_C (0x5de87abb),
+      UINT32_C (0x7229ea81), UINT32_C (0xd5b2d750),
+      UINT32_C (0x56e6cd21), UINT32_C (0xfe1e42d5),
+      UINT32_C (0x96da2655), UINT32_C (0xc2b9aa36),
+      UINT32_C (0xb8f6fd4a), UINT32_C (0x6a158d10),
+      UINT32_C (0x01913fd3), UINT32_C (0xaf7d1fb8),
+      UINT32_C (0x0b5e435f), UINT32_C (0x90c10757),
+      UINT32_C (0x6554abda), UINT32_C (0x7a68710f)
+    },
+    {
+      UINT32_C (0x82ac484f), UINT32_C (0xd7e1c7be),
+      UINT32_C (0x95c85eaa), UINT32_C (0x94a302f4),
+      UINT32_C (0x4d3cfbda), UINT32_C (0x786b2908),
+      UINT32_C (0x1010b275), UINT32_C (0x82d53d12),
+      UINT32_C (0x21e2a51c), UINT32_C (0x3d1e9150),
+      UINT32_C (0xb059261d), UINT32_C (0xd0638e1a),
+      UINT32_C (0x31860f05), UINT32_C (0x81f2864d),
+      UINT32_C (0xff4cfc35), UINT32_C (0x0451516d),
+      UINT32_C (0xbd086f26), UINT32_C (0xbc5654c1),
+      UINT32_C (0x65dfa427), UINT32_C (0xa82427f5),
+      UINT32_C (0x582e3014), UINT32_C (0xb8d2486d),
+      UINT32_C (0xc79a1749), UINT32_C (0x9a1d7745),
+      UINT32_C (0x8766bb54), UINT32_C (0x1e04a7f7),
+      UINT32_C (0x3d3dff8a), UINT32_C (0xd5ec6bf4),
+      UINT32_C (0xdbef7d9f), UINT32_C (0x36ec0ea3),
+      UINT32_C (0x1feb2e4f), UINT32_C (0x15cfcc5c),
+      UINT32_C (0xd8c423fb), UINT32_C (0xd0ef3cc9),
+      UINT32_C (0xeb244925), UINT32_C (0xba5590c8),
+      UINT32_C (0xa5f48ac4), UINT32_C (0x33c5321c),
+      UINT32_C (0x613b67b2), UINT32_C (0x479c3a22),
+      UINT32_C (0xe21339cc), UINT32_C (0x10d210aa),
+      UINT32_C (0x931dd7e2), UINT32_C (0xef05ee06),
+      UINT32_C (0xb82f2703), UINT32_C (0xa385cb2c),
+      UINT32_C (0x5d67133c), UINT32_C (0x877eb7b4),
+      UINT32_C (0x1e3437f7), UINT32_C (0x5afb43ae),
+      UINT32_C (0x53c078f3), UINT32_C (0x94d90481),
+      UINT32_C (0x1d964589), UINT32_C (0x08063a85),
+      UINT32_C (0xe1322228), UINT32_C (0x1956b1e5),
+      UINT32_C (0x31860f13), UINT32_C (0x2e7b022f),
+      UINT32_C (0x21182ca3), UINT32_C (0x96f703ac),
+      UINT32_C (0x46819e2e), UINT32_C (0x0d28fe52),
+      UINT32_C (0x3724d4dc), UINT32_C (0xa0eabe6b),
+      UINT32_C (0xc66699fd), UINT32_C (0xc6112fdd),
+      UINT32_C (0x19c1e69c), UINT32_C (0x04d3658a),
+      UINT32_C (0x4b55dd99), UINT32_C (0x31907d62),
+      UINT32_C (0xf854b522), UINT32_C (0x4d678f26),
+      UINT32_C (0x22ae0582), UINT32_C (0xeafed133),
+      UINT32_C (0xe4a51d21), UINT32_C (0x84bd6dd6),
+      UINT32_C (0xc1a51375), UINT32_C (0x3f28ee63),
+      UINT32_C (0xfb737b1a), UINT32_C (0x70a1660e),
+      UINT32_C (0x8a8dfaa3), UINT32_C (0x1be79937),
+      UINT32_C (0xf7476978), UINT32_C (0x513c1764),
+      UINT32_C (0x531ac6bf), UINT32_C (0x12c06908),
+      UINT32_C (0x001cdb95), UINT32_C (0x1a4b6a53),
+      UINT32_C (0xd067fce5), UINT32_C (0x12b2cfb6),
+      UINT32_C (0x9ddb477f), UINT32_C (0x740e0066),
+      UINT32_C (0x39ddf25a), UINT32_C (0xcc8bfa2d),
+      UINT32_C (0xf1b20eaf), UINT32_C (0x64f2632c),
+      UINT32_C (0x9783cdee), UINT32_C (0x63bfd4d8),
+      UINT32_C (0x0084cfe5), UINT32_C (0x75f4e9e2),
+      UINT32_C (0x19b48fd0), UINT32_C (0x6c48ddd8),
+      UINT32_C (0x7a36af93), UINT32_C (0x71865c4c),
+      UINT32_C (0x9ce0199d), UINT32_C (0x867027d7),
+      UINT32_C (0x2cb7b77f), UINT32_C (0x84ef01da),
+      UINT32_C (0x72f5972f), UINT32_C (0x040f7074),
+      UINT32_C (0xdf9afa29), UINT32_C (0xc921f94e),
+      UINT32_C (0x75c08a36), UINT32_C (0x18c1ef9a),
+      UINT32_C (0xd649a428), UINT32_C (0xc5b71937),
+      UINT32_C (0x8a30738a), UINT32_C (0xd97cd348),
+      UINT32_C (0x858129a6), UINT32_C (0x239e3b0a),
+      UINT32_C (0xbbb8abc4), UINT32_C (0x80fac4c2),
+      UINT32_C (0xecfcf20b), UINT32_C (0xd9d711f9),
+      UINT32_C (0xe2a4ef71), UINT32_C (0xb5fe87c0),
+      UINT32_C (0xbe8b06b2), UINT32_C (0xaafef5a7),
+      UINT32_C (0x9c15db3b), UINT32_C (0x0aeb8165),
+      UINT32_C (0x4389a84a), UINT32_C (0x253b1d7a),
+      UINT32_C (0x19047c79), UINT32_C (0x7cdc78a2),
+      UINT32_C (0xd20adf03), UINT32_C (0x56f55a71),
+      UINT32_C (0x3e730fa8), UINT32_C (0xfd8650d8),
+      UINT32_C (0x959e234e), UINT32_C (0xb7546681),
+      UINT32_C (0xdad1b22a), UINT32_C (0x142a6e85),
+      UINT32_C (0x8ef4bce6), UINT32_C (0x68235b9d),
+      UINT32_C (0x85a13f85), UINT32_C (0x74096ae7),
+      UINT32_C (0xa949bea2), UINT32_C (0x29322d0d),
+      UINT32_C (0xd5683858), UINT32_C (0x82846526),
+      UINT32_C (0x403dae08), UINT32_C (0x6dd1943a),
+      UINT32_C (0xe1279bff), UINT32_C (0x9e7e4f04),
+      UINT32_C (0x1c3a4524), UINT32_C (0x484525e4),
+      UINT32_C (0x81d4cc5f), UINT32_C (0xe24124c0),
+      UINT32_C (0x037464c0), UINT32_C (0xbf1bd691),
+      UINT32_C (0x26ceb003), UINT32_C (0x275ead3a),
+      UINT32_C (0xc5bde908), UINT32_C (0x26414ff3),
+      UINT32_C (0xa30519ad), UINT32_C (0xd7b43abe),
+      UINT32_C (0x2ce5d3d5), UINT32_C (0x88412761),
+      UINT32_C (0x97ca2070), UINT32_C (0xe5fbb9c7),
+      UINT32_C (0x276df0b4), UINT32_C (0x308f751f),
+      UINT32_C (0x37a97df6), UINT32_C (0xc9cd808c),
+      UINT32_C (0xfe4cb380), UINT32_C (0x3d469303),
+      UINT32_C (0xaee19096), UINT32_C (0xc0d5d42a),
+      UINT32_C (0x4e823ad3), UINT32_C (0xf5f9cc3b),
+      UINT32_C (0x4286619c), UINT32_C (0x9ca45e1c),
+      UINT32_C (0x66c97340), UINT32_C (0x891aec49),
+      UINT32_C (0x45bae606), UINT32_C (0xc798f047),
+      UINT32_C (0x52649d6c), UINT32_C (0xce86fdfc),
+      UINT32_C (0x80c6e402), UINT32_C (0xd6ec2f2b),
+      UINT32_C (0x27c82282), UINT32_C (0x1fe26ce0),
+      UINT32_C (0x92f57ea7), UINT32_C (0xde462f4d),
+      UINT32_C (0x07497cae), UINT32_C (0x5a48755c),
+      UINT32_C (0x721502dd), UINT32_C (0x6cbe7935),
+      UINT32_C (0x836d8003), UINT32_C (0x9ead7f70),
+      UINT32_C (0x9ab3a42f), UINT32_C (0x4c8652d6),
+      UINT32_C (0x32e39273), UINT32_C (0xe8fa3860),
+      UINT32_C (0x1da4f25a), UINT32_C (0x0cd6ef81),
+      UINT32_C (0x02503f7d), UINT32_C (0x8854a0a1),
+      UINT32_C (0x9a30c4e8), UINT32_C (0x88157153),
+      UINT32_C (0x05efe294), UINT32_C (0x57c4c925),
+      UINT32_C (0x2887d96f), UINT32_C (0xc1a71e3c),
+      UINT32_C (0xe9f84163), UINT32_C (0x2d0985de),
+      UINT32_C (0xd21e796c), UINT32_C (0x6fb5ce56),
+      UINT32_C (0x02614abf), UINT32_C (0xc3c7be2c),
+      UINT32_C (0xb54fed6f), UINT32_C (0xa617a083),
+      UINT32_C (0xc3142d8f), UINT32_C (0x6079e4ce),
+      UINT32_C (0xceffc147), UINT32_C (0x1d0cb81b),
+      UINT32_C (0xdc153e5f), UINT32_C (0xe36ef5bb),
+      UINT32_C (0xd531161a), UINT32_C (0x165b1015),
+      UINT32_C (0x7aa114ed), UINT32_C (0x3f7579b3),
+      UINT32_C (0xf7f395f1), UINT32_C (0xbc6172c7),
+      UINT32_C (0xa86f875e), UINT32_C (0x0e6c51b3),
+      UINT32_C (0xcdfec2af), UINT32_C (0x73c0e762),
+      UINT32_C (0x824c2009), UINT32_C (0xc5a87748),
+      UINT32_C (0x94d40125), UINT32_C (0x8aba3ffb),
+      UINT32_C (0xd32be060), UINT32_C (0x8c17eff0),
+      UINT32_C (0x21e2547e), UINT32_C (0x07cffad9),
+      UINT32_C (0x05340e15), UINT32_C (0xf3310c92),
+      UINT32_C (0x9d8d1908), UINT32_C (0x86ba527f),
+      UINT32_C (0xf943f672), UINT32_C (0xef73fbf0),
+      UINT32_C (0x46d95ca5), UINT32_C (0xc54cd95b),
+      UINT32_C (0x9d855e89), UINT32_C (0x4bb5af29)
+    }
+   #else
+    {
+      UINT64_C (0x12a8f216af9418c2), UINT64_C (0xd4490ad526f14431),
+      UINT64_C (0xb49c3b3995091a36), UINT64_C (0x5b45e522e4b1b4ef),
+      UINT64_C (0xa1e9300cd8520548), UINT64_C (0x49787fef17af9924),
+      UINT64_C (0x03219a39ee587a30), UINT64_C (0xebe9ea2adf4321c7),
+      UINT64_C (0x804456af10f5fb53), UINT64_C (0xd74bbe77e6116ac7),
+      UINT64_C (0x7c0828dd624ec390), UINT64_C (0x14a195640116f336),
+      UINT64_C (0x2eab8ca63ce802d7), UINT64_C (0xc6e57a78fbd986e0),
+      UINT64_C (0x58efc10b06a2068d), UINT64_C (0xabeeddb2dde06ff1),
+      UINT64_C (0x0b090a7560a968e3), UINT64_C (0x2cf9c8ca052f6e9f),
+      UINT64_C (0x116d0016cb948f09), UINT64_C (0xa59e0bd101731a28),
+      UINT64_C (0x63767572ae3d6174), UINT64_C (0xab4f6451cc1d45ec),
+      UINT64_C (0xc2a1e7b5b459aeb5), UINT64_C (0x2472f6207c2d0484),
+      UINT64_C (0xe699ed85b0dfb40d), UINT64_C (0xd4347f66ec8941c3),
+      UINT64_C (0xf4d14597e660f855), UINT64_C (0x8b889d624d44885d),
+      UINT64_C (0x258e5a80c7204c4b), UINT64_C (0xaf0c317d32adaa8a),
+      UINT64_C (0x9c4cd6257c5a3603), UINT64_C (0xeb3593803173e0ce),
+      UINT64_C (0x36f60e2ba4fa6800), UINT64_C (0x38b6525c21a42b0e),
+      UINT64_C (0xf4f5d05c10cab243), UINT64_C (0xcf3f4688801eb9aa),
+      UINT64_C (0x1ddc0325259b27de), UINT64_C (0xb9571fa04dc089c8),
+      UINT64_C (0xd7504dfa8816edbb), UINT64_C (0x1fe2cca76517db90),
+      UINT64_C (0x261e4e4c0a333a9d), UINT64_C (0x219b97e26ffc81bd),
+      UINT64_C (0x66b4835d9eafea22), UINT64_C (0x4cc317fb9cddd023),
+      UINT64_C (0x50b704cab602c329), UINT64_C (0xedb454e7badc0805),
+      UINT64_C (0x9e17e49642a3e4c1), UINT64_C (0x66c1a2a1a60cd889),
+      UINT64_C (0x7983eed3740847d5), UINT64_C (0x298af231c85bafab),
+      UINT64_C (0x2680b122baa28d97), UINT64_C (0x734de8181f6ec39a),
+      UINT64_C (0x53898e4c3910da55), UINT64_C (0x1761f93a44d5aefe),
+      UINT64_C (0xe4dbf0634473f5d2), UINT64_C (0x4ed0fe7e9dc91335),
+      UINT64_C (0xd18d8549d140caea), UINT64_C (0x1cfc8bed0d681639),
+      UINT64_C (0xca1e3785a9e724e5), UINT64_C (0xb67c1fa481680af8),
+      UINT64_C (0xdfea21ea9e7557e3), UINT64_C (0xd6b6d0ecc617c699),
+      UINT64_C (0xfa7e393983325753), UINT64_C (0xa09e8c8c35ab96de),
+      UINT64_C (0x8fe88b57305e2ab6), UINT64_C (0x89039d79d6fc5c5c),
+      UINT64_C (0x9bfb227ebdf4c5ce), UINT64_C (0x7f7cc39420a3a545),
+      UINT64_C (0x3f6c6af859d80055), UINT64_C (0xc8763c5b08d1908c),
+      UINT64_C (0x469356c504ec9f9d), UINT64_C (0x26e6db8ffdf5adfe),
+      UINT64_C (0x3a938fee32d29981), UINT64_C (0x2c5e9deb57ef4743),
+      UINT64_C (0x1e99b96e70a9be8b), UINT64_C (0x764dbeae7fa4f3a6),
+      UINT64_C (0xaac40a2703d9bea0), UINT64_C (0x1a8c1e992b941148),
+      UINT64_C (0x73aa8a564fb7ac9e), UINT64_C (0x604d51b25fbf70e2),
+      UINT64_C (0xdd69a0d8ab3b546d), UINT64_C (0x65ca5b96b7552210),
+      UINT64_C (0x2fd7e4b9e72cd38c), UINT64_C (0x51d2b1ab2ddfb636),
+      UINT64_C (0x9d1d84fcce371425), UINT64_C (0xa44cfe79ae538bbe),
+      UINT64_C (0xde68a2355b93cae6), UINT64_C (0x9fc10d0f989993e0),
+      UINT64_C (0x94ebc8abcfb56dae), UINT64_C (0xd7a023a73260b45c),
+      UINT64_C (0x72c8834a5957b511), UINT64_C (0x8f8419a348f296bf),
+      UINT64_C (0x1e152328f3318dea), UINT64_C (0x4838d65f6ef6748f),
+      UINT64_C (0xd6bf7baee43cac40), UINT64_C (0x13328503df48229f),
+      UINT64_C (0x7440fb816508c4fe), UINT64_C (0x9d266d6a1cc0542c),
+      UINT64_C (0x4dda48153c94938a), UINT64_C (0x74c04bf1790c0efe),
+      UINT64_C (0xe1925c71285279f5), UINT64_C (0x8a8e849eb32781a5),
+      UINT64_C (0x073973751f12dd5e), UINT64_C (0xa319ce15b0b4db31),
+      UINT64_C (0x6dd856d94d259236), UINT64_C (0x67378d8eccef96cb),
+      UINT64_C (0x9fc477de4ed681da), UINT64_C (0xf3b8b6675a6507ff),
+      UINT64_C (0xc3a9dc228caac9e9), UINT64_C (0xc37b45b3f8d6f2ba),
+      UINT64_C (0xb559eb1d04e5e932), UINT64_C (0x1b0cab936e65c744),
+      UINT64_C (0xaf08da9177dda93d), UINT64_C (0xac12fb171817eee7),
+      UINT64_C (0x1fff7ac80904bf45), UINT64_C (0xa9119b60369ffebd),
+      UINT64_C (0xbfced1b0048eac50), UINT64_C (0xb67b7896167b4c84),
+      UINT64_C (0x9b3cdb65f82ca382), UINT64_C (0xdbc27ab5447822bf),
+      UINT64_C (0x10dcd78e3851a492), UINT64_C (0xb438c2b67f98e5e9),
+      UINT64_C (0x43954b3252dc25e5), UINT64_C (0xab9090168dd05f34),
+      UINT64_C (0xce68341f79893389), UINT64_C (0x36833336d068f707),
+      UINT64_C (0xdcdd7d20903d0c25), UINT64_C (0xda3a361b1c5157b1),
+      UINT64_C (0x7f9d1a2e1ebe1327), UINT64_C (0x5d0a12f27ad310d1),
+      UINT64_C (0x3bc36e078f7515d7), UINT64_C (0x4da8979a0041e8a9),
+      UINT64_C (0x950113646d1d6e03), UINT64_C (0x7b4a38e32537df62),
+      UINT64_C (0x8a1b083821f40cb4), UINT64_C (0x3d5774a11d31ab39),
+      UINT64_C (0x7a76956c3eafb413), UINT64_C (0x7f5126dbba5e0ca7),
+      UINT64_C (0x12153635b2c0cf57), UINT64_C (0x7b3f0195fc6f290f),
+      UINT64_C (0x5544f7d774b14aef), UINT64_C (0x56c074a581ea17fe),
+      UINT64_C (0xe7f28ecd2d49eecd), UINT64_C (0xe479ee5b9930578c),
+      UINT64_C (0x9ff38fed72e9052f), UINT64_C (0x9f65789a6509a440),
+      UINT64_C (0x0981dcd296a8736d), UINT64_C (0x5873888850659ae7),
+      UINT64_C (0xc678b6d860284a1c), UINT64_C (0x63e22c147b9c3403),
+      UINT64_C (0x92fae24291f2b3f1), UINT64_C (0x829626e3892d95d7),
+      UINT64_C (0xcffe1939438e9b24), UINT64_C (0x79999cdff70902cb),
+      UINT64_C (0x8547eddfb81ccb94), UINT64_C (0x7b77497b32503b12),
+      UINT64_C (0x97fcaacbf030bc24), UINT64_C (0x6ced1983376fa72b),
+      UINT64_C (0x7e75d99d94a70f4d), UINT64_C (0xd2733c4335c6a72f),
+      UINT64_C (0xdbc0d2b6ab90a559), UINT64_C (0x94628d38d0c20584),
+      UINT64_C (0x64972d68dee33360), UINT64_C (0xb9c11d5b1e43a07e),
+      UINT64_C (0x2de0966daf2f8b1c), UINT64_C (0x2e18bc1ad9704a68),
+      UINT64_C (0xd4dba84729af48ad), UINT64_C (0xb7a0b174cff6f36e),
+      UINT64_C (0xe94c39a54a98307f), UINT64_C (0xaa70b5b4f89695a2),
+      UINT64_C (0x3bdbb92c43b17f26), UINT64_C (0xcccb7005c6b9c28d),
+      UINT64_C (0x18a6a990c8b35ebd), UINT64_C (0xfc7c95d827357afa),
+      UINT64_C (0x1fca8a92fd719f85), UINT64_C (0x1dd01aafcd53486a),
+      UINT64_C (0x49353fea39ba63b1), UINT64_C (0xf85b2b4fbcde44b7),
+      UINT64_C (0xbe7444e39328a0ac), UINT64_C (0x3e2b8bcbf016d66d),
+      UINT64_C (0x964e915cd5e2b207), UINT64_C (0x1725cabfcb045b00),
+      UINT64_C (0x7fbf21ec8a1f45ec), UINT64_C (0x11317ba87905e790),
+      UINT64_C (0x2fe4b17170e59750), UINT64_C (0xe8d9ecbe2cf3d73f),
+      UINT64_C (0xb57d2e985e1419c7), UINT64_C (0x0572b974f03ce0bb),
+      UINT64_C (0xa8d7e4dab780a08d), UINT64_C (0x4715ed43e8a45c0a),
+      UINT64_C (0xc330de426430f69d), UINT64_C (0x23b70edb1955c4bf),
+      UINT64_C (0x098954d51fff6580), UINT64_C (0x8107fccf064fcf56),
+      UINT64_C (0x852f54934da55cc9), UINT64_C (0x09c7e552bc76492f),
+      UINT64_C (0xe9f6760e32cd8021), UINT64_C (0xa3bc941d0a5061cb),
+      UINT64_C (0xba89142e007503b8), UINT64_C (0xdc842b7e2819e230),
+      UINT64_C (0xbbe83f4ecc2bdecb), UINT64_C (0xcd454f8f19c5126a),
+      UINT64_C (0xc62c58f97dd949bf), UINT64_C (0x693501d628297551),
+      UINT64_C (0xb9ab4ce57f2d34f3), UINT64_C (0x9255abb50d532280),
+      UINT64_C (0xebfafa33d7254b59), UINT64_C (0xe9f6082b05542e4e),
+      UINT64_C (0x35dd37d5871448af), UINT64_C (0xb03031a8b4516e84),
+      UINT64_C (0xb3f256d8aca0b0b9), UINT64_C (0x0fd22063edc29fca),
+      UINT64_C (0xd9a11fbb3d9808e4), UINT64_C (0x3a9bf55ba91f81ca),
+      UINT64_C (0xc8c93882f9475f5f), UINT64_C (0x947ae053ee56e63c),
+      UINT64_C (0xc7d9f16864a76e94), UINT64_C (0x7bd94e1d8e17debc),
+      UINT64_C (0xd873db391292ed4f), UINT64_C (0x30f5611484119414),
+      UINT64_C (0x565c31f7de89ea27), UINT64_C (0xd0e4366228b03343),
+      UINT64_C (0x325928ee6e6f8794), UINT64_C (0x6f423357e7c6a9f9),
+      UINT64_C (0x99170a5dc3115544), UINT64_C (0x59b97885e2f2ea28),
+      UINT64_C (0xbc4097b116c524d2), UINT64_C (0x7a13f18bbedc4ff5),
+      UINT64_C (0x071582401c38434d), UINT64_C (0xb422061193d6f6a7),
+      UINT64_C (0xb4b81b3fa97511e2), UINT64_C (0x65d34954daf3cebd),
+      UINT64_C (0xb344c470397bba52), UINT64_C (0xbac7a9a18531294b),
+      UINT64_C (0xecb53939887e8175), UINT64_C (0x565601c0364e3228),
+      UINT64_C (0xef1955914b609f93), UINT64_C (0x16f50edf91e513af),
+      UINT64_C (0x56963b0dca418fc0), UINT64_C (0xd60f6dcedc314222),
+      UINT64_C (0x364f6ffa464ee52e), UINT64_C (0x6c3b8e3e336139d3),
+      UINT64_C (0xf943aee7febf21b8), UINT64_C (0x088e049589c432e0),
+      UINT64_C (0xd49503536abca345), UINT64_C (0x3a6c27934e31188a),
+      UINT64_C (0x957baf61700cff4e), UINT64_C (0x37624ae5a48fa6e9),
+      UINT64_C (0x501f65edb3034d07), UINT64_C (0x907f30421d78c5de),
+      UINT64_C (0x1a804aadb9cfa741), UINT64_C (0x0ce2a38c344a6eed),
+      UINT64_C (0xd363eff5f0977996), UINT64_C (0x2cd16e2abd791e33),
+      UINT64_C (0x58627e1a149bba21), UINT64_C (0x7f9b6af1ebf78baf)
+    },
+    {
+      UINT64_C (0xd20d8c88c8ffe65f), UINT64_C (0x917f1dd5f8886c61),
+      UINT64_C (0x56986e2ef3ed091b), UINT64_C (0x5fa7867caf35e149),
+      UINT64_C (0x81a1549fd6573da5), UINT64_C (0x96fbf83a12884624),
+      UINT64_C (0xe728e8c83c334074), UINT64_C (0xf1bcc3d275afe51a),
+      UINT64_C (0x71f1ce2490d20b07), UINT64_C (0xe6c42178c4bbb92e),
+      UINT64_C (0x0a9c32d5eae45305), UINT64_C (0x0c335248857fa9e7),
+      UINT64_C (0x142de49fff7a7c3d), UINT64_C (0x64a53dc924fe7ac9),
+      UINT64_C (0x9f6a419d382595f4), UINT64_C (0x150f361dab9dec26),
+      UINT64_C (0xc61bb3a141e50e8c), UINT64_C (0x2785338347f2ba08),
+      UINT64_C (0x7ca9723fbb2e8988), UINT64_C (0xce2f8642ca0712dc),
+      UINT64_C (0x59300222b4561e00), UINT64_C (0xc2b5a03f71471a6f),
+      UINT64_C (0xd5f9e858292504d5), UINT64_C (0x65fa4f227a2b6d79),
+      UINT64_C (0x93cbe0b699c2585d), UINT64_C (0x1d95b0a5fcf90bc6),
+      UINT64_C (0x17efee45b0dee640), UINT64_C (0x9e4c1269baa4bf37),
+      UINT64_C (0xd79476a84ee20d06), UINT64_C (0x0a56a5f0bfe39272),
+      UINT64_C (0x7eba726d8c94094b), UINT64_C (0x5e5637885f29bc2b),
+      UINT64_C (0xd586bd01c5c217f6), UINT64_C (0x233003b5a6cfe6ad),
+      UINT64_C (0x24c0e332b70019b0), UINT64_C (0x9da058c67844f20c),
+      UINT64_C (0xe4d9429322cd065a), UINT64_C (0x1fab64ea29a2ddf7),
+      UINT64_C (0x8af38731c02ba980), UINT64_C (0x7dc7785b8efdfc80),
+      UINT64_C (0x486289ddcc3d6780), UINT64_C (0x222bbfae61725606),
+      UINT64_C (0x2bc60a63a6f3b3f2), UINT64_C (0x177e00f9fc32f791),
+      UINT64_C (0x522e23f3925e319e), UINT64_C (0x9c2ed44081ce5fbd),
+      UINT64_C (0x964781ce734b3c84), UINT64_C (0xf05d129681949a4c),
+      UINT64_C (0x046e3ecaaf453ce9), UINT64_C (0x962aceefa82e1c84),
+      UINT64_C (0xf5b4b0b0d2deeeb4), UINT64_C (0x1af3dbe25d8f45da),
+      UINT64_C (0xf9f4892ed96bd438), UINT64_C (0xc4c118bfe78feaae),
+      UINT64_C (0x07a69afdcc42261a), UINT64_C (0xf8549e1a3aa5e00d),
+      UINT64_C (0x2102ae466ebb1148), UINT64_C (0xe87fbb46217a360e),
+      UINT64_C (0x310cb380db6f7503), UINT64_C (0xb5fdfc5d3132c498),
+      UINT64_C (0xdaf8e9829fe96b5f), UINT64_C (0xcac09afbddd2cdb4),
+      UINT64_C (0xb862225b055b6960), UINT64_C (0x55b6344cf97aafae),
+      UINT64_C (0xff577222c14f0a3a), UINT64_C (0x4e4b705b92903ba4),
+      UINT64_C (0x730499af921549ff), UINT64_C (0x13ae978d09fe5557),
+      UINT64_C (0xd9e92aa246bf719e), UINT64_C (0x7a4c10ec2158c4a6),
+      UINT64_C (0x49cad48cebf4a71e), UINT64_C (0xcf05daf5ac8d77b0),
+      UINT64_C (0xabbdcdd7ed5c0860), UINT64_C (0x9853eab63b5e0b35),
+      UINT64_C (0x352787baa0d7c22f), UINT64_C (0xc7f6aa2de59aea61),
+      UINT64_C (0x03727073c2e134b1), UINT64_C (0x5a0f544dd2b1fb18),
+      UINT64_C (0x74f85198b05a2e7d), UINT64_C (0x963ef2c96b33be31),
+      UINT64_C (0x4659d2b743848a2c), UINT64_C (0x19ebb029435dcb0f),
+      UINT64_C (0x4e9d2827355fc492), UINT64_C (0xccec0a73b49c9921),
+      UINT64_C (0x46c9feb55d120902), UINT64_C (0x8d2636b81555a786),
+      UINT64_C (0x30c05b1ba332f41c), UINT64_C (0xf6f7fd1431714200),
+      UINT64_C (0x1a4ff12616eefc89), UINT64_C (0x990a98fd5071d263),
+      UINT64_C (0x84547ddc3e203c94), UINT64_C (0x07a3aec79624c7da),
+      UINT64_C (0x8a328a1cedfe552c), UINT64_C (0xd1e649de1e7f268b),
+      UINT64_C (0x2d8d5432157064c8), UINT64_C (0x4ae7d6a36eb5dbcb),
+      UINT64_C (0x57e3306d881edb4f), UINT64_C (0x0a804d18b7097475),
+      UINT64_C (0xe74733427b72f0c1), UINT64_C (0x24b33c9d7ed25117),
+      UINT64_C (0xe805a1e290cf2456), UINT64_C (0x3b544ebe544c19f9),
+      UINT64_C (0x3e666e6f69ae2c15), UINT64_C (0xfb152fe3ff26da89),
+      UINT64_C (0xb49b52e587a1ee60), UINT64_C (0xac042e70f8b383f2),
+      UINT64_C (0x89c350c893ae7dc1), UINT64_C (0xb592bf39b0364963),
+      UINT64_C (0x190e714fada5156e), UINT64_C (0xec8177f83f900978),
+      UINT64_C (0x91b534f885818a06), UINT64_C (0x81536d601170fc20),
+      UINT64_C (0xd4c718bc4ae8ae5f), UINT64_C (0x9eedeca8e272b933),
+      UINT64_C (0x10e8b35af3eeab37), UINT64_C (0x0e09b88e1914f7af),
+      UINT64_C (0x3fa9ddfb67e2f199), UINT64_C (0xb10bb459132d0a26),
+      UINT64_C (0x2c046f22062dc67d), UINT64_C (0x5e90277e7cb39e2d),
+      UINT64_C (0xd6b04d3b7651dd7e), UINT64_C (0xe34a1d250e7a8d6b),
+      UINT64_C (0x53c065c6c8e63528), UINT64_C (0x1bdea12e35f6a8c9),
+      UINT64_C (0x21874b8b4d2dbc4f), UINT64_C (0x3a88a0fbbcb05c63),
+      UINT64_C (0x43ed7f5a0fae657d), UINT64_C (0x230e343dfba08d33),
+      UINT64_C (0xb5b4071dbfc73a66), UINT64_C (0x8f9887e6078735a1),
+      UINT64_C (0x08de8a1c7797da9b), UINT64_C (0xfcb6be43a9f2fe9b),
+      UINT64_C (0x049a7f41061a9e60), UINT64_C (0x9f91508bffcfc14a),
+      UINT64_C (0xe3273522064480ca), UINT64_C (0xcd04f3ff001a4778),
+      UINT64_C (0x6bfa9aae5ec05779), UINT64_C (0x371f77e76bb8417e),
+      UINT64_C (0x3550c2321fd6109c), UINT64_C (0xfb4a3d794a9a80d2),
+      UINT64_C (0xf43c732873f24c13), UINT64_C (0xaa9119ff184cccf4),
+      UINT64_C (0xb69e38a8965c6b65), UINT64_C (0x1f2b1d1f15f6dc9c),
+      UINT64_C (0x67fef95d92607890), UINT64_C (0x31865ced6120f37d),
+      UINT64_C (0x3a6853c7e70757a7), UINT64_C (0x32ab0edb696703d3),
+      UINT64_C (0xee97f453f06791ed), UINT64_C (0x6dc93d9526a50e68),
+      UINT64_C (0x78edefd694af1eed), UINT64_C (0x9c1169fa2777b874),
+      UINT64_C (0x50065e535a213cf6), UINT64_C (0xde0c89a556b9ae70),
+      UINT64_C (0xd1e0ccd25bb9c169), UINT64_C (0x6b17b224bad6bf27),
+      UINT64_C (0x6b02e63195ad0cf8), UINT64_C (0x455a4b4cfe30e3f5),
+      UINT64_C (0x9338e69c052b8e7b), UINT64_C (0x5092ef950a16da0b),
+      UINT64_C (0x7c45d833aff07862), UINT64_C (0xa5b1cfdba0ab4067),
+      UINT64_C (0x6ad047c430a12104), UINT64_C (0x6c47bec883a7de39),
+      UINT64_C (0x944f6de09134dfb6), UINT64_C (0x9aeba33ac6ecc6b0),
+      UINT64_C (0x52e762596bf68235), UINT64_C (0x22af003ab672e811),
+      UINT64_C (0xb5635c95ff7296e2), UINT64_C (0xed2df21216235097),
+      UINT64_C (0x4a29c6465a314cd1), UINT64_C (0xd83cc2687a19255f),
+      UINT64_C (0x506c11b9d90e8b1d), UINT64_C (0x57277707199b8175),
+      UINT64_C (0xcaf21ecd4377b28c), UINT64_C (0xc0c0f5a60ef4cdcf),
+      UINT64_C (0x93b633abfa3469f8), UINT64_C (0xe846963877671a17),
+      UINT64_C (0x59ac2c7873f910a3), UINT64_C (0x660d3257380841ee),
+      UINT64_C (0xd813f2fab7f5c5ca), UINT64_C (0x4112cf68649a260e),
+      UINT64_C (0x443f64ec5a371195), UINT64_C (0xb0774d261cc609db),
+      UINT64_C (0x720bf5f26f4d2eaa), UINT64_C (0x1c2559e30f0946be),
+      UINT64_C (0xe328e230e3e2b3fb), UINT64_C (0x087e79e5a57d1d13),
+      UINT64_C (0x08dd9bdfd96b9f63), UINT64_C (0x64d0e29eea8838b3),
+      UINT64_C (0xddf957bc36d8b9ca), UINT64_C (0x6ffe73e81b637fb3),
+      UINT64_C (0x1a4e4822eb4d7a59), UINT64_C (0x5d94337fbfaf7f5b),
+      UINT64_C (0xd30c088ba61ea5ef), UINT64_C (0x9d765e419fb69f6d),
+      UINT64_C (0x9e21f4f903b33fd9), UINT64_C (0xb4d8f77bc3e56167),
+      UINT64_C (0x733ea705fae4fa77), UINT64_C (0xa4ec0132764ca04b),
+      UINT64_C (0x7976033a39f7d952), UINT64_C (0x106f72fe81e2c590),
+      UINT64_C (0x8c90fd9b083f4558), UINT64_C (0xfd080d236da814ba),
+      UINT64_C (0x7b64978555326f9f), UINT64_C (0x60e8ed72c0dff5d1),
+      UINT64_C (0xb063e962e045f54d), UINT64_C (0x959f587d507a8359),
+      UINT64_C (0x758f450c88572e0b), UINT64_C (0x1b6baca2ae4e125b),
+      UINT64_C (0x61cf4f94c97df93d), UINT64_C (0x2738259634305c14),
+      UINT64_C (0xd39bb9c3a48db6cf), UINT64_C (0x8215e577001332c8),
+      UINT64_C (0xa1082c0466df6c0a), UINT64_C (0xef02cdd06ffdb432),
+      UINT64_C (0xfc87614baf287e07), UINT64_C (0x240ab57a8b888b20),
+      UINT64_C (0xbf8d5108e27e0d48), UINT64_C (0x61bdd1307c66e300),
+      UINT64_C (0xb925a6cd0421aff3), UINT64_C (0x3e003e616a6591e9),
+      UINT64_C (0x94c3251f06f90cf3), UINT64_C (0xbf84470805e69b5f),
+      UINT64_C (0x98f076a4f7a2322e), UINT64_C (0x70cb6af7c2d5bcf0),
+      UINT64_C (0xb64be8d8b25396c1), UINT64_C (0xa9aa4d20db084e9b),
+      UINT64_C (0x2e6d02c36017f67f), UINT64_C (0xefed53d75fd64e6b),
+      UINT64_C (0xd9f1f30ccd97fb09), UINT64_C (0xa2ebee47e2fbfce1),
+      UINT64_C (0xb8d91274b9e9d4fb), UINT64_C (0x1db956e450275779),
+      UINT64_C (0x4fc8e9560f91b123), UINT64_C (0x63573ff03e224774),
+      UINT64_C (0x0647dfedcd894a29), UINT64_C (0x7884d9bc6cb569d8),
+      UINT64_C (0x7fba195410e5ca30), UINT64_C (0x106c09b972d2e822),
+      UINT64_C (0x241260ed4ad1e87d), UINT64_C (0x64c8e531bff53b55),
+      UINT64_C (0xca672b91e9e4fa16), UINT64_C (0x3871700761b3f743),
+      UINT64_C (0xf95cffa23af5f6f4), UINT64_C (0x8d14dedb30be846e),
+      UINT64_C (0x3b097adaf088f94e), UINT64_C (0x21e0bd5026c619bf),
+      UINT64_C (0x1bda0492e7e4586e), UINT64_C (0xd23c8e176d113600),
+      UINT64_C (0x252f59cf0d9f04bb), UINT64_C (0xb3598080ce64a656),
+      UINT64_C (0x993e1de72d36d310), UINT64_C (0xa2853b80f17f58ee),
+      UINT64_C (0x1877b51e57a764d5), UINT64_C (0x001f837cc7350524)
+    }
+   #endif
+  };
+
+int
+main (int argc, char **argv)
+{
+  unsigned int i;
+  isaac_word r[ISAAC_WORDS];
+  int iterations;
+
+  /* Seed with zeros, and discard the first buffer of output,
+     as that's what the standard programs do.  */
+  static struct isaac_state s;
+  isaac_seed (&s);
+  isaac_refill (&s, r);
+
+  for (i = 0; i < sizeof expected / sizeof expected[0]; i++)
+    {
+      isaac_refill (&s, r);
+      ASSERT (memcmp (r, expected[i], sizeof r) == 0);
+    }
+
+  /* If invoked with a positive argument, run a benchmark;
+     if with a negative, run a do-nothing benchmark.  */
+  for (iterations = argc <= 1 ? 0 : strtol (argv[1], nullptr, 10);
+       iterations != 0;
+       iterations += (iterations < 0 ? 1 : -1))
+    if (0 <= iterations)
+      isaac_refill (&s, r);
+
+  return 0;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod.c
new file mode 100644 (file)
index 0000000..a4d6887
--- /dev/null
@@ -0,0 +1,980 @@
+/*
+ * Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ * Written by Eric Blake
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strtod, double, (char const *, char **));
+
+#include <errno.h>
+#include <float.h>
+#include <math.h>
+#include <string.h>
+
+#include "isnand-nolibm.h"
+#include "minus-zero.h"
+#include "macros.h"
+
+/* Avoid requiring -lm just for fabs.  */
+#define FABS(d) ((d) < 0.0 ? -(d) : (d))
+
+int
+main (void)
+{
+  int status = 0;
+  /* Subject sequence empty or invalid.  */
+  {
+    const char input[] = "";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " ";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " +";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " .";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " .e0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);              /* IRIX 6.5, OSF/1 5.1 */
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " +.e-0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);              /* IRIX 6.5, OSF/1 5.1 */
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " in";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " na";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+
+  /* Simple floating point values.  */
+  {
+    const char input[] = "1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ".5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.5);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = " 1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "-1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == -1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e+0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 4);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e-0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 4);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 10.0);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "5e-1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.5);
+    ASSERT (ptr == input + 4);
+    ASSERT (errno == 0);
+  }
+
+  /* Zero.  */
+  {
+    const char input[] = "0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ".0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0e0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0e+9999999";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0e-9999999";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "-0";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!!signbit (result) == !!signbit (minus_zerod)); /* IRIX 6.5, OSF/1 4.0 */
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+
+  /* Suffixes.  */
+  {
+    const char input[] = "1f";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.f";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e+";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e-";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1E 2";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* HP-UX 11.11, IRIX 6.5, OSF/1 4.0 */
+    ASSERT (ptr == input + 1);          /* HP-UX 11.11, IRIX 6.5 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "00x1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "-0x";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!!signbit (result) == !!signbit (minus_zerod)); /* Mac OS X 10.3, FreeBSD 6.2, IRIX 6.5, OSF/1 4.0 */
+    ASSERT (ptr == input + 2);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xg";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xp";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0XP";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x.";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xp+";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xp+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x.p+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, AIX 7.1 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1p+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1P+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+
+  /* Overflow/underflow.  */
+  {
+    const char input[] = "1E1000000";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == HUGE_VAL);
+    ASSERT (ptr == input + 9);          /* OSF/1 5.1 */
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "-1E1000000";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == -HUGE_VAL);
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "1E-100000";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (0.0 <= result && result <= DBL_MIN);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 9);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "-1E-100000";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (-DBL_MIN <= result && result <= 0.0);
+#if 0
+    /* FIXME - this is glibc bug 5995; POSIX allows returning positive
+       0 on negative underflow, even though quality of implementation
+       demands preserving the sign.  Disable this test until fixed
+       glibc is more prevalent.  */
+    ASSERT (!!signbit (result) == !!signbit (minus_zerod)); /* glibc-2.3.6, mingw */
+#endif
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "1E 1000000";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* HP-UX 11.11, IRIX 6.5, OSF/1 4.0 */
+    ASSERT (ptr == input + 1);          /* HP-UX 11.11, IRIX 6.5 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1P 1000000";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+
+  /* Infinity.  */
+  {
+    const char input[] = "iNf";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == HUGE_VAL);        /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr == input + 3);          /* OpenBSD 4.0, HP-UX 11.00, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw */
+    ASSERT (errno == 0);                /* HP-UX 11.11, OSF/1 4.0 */
+  }
+  {
+    const char input[] = "-InF";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == -HUGE_VAL);       /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr == input + 4);          /* OpenBSD 4.0, HP-UX 11.00, IRIX 6.5, OSF/1 4.0, Solaris 9, mingw */
+    ASSERT (errno == 0);                /* HP-UX 11.11, OSF/1 4.0 */
+  }
+  {
+    const char input[] = "infinite";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == HUGE_VAL);        /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr == input + 3);          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (errno == 0);                /* OSF/1 4.0 */
+  }
+  {
+    const char input[] = "infinitY";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == HUGE_VAL);        /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr == input + 8);          /* OpenBSD 4.0, HP-UX 11.00, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw */
+    ASSERT (errno == 0);                /* HP-UX 11.11, OSF/1 4.0 */
+  }
+  {
+    const char input[] = "infinitY.";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == HUGE_VAL);        /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr == input + 8);          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (errno == 0);                /* OSF/1 4.0 */
+  }
+
+  /* NaN.  Some processors set the sign bit of the default NaN, so all
+     we check is that using a sign changes the result.  */
+  {
+    const char input[] = "-nan";
+    char *ptr1;
+    char *ptr2;
+    double result1;
+    double result2;
+    errno = 0;
+    result1 = strtod (input, &ptr1);
+    result2 = strtod (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnand (result1));          /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (isnand (result2));          /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+# if 0
+    /* Sign bits of NaN is a portability sticking point, not worth
+       worrying about.  */
+    ASSERT (!!signbit (result1) != !!signbit (result2)); /* glibc-2.3.6, IRIX 6.5, OSF/1 5.1, mingw */
+# endif
+    ASSERT (ptr1 == input + 4);         /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, Solaris 2.5.1, mingw */
+    ASSERT (ptr2 == input + 4);         /* OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, Solaris 2.5.1, mingw */
+    ASSERT (errno == 0);                /* HP-UX 11.11 */
+#else
+    ASSERT (result1 == 0.0);
+    ASSERT (result2 == 0.0);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    const char input[] = "+nan(";
+    char *ptr1;
+    char *ptr2;
+    double result1;
+    double result2;
+    errno = 0;
+    result1 = strtod (input, &ptr1);
+    result2 = strtod (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnand (result1));          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (isnand (result2));          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (!!signbit (result1) == !!signbit (result2));
+    ASSERT (ptr1 == input + 4);         /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 2.5.1, mingw */
+    ASSERT (ptr2 == input + 4);         /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 2.5.1, mingw */
+    ASSERT (errno == 0);
+#else
+    ASSERT (result1 == 0.0);
+    ASSERT (result2 == 0.0);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    const char input[] = "-nan()";
+    char *ptr1;
+    char *ptr2;
+    double result1;
+    double result2;
+    errno = 0;
+    result1 = strtod (input, &ptr1);
+    result2 = strtod (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnand (result1));          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (isnand (result2));          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+# if 0
+    /* Sign bits of NaN is a portability sticking point, not worth
+       worrying about.  */
+    ASSERT (!!signbit (result1) != !!signbit (result2)); /* glibc-2.3.6, IRIX 6.5, OSF/1 5.1, mingw */
+# endif
+    ASSERT (ptr1 == input + 6);         /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr2 == input + 6);         /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (errno == 0);
+#else
+    ASSERT (result1 == 0.0);
+    ASSERT (result2 == 0.0);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    const char input[] = " nan().";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnand (result));           /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr == input + 6);          /* glibc-2.3.6, Mac OS X 10.3, FreeBSD 6.2, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (errno == 0);
+#else
+    ASSERT (result == 0.0);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    /* The behavior of nan(0) is implementation-defined, but all
+       implementations we know of which handle optional
+       n-char-sequences handle nan(0) the same as nan().  */
+    const char input[] = "-nan(0).";
+    char *ptr1;
+    char *ptr2;
+    double result1;
+    double result2;
+    errno = 0;
+    result1 = strtod (input, &ptr1);
+    result2 = strtod (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnand (result1));          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (isnand (result2));          /* OpenBSD 4.0, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+# if 0
+    /* Sign bits of NaN is a portability sticking point, not worth
+       worrying about.  */
+    ASSERT (!!signbit (result1) != !!signbit (result2)); /* glibc-2.3.6, IRIX 6.5, OSF/1 5.1, mingw */
+# endif
+    ASSERT (ptr1 == input + 7);         /* glibc-2.3.6, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (ptr2 == input + 7);         /* glibc-2.3.6, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, mingw */
+    ASSERT (errno == 0);
+#else
+    ASSERT (result1 == 0.0);
+    ASSERT (result2 == 0.0);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+
+  /* Hex.  */
+  {
+    const char input[] = "0xa";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 10.0);            /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0XA";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 10.0);            /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p+";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1P+";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 2.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 6);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0X1P+1";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 2.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 6);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p+1a";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 2.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 6);          /* NetBSD 3.0, OpenBSD 4.0, AIX 5.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p 2";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);             /* NetBSD 3.0, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (ptr == input + 3);          /* NetBSD 3.0, OpenBSD 4.0, AIX 7.1, HP-UX 11.11, IRIX 6.5, OSF/1 5.1, Solaris 10, mingw */
+    ASSERT (errno == 0);
+  }
+
+  /* Large buffers.  */
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        double result;
+        memset (input, '\t', m - 1);
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtod (input, &ptr);
+        ASSERT (result == 1.0);
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);
+      }
+    free (input);
+  }
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        double result;
+        memset (input, '0', m - 1);
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtod (input, &ptr);
+        ASSERT (result == 1.0);
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);
+      }
+    free (input);
+  }
+#if 0
+  /* Newlib has an artificial limit of 20000 for the exponent.  TODO -
+     gnulib should fix this.  */
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        double result;
+        input[0] = '.';
+        memset (input + 1, '0', m - 10);
+        input[m - 9] = '1';
+        input[m - 8] = 'e';
+        input[m - 7] = '+';
+        input[m - 6] = '9';
+        input[m - 5] = '9';
+        input[m - 4] = '9';
+        input[m - 3] = '9';
+        input[m - 2] = '9';
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtod (input, &ptr);
+        ASSERT (result == 1.0);         /* Mac OS X 10.3, FreeBSD 6.2, NetBSD 3.0, OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+        ASSERT (ptr == input + m);      /* OSF/1 5.1 */
+        ASSERT (errno == 0);            /* Mac OS X 10.3, FreeBSD 6.2, NetBSD 3.0, OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+      }
+    free (input);
+  }
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        double result;
+        input[0] = '1';
+        memset (input + 1, '0', m - 9);
+        input[m - 8] = 'e';
+        input[m - 7] = '-';
+        input[m - 6] = '9';
+        input[m - 5] = '9';
+        input[m - 4] = '9';
+        input[m - 3] = '9';
+        input[m - 2] = '9';
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtod (input, &ptr);
+        ASSERT (result == 1.0);         /* Mac OS X 10.3, FreeBSD 6.2, NetBSD 3.0, OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);            /* Mac OS X 10.3, FreeBSD 6.2, NetBSD 3.0, OpenBSD 4.0, IRIX 6.5, OSF/1 5.1, mingw */
+      }
+    free (input);
+  }
+#endif
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        double result;
+        input[0] = '-';
+        input[1] = '0';
+        input[2] = 'e';
+        input[3] = '1';
+        memset (input + 4, '0', m - 3);
+        input[m] = '\0';
+        errno = 0;
+        result = strtod (input, &ptr);
+        ASSERT (result == 0.0);
+        ASSERT (!!signbit (result) == !!signbit (minus_zerod)); /* IRIX 6.5, OSF/1 4.0 */
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);
+      }
+    free (input);
+  }
+
+  /* Rounding.  */
+  /* TODO - is it worth some tests of rounding for typical IEEE corner
+     cases, such as .5 ULP rounding up to the smallest denormal and
+     not causing underflow, or DBL_MIN - .5 ULP not causing an
+     infinite loop?  */
+
+  return status;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod1.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod1.c
new file mode 100644 (file)
index 0000000..cb0bf8b
--- /dev/null
@@ -0,0 +1,101 @@
+/* Test of strtod() in a French locale.
+   Copyright (C) 2019-2024 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+  /* Try to set the locale by implicitly looking at the LC_ALL environment
+     variable.
+     configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  {
+    const char input[] = "1,";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ",5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.5);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1,5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.5);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+       radix character.  */
+    ASSERT ((ptr == input + 1 && result == 1.0)
+            || (ptr == input + 3 && result == 1.5));
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "123.456,789";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+       radix character.  */
+    ASSERT ((ptr == input + 3 && result == 123.0)
+            || (ptr == input + 7 && result > 123.45 && result < 123.46));
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "123,456.789";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result > 123.45 && result < 123.46);
+    ASSERT (ptr == input + 7);
+    ASSERT (errno == 0);
+  }
+
+  return 0;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod1.sh b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtod1.sh
new file mode 100755 (executable)
index 0000000..306ca52
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+: "${LOCALE_FR=fr_FR}"
+: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
+
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no locale for testing is installed"
+  else
+    echo "Skipping test: no locale for testing is supported"
+  fi
+  exit 77
+fi
+
+if $LC_NUMERIC_IMPLEMENTED; then
+  :
+else
+  echo "Skipping test: LC_NUMERIC category of locales is not implemented"
+  exit 77
+fi
+
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-strtod1${EXEEXT} || exit 1
+fi
+
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-strtod1${EXEEXT} || exit 1
+fi
+
+exit 0
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold.c
new file mode 100644 (file)
index 0000000..b2672dc
--- /dev/null
@@ -0,0 +1,980 @@
+/*
+ * Copyright (C) 2008-2024 Free Software Foundation, Inc.
+ * Written by Eric Blake
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strtold, long double, (char const *, char **));
+
+#include <errno.h>
+#include <float.h>
+#include <math.h>
+#include <string.h>
+
+#include "isnanl-nolibm.h"
+#include "minus-zero.h"
+#include "macros.h"
+
+/* Avoid requiring -lm just for fabsl.  */
+#define FABSL(d) ((d) < 0.0L ? -(d) : (d))
+
+int
+main (void)
+{
+  int status = 0;
+  /* Subject sequence empty or invalid.  */
+  {
+    const char input[] = "";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " ";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " +";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " .";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " .e0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);              /* IRIX 6.5 */
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " +.e-0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);              /* IRIX 6.5 */
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " in";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+  {
+    const char input[] = " na";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+  }
+
+  /* Simple floating point values.  */
+  {
+    const char input[] = "1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ".5";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.5L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = " 1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "-1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == -1.0L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e+0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 4);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e-0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 4);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 10.0L);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "5e-1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.5L);
+    ASSERT (ptr == input + 4);
+    ASSERT (errno == 0);
+  }
+
+  /* Zero.  */
+  {
+    const char input[] = "0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ".0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0e0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0e+9999999";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0e-9999999";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "-0";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!!signbit (result) == !!signbit (minus_zerol)); /* IRIX 6.5 */
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+
+  /* Suffixes.  */
+  {
+    const char input[] = "1f";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.f";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e+";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1e-";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1E 2";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* HP-UX 11.31/ia64, IRIX 6.5 */
+    ASSERT (ptr == input + 1);          /* HP-UX 11.31/ia64, IRIX 6.5 */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "00x1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "-0x";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!!signbit (result) == !!signbit (minus_zerol)); /* Mac OS X 10.5, IRIX 6.5 */
+    ASSERT (ptr == input + 2);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xg";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xp";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0XP";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x.";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xp+";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0xp+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x.p+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 1);          /* glibc-2.3.2, Mac OS X 10.5, Haiku */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1p+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1P+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 1);
+    ASSERT (errno == 0);
+  }
+
+  /* Overflow/underflow.  */
+  {
+    const char input[] = "1E1000000";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == HUGE_VALL);
+    ASSERT (ptr == input + 9);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "-1E1000000";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == -HUGE_VALL);
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "1E-100000";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (0.0L <= result && result <= LDBL_MIN);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input + 9);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "-1E-100000";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (-LDBL_MIN <= result && result <= 0.0L);
+#if 0
+    /* FIXME - this is glibc bug 5995; POSIX allows returning positive
+       0 on negative underflow, even though quality of implementation
+       demands preserving the sign.  Disable this test until fixed
+       glibc is more prevalent.  */
+    ASSERT (!!signbit (result) == !!signbit (minus_zerol)); /* glibc-2.3.2, Haiku */
+#endif
+    ASSERT (ptr == input + 10);
+    ASSERT (errno == ERANGE);
+  }
+  {
+    const char input[] = "1E 1000000";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* HP-UX 11.31/ia64, IRIX 6.5 */
+    ASSERT (ptr == input + 1);          /* HP-UX 11.31/ia64, IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64, IRIX 6.5 */
+  }
+  {
+    const char input[] = "0x1P 1000000";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* HP-UX 11.31/ia64, IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* HP-UX 11.31/ia64, IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+
+  /* Infinity.  */
+  {
+    const char input[] = "iNf";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == HUGE_VALL);       /* IRIX 6.5 */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+  }
+  {
+    const char input[] = "-InF";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == -HUGE_VALL);      /* IRIX 6.5 */
+    ASSERT (ptr == input + 4);          /* IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+  }
+  {
+    const char input[] = "infinite";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == HUGE_VALL);       /* IRIX 6.5 */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+  }
+  {
+    const char input[] = "infinitY";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == HUGE_VALL);       /* IRIX 6.5 */
+    ASSERT (ptr == input + 8);          /* IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+  }
+  {
+    const char input[] = "infinitY.";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == HUGE_VALL);       /* IRIX 6.5 */
+    ASSERT (ptr == input + 8);          /* IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+  }
+
+  /* NaN.  Some processors set the sign bit of the default NaN, so all
+     we check is that using a sign changes the result.  */
+  {
+    const char input[] = "-nan";
+    char *ptr1;
+    char *ptr2;
+    long double result1;
+    long double result2;
+    errno = 0;
+    result1 = strtold (input, &ptr1);
+    result2 = strtold (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnanl (result1));          /* IRIX 6.5 */
+    ASSERT (isnanl (result2));          /* IRIX 6.5 */
+# if 0
+    /* Sign bits of NaN is a portability sticking point, not worth
+       worrying about.  */
+    ASSERT (!!signbit (result1) != !!signbit (result2));
+# endif
+    ASSERT (ptr1 == input + 4);         /* IRIX 6.5 */
+    ASSERT (ptr2 == input + 4);         /* IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+#else
+    ASSERT (result1 == 0.0L);
+    ASSERT (result2 == 0.0L);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    const char input[] = "+nan(";
+    char *ptr1;
+    char *ptr2;
+    long double result1;
+    long double result2;
+    errno = 0;
+    result1 = strtold (input, &ptr1);
+    result2 = strtold (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnanl (result1));          /* IRIX 6.5 */
+    ASSERT (isnanl (result2));          /* IRIX 6.5 */
+    ASSERT (!!signbit (result1) == !!signbit (result2));
+    ASSERT (ptr1 == input + 4);         /* Mac OS X 10.5, IRIX 6.5 */
+    ASSERT (ptr2 == input + 4);         /* Mac OS X 10.5, IRIX 6.5 */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+#else
+    ASSERT (result1 == 0.0L);
+    ASSERT (result2 == 0.0L);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    const char input[] = "-nan()";
+    char *ptr1;
+    char *ptr2;
+    long double result1;
+    long double result2;
+    errno = 0;
+    result1 = strtold (input, &ptr1);
+    result2 = strtold (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnanl (result1));          /* IRIX 6.5 */
+    ASSERT (isnanl (result2));          /* IRIX 6.5 */
+# if 0
+    /* Sign bits of NaN is a portability sticking point, not worth
+       worrying about.  */
+    ASSERT (!!signbit (result1) != !!signbit (result2)); /* glibc-2.3.2, musl libc, OpenBSD 6.0, IRIX 6.5, mingw, Haiku */
+# endif
+    ASSERT (ptr1 == input + 6);         /* glibc-2.3.2, IRIX 6.5, mingw, Haiku */
+    ASSERT (ptr2 == input + 6);         /* glibc-2.3.2, IRIX 6.5, mingw, Haiku */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64, Haiku */
+#else
+    ASSERT (result1 == 0.0L);
+    ASSERT (result2 == 0.0L);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    const char input[] = " nan().";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnanl (result));           /* IRIX 6.5 */
+    ASSERT (ptr == input + 6);          /* glibc-2.3.2, IRIX 6.5, mingw, Haiku */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64, Haiku */
+#else
+    ASSERT (result == 0.0L);
+    ASSERT (!signbit (result));
+    ASSERT (ptr == input);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+  {
+    /* The behavior of nan(0) is implementation-defined, but all
+       implementations we know of which handle optional
+       n-char-sequences handle nan(0) the same as nan().  */
+    const char input[] = "-nan(0).";
+    char *ptr1;
+    char *ptr2;
+    long double result1;
+    long double result2;
+    errno = 0;
+    result1 = strtold (input, &ptr1);
+    result2 = strtold (input + 1, &ptr2);
+#if 1 /* All known CPUs support NaNs.  */
+    ASSERT (isnanl (result1));          /* IRIX 6.5 */
+    ASSERT (isnanl (result2));          /* IRIX 6.5 */
+# if 0
+    /* Sign bits of NaN is a portability sticking point, not worth
+       worrying about.  */
+    ASSERT (!!signbit (result1) != !!signbit (result2));
+# endif
+    ASSERT (ptr1 == input + 7);         /* glibc-2.3.2, IRIX 6.5, mingw, Haiku */
+    ASSERT (ptr2 == input + 7);         /* glibc-2.3.2, IRIX 6.5, mingw, Haiku */
+    ASSERT (errno == 0);                /* HP-UX 11.31/ia64 */
+#else
+    ASSERT (result1 == 0.0L);
+    ASSERT (result2 == 0.0L);
+    ASSERT (!signbit (result1));
+    ASSERT (!signbit (result2));
+    ASSERT (ptr1 == input);
+    ASSERT (ptr2 == input + 1);
+    ASSERT (errno == 0 || errno == EINVAL);
+#endif
+  }
+
+  /* Hex.  */
+  {
+    const char input[] = "0xa";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 10.0L);           /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0XA";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 10.0L);           /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p+";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1P+";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 2.0L);            /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 6);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0X1P+1";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 2.0L);            /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 6);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p+1a";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 2.0L);            /* IRIX 6.5, mingw */
+    ASSERT (ptr == input + 6);          /* IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "0x1p 2";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);            /* HP-UX 11.31/ia64, IRIX 6.5, mingw */
+    ASSERT (ptr == input + 3);          /* HP-UX 11.31/ia64, IRIX 6.5, mingw */
+    ASSERT (errno == 0);
+  }
+
+  /* Large buffers.  */
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        long double result;
+        memset (input, '\t', m - 1);
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtold (input, &ptr);
+        ASSERT (result == 1.0L);
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);
+      }
+    free (input);
+  }
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        long double result;
+        memset (input, '0', m - 1);
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtold (input, &ptr);
+        ASSERT (result == 1.0L);
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);
+      }
+    free (input);
+  }
+#if 0
+  /* Newlib has an artificial limit of 20000 for the exponent.  TODO -
+     gnulib should fix this.  */
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        long double result;
+        input[0] = '.';
+        memset (input + 1, '0', m - 10);
+        input[m - 9] = '1';
+        input[m - 8] = 'e';
+        input[m - 7] = '+';
+        input[m - 6] = '9';
+        input[m - 5] = '9';
+        input[m - 4] = '9';
+        input[m - 3] = '9';
+        input[m - 2] = '9';
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtold (input, &ptr);
+        ASSERT (result == 1.0L);        /* Mac OS X 10.5, FreeBSD 11.0, NetBSD 7.1, OpenBSD 6.0, Minix 3.3, IRIX 6.5, mingw */
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);            /* Mac OS X 10.5, FreeBSD 11.0, NetBSD 7.1, OpenBSD 6.0, Minix 3.3, IRIX 6.5, mingw */
+      }
+    free (input);
+  }
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        long double result;
+        input[0] = '1';
+        memset (input + 1, '0', m - 9);
+        input[m - 8] = 'e';
+        input[m - 7] = '-';
+        input[m - 6] = '9';
+        input[m - 5] = '9';
+        input[m - 4] = '9';
+        input[m - 3] = '9';
+        input[m - 2] = '9';
+        input[m - 1] = '1';
+        input[m] = '\0';
+        errno = 0;
+        result = strtold (input, &ptr);
+        ASSERT (result == 1.0L);        /* Mac OS X 10.5, FreeBSD 11.0, NetBSD 7.1, OpenBSD 6.0, Minix 3.3, IRIX 6.5, mingw */
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);            /* Mac OS X 10.5, FreeBSD 11.0, NetBSD 7.1, OpenBSD 6.0, Minix 3.3, IRIX 6.5, mingw */
+      }
+    free (input);
+  }
+#endif
+  {
+    size_t m = 1000000;
+    char *input = malloc (m + 1);
+    if (input)
+      {
+        char *ptr;
+        long double result;
+        input[0] = '-';
+        input[1] = '0';
+        input[2] = 'e';
+        input[3] = '1';
+        memset (input + 4, '0', m - 3);
+        input[m] = '\0';
+        errno = 0;
+        result = strtold (input, &ptr);
+        ASSERT (result == 0.0L);
+        ASSERT (!!signbit (result) == !!signbit (minus_zerol)); /* IRIX 6.5 */
+        ASSERT (ptr == input + m);
+        ASSERT (errno == 0);
+      }
+    free (input);
+  }
+
+  /* Rounding.  */
+  /* TODO - is it worth some tests of rounding for typical IEEE corner
+     cases, such as .5 ULP rounding up to the smallest denormal and
+     not causing underflow, or LDBL_MIN - .5 ULP not causing an
+     infinite loop?  */
+
+  return status;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold1.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold1.c
new file mode 100644 (file)
index 0000000..5bcf996
--- /dev/null
@@ -0,0 +1,101 @@
+/* Test of strtold() in a French locale.
+   Copyright (C) 2019-2024 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+  /* Try to set the locale by implicitly looking at the LC_ALL environment
+     variable.
+     configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  {
+    const char input[] = "1,";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.0L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ",5";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 0.5L);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1,5";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result == 1.5L);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.5";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+       radix character.  */
+    ASSERT ((ptr == input + 1 && result == 1.0L)
+            || (ptr == input + 3 && result == 1.5L));
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "123.456,789";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+       radix character.  */
+    ASSERT ((ptr == input + 3 && result == 123.0L)
+            || (ptr == input + 7 && result > 123.45L && result < 123.46L));
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "123,456.789";
+    char *ptr;
+    long double result;
+    errno = 0;
+    result = strtold (input, &ptr);
+    ASSERT (result > 123.45L && result < 123.46L);
+    ASSERT (ptr == input + 7);
+    ASSERT (errno == 0);
+  }
+
+  return 0;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold1.sh b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/test-strtold1.sh
new file mode 100755 (executable)
index 0000000..3af4576
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+: "${LOCALE_FR=fr_FR}"
+: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
+
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no locale for testing is installed"
+  else
+    echo "Skipping test: no locale for testing is supported"
+  fi
+  exit 77
+fi
+
+if $LC_NUMERIC_IMPLEMENTED; then
+  :
+else
+  echo "Skipping test: LC_NUMERIC category of locales is not implemented"
+  exit 77
+fi
+
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-strtold1${EXEEXT} || exit 1
+fi
+
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-strtold1${EXEEXT} || exit 1
+fi
+
+exit 0
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unicase/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unicase/.gitignore
deleted file mode 100644 (file)
index 19cfffe..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/test-mapping-part1.h
-/test-mapping-part2.h
-/test-uc_tolower.c
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unictype/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unictype/.gitignore
deleted file mode 100644 (file)
index e77e050..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/test-ctype_alnum.c
-/test-ctype_alpha.c
-/test-ctype_blank.c
-/test-ctype_cntrl.c
-/test-ctype_digit.c
-/test-ctype_graph.c
-/test-ctype_lower.c
-/test-ctype_print.c
-/test-ctype_punct.c
-/test-ctype_space.c
-/test-ctype_upper.c
-/test-ctype_xdigit.c
-/test-predicate-part1.h
-/test-predicate-part2.h
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unistr/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/unistr/.gitignore
deleted file mode 100644 (file)
index fb51e7d..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/test-chr.h
-/test-cpy.h
-/test-pcpy.h
-/test-set.h
-/test-strcat.h
-/test-u32-chr.c
-/test-u32-cpy.c
-/test-u32-pcpy.c
-/test-u32-set.c
-/test-u32-strcat.c
-/test-u32-strlen.c
-/test-u8-mbtoucr.c
-/test-u8-uctomb.c
-/u-set.h
-/u32-set.c
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/uniwidth/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/gnulib-tests/uniwidth/.gitignore
deleted file mode 100644 (file)
index 2cd813b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/test-uc_width.c
-/test-uc_width2.c
-/test-uc_width2.sh
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/.gitignore
deleted file mode 100644 (file)
index 3629c46..0000000
+++ /dev/null
@@ -1,762 +0,0 @@
-/_Noreturn.h
-/access.c
-/acl-errno-valid.c
-/acl-internal.c
-/acl-internal.h
-/acl.h
-/acl_entries.c
-/af_alg.c
-/af_alg.h
-/alignalloc.c
-/alignalloc.h
-/alignof.h
-/alloca.c
-/alloca.in.h
-/allocator.c
-/allocator.h
-/anytostr.c
-/areadlink-with-size.c
-/areadlink.c
-/areadlink.h
-/areadlinkat-with-size.c
-/areadlinkat.c
-/arg-nonnull.h
-/argmatch.c
-/argmatch.h
-/argv-iter.c
-/argv-iter.h
-/arpa_inet.in.h
-/asnprintf.c
-/asprintf.c
-/assert.in.h
-/assure.h
-/at-func.c
-/at-func2.c
-/attribute.h
-/backup-find.c
-/backup-internal.h
-/backup-rename.c
-/backupfile.c
-/backupfile.h
-/base32.c
-/base32.h
-/base64.c
-/base64.h
-/basename-lgpl.c
-/basename-lgpl.h
-/basename.c
-/binary-io.c
-/binary-io.h
-/bitrotate.c
-/bitrotate.h
-/boot-time-aux.h
-/btoc32.c
-/btowc.c
-/byteswap.in.h
-/c++defs.h
-/c-ctype.c
-/c-ctype.h
-/c-file-type.c
-/c-strcase.h
-/c-strcasecmp.c
-/c-strcaseeq.h
-/c-strncasecmp.c
-/c32_apply_type_test.c
-/c32_get_type_test.c
-/c32is-impl.h
-/c32isalnum.c
-/c32isalpha.c
-/c32isblank.c
-/c32iscntrl.c
-/c32isdigit.c
-/c32isgraph.c
-/c32islower.c
-/c32isprint.c
-/c32ispunct.c
-/c32isspace.c
-/c32isupper.c
-/c32isxdigit.c
-/c32to-impl.h
-/c32tolower.c
-/c32width.c
-/calloc.c
-/canon-host.c
-/canon-host.h
-/canonicalize.c
-/canonicalize.h
-/careadlinkat.c
-/careadlinkat.h
-/cdefs.h
-/chdir-long.c
-/chdir-long.h
-/chmod.c
-/chmodat.c
-/chown.c
-/chownat.c
-/cloexec.c
-/cloexec.h
-/close-stream.c
-/close-stream.h
-/close.c
-/closedir.c
-/closein.c
-/closein.h
-/closeout.c
-/closeout.h
-/copy-acl.c
-/copy-file-range.c
-/count-leading-zeros.c
-/count-leading-zeros.h
-/creat-safer.c
-/ctype.in.h
-/cycle-check.c
-/cycle-check.h
-/dev-ino.h
-/di-set.c
-/di-set.h
-/dirchownmod.c
-/dirchownmod.h
-/dirent--.h
-/dirent-private.h
-/dirent-safer.h
-/dirent.in.h
-/dirfd.c
-/dirname-lgpl.c
-/dirname.c
-/dirname.h
-/dtoastr.c
-/dtotimespec.c
-/dup-safer-flag.c
-/dup-safer.c
-/dup.c
-/dup2.c
-/dynarray.h
-/eloop-threshold.h
-/errno.in.h
-/error.c
-/error.in.h
-/euidaccess.c
-/exclude.c
-/exclude.h
-/exitfail.c
-/exitfail.h
-/explicit_bzero.c
-/faccessat.c
-/fchdir.c
-/fchmodat.c
-/fchown-stub.c
-/fchownat.c
-/fclose.c
-/fcntl--.h
-/fcntl-safer.h
-/fcntl.c
-/fcntl.in.h
-/fd-hook.c
-/fd-hook.h
-/fd-safer-flag.c
-/fd-safer.c
-/fdatasync.c
-/fdopen.c
-/fdopendir.c
-/fdutimensat.c
-/fflush.c
-/file-has-acl.c
-/file-set.c
-/file-set.h
-/file-type.c
-/file-type.h
-/fileblocks.c
-/filemode.c
-/filemode.h
-/filename.h
-/filenamecat-lgpl.c
-/filenamecat.c
-/filenamecat.h
-/filevercmp.c
-/filevercmp.h
-/flexmember.h
-/float+.h
-/float.c
-/float.in.h
-/fnmatch.c
-/fnmatch.in.h
-/fnmatch_loop.c
-/fopen-safer.c
-/fopen.c
-/fpending.c
-/fpending.h
-/fprintftime.c
-/fprintftime.h
-/fpucw.h
-/fpurge.c
-/freadahead.c
-/freadahead.h
-/freading.c
-/freading.h
-/freadptr.c
-/freadptr.h
-/freadseek.c
-/freadseek.h
-/free.c
-/freopen-safer.c
-/freopen.c
-/frexp.c
-/frexpl.c
-/fseek.c
-/fseeko.c
-/fseterr.c
-/fseterr.h
-/fstat.c
-/fstatat.c
-/fsusage.c
-/fsusage.h
-/fsync.c
-/ftell.c
-/ftello.c
-/ftoastr.c
-/ftoastr.h
-/ftruncate.c
-/fts-cycle.c
-/fts.c
-/fts_.h
-/full-read.c
-/full-read.h
-/full-write.c
-/full-write.h
-/futimens.c
-/gai_strerror.c
-/get-permissions.c
-/getaddrinfo.c
-/getcwd-lgpl.c
-/getcwd.c
-/getdelim.c
-/getdtablesize.c
-/getfilecon.c
-/getgroups.c
-/gethostname.c
-/gethrxtime.c
-/gethrxtime.h
-/getline.c
-/getloadavg.c
-/getlogin.c
-/getndelim2.c
-/getndelim2.h
-/getopt-cdefs.in.h
-/getopt-core.h
-/getopt-ext.h
-/getopt-pfx-core.h
-/getopt-pfx-ext.h
-/getopt.c
-/getopt.in.h
-/getopt1.c
-/getopt_int.h
-/getpagesize.c
-/getprogname.c
-/getprogname.h
-/getrandom.c
-/gettext.h
-/gettime-res.c
-/gettime.c
-/gettimeofday.c
-/getugroups.c
-/getugroups.h
-/gl_openssl.h
-/gnulib.mk
-/group-member.c
-/hard-locale.c
-/hard-locale.h
-/hash-pjw.c
-/hash-pjw.h
-/hash-triple-simple.c
-/hash-triple.c
-/hash-triple.h
-/hash.c
-/hash.h
-/human.c
-/human.h
-/i-ring.c
-/i-ring.h
-/ialloc.c
-/ialloc.h
-/iconv.c
-/iconv.in.h
-/iconv_close.c
-/iconv_open-aix.gperf
-/iconv_open-hpux.gperf
-/iconv_open-irix.gperf
-/iconv_open-osf.gperf
-/iconv_open-solaris.gperf
-/iconv_open-zos.gperf
-/iconv_open.c
-/idcache.c
-/idcache.h
-/idx.h
-/ignore-value.h
-/imaxtostr.c
-/inet_ntop.c
-/ino-map.c
-/ino-map.h
-/intprops-internal.h
-/intprops.h
-/inttostr.c
-/inttostr.h
-/inttypes.in.h
-/isapipe.c
-/isapipe.h
-/isatty.c
-/isblank.c
-/isnan.c
-/isnand-nolibm.h
-/isnand.c
-/isnanf-nolibm.h
-/isnanf.c
-/isnanl-nolibm.h
-/isnanl.c
-/iswblank.c
-/iswctype-impl.h
-/iswctype.c
-/iswdigit.c
-/iswpunct.c
-/iswxdigit.c
-/itold.c
-/langinfo.in.h
-/lc-charset-dispatch.c
-/lc-charset-dispatch.h
-/lchmod.c
-/lchown.c
-/ldtoastr.c
-/libc-config.h
-/limits.in.h
-/linebuffer.c
-/linebuffer.h
-/link.c
-/linkat.c
-/localcharset.c
-/localcharset.h
-/locale.in.h
-/localeconv.c
-/long-options.c
-/long-options.h
-/lseek.c
-/lstat.c
-/malloc.c
-/malloca.c
-/malloca.h
-/math.c
-/math.in.h
-/mbrlen.c
-/mbrtoc32.c
-/mbrtowc-impl-utf8.h
-/mbrtowc-impl.h
-/mbrtowc.c
-/mbscasecmp.c
-/mbschr.c
-/mbsinit.c
-/mbslen.c
-/mbsrtoc32s-state.c
-/mbsrtoc32s.c
-/mbsrtowcs-impl.h
-/mbsrtowcs-state.c
-/mbsrtowcs.c
-/mbswidth.c
-/mbswidth.h
-/mbszero.c
-/mbtowc-impl.h
-/mbtowc-lock.c
-/mbtowc-lock.h
-/mbtowc.c
-/mcel.c
-/mcel.h
-/md5-stream.c
-/md5.c
-/md5.h
-/memcasecmp.c
-/memcasecmp.h
-/memchr.c
-/memchr.valgrind
-/memchr2.c
-/memchr2.h
-/memchr2.valgrind
-/memcmp2.c
-/memcmp2.h
-/memcoll.c
-/memcoll.h
-/mempcpy.c
-/memrchr.c
-/memset_explicit.c
-/mgetgroups.c
-/mgetgroups.h
-/mini-gmp-gnulib.c
-/mini-gmp.c
-/mini-gmp.h
-/minmax.h
-/mkancesdirs.c
-/mkancesdirs.h
-/mkdir-p.c
-/mkdir-p.h
-/mkdir.c
-/mkdirat.c
-/mkfifo.c
-/mkfifoat.c
-/mknod.c
-/mknodat.c
-/mkostemp.c
-/mkstemp-safer.c
-/mkstemp.c
-/mktime-internal.h
-/mktime.c
-/modechange.c
-/modechange.h
-/mountlist.c
-/mountlist.h
-/mpsort.c
-/mpsort.h
-/msvc-inval.c
-/msvc-inval.h
-/msvc-nothrow.c
-/msvc-nothrow.h
-/nanosleep.c
-/netdb.in.h
-/netinet_in.in.h
-/nl_langinfo-lock.c
-/nl_langinfo.c
-/nproc.c
-/nproc.h
-/nstrftime.c
-/obstack.c
-/obstack.in.h
-/offtostr.c
-/open-safer.c
-/open.c
-/openat-die.c
-/openat-priv.h
-/openat-proc.c
-/openat-safer.c
-/openat.c
-/openat.h
-/opendir-safer.c
-/opendir.c
-/opendirat.c
-/opendirat.h
-/parse-datetime.h
-/parse-datetime.y
-/pathmax.h
-/physmem.c
-/physmem.h
-/pipe-safer.c
-/pipe.c
-/pipe2.c
-/posix_memalign.c
-/posixtm.c
-/posixtm.h
-/posixver.c
-/posixver.h
-/printf-args.c
-/printf-args.h
-/printf-frexp.c
-/printf-frexp.h
-/printf-frexpl.c
-/printf-frexpl.h
-/printf-parse.c
-/printf-parse.h
-/priv-set.c
-/priv-set.h
-/progname.c
-/progname.h
-/propername-lite.c
-/propername.h
-/pselect.c
-/pthread-cond.c
-/pthread-mutex.c
-/pthread-thread.c
-/pthread.in.h
-/pthread_mutex_timedlock.c
-/pthread_sigmask.c
-/putenv.c
-/qcopy-acl.c
-/qset-acl.c
-/qsort.c
-/qsort_r.c
-/quote.h
-/quotearg.c
-/quotearg.h
-/raise.c
-/rawmemchr.c
-/rawmemchr.valgrind
-/read-file.c
-/read-file.h
-/read.c
-/readdir.c
-/readlink.c
-/readlinkat.c
-/readtokens.c
-/readtokens.h
-/readtokens0.c
-/readtokens0.h
-/readutmp.c
-/readutmp.h
-/realloc.c
-/reallocarray.c
-/regcomp.c
-/regex.c
-/regex.h
-/regex_internal.c
-/regex_internal.h
-/regexec.c
-/remove.c
-/rename.c
-/renameat.c
-/renameatu.c
-/renameatu.h
-/rewinddir.c
-/rmdir.c
-/root-uid.h
-/rpmatch.c
-/safe-read.c
-/safe-read.h
-/safe-write.c
-/safe-write.h
-/same-inode.c
-/same-inode.h
-/same.c
-/same.h
-/save-cwd.c
-/save-cwd.h
-/savedir.c
-/savedir.h
-/savewd.c
-/savewd.h
-/sched.in.h
-/scratch_buffer.h
-/se-context.c
-/se-context.in.h
-/se-label.c
-/se-label.in.h
-/se-selinux.c
-/se-selinux.in.h
-/secure_getenv.c
-/select.c
-/selinux-at.c
-/selinux-at.h
-/set-acl.c
-/set-permissions.c
-/setenv.c
-/setlocale-lock.c
-/setlocale_null.c
-/setlocale_null.h
-/settime.c
-/sha1-stream.c
-/sha1.c
-/sha1.h
-/sha256-stream.c
-/sha256.c
-/sha256.h
-/sha512-stream.c
-/sha512.c
-/sha512.h
-/sig-handler.c
-/sig-handler.h
-/sig2str.c
-/sig2str.h
-/sigaction.c
-/siglist.h
-/signal.in.h
-/signbitd.c
-/signbitf.c
-/signbitl.c
-/sigprocmask.c
-/size_max.h
-/sm3-stream.c
-/sm3.c
-/sm3.h
-/snprintf.c
-/sockets.c
-/sockets.h
-/stat-macros.h
-/stat-size.h
-/stat-time.c
-/stat-time.h
-/stat-w32.c
-/stat-w32.h
-/stat.c
-/stdarg.in.h
-/stdckdint.in.h
-/stddef.in.h
-/stdint.in.h
-/stdio--.h
-/stdio-impl.h
-/stdio-read.c
-/stdio-safer.h
-/stdio-write.c
-/stdio.in.h
-/stdlib--.h
-/stdlib-safer.h
-/stdlib.in.h
-/stpcpy.c
-/str-two-way.h
-/strdup.c
-/streq.h
-/strerror-override.c
-/strerror-override.h
-/strerror.c
-/strftime.h
-/string.in.h
-/stripslash.c
-/strnlen.c
-/strnlen1.c
-/strnlen1.h
-/strsignal.c
-/strstr.c
-/strtoimax.c
-/strtol.c
-/strtoll.c
-/strtoul.c
-/strtoull.c
-/strtoumax.c
-/symlink.c
-/symlinkat.c
-/sys-limits.h
-/sys_ioctl.in.h
-/sys_random.in.h
-/sys_resource.in.h
-/sys_select.in.h
-/sys_socket.c
-/sys_socket.in.h
-/sys_stat.in.h
-/sys_time.in.h
-/sys_types.in.h
-/sys_uio.in.h
-/sys_utsname.in.h
-/sys_wait.in.h
-/tempname.c
-/tempname.h
-/termios.in.h
-/time-internal.h
-/time.c
-/time.in.h
-/time_r.c
-/time_rz.c
-/timegm.c
-/timespec.c
-/timespec.h
-/tmpdir.c
-/tmpdir.h
-/tzset.c
-/u64.c
-/u64.h
-/uchar.in.h
-/uinttostr.c
-/umaxtostr.c
-/uname.c
-/unicase.in.h
-/unicodeio.c
-/unicodeio.h
-/unictype.in.h
-/uninorm.in.h
-/unistd--.h
-/unistd-safer.h
-/unistd.c
-/unistd.in.h
-/unistr.in.h
-/unitypes.in.h
-/uniwidth.in.h
-/unlink.c
-/unlinkat.c
-/unlinkdir.c
-/unlinkdir.h
-/unlocked-io.h
-/unsetenv.c
-/userspec.c
-/userspec.h
-/utime.c
-/utime.in.h
-/utimecmp.c
-/utimecmp.h
-/utimens.c
-/utimens.h
-/utimensat.c
-/vasnprintf.c
-/vasnprintf.h
-/vasprintf.c
-/verify.h
-/verror.c
-/verror.h
-/version-etc-fsf.c
-/version-etc.c
-/version-etc.h
-/vfprintf.c
-/vprintf.c
-/w32sock.h
-/warn-on-use.h
-/wchar.in.h
-/wcrtomb.c
-/wctype-h.c
-/wctype-impl.h
-/wctype.c
-/wctype.in.h
-/wcwidth.c
-/windows-cond.c
-/windows-cond.h
-/windows-initguard.h
-/windows-mutex.c
-/windows-mutex.h
-/windows-once.c
-/windows-once.h
-/windows-recmutex.c
-/windows-recmutex.h
-/windows-rwlock.c
-/windows-rwlock.h
-/windows-thread.c
-/windows-thread.h
-/windows-timedmutex.c
-/windows-timedmutex.h
-/windows-timedrecmutex.c
-/windows-timedrecmutex.h
-/windows-tls.c
-/windows-tls.h
-/wmemchr-impl.h
-/wmemchr.c
-/wmempcpy.c
-/write-any-file.c
-/write-any-file.h
-/write.c
-/xalignalloc.c
-/xalloc-die.c
-/xalloc-oversized.h
-/xalloc.h
-/xasprintf.c
-/xbinary-io.c
-/xbinary-io.h
-/xgetaname-impl.h
-/xgetcwd.c
-/xgetcwd.h
-/xgetgroups.c
-/xgethostname.c
-/xgethostname.h
-/xmalloc.c
-/xmemcoll.c
-/xmemcoll.h
-/xnanosleep.c
-/xnanosleep.h
-/xprintf.c
-/xprintf.h
-/xreadlink.c
-/xreadlink.h
-/xsize.c
-/xsize.h
-/xstrtod.c
-/xstrtod.h
-/xstrtoimax.c
-/xstrtol-error.c
-/xstrtol-error.h
-/xstrtol.c
-/xstrtol.h
-/xstrtold.c
-/xstrtoul.c
-/xstrtoumax.c
-/xtime.c
-/xtime.h
-/xvasprintf.c
-/xvasprintf.h
-/yesno.c
-/yesno.h
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/buffer-lcm.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/buffer-lcm.c
new file mode 100644 (file)
index 0000000..7e3773d
--- /dev/null
@@ -0,0 +1,59 @@
+/* buffer-lcm.c - compute a good buffer size for dealing with two files
+
+   Copyright (C) 2002-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+#include "buffer-lcm.h"
+
+/* Return a buffer size suitable for doing I/O with files whose block
+   sizes are A and B.  However, never return a value greater than
+   LCM_MAX.  */
+
+size_t
+buffer_lcm (size_t a, size_t b, size_t lcm_max)
+{
+  size_t size;
+
+  /* Use reasonable values if buffer sizes are zero.  */
+  if (!a)
+    size = b ? b : 8 * 1024;
+  else
+    {
+      if (b)
+        {
+          /* Return lcm (A, B) if it is in range; otherwise, fall back
+             on A.  */
+
+          size_t lcm, m, n, q, r;
+
+          /* N = gcd (A, B).  */
+          for (m = a, n = b;  (r = m % n) != 0;  m = n, n = r)
+            continue;
+
+          /* LCM = lcm (A, B), if in range.  */
+          q = a / n;
+          lcm = q * b;
+          if (lcm <= lcm_max && lcm / b == q)
+            return lcm;
+        }
+
+      size = a;
+    }
+
+  return size <= lcm_max ? size : lcm_max;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/buffer-lcm.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/buffer-lcm.h
new file mode 100644 (file)
index 0000000..454c65b
--- /dev/null
@@ -0,0 +1,2 @@
+#include <stddef.h>
+size_t buffer_lcm (size_t, size_t, size_t) _GL_ATTRIBUTE_CONST;
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtod.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtod.c
new file mode 100644 (file)
index 0000000..0a22eed
--- /dev/null
@@ -0,0 +1,332 @@
+/* Convert string to double, using the C locale.
+
+   Copyright (C) 2003-2004, 2006, 2009-2024 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "c-strtod.h"
+
+#include <errno.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if LONG
+# define C_STRTOD c_strtold
+# define DOUBLE long double
+# define STRTOD_L strtold_l
+# define HAVE_GOOD_STRTOD_L (HAVE_STRTOLD_L && !GNULIB_defined_strtold_function)
+# define STRTOD strtold
+#else
+# define C_STRTOD c_strtod
+# define DOUBLE double
+# define STRTOD_L strtod_l
+# define HAVE_GOOD_STRTOD_L (HAVE_STRTOD_L && !GNULIB_defined_strtod_function)
+# define STRTOD strtod
+#endif
+
+#if defined LC_ALL_MASK && (HAVE_GOOD_STRTOD_L || HAVE_WORKING_USELOCALE)
+
+/* Cache for the C locale object.
+   Marked volatile so that different threads see the same value
+   (avoids locking).  */
+static volatile locale_t c_locale_cache;
+
+/* Return the C locale object, or (locale_t) 0 with errno set
+   if it cannot be created.  */
+static locale_t
+c_locale (void)
+{
+  if (!c_locale_cache)
+    c_locale_cache = newlocale (LC_ALL_MASK, "C", (locale_t) 0);
+  return c_locale_cache;
+}
+
+#else
+
+# if HAVE_NL_LANGINFO
+#  include <langinfo.h>
+# endif
+# include "c-ctype.h"
+
+/* Determine the decimal-point character according to the current locale.  */
+static char
+decimal_point_char (void)
+{
+  const char *point;
+  /* Determine it in a multithread-safe way.  We know nl_langinfo is
+     multithread-safe on glibc systems and Mac OS X systems, but is not required
+     to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
+     localeconv() is rarely multithread-safe.  */
+# if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
+  point = nl_langinfo (RADIXCHAR);
+# elif 1
+  char pointbuf[5];
+  sprintf (pointbuf, "%#.0f", 1.0);
+  point = &pointbuf[1];
+# else
+  point = localeconv () -> decimal_point;
+# endif
+  /* The decimal point is always a single byte: either '.' or ','.  */
+  return (point[0] != '\0' ? point[0] : '.');
+}
+
+#endif
+
+DOUBLE
+C_STRTOD (char const *nptr, char **endptr)
+{
+  DOUBLE r;
+
+#if defined LC_ALL_MASK && (HAVE_GOOD_STRTOD_L || HAVE_WORKING_USELOCALE)
+
+  locale_t locale = c_locale ();
+  if (!locale)
+    {
+      if (endptr)
+        *endptr = (char *) nptr;
+      return 0; /* errno is set here */
+    }
+
+# if HAVE_GOOD_STRTOD_L
+
+  r = STRTOD_L (nptr, endptr, locale);
+
+# else /* HAVE_WORKING_USELOCALE */
+
+  locale_t old_locale = uselocale (locale);
+  if (old_locale == (locale_t)0)
+    {
+      if (endptr)
+        *endptr = (char *) nptr;
+      return 0; /* errno is set here */
+    }
+
+  r = STRTOD (nptr, endptr);
+
+  int saved_errno = errno;
+  if (uselocale (old_locale) == (locale_t)0)
+    /* We can't switch back to the old locale.  The thread is hosed.  */
+    abort ();
+  errno = saved_errno;
+
+# endif
+
+#else
+
+  char decimal_point = decimal_point_char ();
+
+  if (decimal_point == '.')
+    /* In this locale, C_STRTOD and STRTOD behave the same way.  */
+    r = STRTOD (nptr, endptr);
+  else
+    {
+      /* Start and end of the floating-point number.  */
+      char const *start;
+      char const *end;
+      /* Position of the decimal point '.' in the floating-point number.
+         Either decimal_point_p == NULL or start <= decimal_point_p < end.  */
+      char const *decimal_point_p = NULL;
+      /* Set to true if we encountered decimal_point while parsing.  */
+      int seen_decimal_point = 0;
+
+      /* Parse
+         1. a sequence of white-space characters,
+         2. a subject sequence possibly containing a floating-point number,
+         as described in POSIX
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtod.html>.
+       */
+      {
+        char const *p;
+
+        p = nptr;
+
+        /* Parse a sequence of white-space characters.  */
+        while (*p != '\0' && c_isspace ((unsigned char) *p))
+          p++;
+        start = p;
+        end = p;
+
+        /* Start to parse a subject sequence.  */
+        if (*p == '+' || *p == '-')
+          p++;
+        if (*p == '0')
+          {
+            end = p + 1;
+            if (p[1] == 'x' || p[1] == 'X')
+              {
+                size_t num_hex_digits = 0;
+                p += 2;
+                /* Parse a non-empty sequence of hexadecimal digits optionally
+                   containing the decimal point character '.'.  */
+                while (*p != '\0')
+                  {
+                    if (c_isxdigit ((unsigned char) *p))
+                      {
+                        num_hex_digits++;
+                        p++;
+                      }
+                    else if (*p == '.')
+                      {
+                        if (decimal_point_p == NULL)
+                          {
+                            decimal_point_p = p;
+                            p++;
+                          }
+                        else
+                          break;
+                      }
+                    else
+                      break;
+                  }
+                seen_decimal_point = (*p == decimal_point);
+                if (num_hex_digits > 0)
+                  {
+                    end = p;
+                    /* Parse the character 'p' or the character 'P', optionally
+                       followed by a '+' or '-' character, and then followed by
+                       one or more decimal digits.  */
+                    if (*p == 'p' || *p == 'P')
+                      {
+                        p++;
+                        if (*p == '+' || *p == '-')
+                          p++;
+                        if (*p != '\0' && c_isdigit ((unsigned char) *p))
+                          {
+                            p++;
+                            while (*p != '\0' && c_isdigit ((unsigned char) *p))
+                              p++;
+                            end = p;
+                          }
+                      }
+                  }
+                else
+                  decimal_point_p = NULL;
+                goto done_parsing;
+              }
+          }
+        {
+          size_t num_digits = 0;
+          /* Parse a non-empty sequence of decimal digits optionally containing
+             the decimal point character '.'.  */
+          while (*p != '\0')
+            {
+              if (c_isdigit ((unsigned char) *p))
+                {
+                  num_digits++;
+                  p++;
+                }
+              else if (*p == '.')
+                {
+                  if (decimal_point_p == NULL)
+                    {
+                      decimal_point_p = p;
+                      p++;
+                    }
+                  else
+                    break;
+                }
+              else
+                break;
+            }
+          seen_decimal_point = (*p == decimal_point);
+          if (num_digits > 0)
+            {
+              end = p;
+              /* Parse the character 'e' or the character 'E', optionally
+                 followed by a '+' or '-' character, and then followed by one or
+                 more decimal digits.  */
+              if (*p == 'e' || *p == 'E')
+                {
+                  p++;
+                  if (*p == '+' || *p == '-')
+                    p++;
+                  if (*p != '\0' && c_isdigit ((unsigned char) *p))
+                    {
+                      p++;
+                      while (*p != '\0' && c_isdigit ((unsigned char) *p))
+                        p++;
+                      end = p;
+                    }
+                }
+            }
+          else
+            decimal_point_p = NULL;
+        }
+      }
+     done_parsing:
+      if (end == start || (decimal_point_p == NULL && !seen_decimal_point))
+        /* If end == start, we have not parsed anything.  The given string
+           might be "INF", "INFINITY", "NAN", "NAN(chars)", or invalid.
+           We can pass it to STRTOD.
+           If end > start and decimal_point_p == NULL, we have parsed a
+           floating-point number, and it does not have a '.' (and not a ','
+           either, of course).  If !seen_decimal_point, we did not
+           encounter decimal_point while parsing.  In this case, the
+           locale-dependent STRTOD function can handle it.  */
+        r = STRTOD (nptr, endptr);
+      else
+        {
+          /* Create a modified floating-point number, in which the character '.'
+             is replaced with the locale-dependent decimal_point.  */
+          size_t len = end - start;
+          char *buf;
+          char *buf_malloced = NULL;
+          char stackbuf[1000];
+          char *end_in_buf;
+
+          if (len < sizeof (stackbuf))
+            buf = stackbuf;
+          else
+            {
+              buf = malloc (len + 1);
+              if (buf == NULL)
+                {
+                  /* Out of memory.
+                     Callers may not be prepared to see errno == ENOMEM.  But
+                     they should be prepared to see errno == EINVAL.  */
+                  errno = EINVAL;
+                  if (endptr != NULL)
+                    *endptr = (char *) nptr;
+                  return 0;
+                }
+              buf_malloced = buf;
+            }
+
+          memcpy (buf, start, len);
+          if (decimal_point_p != NULL)
+            buf[decimal_point_p - start] = decimal_point;
+          buf[len] = '\0';
+
+          r = STRTOD (buf, &end_in_buf);
+          if (endptr != NULL)
+            *endptr = (char *) (start + (end_in_buf - buf));
+
+          if (buf_malloced != NULL)
+            {
+              int saved_errno = errno;
+              free (buf_malloced);
+              errno = saved_errno;
+            }
+        }
+    }
+
+#endif
+
+  return r;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtod.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtod.h
new file mode 100644 (file)
index 0000000..7576e5f
--- /dev/null
@@ -0,0 +1,45 @@
+/* Convert string to double, using the C locale.  -*- coding: utf-8 -*-
+
+   Copyright (C) 2003-2004, 2009-2024 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Parse the initial portion of the string pointed to by NPTR as a floating-
+   point number (in decimal or hexadecimal notation), like in the C locale:
+   accepting only the ASCII digits '0'..'9', and only '.' as decimal point
+   character.
+   If ENDPTR is not NULL, set *ENDPTR to point to the first byte beyond the
+   parsed number or to NPTR if the string does not start with a parsable
+   number.
+   Return value:
+   - If successful, return the value as a double or 'long double',
+     respectively, and don't modify errno.
+   - In case of overflow, return Â±HUGE_VAL or Â±HUGE_VALL, respectively, and
+     set errno to ERANGE.
+   - In case of underflow, return a value very near to 0 and set errno to
+     ERANGE.
+   - If the string does not start with a number at all, return 0 (and recall
+     that if ENDPTR != NULL, *ENDPTR is set to NPTR), and maybe set errno to
+     EINVAL.
+   - In case of other error, return 0 and set errno, for example to ENOMEM.  */
+extern double      c_strtod  (char const *nptr, char **endptr);
+extern long double c_strtold (char const *nptr, char **endptr);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtold.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/c-strtold.c
new file mode 100644 (file)
index 0000000..aa65557
--- /dev/null
@@ -0,0 +1,19 @@
+/* Convert string to 'long double' in C locale.
+
+   Copyright (C) 2004-2024 Free Software Foundation, Inc.
+
+   This file 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 file is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define LONG 1
+#include "c-strtod.c"
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtod.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtod.c
new file mode 100644 (file)
index 0000000..1ba9b1d
--- /dev/null
@@ -0,0 +1,76 @@
+/* Convert string to double in the current locale, falling back on the C locale.
+
+   Copyright 2019-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "cl-strtod.h"
+
+#include <c-strtod.h>
+
+#include <errno.h>
+#include <stdlib.h>
+
+#if LONG
+# define CL_STRTOD cl_strtold
+# define DOUBLE long double
+# define C_STRTOD c_strtold
+# define STRTOD strtold
+#else
+# define CL_STRTOD cl_strtod
+# define DOUBLE double
+# define C_STRTOD c_strtod
+# define STRTOD strtod
+#endif
+
+/* This function acts like strtod or strtold, except that it falls
+   back on the C locale if the initial prefix is not parsable in
+   the current locale.  If the prefix is parsable in both locales,
+   it uses the longer parse, breaking ties in favor of the current locale.
+
+   Parse the initial prefix of NPTR as a floating-point number in the
+   current locale or in the C locale (preferring the locale that
+   yields the longer parse, or the current locale if there is a tie).
+   If ENDPTR is non-null, set *ENDPTR to the first unused byte, or to
+   NPTR if the prefix cannot be parsed.
+
+   If successful, return a number without changing errno.
+   If the prefix cannot be parsed, return 0 and possibly set errno to EINVAL.
+   If the number overflows, return an extreme value and set errno to ERANGE.
+   If the number underflows, return a value close to 0 and set errno to ERANGE.
+   If there is some other error, return 0 and set errno.  */
+
+DOUBLE
+CL_STRTOD (char const *nptr, char **restrict endptr)
+{
+  char *end;
+  DOUBLE d = STRTOD (nptr, &end);
+  if (*end)
+    {
+      int strtod_errno = errno;
+      char *c_end;
+      DOUBLE c = C_STRTOD (nptr, &c_end);
+      if (end < c_end)
+        d = c, end = c_end;
+      else
+        errno = strtod_errno;
+    }
+  if (endptr)
+    *endptr = end;
+  return d;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtod.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtod.h
new file mode 100644 (file)
index 0000000..4f11972
--- /dev/null
@@ -0,0 +1,4 @@
+double cl_strtod (char const *, char **restrict)
+  _GL_ATTRIBUTE_NONNULL ((1));
+long double cl_strtold (char const *, char **restrict)
+  _GL_ATTRIBUTE_NONNULL ((1));
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtold.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/cl-strtold.c
new file mode 100644 (file)
index 0000000..95ae46d
--- /dev/null
@@ -0,0 +1,2 @@
+#define LONG 1
+#include "cl-strtod.c"
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fadvise.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fadvise.c
new file mode 100644 (file)
index 0000000..79e6ac7
--- /dev/null
@@ -0,0 +1,43 @@
+/* Declare an access pattern hint for files.
+   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Without this pragma, gcc suggests that (given !HAVE_POSIX_FADVISE)
+   the fdadvise function might be a candidate for attribute 'const'.  */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
+#endif
+
+#include <config.h>
+#include "fadvise.h"
+
+#include <stdio.h>
+#include <fcntl.h>
+#include "ignore-value.h"
+
+void
+fdadvise (int fd, off_t offset, off_t len, fadvice_t advice)
+{
+#if HAVE_POSIX_FADVISE
+  ignore_value (posix_fadvise (fd, offset, len, advice));
+#endif
+}
+
+void
+fadvise (FILE *fp, fadvice_t advice)
+{
+  if (fp)
+    fdadvise (fileno (fp), 0, 0, advice);
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fadvise.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fadvise.h
new file mode 100644 (file)
index 0000000..276a883
--- /dev/null
@@ -0,0 +1,71 @@
+/* Declare an access pattern hint for files.
+   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/types.h>
+
+/* There are a few hints one can provide, which have the
+   following characteristics on Linux 2.6.31 at least.
+
+   POSIX_FADV_SEQUENTIAL
+     Doubles the size of read ahead done for file
+   POSIX_FADV_WILLNEED
+     _synchronously_ prepopulate the buffer cache with the file
+   POSIX_FADV_NOREUSE
+     Could lower priority of data in buffer caches,
+     but currently does nothing.
+   POSIX_FADV_DONTNEED
+     Drop the file from cache.
+     Note this is automatically done when files are unlinked.
+
+   We use this enum "type" both to make it explicit that
+   these options are mutually exclusive, and to discourage
+   the passing of the possibly undefined POSIX_FADV_... values.
+   Note we could #undef the POSIX_FADV_ values, but that would
+   preclude using the posix_fadvise() function with its standard
+   constants. Using posix_fadvise() might be required if the return
+   value is needed, but it must be guarded by appropriate #ifdefs.  */
+
+#if HAVE_POSIX_FADVISE
+typedef enum {
+  FADVISE_NORMAL =     POSIX_FADV_NORMAL,
+  FADVISE_SEQUENTIAL = POSIX_FADV_SEQUENTIAL,
+  FADVISE_NOREUSE =    POSIX_FADV_NOREUSE,
+  FADVISE_DONTNEED =   POSIX_FADV_DONTNEED,
+  FADVISE_WILLNEED =   POSIX_FADV_WILLNEED,
+  FADVISE_RANDOM =     POSIX_FADV_RANDOM
+} fadvice_t;
+#else
+typedef enum {
+  FADVISE_NORMAL,
+  FADVISE_SEQUENTIAL,
+  FADVISE_NOREUSE,
+  FADVISE_DONTNEED,
+  FADVISE_WILLNEED,
+  FADVISE_RANDOM
+} fadvice_t;
+#endif
+
+/* We ignore any errors as these hints are only advisory.
+   There is the chance one can pass invalid ADVICE, which will
+   not be indicated, but given the simplicity of the interface
+   this is unlikely.  Also not returning errors allows the
+   unconditional passing of descriptors to non standard files,
+   which will just be ignored if unsupported.  */
+
+void fdadvise (int fd, off_t offset, off_t len, fadvice_t advice);
+void fadvise (FILE *fp, fadvice_t advice);
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fd-reopen.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fd-reopen.c
new file mode 100644 (file)
index 0000000..f515077
--- /dev/null
@@ -0,0 +1,46 @@
+/* Invoke open, but return either a desired file descriptor or -1.
+
+   Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "fd-reopen.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+/* Open a file to a particular file descriptor.  This is like standard
+   'open', except it always returns DESIRED_FD if successful.  */
+
+int
+fd_reopen (int desired_fd, char const *file, int flags, mode_t mode)
+{
+  int fd = open (file, flags, mode);
+
+  if (fd == desired_fd || fd < 0)
+    return fd;
+  else
+    {
+      int fd2 = dup2 (fd, desired_fd);
+      int saved_errno = errno;
+      close (fd);
+      errno = saved_errno;
+      return fd2;
+    }
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fd-reopen.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/fd-reopen.h
new file mode 100644 (file)
index 0000000..9798475
--- /dev/null
@@ -0,0 +1,22 @@
+/* Invoke open, but return either a desired file descriptor or -1.
+
+   Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <sys/types.h>
+
+int fd_reopen (int, char const *, int, mode_t) _GL_ATTRIBUTE_NONNULL ();
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/glthread/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/glthread/.gitignore
deleted file mode 100644 (file)
index b854214..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-/lock.c
-/lock.h
-/threadlib.c
-/tls.c
-/tls.h
index 6d773e86c79cecd2e5b95ba66ca2a5591d0264dd..a5778254a2d1d6103b87afb66d29b8365916e38d 100644 (file)
@@ -23,7 +23,8 @@
 # Generated by gnulib-tool.
 # Reproduce by:
 # gnulib-tool --import \
-#  --lib=libgnu \
+#  --local-dir=gl \
+#  --lib=libcoreutils \
 #  --source-base=lib \
 #  --m4-base=m4 \
 #  --doc-base=doc \
 MOSTLYCLEANFILES += lib/core lib/*.stackdump
 # No GNU Make output.
 
-noinst_LIBRARIES += lib/libgnu.a
+noinst_LIBRARIES += lib/libcoreutils.a
 
-lib_libgnu_a_SOURCES =
-lib_libgnu_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
-lib_libgnu_a_LIBADD = $(gl_LIBOBJS)
-lib_libgnu_a_DEPENDENCIES = $(gl_LIBOBJS)
-EXTRA_lib_libgnu_a_SOURCES =
+lib_libcoreutils_a_SOURCES =
+lib_libcoreutils_a_CFLAGS = $(AM_CFLAGS) $(GL_CFLAG_GNULIB_WARNINGS)
+lib_libcoreutils_a_LIBADD = $(gl_LIBOBJS)
+lib_libcoreutils_a_DEPENDENCIES = $(gl_LIBOBJS)
+EXTRA_lib_libcoreutils_a_SOURCES =
 
 ## begin gnulib module absolute-header
 
@@ -348,30 +349,30 @@ HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
 ## begin gnulib module access
 
 if GL_COND_OBJ_ACCESS
-lib_libgnu_a_SOURCES += lib/access.c
+lib_libcoreutils_a_SOURCES += lib/access.c
 endif
 
 ## end   gnulib module access
 
 ## begin gnulib module acl
 
-lib_libgnu_a_SOURCES += lib/copy-acl.c lib/set-acl.c
+lib_libcoreutils_a_SOURCES += lib/copy-acl.c lib/set-acl.c
 
 ## end   gnulib module acl
 
 ## begin gnulib module acl-permissions
 
-lib_libgnu_a_SOURCES += lib/acl-errno-valid.c lib/acl-internal.c    lib/get-permissions.c lib/set-permissions.c
+lib_libcoreutils_a_SOURCES += lib/acl-errno-valid.c lib/acl-internal.c    lib/get-permissions.c lib/set-permissions.c
 
 EXTRA_DIST += lib/acl-internal.h lib/acl.h lib/acl_entries.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/acl_entries.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/acl_entries.c
 
 ## end   gnulib module acl-permissions
 
 ## begin gnulib module alignalloc
 
-lib_libgnu_a_SOURCES += lib/alignalloc.c
+lib_libcoreutils_a_SOURCES += lib/alignalloc.c
 
 EXTRA_DIST += lib/alignalloc.h
 
@@ -387,11 +388,11 @@ EXTRA_DIST += lib/alignof.h
 ## begin gnulib module alloca
 
 
-lib_libgnu_a_LIBADD += @ALLOCA@
-lib_libgnu_a_DEPENDENCIES += @ALLOCA@
+lib_libcoreutils_a_LIBADD += @ALLOCA@
+lib_libcoreutils_a_DEPENDENCIES += @ALLOCA@
 EXTRA_DIST += lib/alloca.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/alloca.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/alloca.c
 
 ## end   gnulib module alloca
 
@@ -420,7 +421,7 @@ EXTRA_DIST += lib/alloca.in.h
 
 ## begin gnulib module allocator
 
-lib_libgnu_a_SOURCES += lib/allocator.c
+lib_libcoreutils_a_SOURCES += lib/allocator.c
 
 EXTRA_DIST += lib/allocator.h
 
@@ -435,7 +436,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen
 
 ## begin gnulib module areadlink
 
-lib_libgnu_a_SOURCES += lib/areadlink.c
+lib_libcoreutils_a_SOURCES += lib/areadlink.c
 
 EXTRA_DIST += lib/areadlink.h
 
@@ -443,7 +444,7 @@ EXTRA_DIST += lib/areadlink.h
 
 ## begin gnulib module areadlink-with-size
 
-lib_libgnu_a_SOURCES += lib/areadlink-with-size.c
+lib_libcoreutils_a_SOURCES += lib/areadlink-with-size.c
 
 EXTRA_DIST += lib/areadlink.h
 
@@ -451,27 +452,27 @@ EXTRA_DIST += lib/areadlink.h
 
 ## begin gnulib module areadlinkat
 
-lib_libgnu_a_SOURCES += lib/areadlinkat.c
+lib_libcoreutils_a_SOURCES += lib/areadlinkat.c
 
 EXTRA_DIST += lib/areadlink.h lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module areadlinkat
 
 ## begin gnulib module areadlinkat-with-size
 
-lib_libgnu_a_SOURCES += lib/areadlinkat-with-size.c
+lib_libcoreutils_a_SOURCES += lib/areadlinkat-with-size.c
 
 EXTRA_DIST += lib/areadlink.h lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module areadlinkat-with-size
 
 ## begin gnulib module argmatch
 
-lib_libgnu_a_SOURCES += lib/argmatch.c
+lib_libcoreutils_a_SOURCES += lib/argmatch.c
 
 EXTRA_DIST += lib/argmatch.h
 
@@ -479,7 +480,7 @@ EXTRA_DIST += lib/argmatch.h
 
 ## begin gnulib module argv-iter
 
-lib_libgnu_a_SOURCES += lib/argv-iter.c lib/argv-iter.h
+lib_libcoreutils_a_SOURCES += lib/argv-iter.c lib/argv-iter.h
 
 ## end   gnulib module argv-iter
 
@@ -559,7 +560,7 @@ EXTRA_DIST += lib/assure.h
 
 ## begin gnulib module at-internal
 
-lib_libgnu_a_SOURCES += lib/openat-priv.h lib/openat-proc.c
+lib_libcoreutils_a_SOURCES += lib/openat-priv.h lib/openat-proc.c
 
 ## end   gnulib module at-internal
 
@@ -572,7 +573,7 @@ EXTRA_DIST += lib/attribute.h
 
 ## begin gnulib module backup-rename
 
-lib_libgnu_a_SOURCES += lib/backupfile.c lib/backup-rename.c
+lib_libcoreutils_a_SOURCES += lib/backupfile.c lib/backup-rename.c
 
 EXTRA_DIST += lib/backup-internal.h lib/backupfile.h
 
@@ -580,7 +581,7 @@ EXTRA_DIST += lib/backup-internal.h lib/backupfile.h
 
 ## begin gnulib module backupfile
 
-lib_libgnu_a_SOURCES += lib/backupfile.c lib/backup-find.c
+lib_libcoreutils_a_SOURCES += lib/backupfile.c lib/backup-find.c
 
 EXTRA_DIST += lib/backup-internal.h lib/backupfile.h
 
@@ -588,19 +589,19 @@ EXTRA_DIST += lib/backup-internal.h lib/backupfile.h
 
 ## begin gnulib module base32
 
-lib_libgnu_a_SOURCES += lib/base32.h lib/base32.c
+lib_libcoreutils_a_SOURCES += lib/base32.h lib/base32.c
 
 ## end   gnulib module base32
 
 ## begin gnulib module base64
 
-lib_libgnu_a_SOURCES += lib/base64.h lib/base64.c
+lib_libcoreutils_a_SOURCES += lib/base64.h lib/base64.c
 
 ## end   gnulib module base64
 
 ## begin gnulib module basename-lgpl
 
-lib_libgnu_a_SOURCES += lib/basename-lgpl.c
+lib_libcoreutils_a_SOURCES += lib/basename-lgpl.c
 
 EXTRA_DIST += lib/basename-lgpl.h
 
@@ -608,7 +609,7 @@ EXTRA_DIST += lib/basename-lgpl.h
 
 ## begin gnulib module binary-io
 
-lib_libgnu_a_SOURCES += lib/binary-io.h lib/binary-io.c
+lib_libcoreutils_a_SOURCES += lib/binary-io.h lib/binary-io.c
 
 ## end   gnulib module binary-io
 
@@ -620,24 +621,30 @@ lib_libgnu_a_SOURCES += lib/binary-io.h lib/binary-io.c
 
 ## begin gnulib module bitrotate
 
-lib_libgnu_a_SOURCES += lib/bitrotate.h lib/bitrotate.c
+lib_libcoreutils_a_SOURCES += lib/bitrotate.h lib/bitrotate.c
 
 ## end   gnulib module bitrotate
 
 ## begin gnulib module btoc32
 
-lib_libgnu_a_SOURCES += lib/btoc32.c
+lib_libcoreutils_a_SOURCES += lib/btoc32.c
 
 ## end   gnulib module btoc32
 
 ## begin gnulib module btowc
 
 if GL_COND_OBJ_BTOWC
-lib_libgnu_a_SOURCES += lib/btowc.c
+lib_libcoreutils_a_SOURCES += lib/btowc.c
 endif
 
 ## end   gnulib module btowc
 
+## begin gnulib module buffer-lcm
+
+lib_libcoreutils_a_SOURCES += lib/buffer-lcm.c lib/buffer-lcm.h
+
+## end   gnulib module buffer-lcm
+
 ## begin gnulib module byteswap
 
 BUILT_SOURCES += $(BYTESWAP_H)
@@ -661,13 +668,13 @@ EXTRA_DIST += lib/byteswap.in.h
 
 ## begin gnulib module c-ctype
 
-lib_libgnu_a_SOURCES += lib/c-ctype.h lib/c-ctype.c
+lib_libcoreutils_a_SOURCES += lib/c-ctype.h lib/c-ctype.c
 
 ## end   gnulib module c-ctype
 
 ## begin gnulib module c-file-type
 
-lib_libgnu_a_SOURCES += lib/c-file-type.c
+lib_libcoreutils_a_SOURCES += lib/c-file-type.c
 
 EXTRA_DIST += lib/file-type.h
 
@@ -675,7 +682,7 @@ EXTRA_DIST += lib/file-type.h
 
 ## begin gnulib module c-strcase
 
-lib_libgnu_a_SOURCES += lib/c-strcase.h lib/c-strcasecmp.c lib/c-strncasecmp.c
+lib_libcoreutils_a_SOURCES += lib/c-strcase.h lib/c-strcasecmp.c lib/c-strncasecmp.c
 
 ## end   gnulib module c-strcase
 
@@ -686,21 +693,39 @@ EXTRA_DIST += lib/c-strcaseeq.h
 
 ## end   gnulib module c-strcaseeq
 
+## begin gnulib module c-strtod
+
+lib_libcoreutils_a_SOURCES += lib/c-strtod.c
+
+EXTRA_DIST += lib/c-strtod.h
+
+## end   gnulib module c-strtod
+
+## begin gnulib module c-strtold
+
+lib_libcoreutils_a_SOURCES += lib/c-strtold.c
+
+EXTRA_DIST += lib/c-strtod.c lib/c-strtod.h
+
+EXTRA_lib_libcoreutils_a_SOURCES += lib/c-strtod.c
+
+## end   gnulib module c-strtold
+
 ## begin gnulib module c32_apply_type_test
 
-lib_libgnu_a_SOURCES += lib/c32_apply_type_test.c
+lib_libcoreutils_a_SOURCES += lib/c32_apply_type_test.c
 
 ## end   gnulib module c32_apply_type_test
 
 ## begin gnulib module c32_get_type_test
 
-lib_libgnu_a_SOURCES += lib/c32_get_type_test.c
+lib_libcoreutils_a_SOURCES += lib/c32_get_type_test.c
 
 ## end   gnulib module c32_get_type_test
 
 ## begin gnulib module c32isalnum
 
-lib_libgnu_a_SOURCES += lib/c32isalnum.c
+lib_libcoreutils_a_SOURCES += lib/c32isalnum.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -708,7 +733,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isalpha
 
-lib_libgnu_a_SOURCES += lib/c32isalpha.c
+lib_libcoreutils_a_SOURCES += lib/c32isalpha.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -716,7 +741,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isblank
 
-lib_libgnu_a_SOURCES += lib/c32isblank.c
+lib_libcoreutils_a_SOURCES += lib/c32isblank.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -724,7 +749,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32iscntrl
 
-lib_libgnu_a_SOURCES += lib/c32iscntrl.c
+lib_libcoreutils_a_SOURCES += lib/c32iscntrl.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -732,7 +757,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isdigit
 
-lib_libgnu_a_SOURCES += lib/c32isdigit.c
+lib_libcoreutils_a_SOURCES += lib/c32isdigit.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -740,7 +765,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isgraph
 
-lib_libgnu_a_SOURCES += lib/c32isgraph.c
+lib_libcoreutils_a_SOURCES += lib/c32isgraph.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -748,7 +773,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32islower
 
-lib_libgnu_a_SOURCES += lib/c32islower.c
+lib_libcoreutils_a_SOURCES += lib/c32islower.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -756,7 +781,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isprint
 
-lib_libgnu_a_SOURCES += lib/c32isprint.c
+lib_libcoreutils_a_SOURCES += lib/c32isprint.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -764,7 +789,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32ispunct
 
-lib_libgnu_a_SOURCES += lib/c32ispunct.c
+lib_libcoreutils_a_SOURCES += lib/c32ispunct.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -772,7 +797,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isspace
 
-lib_libgnu_a_SOURCES += lib/c32isspace.c
+lib_libcoreutils_a_SOURCES += lib/c32isspace.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -780,7 +805,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isupper
 
-lib_libgnu_a_SOURCES += lib/c32isupper.c
+lib_libcoreutils_a_SOURCES += lib/c32isupper.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -788,7 +813,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32isxdigit
 
-lib_libgnu_a_SOURCES += lib/c32isxdigit.c
+lib_libcoreutils_a_SOURCES += lib/c32isxdigit.c
 
 EXTRA_DIST += lib/c32is-impl.h
 
@@ -796,7 +821,7 @@ EXTRA_DIST += lib/c32is-impl.h
 
 ## begin gnulib module c32tolower
 
-lib_libgnu_a_SOURCES += lib/c32tolower.c
+lib_libcoreutils_a_SOURCES += lib/c32tolower.c
 
 EXTRA_DIST += lib/c32to-impl.h
 
@@ -804,7 +829,7 @@ EXTRA_DIST += lib/c32to-impl.h
 
 ## begin gnulib module c32width
 
-lib_libgnu_a_SOURCES += lib/c32width.c
+lib_libcoreutils_a_SOURCES += lib/c32width.c
 
 ## end   gnulib module c32width
 
@@ -813,7 +838,7 @@ lib_libgnu_a_SOURCES += lib/c32width.c
 
 EXTRA_DIST += lib/calloc.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/calloc.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/calloc.c
 
 ## end   gnulib module calloc-gnu
 
@@ -822,13 +847,13 @@ EXTRA_lib_libgnu_a_SOURCES += lib/calloc.c
 
 EXTRA_DIST += lib/calloc.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/calloc.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/calloc.c
 
 ## end   gnulib module calloc-posix
 
 ## begin gnulib module canon-host
 
-lib_libgnu_a_SOURCES += lib/canon-host.c
+lib_libcoreutils_a_SOURCES += lib/canon-host.c
 
 EXTRA_DIST += lib/canon-host.h
 
@@ -836,7 +861,7 @@ EXTRA_DIST += lib/canon-host.h
 
 ## begin gnulib module canonicalize
 
-lib_libgnu_a_SOURCES += lib/canonicalize.c
+lib_libcoreutils_a_SOURCES += lib/canonicalize.c
 
 EXTRA_DIST += lib/canonicalize.h
 
@@ -844,7 +869,7 @@ EXTRA_DIST += lib/canonicalize.h
 
 ## begin gnulib module careadlinkat
 
-lib_libgnu_a_SOURCES += lib/careadlinkat.c
+lib_libcoreutils_a_SOURCES += lib/careadlinkat.c
 
 EXTRA_DIST += lib/careadlinkat.h
 
@@ -853,7 +878,7 @@ EXTRA_DIST += lib/careadlinkat.h
 ## begin gnulib module chdir-long
 
 if GL_COND_OBJ_CHDIR_LONG
-lib_libgnu_a_SOURCES += lib/chdir-long.c
+lib_libcoreutils_a_SOURCES += lib/chdir-long.c
 endif
 
 EXTRA_DIST += lib/chdir-long.h
@@ -863,37 +888,55 @@ EXTRA_DIST += lib/chdir-long.h
 ## begin gnulib module chmod
 
 if GL_COND_OBJ_CHMOD
-lib_libgnu_a_SOURCES += lib/chmod.c
+lib_libcoreutils_a_SOURCES += lib/chmod.c
 endif
 
 ## end   gnulib module chmod
 
 ## begin gnulib module chmodat
 
-lib_libgnu_a_SOURCES += lib/chmodat.c
+lib_libcoreutils_a_SOURCES += lib/chmodat.c
 
 ## end   gnulib module chmodat
 
 ## begin gnulib module chown
 
 if GL_COND_OBJ_CHOWN
-lib_libgnu_a_SOURCES += lib/chown.c
+lib_libcoreutils_a_SOURCES += lib/chown.c
 endif
 if GL_COND_OBJ_FCHOWN_STUB
-lib_libgnu_a_SOURCES += lib/fchown-stub.c
+lib_libcoreutils_a_SOURCES += lib/fchown-stub.c
 endif
 
 ## end   gnulib module chown
 
 ## begin gnulib module chownat
 
-lib_libgnu_a_SOURCES += lib/chownat.c
+lib_libcoreutils_a_SOURCES += lib/chownat.c
 
 ## end   gnulib module chownat
 
+## begin gnulib module cl-strtod
+
+lib_libcoreutils_a_SOURCES += lib/cl-strtod.c
+
+EXTRA_DIST += lib/cl-strtod.h
+
+## end   gnulib module cl-strtod
+
+## begin gnulib module cl-strtold
+
+lib_libcoreutils_a_SOURCES += lib/cl-strtold.c
+
+EXTRA_DIST += lib/cl-strtod.c lib/cl-strtod.h
+
+EXTRA_lib_libcoreutils_a_SOURCES += lib/cl-strtod.c
+
+## end   gnulib module cl-strtold
+
 ## begin gnulib module cloexec
 
-lib_libgnu_a_SOURCES += lib/cloexec.c
+lib_libcoreutils_a_SOURCES += lib/cloexec.c
 
 EXTRA_DIST += lib/cloexec.h
 
@@ -902,14 +945,14 @@ EXTRA_DIST += lib/cloexec.h
 ## begin gnulib module close
 
 if GL_COND_OBJ_CLOSE
-lib_libgnu_a_SOURCES += lib/close.c
+lib_libcoreutils_a_SOURCES += lib/close.c
 endif
 
 ## end   gnulib module close
 
 ## begin gnulib module close-stream
 
-lib_libgnu_a_SOURCES += lib/close-stream.c
+lib_libcoreutils_a_SOURCES += lib/close-stream.c
 
 EXTRA_DIST += lib/close-stream.h
 
@@ -918,7 +961,7 @@ EXTRA_DIST += lib/close-stream.h
 ## begin gnulib module closedir
 
 if GL_COND_OBJ_CLOSEDIR
-lib_libgnu_a_SOURCES += lib/closedir.c
+lib_libcoreutils_a_SOURCES += lib/closedir.c
 endif
 
 EXTRA_DIST += lib/dirent-private.h
@@ -927,7 +970,7 @@ EXTRA_DIST += lib/dirent-private.h
 
 ## begin gnulib module closein
 
-lib_libgnu_a_SOURCES += lib/closein.c
+lib_libcoreutils_a_SOURCES += lib/closein.c
 
 EXTRA_DIST += lib/closein.h
 
@@ -935,7 +978,7 @@ EXTRA_DIST += lib/closein.h
 
 ## begin gnulib module closeout
 
-lib_libgnu_a_SOURCES += lib/closeout.c
+lib_libcoreutils_a_SOURCES += lib/closeout.c
 
 EXTRA_DIST += lib/closeout.h
 
@@ -992,14 +1035,14 @@ CLEANFILES += lib/configmake.h lib/configmake.h-t
 ## begin gnulib module copy-file-range
 
 if GL_COND_OBJ_COPY_FILE_RANGE
-lib_libgnu_a_SOURCES += lib/copy-file-range.c
+lib_libcoreutils_a_SOURCES += lib/copy-file-range.c
 endif
 
 ## end   gnulib module copy-file-range
 
 ## begin gnulib module count-leading-zeros
 
-lib_libgnu_a_SOURCES += lib/count-leading-zeros.c
+lib_libcoreutils_a_SOURCES += lib/count-leading-zeros.c
 
 EXTRA_DIST += lib/count-leading-zeros.h
 
@@ -1007,7 +1050,7 @@ EXTRA_DIST += lib/count-leading-zeros.h
 
 ## begin gnulib module crypto/af_alg
 
-lib_libgnu_a_SOURCES += lib/af_alg.c
+lib_libcoreutils_a_SOURCES += lib/af_alg.c
 
 EXTRA_DIST += lib/af_alg.h lib/sys-limits.h
 
@@ -1015,13 +1058,13 @@ EXTRA_DIST += lib/af_alg.h lib/sys-limits.h
 
 ## begin gnulib module crypto/md5
 
-lib_libgnu_a_SOURCES += lib/md5-stream.c
+lib_libcoreutils_a_SOURCES += lib/md5-stream.c
 
 ## end   gnulib module crypto/md5
 
 ## begin gnulib module crypto/md5-buffer
 
-lib_libgnu_a_SOURCES += lib/md5.c
+lib_libcoreutils_a_SOURCES += lib/md5.c
 
 EXTRA_DIST += lib/gl_openssl.h lib/md5.h
 
@@ -1029,13 +1072,13 @@ EXTRA_DIST += lib/gl_openssl.h lib/md5.h
 
 ## begin gnulib module crypto/sha1
 
-lib_libgnu_a_SOURCES += lib/sha1-stream.c
+lib_libcoreutils_a_SOURCES += lib/sha1-stream.c
 
 ## end   gnulib module crypto/sha1
 
 ## begin gnulib module crypto/sha1-buffer
 
-lib_libgnu_a_SOURCES += lib/sha1.c
+lib_libcoreutils_a_SOURCES += lib/sha1.c
 
 EXTRA_DIST += lib/gl_openssl.h lib/sha1.h
 
@@ -1043,13 +1086,13 @@ EXTRA_DIST += lib/gl_openssl.h lib/sha1.h
 
 ## begin gnulib module crypto/sha256
 
-lib_libgnu_a_SOURCES += lib/sha256-stream.c
+lib_libcoreutils_a_SOURCES += lib/sha256-stream.c
 
 ## end   gnulib module crypto/sha256
 
 ## begin gnulib module crypto/sha256-buffer
 
-lib_libgnu_a_SOURCES += lib/sha256.c
+lib_libcoreutils_a_SOURCES += lib/sha256.c
 
 EXTRA_DIST += lib/gl_openssl.h lib/sha256.h
 
@@ -1057,13 +1100,13 @@ EXTRA_DIST += lib/gl_openssl.h lib/sha256.h
 
 ## begin gnulib module crypto/sha512
 
-lib_libgnu_a_SOURCES += lib/sha512-stream.c
+lib_libcoreutils_a_SOURCES += lib/sha512-stream.c
 
 ## end   gnulib module crypto/sha512
 
 ## begin gnulib module crypto/sha512-buffer
 
-lib_libgnu_a_SOURCES += lib/sha512.c
+lib_libcoreutils_a_SOURCES += lib/sha512.c
 
 EXTRA_DIST += lib/gl_openssl.h lib/sha512.h
 
@@ -1071,13 +1114,13 @@ EXTRA_DIST += lib/gl_openssl.h lib/sha512.h
 
 ## begin gnulib module crypto/sm3
 
-lib_libgnu_a_SOURCES += lib/sm3-stream.c
+lib_libcoreutils_a_SOURCES += lib/sm3-stream.c
 
 ## end   gnulib module crypto/sm3
 
 ## begin gnulib module crypto/sm3-buffer
 
-lib_libgnu_a_SOURCES += lib/sm3.c
+lib_libcoreutils_a_SOURCES += lib/sm3.c
 
 EXTRA_DIST += lib/sm3.h
 
@@ -1111,7 +1154,7 @@ EXTRA_DIST += lib/ctype.in.h
 
 ## begin gnulib module cycle-check
 
-lib_libgnu_a_SOURCES += lib/cycle-check.c
+lib_libcoreutils_a_SOURCES += lib/cycle-check.c
 
 EXTRA_DIST += lib/cycle-check.h
 
@@ -1126,7 +1169,7 @@ EXTRA_DIST += lib/dev-ino.h
 
 ## begin gnulib module di-set
 
-lib_libgnu_a_SOURCES += lib/di-set.c lib/di-set.h
+lib_libcoreutils_a_SOURCES += lib/di-set.c lib/di-set.h
 
 ## end   gnulib module di-set
 
@@ -1182,7 +1225,7 @@ EXTRA_DIST += lib/dirent.in.h
 
 ## begin gnulib module dirent-safer
 
-lib_libgnu_a_SOURCES += lib/opendir-safer.c
+lib_libcoreutils_a_SOURCES += lib/opendir-safer.c
 
 EXTRA_DIST += lib/dirent--.h lib/dirent-safer.h
 
@@ -1191,7 +1234,7 @@ EXTRA_DIST += lib/dirent--.h lib/dirent-safer.h
 ## begin gnulib module dirfd
 
 if GL_COND_OBJ_DIRFD
-lib_libgnu_a_SOURCES += lib/dirfd.c
+lib_libcoreutils_a_SOURCES += lib/dirfd.c
 endif
 
 EXTRA_DIST += lib/dirent-private.h
@@ -1200,17 +1243,17 @@ EXTRA_DIST += lib/dirent-private.h
 
 ## begin gnulib module dirname
 
-lib_libgnu_a_SOURCES += lib/dirname.c lib/basename.c
+lib_libcoreutils_a_SOURCES += lib/dirname.c lib/basename.c
 
 EXTRA_DIST += lib/stripslash.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/stripslash.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/stripslash.c
 
 ## end   gnulib module dirname
 
 ## begin gnulib module dirname-lgpl
 
-lib_libgnu_a_SOURCES += lib/dirname-lgpl.c lib/stripslash.c
+lib_libcoreutils_a_SOURCES += lib/dirname-lgpl.c lib/stripslash.c
 
 EXTRA_DIST += lib/dirname.h
 
@@ -1225,24 +1268,24 @@ EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag
 
 ## begin gnulib module dtoastr
 
-lib_libgnu_a_SOURCES += lib/dtoastr.c
+lib_libcoreutils_a_SOURCES += lib/dtoastr.c
 
 EXTRA_DIST += lib/ftoastr.c lib/ftoastr.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/ftoastr.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/ftoastr.c
 
 ## end   gnulib module dtoastr
 
 ## begin gnulib module dtotimespec
 
-lib_libgnu_a_SOURCES += lib/dtotimespec.c
+lib_libcoreutils_a_SOURCES += lib/dtotimespec.c
 
 ## end   gnulib module dtotimespec
 
 ## begin gnulib module dup
 
 if GL_COND_OBJ_DUP
-lib_libgnu_a_SOURCES += lib/dup.c
+lib_libcoreutils_a_SOURCES += lib/dup.c
 endif
 
 ## end   gnulib module dup
@@ -1250,7 +1293,7 @@ endif
 ## begin gnulib module dup2
 
 if GL_COND_OBJ_DUP2
-lib_libgnu_a_SOURCES += lib/dup2.c
+lib_libcoreutils_a_SOURCES += lib/dup2.c
 endif
 
 ## end   gnulib module dup2
@@ -1298,7 +1341,7 @@ EXTRA_DIST += lib/errno.in.h
 ## begin gnulib module error
 
 if GL_COND_OBJ_ERROR
-lib_libgnu_a_SOURCES += lib/error.c
+lib_libcoreutils_a_SOURCES += lib/error.c
 endif
 
 ## end   gnulib module error
@@ -1331,14 +1374,14 @@ EXTRA_DIST += lib/error.in.h
 ## begin gnulib module euidaccess
 
 if GL_COND_OBJ_EUIDACCESS
-lib_libgnu_a_SOURCES += lib/euidaccess.c
+lib_libcoreutils_a_SOURCES += lib/euidaccess.c
 endif
 
 ## end   gnulib module euidaccess
 
 ## begin gnulib module exclude
 
-lib_libgnu_a_SOURCES += lib/exclude.c
+lib_libcoreutils_a_SOURCES += lib/exclude.c
 
 EXTRA_DIST += lib/exclude.h
 
@@ -1346,7 +1389,7 @@ EXTRA_DIST += lib/exclude.h
 
 ## begin gnulib module exitfail
 
-lib_libgnu_a_SOURCES += lib/exitfail.c
+lib_libcoreutils_a_SOURCES += lib/exitfail.c
 
 EXTRA_DIST += lib/exitfail.h
 
@@ -1355,7 +1398,7 @@ EXTRA_DIST += lib/exitfail.h
 ## begin gnulib module explicit_bzero
 
 if GL_COND_OBJ_EXPLICIT_BZERO
-lib_libgnu_a_SOURCES += lib/explicit_bzero.c
+lib_libcoreutils_a_SOURCES += lib/explicit_bzero.c
 endif
 
 ## end   gnulib module explicit_bzero
@@ -1363,19 +1406,25 @@ endif
 ## begin gnulib module faccessat
 
 if GL_COND_OBJ_FACCESSAT
-lib_libgnu_a_SOURCES += lib/faccessat.c
+lib_libcoreutils_a_SOURCES += lib/faccessat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module faccessat
 
+## begin gnulib module fadvise
+
+lib_libcoreutils_a_SOURCES += lib/fadvise.c lib/fadvise.h
+
+## end   gnulib module fadvise
+
 ## begin gnulib module fchdir
 
 if GL_COND_OBJ_FCHDIR
-lib_libgnu_a_SOURCES += lib/fchdir.c
+lib_libcoreutils_a_SOURCES += lib/fchdir.c
 endif
 
 ## end   gnulib module fchdir
@@ -1383,31 +1432,31 @@ endif
 ## begin gnulib module fchmodat
 
 if GL_COND_OBJ_FCHMODAT
-lib_libgnu_a_SOURCES += lib/fchmodat.c
+lib_libcoreutils_a_SOURCES += lib/fchmodat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module fchmodat
 
 ## begin gnulib module fchownat
 
 if GL_COND_OBJ_FCHOWNAT
-lib_libgnu_a_SOURCES += lib/fchownat.c
+lib_libcoreutils_a_SOURCES += lib/fchownat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module fchownat
 
 ## begin gnulib module fclose
 
 if GL_COND_OBJ_FCLOSE
-lib_libgnu_a_SOURCES += lib/fclose.c
+lib_libcoreutils_a_SOURCES += lib/fclose.c
 endif
 
 ## end   gnulib module fclose
@@ -1415,7 +1464,7 @@ endif
 ## begin gnulib module fcntl
 
 if GL_COND_OBJ_FCNTL
-lib_libgnu_a_SOURCES += lib/fcntl.c
+lib_libcoreutils_a_SOURCES += lib/fcntl.c
 endif
 
 ## end   gnulib module fcntl
@@ -1460,7 +1509,7 @@ EXTRA_DIST += lib/fcntl.in.h
 
 ## begin gnulib module fcntl-safer
 
-lib_libgnu_a_SOURCES += lib/creat-safer.c lib/open-safer.c
+lib_libcoreutils_a_SOURCES += lib/creat-safer.c lib/open-safer.c
 
 EXTRA_DIST += lib/fcntl--.h lib/fcntl-safer.h
 
@@ -1468,22 +1517,28 @@ EXTRA_DIST += lib/fcntl--.h lib/fcntl-safer.h
 
 ## begin gnulib module fd-hook
 
-lib_libgnu_a_SOURCES += lib/fd-hook.c
+lib_libcoreutils_a_SOURCES += lib/fd-hook.c
 
 EXTRA_DIST += lib/fd-hook.h
 
 ## end   gnulib module fd-hook
 
+## begin gnulib module fd-reopen
+
+lib_libcoreutils_a_SOURCES += lib/fd-reopen.c lib/fd-reopen.h
+
+## end   gnulib module fd-reopen
+
 ## begin gnulib module fd-safer-flag
 
-lib_libgnu_a_SOURCES += lib/fd-safer-flag.c lib/dup-safer-flag.c
+lib_libcoreutils_a_SOURCES += lib/fd-safer-flag.c lib/dup-safer-flag.c
 
 ## end   gnulib module fd-safer-flag
 
 ## begin gnulib module fdatasync
 
 if GL_COND_OBJ_FDATASYNC
-lib_libgnu_a_SOURCES += lib/fdatasync.c
+lib_libcoreutils_a_SOURCES += lib/fdatasync.c
 endif
 
 ## end   gnulib module fdatasync
@@ -1491,7 +1546,7 @@ endif
 ## begin gnulib module fdopen
 
 if GL_COND_OBJ_FDOPEN
-lib_libgnu_a_SOURCES += lib/fdopen.c
+lib_libcoreutils_a_SOURCES += lib/fdopen.c
 endif
 
 ## end   gnulib module fdopen
@@ -1499,7 +1554,7 @@ endif
 ## begin gnulib module fdopendir
 
 if GL_COND_OBJ_FDOPENDIR
-lib_libgnu_a_SOURCES += lib/fdopendir.c
+lib_libcoreutils_a_SOURCES += lib/fdopendir.c
 endif
 
 EXTRA_DIST += lib/dirent-private.h
@@ -1508,7 +1563,7 @@ EXTRA_DIST += lib/dirent-private.h
 
 ## begin gnulib module fdutimensat
 
-lib_libgnu_a_SOURCES += lib/fdutimensat.c
+lib_libcoreutils_a_SOURCES += lib/fdutimensat.c
 
 EXTRA_DIST += lib/utimens.h
 
@@ -1517,7 +1572,7 @@ EXTRA_DIST += lib/utimens.h
 ## begin gnulib module fflush
 
 if GL_COND_OBJ_FFLUSH
-lib_libgnu_a_SOURCES += lib/fflush.c
+lib_libcoreutils_a_SOURCES += lib/fflush.c
 endif
 
 EXTRA_DIST += lib/stdio-impl.h
@@ -1526,7 +1581,7 @@ EXTRA_DIST += lib/stdio-impl.h
 
 ## begin gnulib module file-has-acl
 
-lib_libgnu_a_SOURCES += lib/file-has-acl.c
+lib_libcoreutils_a_SOURCES += lib/file-has-acl.c
 
 EXTRA_DIST += lib/acl-internal.h
 
@@ -1534,7 +1589,7 @@ EXTRA_DIST += lib/acl-internal.h
 
 ## begin gnulib module file-set
 
-lib_libgnu_a_SOURCES += lib/file-set.c
+lib_libcoreutils_a_SOURCES += lib/file-set.c
 
 EXTRA_DIST += lib/file-set.h
 
@@ -1542,7 +1597,7 @@ EXTRA_DIST += lib/file-set.h
 
 ## begin gnulib module file-type
 
-lib_libgnu_a_SOURCES += lib/file-type.c
+lib_libcoreutils_a_SOURCES += lib/file-type.c
 
 EXTRA_DIST += lib/file-type.h
 
@@ -1551,14 +1606,14 @@ EXTRA_DIST += lib/file-type.h
 ## begin gnulib module fileblocks
 
 if GL_COND_OBJ_FILEBLOCKS
-lib_libgnu_a_SOURCES += lib/fileblocks.c
+lib_libcoreutils_a_SOURCES += lib/fileblocks.c
 endif
 
 ## end   gnulib module fileblocks
 
 ## begin gnulib module filemode
 
-lib_libgnu_a_SOURCES += lib/filemode.c
+lib_libcoreutils_a_SOURCES += lib/filemode.c
 
 EXTRA_DIST += lib/filemode.h
 
@@ -1573,13 +1628,13 @@ EXTRA_DIST += lib/filename.h
 
 ## begin gnulib module filenamecat
 
-lib_libgnu_a_SOURCES += lib/filenamecat.c
+lib_libcoreutils_a_SOURCES += lib/filenamecat.c
 
 ## end   gnulib module filenamecat
 
 ## begin gnulib module filenamecat-lgpl
 
-lib_libgnu_a_SOURCES += lib/filenamecat-lgpl.c
+lib_libcoreutils_a_SOURCES += lib/filenamecat-lgpl.c
 
 EXTRA_DIST += lib/filenamecat.h
 
@@ -1587,7 +1642,7 @@ EXTRA_DIST += lib/filenamecat.h
 
 ## begin gnulib module filevercmp
 
-lib_libgnu_a_SOURCES += lib/filevercmp.c
+lib_libcoreutils_a_SOURCES += lib/filevercmp.c
 
 EXTRA_DIST += lib/filevercmp.h
 
@@ -1625,10 +1680,10 @@ endif
 MOSTLYCLEANFILES += lib/float.h lib/float.h-t
 
 if GL_COND_OBJ_FLOAT
-lib_libgnu_a_SOURCES += lib/float.c
+lib_libcoreutils_a_SOURCES += lib/float.c
 endif
 if GL_COND_OBJ_ITOLD
-lib_libgnu_a_SOURCES += lib/itold.c
+lib_libcoreutils_a_SOURCES += lib/itold.c
 endif
 
 EXTRA_DIST += lib/float.in.h
@@ -1640,7 +1695,7 @@ EXTRA_DIST += lib/float.in.h
 
 EXTRA_DIST += lib/fnmatch.c lib/fnmatch_loop.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/fnmatch.c lib/fnmatch_loop.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/fnmatch.c lib/fnmatch_loop.c
 
 ## end   gnulib module fnmatch
 
@@ -1649,7 +1704,7 @@ EXTRA_lib_libgnu_a_SOURCES += lib/fnmatch.c lib/fnmatch_loop.c
 
 EXTRA_DIST += lib/fnmatch.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/fnmatch.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/fnmatch.c
 
 ## end   gnulib module fnmatch-gnu
 
@@ -1691,7 +1746,7 @@ EXTRA_DIST += lib/fnmatch.in.h
 
 EXTRA_DIST += lib/fopen.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/fopen.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/fopen.c
 
 ## end   gnulib module fopen
 
@@ -1700,13 +1755,13 @@ EXTRA_lib_libgnu_a_SOURCES += lib/fopen.c
 
 EXTRA_DIST += lib/fopen.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/fopen.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/fopen.c
 
 ## end   gnulib module fopen-gnu
 
 ## begin gnulib module fopen-safer
 
-lib_libgnu_a_SOURCES += lib/fopen-safer.c
+lib_libcoreutils_a_SOURCES += lib/fopen-safer.c
 
 EXTRA_DIST += lib/stdio--.h lib/stdio-safer.h
 
@@ -1715,7 +1770,7 @@ EXTRA_DIST += lib/stdio--.h lib/stdio-safer.h
 ## begin gnulib module fpending
 
 if GL_COND_OBJ_FPENDING
-lib_libgnu_a_SOURCES += lib/fpending.c
+lib_libcoreutils_a_SOURCES += lib/fpending.c
 endif
 
 EXTRA_DIST += lib/fpending.h lib/stdio-impl.h
@@ -1724,7 +1779,7 @@ EXTRA_DIST += lib/fpending.h lib/stdio-impl.h
 
 ## begin gnulib module fprintftime
 
-lib_libgnu_a_SOURCES += lib/fprintftime.c
+lib_libcoreutils_a_SOURCES += lib/fprintftime.c
 
 EXTRA_DIST += lib/fprintftime.h
 
@@ -1740,7 +1795,7 @@ EXTRA_DIST += lib/fpucw.h
 ## begin gnulib module fpurge
 
 if GL_COND_OBJ_FPURGE
-lib_libgnu_a_SOURCES += lib/fpurge.c
+lib_libcoreutils_a_SOURCES += lib/fpurge.c
 endif
 
 EXTRA_DIST += lib/stdio-impl.h
@@ -1750,7 +1805,7 @@ EXTRA_DIST += lib/stdio-impl.h
 ## begin gnulib module freadahead
 
 if GL_COND_OBJ_FREADAHEAD
-lib_libgnu_a_SOURCES += lib/freadahead.c
+lib_libcoreutils_a_SOURCES += lib/freadahead.c
 endif
 
 EXTRA_DIST += lib/freadahead.h lib/stdio-impl.h
@@ -1759,7 +1814,7 @@ EXTRA_DIST += lib/freadahead.h lib/stdio-impl.h
 
 ## begin gnulib module freading
 
-lib_libgnu_a_SOURCES += lib/freading.c
+lib_libcoreutils_a_SOURCES += lib/freading.c
 
 EXTRA_DIST += lib/freading.h lib/stdio-impl.h
 
@@ -1768,7 +1823,7 @@ EXTRA_DIST += lib/freading.h lib/stdio-impl.h
 ## begin gnulib module freadptr
 
 if GL_COND_OBJ_FREADPTR
-lib_libgnu_a_SOURCES += lib/freadptr.c
+lib_libcoreutils_a_SOURCES += lib/freadptr.c
 endif
 
 EXTRA_DIST += lib/freadptr.h lib/stdio-impl.h
@@ -1777,7 +1832,7 @@ EXTRA_DIST += lib/freadptr.h lib/stdio-impl.h
 
 ## begin gnulib module freadseek
 
-lib_libgnu_a_SOURCES += lib/freadseek.c
+lib_libcoreutils_a_SOURCES += lib/freadseek.c
 
 EXTRA_DIST += lib/freadseek.h lib/stdio-impl.h
 
@@ -1786,7 +1841,7 @@ EXTRA_DIST += lib/freadseek.h lib/stdio-impl.h
 ## begin gnulib module free-posix
 
 if GL_COND_OBJ_FREE
-lib_libgnu_a_SOURCES += lib/free.c
+lib_libcoreutils_a_SOURCES += lib/free.c
 endif
 
 ## end   gnulib module free-posix
@@ -1794,14 +1849,14 @@ endif
 ## begin gnulib module freopen
 
 if GL_COND_OBJ_FREOPEN
-lib_libgnu_a_SOURCES += lib/freopen.c
+lib_libcoreutils_a_SOURCES += lib/freopen.c
 endif
 
 ## end   gnulib module freopen
 
 ## begin gnulib module freopen-safer
 
-lib_libgnu_a_SOURCES += lib/freopen-safer.c
+lib_libcoreutils_a_SOURCES += lib/freopen-safer.c
 
 EXTRA_DIST += lib/stdio--.h lib/stdio-safer.h
 
@@ -1812,7 +1867,7 @@ EXTRA_DIST += lib/stdio--.h lib/stdio-safer.h
 
 EXTRA_DIST += lib/frexp.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/frexp.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/frexp.c
 
 ## end   gnulib module frexp-nolibm
 
@@ -1821,14 +1876,14 @@ EXTRA_lib_libgnu_a_SOURCES += lib/frexp.c
 
 EXTRA_DIST += lib/frexp.c lib/frexpl.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/frexp.c lib/frexpl.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/frexp.c lib/frexpl.c
 
 ## end   gnulib module frexpl-nolibm
 
 ## begin gnulib module fseek
 
 if GL_COND_OBJ_FSEEK
-lib_libgnu_a_SOURCES += lib/fseek.c
+lib_libcoreutils_a_SOURCES += lib/fseek.c
 endif
 
 ## end   gnulib module fseek
@@ -1836,7 +1891,7 @@ endif
 ## begin gnulib module fseeko
 
 if GL_COND_OBJ_FSEEKO
-lib_libgnu_a_SOURCES += lib/fseeko.c
+lib_libcoreutils_a_SOURCES += lib/fseeko.c
 endif
 
 EXTRA_DIST += lib/stdio-impl.h
@@ -1846,7 +1901,7 @@ EXTRA_DIST += lib/stdio-impl.h
 ## begin gnulib module fseterr
 
 if GL_COND_OBJ_FSETERR
-lib_libgnu_a_SOURCES += lib/fseterr.c
+lib_libcoreutils_a_SOURCES += lib/fseterr.c
 endif
 
 EXTRA_DIST += lib/fseterr.h lib/stdio-impl.h
@@ -1856,31 +1911,31 @@ EXTRA_DIST += lib/fseterr.h lib/stdio-impl.h
 ## begin gnulib module fstat
 
 if GL_COND_OBJ_FSTAT
-lib_libgnu_a_SOURCES += lib/fstat.c
+lib_libcoreutils_a_SOURCES += lib/fstat.c
 endif
 
 EXTRA_DIST += lib/stat-w32.c lib/stat-w32.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/stat-w32.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/stat-w32.c
 
 ## end   gnulib module fstat
 
 ## begin gnulib module fstatat
 
 if GL_COND_OBJ_FSTATAT
-lib_libgnu_a_SOURCES += lib/fstatat.c
+lib_libcoreutils_a_SOURCES += lib/fstatat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module fstatat
 
 ## begin gnulib module fsusage
 
 if GL_COND_OBJ_FSUSAGE
-lib_libgnu_a_SOURCES += lib/fsusage.c
+lib_libcoreutils_a_SOURCES += lib/fsusage.c
 endif
 
 EXTRA_DIST += lib/fsusage.h
@@ -1890,7 +1945,7 @@ EXTRA_DIST += lib/fsusage.h
 ## begin gnulib module fsync
 
 if GL_COND_OBJ_FSYNC
-lib_libgnu_a_SOURCES += lib/fsync.c
+lib_libcoreutils_a_SOURCES += lib/fsync.c
 endif
 
 ## end   gnulib module fsync
@@ -1898,7 +1953,7 @@ endif
 ## begin gnulib module ftell
 
 if GL_COND_OBJ_FTELL
-lib_libgnu_a_SOURCES += lib/ftell.c
+lib_libcoreutils_a_SOURCES += lib/ftell.c
 endif
 
 ## end   gnulib module ftell
@@ -1906,7 +1961,7 @@ endif
 ## begin gnulib module ftello
 
 if GL_COND_OBJ_FTELLO
-lib_libgnu_a_SOURCES += lib/ftello.c
+lib_libcoreutils_a_SOURCES += lib/ftello.c
 endif
 
 EXTRA_DIST += lib/stdio-impl.h
@@ -1915,7 +1970,7 @@ EXTRA_DIST += lib/stdio-impl.h
 
 ## begin gnulib module ftoastr
 
-lib_libgnu_a_SOURCES += lib/ftoastr.c
+lib_libcoreutils_a_SOURCES += lib/ftoastr.c
 
 EXTRA_DIST += lib/ftoastr.h
 
@@ -1924,7 +1979,7 @@ EXTRA_DIST += lib/ftoastr.h
 ## begin gnulib module ftruncate
 
 if GL_COND_OBJ_FTRUNCATE
-lib_libgnu_a_SOURCES += lib/ftruncate.c
+lib_libcoreutils_a_SOURCES += lib/ftruncate.c
 endif
 
 ## end   gnulib module ftruncate
@@ -1932,35 +1987,35 @@ endif
 ## begin gnulib module fts
 
 if GL_COND_OBJ_FTS
-lib_libgnu_a_SOURCES += lib/fts.c
+lib_libcoreutils_a_SOURCES += lib/fts.c
 endif
 
 EXTRA_DIST += lib/fts-cycle.c lib/fts_.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/fts-cycle.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/fts-cycle.c
 
 ## end   gnulib module fts
 
 ## begin gnulib module full-read
 
-lib_libgnu_a_SOURCES += lib/full-read.h lib/full-read.c
+lib_libcoreutils_a_SOURCES += lib/full-read.h lib/full-read.c
 
 EXTRA_DIST += lib/full-write.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/full-write.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/full-write.c
 
 ## end   gnulib module full-read
 
 ## begin gnulib module full-write
 
-lib_libgnu_a_SOURCES += lib/full-write.h lib/full-write.c
+lib_libcoreutils_a_SOURCES += lib/full-write.h lib/full-write.c
 
 ## end   gnulib module full-write
 
 ## begin gnulib module futimens
 
 if GL_COND_OBJ_FUTIMENS
-lib_libgnu_a_SOURCES += lib/futimens.c
+lib_libcoreutils_a_SOURCES += lib/futimens.c
 endif
 
 ## end   gnulib module futimens
@@ -1995,10 +2050,10 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh
 ## begin gnulib module getaddrinfo
 
 if GL_COND_OBJ_GETADDRINFO
-lib_libgnu_a_SOURCES += lib/getaddrinfo.c
+lib_libcoreutils_a_SOURCES += lib/getaddrinfo.c
 endif
 if GL_COND_OBJ_GAI_STRERROR
-lib_libgnu_a_SOURCES += lib/gai_strerror.c
+lib_libcoreutils_a_SOURCES += lib/gai_strerror.c
 endif
 
 ## end   gnulib module getaddrinfo
@@ -2006,7 +2061,7 @@ endif
 ## begin gnulib module getcwd
 
 if GL_COND_OBJ_GETCWD
-lib_libgnu_a_SOURCES += lib/getcwd.c
+lib_libcoreutils_a_SOURCES += lib/getcwd.c
 endif
 
 ## end   gnulib module getcwd
@@ -2014,7 +2069,7 @@ endif
 ## begin gnulib module getcwd-lgpl
 
 if GL_COND_OBJ_GETCWD_LGPL
-lib_libgnu_a_SOURCES += lib/getcwd-lgpl.c
+lib_libcoreutils_a_SOURCES += lib/getcwd-lgpl.c
 endif
 
 ## end   gnulib module getcwd-lgpl
@@ -2022,7 +2077,7 @@ endif
 ## begin gnulib module getdelim
 
 if GL_COND_OBJ_GETDELIM
-lib_libgnu_a_SOURCES += lib/getdelim.c
+lib_libcoreutils_a_SOURCES += lib/getdelim.c
 endif
 
 ## end   gnulib module getdelim
@@ -2030,7 +2085,7 @@ endif
 ## begin gnulib module getdtablesize
 
 if GL_COND_OBJ_GETDTABLESIZE
-lib_libgnu_a_SOURCES += lib/getdtablesize.c
+lib_libcoreutils_a_SOURCES += lib/getdtablesize.c
 endif
 
 ## end   gnulib module getdtablesize
@@ -2038,7 +2093,7 @@ endif
 ## begin gnulib module getgroups
 
 if GL_COND_OBJ_GETGROUPS
-lib_libgnu_a_SOURCES += lib/getgroups.c
+lib_libcoreutils_a_SOURCES += lib/getgroups.c
 endif
 
 ## end   gnulib module getgroups
@@ -2046,7 +2101,7 @@ endif
 ## begin gnulib module gethostname
 
 if GL_COND_OBJ_GETHOSTNAME
-lib_libgnu_a_SOURCES += lib/gethostname.c
+lib_libcoreutils_a_SOURCES += lib/gethostname.c
 endif
 
 EXTRA_DIST += lib/w32sock.h
@@ -2055,7 +2110,7 @@ EXTRA_DIST += lib/w32sock.h
 
 ## begin gnulib module gethrxtime
 
-lib_libgnu_a_SOURCES += lib/gethrxtime.c lib/xtime.c
+lib_libcoreutils_a_SOURCES += lib/gethrxtime.c lib/xtime.c
 
 EXTRA_DIST += lib/gethrxtime.h lib/xtime.h
 
@@ -2064,7 +2119,7 @@ EXTRA_DIST += lib/gethrxtime.h lib/xtime.h
 ## begin gnulib module getline
 
 if GL_COND_OBJ_GETLINE
-lib_libgnu_a_SOURCES += lib/getline.c
+lib_libcoreutils_a_SOURCES += lib/getline.c
 endif
 
 ## end   gnulib module getline
@@ -2072,7 +2127,7 @@ endif
 ## begin gnulib module getloadavg
 
 if GL_COND_OBJ_GETLOADAVG
-lib_libgnu_a_SOURCES += lib/getloadavg.c
+lib_libcoreutils_a_SOURCES += lib/getloadavg.c
 endif
 
 ## end   gnulib module getloadavg
@@ -2080,14 +2135,14 @@ endif
 ## begin gnulib module getlogin
 
 if GL_COND_OBJ_GETLOGIN
-lib_libgnu_a_SOURCES += lib/getlogin.c
+lib_libcoreutils_a_SOURCES += lib/getlogin.c
 endif
 
 ## end   gnulib module getlogin
 
 ## begin gnulib module getndelim2
 
-lib_libgnu_a_SOURCES += lib/getndelim2.c
+lib_libcoreutils_a_SOURCES += lib/getndelim2.c
 
 EXTRA_DIST += lib/getndelim2.h
 
@@ -2131,7 +2186,7 @@ endif
 MOSTLYCLEANFILES += lib/getopt.h lib/getopt.h-t lib/getopt-cdefs.h lib/getopt-cdefs.h-t
 
 if GL_COND_OBJ_GETOPT
-lib_libgnu_a_SOURCES += lib/getopt.c lib/getopt1.c
+lib_libcoreutils_a_SOURCES += lib/getopt.c lib/getopt1.c
 endif
 
 EXTRA_DIST += lib/getopt-cdefs.in.h lib/getopt-core.h lib/getopt-ext.h lib/getopt-pfx-core.h lib/getopt-pfx-ext.h lib/getopt.in.h lib/getopt_int.h
@@ -2141,7 +2196,7 @@ EXTRA_DIST += lib/getopt-cdefs.in.h lib/getopt-core.h lib/getopt-ext.h lib/getop
 ## begin gnulib module getpagesize
 
 if GL_COND_OBJ_GETPAGESIZE
-lib_libgnu_a_SOURCES += lib/getpagesize.c
+lib_libcoreutils_a_SOURCES += lib/getpagesize.c
 endif
 
 ## end   gnulib module getpagesize
@@ -2149,7 +2204,7 @@ endif
 ## begin gnulib module getprogname
 
 if GL_COND_OBJ_GETPROGNAME
-lib_libgnu_a_SOURCES += lib/getprogname.c
+lib_libcoreutils_a_SOURCES += lib/getprogname.c
 endif
 
 EXTRA_DIST += lib/getprogname.h
@@ -2159,40 +2214,40 @@ EXTRA_DIST += lib/getprogname.h
 ## begin gnulib module getrandom
 
 if GL_COND_OBJ_GETRANDOM
-lib_libgnu_a_SOURCES += lib/getrandom.c
+lib_libcoreutils_a_SOURCES += lib/getrandom.c
 endif
 
 ## end   gnulib module getrandom
 
 ## begin gnulib module gettext-h
 
-lib_libgnu_a_SOURCES += lib/gettext.h
+lib_libcoreutils_a_SOURCES += lib/gettext.h
 
 ## end   gnulib module gettext-h
 
 ## begin gnulib module gettime
 
-lib_libgnu_a_SOURCES += lib/gettime.c
+lib_libcoreutils_a_SOURCES += lib/gettime.c
 
 ## end   gnulib module gettime
 
 ## begin gnulib module gettime-res
 
-lib_libgnu_a_SOURCES += lib/gettime-res.c
+lib_libcoreutils_a_SOURCES += lib/gettime-res.c
 
 ## end   gnulib module gettime-res
 
 ## begin gnulib module gettimeofday
 
 if GL_COND_OBJ_GETTIMEOFDAY
-lib_libgnu_a_SOURCES += lib/gettimeofday.c
+lib_libcoreutils_a_SOURCES += lib/gettimeofday.c
 endif
 
 ## end   gnulib module gettimeofday
 
 ## begin gnulib module getugroups
 
-lib_libgnu_a_SOURCES += lib/getugroups.c
+lib_libcoreutils_a_SOURCES += lib/getugroups.c
 
 EXTRA_DIST += lib/getugroups.h
 
@@ -2237,11 +2292,11 @@ lib/malloc/dynarray-skeleton.gl.h: lib/malloc/dynarray-skeleton.c
        $(AM_V_at)mv $@-t $@
 MOSTLYCLEANFILES += lib/malloc/dynarray-skeleton.gl.h lib/malloc/dynarray-skeleton.gl.h-t
 
-lib_libgnu_a_SOURCES += lib/malloc/dynarray_at_failure.c                 lib/malloc/dynarray_emplace_enlarge.c                 lib/malloc/dynarray_finalize.c                 lib/malloc/dynarray_resize.c                 lib/malloc/dynarray_resize_clear.c
+lib_libcoreutils_a_SOURCES += lib/malloc/dynarray_at_failure.c                 lib/malloc/dynarray_emplace_enlarge.c                 lib/malloc/dynarray_finalize.c                 lib/malloc/dynarray_resize.c                 lib/malloc/dynarray_resize_clear.c
 
 EXTRA_DIST += lib/dynarray.h lib/malloc/dynarray-skeleton.c lib/malloc/dynarray.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/malloc/dynarray-skeleton.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/malloc/dynarray-skeleton.c
 
 ## end   gnulib module glibc-internal/dynarray
 
@@ -2260,7 +2315,7 @@ lib/malloc/scratch_buffer.gl.h: lib/malloc/scratch_buffer.h
        $(AM_V_at)mv $@-t $@
 MOSTLYCLEANFILES += lib/malloc/scratch_buffer.gl.h lib/malloc/scratch_buffer.gl.h-t
 
-lib_libgnu_a_SOURCES += lib/malloc/scratch_buffer_grow.c                 lib/malloc/scratch_buffer_grow_preserve.c                 lib/malloc/scratch_buffer_set_array_size.c
+lib_libcoreutils_a_SOURCES += lib/malloc/scratch_buffer_grow.c                 lib/malloc/scratch_buffer_grow_preserve.c                 lib/malloc/scratch_buffer_set_array_size.c
 
 EXTRA_DIST += lib/malloc/scratch_buffer.h lib/scratch_buffer.h
 
@@ -2301,14 +2356,14 @@ V_GPERF_0 = @echo "  GPERF   " $@;
 ## begin gnulib module group-member
 
 if GL_COND_OBJ_GROUP_MEMBER
-lib_libgnu_a_SOURCES += lib/group-member.c
+lib_libcoreutils_a_SOURCES += lib/group-member.c
 endif
 
 ## end   gnulib module group-member
 
 ## begin gnulib module hard-locale
 
-lib_libgnu_a_SOURCES += lib/hard-locale.c
+lib_libcoreutils_a_SOURCES += lib/hard-locale.c
 
 EXTRA_DIST += lib/hard-locale.h
 
@@ -2316,7 +2371,7 @@ EXTRA_DIST += lib/hard-locale.h
 
 ## begin gnulib module hash
 
-lib_libgnu_a_SOURCES += lib/hash.c
+lib_libcoreutils_a_SOURCES += lib/hash.c
 
 EXTRA_DIST += lib/hash.h
 
@@ -2324,19 +2379,19 @@ EXTRA_DIST += lib/hash.h
 
 ## begin gnulib module hash-pjw
 
-lib_libgnu_a_SOURCES += lib/hash-pjw.h lib/hash-pjw.c
+lib_libcoreutils_a_SOURCES += lib/hash-pjw.h lib/hash-pjw.c
 
 ## end   gnulib module hash-pjw
 
 ## begin gnulib module hash-triple
 
-lib_libgnu_a_SOURCES += lib/hash-triple.c
+lib_libcoreutils_a_SOURCES += lib/hash-triple.c
 
 ## end   gnulib module hash-triple
 
 ## begin gnulib module hash-triple-simple
 
-lib_libgnu_a_SOURCES += lib/hash-triple-simple.c
+lib_libcoreutils_a_SOURCES += lib/hash-triple-simple.c
 
 EXTRA_DIST += lib/hash-triple.h
 
@@ -2349,9 +2404,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
 
 ## end   gnulib module havelib
 
+## begin gnulib module heap
+
+lib_libcoreutils_a_SOURCES += lib/heap.c lib/heap.h
+
+## end   gnulib module heap
+
 ## begin gnulib module human
 
-lib_libgnu_a_SOURCES += lib/human.c
+lib_libcoreutils_a_SOURCES += lib/human.c
 
 EXTRA_DIST += lib/human.h
 
@@ -2359,7 +2420,7 @@ EXTRA_DIST += lib/human.h
 
 ## begin gnulib module i-ring
 
-lib_libgnu_a_SOURCES += lib/i-ring.c
+lib_libcoreutils_a_SOURCES += lib/i-ring.c
 
 EXTRA_DIST += lib/i-ring.h
 
@@ -2367,7 +2428,7 @@ EXTRA_DIST += lib/i-ring.h
 
 ## begin gnulib module ialloc
 
-lib_libgnu_a_SOURCES += lib/ialloc.c
+lib_libcoreutils_a_SOURCES += lib/ialloc.c
 
 EXTRA_DIST += lib/ialloc.h
 
@@ -2411,10 +2472,10 @@ EXTRA_DIST += lib/iconv.in.h
 ## begin gnulib module iconv_open
 
 if GL_COND_OBJ_ICONV_OPEN
-lib_libgnu_a_SOURCES += lib/iconv_open.c
+lib_libcoreutils_a_SOURCES += lib/iconv_open.c
 endif
 if GL_COND_OBJ_ICONV
-lib_libgnu_a_SOURCES += lib/iconv.c lib/iconv_close.c
+lib_libcoreutils_a_SOURCES += lib/iconv.c lib/iconv_close.c
 endif
 
 $(top_srcdir)/lib/iconv_open-aix.h: $(top_srcdir)/lib/iconv_open-aix.gperf
@@ -2446,7 +2507,7 @@ EXTRA_DIST += lib/iconv_open-aix.gperf lib/iconv_open-hpux.gperf lib/iconv_open-
 
 ## begin gnulib module idcache
 
-lib_libgnu_a_SOURCES += lib/idcache.c
+lib_libcoreutils_a_SOURCES += lib/idcache.c
 
 EXTRA_DIST += lib/idcache.h
 
@@ -2454,7 +2515,7 @@ EXTRA_DIST += lib/idcache.h
 
 ## begin gnulib module idx
 
-lib_libgnu_a_SOURCES += lib/idx.h
+lib_libcoreutils_a_SOURCES += lib/idx.h
 
 ## end   gnulib module idx
 
@@ -2468,14 +2529,14 @@ EXTRA_DIST += lib/ignore-value.h
 ## begin gnulib module inet_ntop
 
 if GL_COND_OBJ_INET_NTOP
-lib_libgnu_a_SOURCES += lib/inet_ntop.c
+lib_libcoreutils_a_SOURCES += lib/inet_ntop.c
 endif
 
 ## end   gnulib module inet_ntop
 
 ## begin gnulib module ino-map
 
-lib_libgnu_a_SOURCES += lib/ino-map.c lib/ino-map.h
+lib_libcoreutils_a_SOURCES += lib/ino-map.c lib/ino-map.h
 
 ## end   gnulib module ino-map
 
@@ -2488,11 +2549,11 @@ EXTRA_DIST += lib/intprops-internal.h lib/intprops.h
 
 ## begin gnulib module inttostr
 
-lib_libgnu_a_SOURCES +=    lib/imaxtostr.c    lib/inttostr.c    lib/offtostr.c    lib/uinttostr.c    lib/umaxtostr.c
+lib_libcoreutils_a_SOURCES +=    lib/imaxtostr.c    lib/inttostr.c    lib/offtostr.c    lib/uinttostr.c    lib/umaxtostr.c
 
 EXTRA_DIST += lib/anytostr.c lib/inttostr.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/anytostr.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/anytostr.c
 
 ## end   gnulib module inttostr
 
@@ -2543,7 +2604,7 @@ EXTRA_DIST += lib/inttypes.in.h
 ## begin gnulib module isapipe
 
 if GL_COND_OBJ_ISAPIPE
-lib_libgnu_a_SOURCES += lib/isapipe.c
+lib_libcoreutils_a_SOURCES += lib/isapipe.c
 endif
 
 EXTRA_DIST += lib/isapipe.h
@@ -2553,7 +2614,7 @@ EXTRA_DIST += lib/isapipe.h
 ## begin gnulib module isatty
 
 if GL_COND_OBJ_ISATTY
-lib_libgnu_a_SOURCES += lib/isatty.c
+lib_libcoreutils_a_SOURCES += lib/isatty.c
 endif
 
 ## end   gnulib module isatty
@@ -2561,7 +2622,7 @@ endif
 ## begin gnulib module isblank
 
 if GL_COND_OBJ_ISBLANK
-lib_libgnu_a_SOURCES += lib/isblank.c
+lib_libcoreutils_a_SOURCES += lib/isblank.c
 endif
 
 ## end   gnulib module isblank
@@ -2571,7 +2632,7 @@ endif
 
 EXTRA_DIST += lib/float+.h lib/isnan.c lib/isnand-nolibm.h lib/isnand.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/isnan.c lib/isnand.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/isnan.c lib/isnand.c
 
 ## end   gnulib module isnand-nolibm
 
@@ -2580,7 +2641,7 @@ EXTRA_lib_libgnu_a_SOURCES += lib/isnan.c lib/isnand.c
 
 EXTRA_DIST += lib/float+.h lib/isnan.c lib/isnanf-nolibm.h lib/isnanf.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/isnan.c lib/isnanf.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/isnan.c lib/isnanf.c
 
 ## end   gnulib module isnanf-nolibm
 
@@ -2589,14 +2650,14 @@ EXTRA_lib_libgnu_a_SOURCES += lib/isnan.c lib/isnanf.c
 
 EXTRA_DIST += lib/float+.h lib/isnan.c lib/isnanl-nolibm.h lib/isnanl.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/isnan.c lib/isnanl.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/isnan.c lib/isnanl.c
 
 ## end   gnulib module isnanl-nolibm
 
 ## begin gnulib module iswblank
 
 if GL_COND_OBJ_ISWBLANK
-lib_libgnu_a_SOURCES += lib/iswblank.c
+lib_libcoreutils_a_SOURCES += lib/iswblank.c
 endif
 
 ## end   gnulib module iswblank
@@ -2604,7 +2665,7 @@ endif
 ## begin gnulib module iswctype
 
 if GL_COND_OBJ_ISWCTYPE
-lib_libgnu_a_SOURCES += lib/iswctype.c
+lib_libcoreutils_a_SOURCES += lib/iswctype.c
 endif
 
 EXTRA_DIST += lib/iswctype-impl.h
@@ -2614,7 +2675,7 @@ EXTRA_DIST += lib/iswctype-impl.h
 ## begin gnulib module iswdigit
 
 if GL_COND_OBJ_ISWDIGIT
-lib_libgnu_a_SOURCES += lib/iswdigit.c
+lib_libcoreutils_a_SOURCES += lib/iswdigit.c
 endif
 
 ## end   gnulib module iswdigit
@@ -2622,7 +2683,7 @@ endif
 ## begin gnulib module iswpunct
 
 if GL_COND_OBJ_ISWPUNCT
-lib_libgnu_a_SOURCES += lib/iswpunct.c
+lib_libcoreutils_a_SOURCES += lib/iswpunct.c
 endif
 
 ## end   gnulib module iswpunct
@@ -2630,7 +2691,7 @@ endif
 ## begin gnulib module iswxdigit
 
 if GL_COND_OBJ_ISWXDIGIT
-lib_libgnu_a_SOURCES += lib/iswxdigit.c
+lib_libcoreutils_a_SOURCES += lib/iswxdigit.c
 endif
 
 ## end   gnulib module iswxdigit
@@ -2671,7 +2732,7 @@ EXTRA_DIST += lib/langinfo.in.h
 ## begin gnulib module lchmod
 
 if GL_COND_OBJ_LCHMOD
-lib_libgnu_a_SOURCES += lib/lchmod.c
+lib_libcoreutils_a_SOURCES += lib/lchmod.c
 endif
 
 ## end   gnulib module lchmod
@@ -2679,18 +2740,18 @@ endif
 ## begin gnulib module lchown
 
 if GL_COND_OBJ_LCHOWN
-lib_libgnu_a_SOURCES += lib/lchown.c
+lib_libcoreutils_a_SOURCES += lib/lchown.c
 endif
 
 ## end   gnulib module lchown
 
 ## begin gnulib module ldtoastr
 
-lib_libgnu_a_SOURCES += lib/ldtoastr.c
+lib_libcoreutils_a_SOURCES += lib/ldtoastr.c
 
 EXTRA_DIST += lib/ftoastr.c lib/ftoastr.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/ftoastr.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/ftoastr.c
 
 ## end   gnulib module ldtoastr
 
@@ -2727,12 +2788,12 @@ endif
 MOSTLYCLEANFILES += lib/gmp.h lib/gmp.h-t
 
 if GL_COND_OBJ_MINI_GMP_GNULIB
-lib_libgnu_a_SOURCES += lib/mini-gmp-gnulib.c
+lib_libcoreutils_a_SOURCES += lib/mini-gmp-gnulib.c
 endif
 
 EXTRA_DIST += lib/mini-gmp.c lib/mini-gmp.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/mini-gmp.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/mini-gmp.c
 
 ## end   gnulib module libgmp
 
@@ -2765,14 +2826,14 @@ EXTRA_DIST += lib/limits.in.h
 
 ## begin gnulib module linebuffer
 
-lib_libgnu_a_SOURCES += lib/linebuffer.h lib/linebuffer.c
+lib_libcoreutils_a_SOURCES += lib/linebuffer.h lib/linebuffer.c
 
 ## end   gnulib module linebuffer
 
 ## begin gnulib module link
 
 if GL_COND_OBJ_LINK
-lib_libgnu_a_SOURCES += lib/link.c
+lib_libcoreutils_a_SOURCES += lib/link.c
 endif
 
 ## end   gnulib module link
@@ -2780,18 +2841,18 @@ endif
 ## begin gnulib module linkat
 
 if GL_COND_OBJ_LINKAT
-lib_libgnu_a_SOURCES += lib/linkat.c
+lib_libcoreutils_a_SOURCES += lib/linkat.c
 endif
 
 EXTRA_DIST += lib/at-func2.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func2.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func2.c
 
 ## end   gnulib module linkat
 
 ## begin gnulib module localcharset
 
-lib_libgnu_a_SOURCES += lib/localcharset.c
+lib_libcoreutils_a_SOURCES += lib/localcharset.c
 
 EXTRA_DIST += lib/localcharset.h
 
@@ -2841,20 +2902,20 @@ EXTRA_DIST += lib/locale.in.h
 ## begin gnulib module localeconv
 
 if GL_COND_OBJ_LOCALECONV
-lib_libgnu_a_SOURCES += lib/localeconv.c
+lib_libcoreutils_a_SOURCES += lib/localeconv.c
 endif
 
 ## end   gnulib module localeconv
 
 ## begin gnulib module lock
 
-lib_libgnu_a_SOURCES += lib/glthread/lock.h lib/glthread/lock.c
+lib_libcoreutils_a_SOURCES += lib/glthread/lock.h lib/glthread/lock.c
 
 ## end   gnulib module lock
 
 ## begin gnulib module long-options
 
-lib_libgnu_a_SOURCES += lib/long-options.c
+lib_libcoreutils_a_SOURCES += lib/long-options.c
 
 EXTRA_DIST += lib/long-options.h
 
@@ -2863,7 +2924,7 @@ EXTRA_DIST += lib/long-options.h
 ## begin gnulib module lseek
 
 if GL_COND_OBJ_LSEEK
-lib_libgnu_a_SOURCES += lib/lseek.c
+lib_libcoreutils_a_SOURCES += lib/lseek.c
 endif
 
 ## end   gnulib module lseek
@@ -2871,7 +2932,7 @@ endif
 ## begin gnulib module lstat
 
 if GL_COND_OBJ_LSTAT
-lib_libgnu_a_SOURCES += lib/lstat.c
+lib_libcoreutils_a_SOURCES += lib/lstat.c
 endif
 
 ## end   gnulib module lstat
@@ -2887,7 +2948,7 @@ EXTRA_DIST += $(top_srcdir)/maint.mk
 
 EXTRA_DIST += lib/malloc.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/malloc.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/malloc.c
 
 ## end   gnulib module malloc-gnu
 
@@ -2896,13 +2957,13 @@ EXTRA_lib_libgnu_a_SOURCES += lib/malloc.c
 
 EXTRA_DIST += lib/malloc.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/malloc.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/malloc.c
 
 ## end   gnulib module malloc-posix
 
 ## begin gnulib module malloca
 
-lib_libgnu_a_SOURCES += lib/malloca.c
+lib_libcoreutils_a_SOURCES += lib/malloca.c
 
 EXTRA_DIST += lib/malloca.h
 
@@ -2911,7 +2972,7 @@ EXTRA_DIST += lib/malloca.h
 ## begin gnulib module math
 
 BUILT_SOURCES += lib/math.h
-lib_libgnu_a_SOURCES += lib/math.c
+lib_libcoreutils_a_SOURCES += lib/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.
@@ -3236,7 +3297,7 @@ EXTRA_DIST += lib/math.in.h
 ## begin gnulib module mbrlen
 
 if GL_COND_OBJ_MBRLEN
-lib_libgnu_a_SOURCES += lib/mbrlen.c
+lib_libcoreutils_a_SOURCES += lib/mbrlen.c
 endif
 
 ## end   gnulib module mbrlen
@@ -3244,91 +3305,91 @@ endif
 ## begin gnulib module mbrtoc32
 
 if GL_COND_OBJ_MBRTOC32
-lib_libgnu_a_SOURCES += lib/mbrtoc32.c
+lib_libcoreutils_a_SOURCES += lib/mbrtoc32.c
 endif
 
 EXTRA_DIST += lib/lc-charset-dispatch.c lib/lc-charset-dispatch.h lib/mbrtowc-impl-utf8.h lib/mbrtowc-impl.h lib/mbtowc-lock.c lib/mbtowc-lock.h lib/windows-initguard.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/lc-charset-dispatch.c lib/mbtowc-lock.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/lc-charset-dispatch.c lib/mbtowc-lock.c
 
 ## end   gnulib module mbrtoc32
 
 ## begin gnulib module mbrtowc
 
 if GL_COND_OBJ_MBRTOWC
-lib_libgnu_a_SOURCES += lib/mbrtowc.c
+lib_libcoreutils_a_SOURCES += lib/mbrtowc.c
 endif
 
 EXTRA_DIST += lib/lc-charset-dispatch.c lib/lc-charset-dispatch.h lib/mbrtowc-impl-utf8.h lib/mbrtowc-impl.h lib/mbtowc-lock.c lib/mbtowc-lock.h lib/windows-initguard.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/lc-charset-dispatch.c lib/mbtowc-lock.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/lc-charset-dispatch.c lib/mbtowc-lock.c
 
 ## end   gnulib module mbrtowc
 
 ## begin gnulib module mbscasecmp
 
-lib_libgnu_a_SOURCES += lib/mbscasecmp.c
+lib_libcoreutils_a_SOURCES += lib/mbscasecmp.c
 
 ## end   gnulib module mbscasecmp
 
 ## begin gnulib module mbschr
 
-lib_libgnu_a_SOURCES += lib/mbschr.c
+lib_libcoreutils_a_SOURCES += lib/mbschr.c
 
 ## end   gnulib module mbschr
 
 ## begin gnulib module mbsinit
 
 if GL_COND_OBJ_MBSINIT
-lib_libgnu_a_SOURCES += lib/mbsinit.c
+lib_libcoreutils_a_SOURCES += lib/mbsinit.c
 endif
 
 ## end   gnulib module mbsinit
 
 ## begin gnulib module mbslen
 
-lib_libgnu_a_SOURCES += lib/mbslen.c
+lib_libcoreutils_a_SOURCES += lib/mbslen.c
 
 ## end   gnulib module mbslen
 
 ## begin gnulib module mbsrtoc32s
 
-lib_libgnu_a_SOURCES += lib/mbsrtoc32s.c
+lib_libcoreutils_a_SOURCES += lib/mbsrtoc32s.c
 
 EXTRA_DIST += lib/mbsrtoc32s-state.c lib/mbsrtowcs-impl.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/mbsrtoc32s-state.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/mbsrtoc32s-state.c
 
 ## end   gnulib module mbsrtoc32s
 
 ## begin gnulib module mbsrtowcs
 
 if GL_COND_OBJ_MBSRTOWCS
-lib_libgnu_a_SOURCES += lib/mbsrtowcs.c
+lib_libcoreutils_a_SOURCES += lib/mbsrtowcs.c
 endif
 
 EXTRA_DIST += lib/mbsrtowcs-impl.h lib/mbsrtowcs-state.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/mbsrtowcs-state.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/mbsrtowcs-state.c
 
 ## end   gnulib module mbsrtowcs
 
 ## begin gnulib module mbswidth
 
-lib_libgnu_a_SOURCES += lib/mbswidth.h lib/mbswidth.c
+lib_libcoreutils_a_SOURCES += lib/mbswidth.h lib/mbswidth.c
 
 ## end   gnulib module mbswidth
 
 ## begin gnulib module mbszero
 
-lib_libgnu_a_SOURCES += lib/mbszero.c
+lib_libcoreutils_a_SOURCES += lib/mbszero.c
 
 ## end   gnulib module mbszero
 
 ## begin gnulib module mbtowc
 
 if GL_COND_OBJ_MBTOWC
-lib_libgnu_a_SOURCES += lib/mbtowc.c
+lib_libcoreutils_a_SOURCES += lib/mbtowc.c
 endif
 
 EXTRA_DIST += lib/mbtowc-impl.h
@@ -3337,13 +3398,13 @@ EXTRA_DIST += lib/mbtowc-impl.h
 
 ## begin gnulib module mcel
 
-lib_libgnu_a_SOURCES += lib/mcel.c lib/mcel.h
+lib_libcoreutils_a_SOURCES += lib/mcel.c lib/mcel.h
 
 ## end   gnulib module mcel
 
 ## begin gnulib module memcasecmp
 
-lib_libgnu_a_SOURCES += lib/memcasecmp.c
+lib_libcoreutils_a_SOURCES += lib/memcasecmp.c
 
 EXTRA_DIST += lib/memcasecmp.h
 
@@ -3352,7 +3413,7 @@ EXTRA_DIST += lib/memcasecmp.h
 ## begin gnulib module memchr
 
 if GL_COND_OBJ_MEMCHR
-lib_libgnu_a_SOURCES += lib/memchr.c
+lib_libcoreutils_a_SOURCES += lib/memchr.c
 endif
 
 EXTRA_DIST += lib/memchr.valgrind
@@ -3361,7 +3422,7 @@ EXTRA_DIST += lib/memchr.valgrind
 
 ## begin gnulib module memchr2
 
-lib_libgnu_a_SOURCES += lib/memchr2.h lib/memchr2.c
+lib_libcoreutils_a_SOURCES += lib/memchr2.h lib/memchr2.c
 
 EXTRA_DIST += lib/memchr2.valgrind
 
@@ -3369,7 +3430,7 @@ EXTRA_DIST += lib/memchr2.valgrind
 
 ## begin gnulib module memcmp2
 
-lib_libgnu_a_SOURCES += lib/memcmp2.c
+lib_libcoreutils_a_SOURCES += lib/memcmp2.c
 
 EXTRA_DIST += lib/memcmp2.h
 
@@ -3377,7 +3438,7 @@ EXTRA_DIST += lib/memcmp2.h
 
 ## begin gnulib module memcoll
 
-lib_libgnu_a_SOURCES += lib/memcoll.c
+lib_libcoreutils_a_SOURCES += lib/memcoll.c
 
 EXTRA_DIST += lib/memcoll.h
 
@@ -3386,7 +3447,7 @@ EXTRA_DIST += lib/memcoll.h
 ## begin gnulib module mempcpy
 
 if GL_COND_OBJ_MEMPCPY
-lib_libgnu_a_SOURCES += lib/mempcpy.c
+lib_libcoreutils_a_SOURCES += lib/mempcpy.c
 endif
 
 ## end   gnulib module mempcpy
@@ -3394,7 +3455,7 @@ endif
 ## begin gnulib module memrchr
 
 if GL_COND_OBJ_MEMRCHR
-lib_libgnu_a_SOURCES += lib/memrchr.c
+lib_libcoreutils_a_SOURCES += lib/memrchr.c
 endif
 
 ## end   gnulib module memrchr
@@ -3402,14 +3463,14 @@ endif
 ## begin gnulib module memset_explicit
 
 if GL_COND_OBJ_MEMSET_EXPLICIT
-lib_libgnu_a_SOURCES += lib/memset_explicit.c
+lib_libcoreutils_a_SOURCES += lib/memset_explicit.c
 endif
 
 ## end   gnulib module memset_explicit
 
 ## begin gnulib module mgetgroups
 
-lib_libgnu_a_SOURCES += lib/mgetgroups.c
+lib_libcoreutils_a_SOURCES += lib/mgetgroups.c
 
 EXTRA_DIST += lib/mgetgroups.h
 
@@ -3417,13 +3478,13 @@ EXTRA_DIST += lib/mgetgroups.h
 
 ## begin gnulib module minmax
 
-lib_libgnu_a_SOURCES += lib/minmax.h
+lib_libcoreutils_a_SOURCES += lib/minmax.h
 
 ## end   gnulib module minmax
 
 ## begin gnulib module mkancesdirs
 
-lib_libgnu_a_SOURCES += lib/mkancesdirs.c
+lib_libcoreutils_a_SOURCES += lib/mkancesdirs.c
 
 EXTRA_DIST += lib/mkancesdirs.h
 
@@ -3432,14 +3493,14 @@ EXTRA_DIST += lib/mkancesdirs.h
 ## begin gnulib module mkdir
 
 if GL_COND_OBJ_MKDIR
-lib_libgnu_a_SOURCES += lib/mkdir.c
+lib_libcoreutils_a_SOURCES += lib/mkdir.c
 endif
 
 ## end   gnulib module mkdir
 
 ## begin gnulib module mkdir-p
 
-lib_libgnu_a_SOURCES += lib/dirchownmod.c lib/mkdir-p.c
+lib_libcoreutils_a_SOURCES += lib/dirchownmod.c lib/mkdir-p.c
 
 EXTRA_DIST += lib/dirchownmod.h lib/mkdir-p.h
 
@@ -3448,19 +3509,19 @@ EXTRA_DIST += lib/dirchownmod.h lib/mkdir-p.h
 ## begin gnulib module mkdirat
 
 if GL_COND_OBJ_MKDIRAT
-lib_libgnu_a_SOURCES += lib/mkdirat.c
+lib_libcoreutils_a_SOURCES += lib/mkdirat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module mkdirat
 
 ## begin gnulib module mkfifo
 
 if GL_COND_OBJ_MKFIFO
-lib_libgnu_a_SOURCES += lib/mkfifo.c
+lib_libcoreutils_a_SOURCES += lib/mkfifo.c
 endif
 
 ## end   gnulib module mkfifo
@@ -3468,22 +3529,22 @@ endif
 ## begin gnulib module mkfifoat
 
 if GL_COND_OBJ_MKFIFOAT
-lib_libgnu_a_SOURCES += lib/mkfifoat.c
+lib_libcoreutils_a_SOURCES += lib/mkfifoat.c
 endif
 if GL_COND_OBJ_MKNODAT
-lib_libgnu_a_SOURCES += lib/mknodat.c
+lib_libcoreutils_a_SOURCES += lib/mknodat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module mkfifoat
 
 ## begin gnulib module mknod
 
 if GL_COND_OBJ_MKNOD
-lib_libgnu_a_SOURCES += lib/mknod.c
+lib_libcoreutils_a_SOURCES += lib/mknod.c
 endif
 
 ## end   gnulib module mknod
@@ -3491,7 +3552,7 @@ endif
 ## begin gnulib module mkostemp
 
 if GL_COND_OBJ_MKOSTEMP
-lib_libgnu_a_SOURCES += lib/mkostemp.c
+lib_libcoreutils_a_SOURCES += lib/mkostemp.c
 endif
 
 ## end   gnulib module mkostemp
@@ -3499,7 +3560,7 @@ endif
 ## begin gnulib module mkstemp
 
 if GL_COND_OBJ_MKSTEMP
-lib_libgnu_a_SOURCES += lib/mkstemp.c
+lib_libcoreutils_a_SOURCES += lib/mkstemp.c
 endif
 
 ## end   gnulib module mkstemp
@@ -3509,7 +3570,7 @@ endif
 
 EXTRA_DIST += lib/mktime-internal.h lib/mktime.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/mktime.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/mktime.c
 
 ## end   gnulib module mktime
 
@@ -3518,13 +3579,13 @@ EXTRA_lib_libgnu_a_SOURCES += lib/mktime.c
 
 EXTRA_DIST += lib/mktime-internal.h lib/mktime.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/mktime.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/mktime.c
 
 ## end   gnulib module mktime-internal
 
 ## begin gnulib module modechange
 
-lib_libgnu_a_SOURCES += lib/modechange.c
+lib_libcoreutils_a_SOURCES += lib/modechange.c
 
 EXTRA_DIST += lib/modechange.h
 
@@ -3533,7 +3594,7 @@ EXTRA_DIST += lib/modechange.h
 ## begin gnulib module mountlist
 
 if GL_COND_OBJ_MOUNTLIST
-lib_libgnu_a_SOURCES += lib/mountlist.c
+lib_libcoreutils_a_SOURCES += lib/mountlist.c
 endif
 
 EXTRA_DIST += lib/mountlist.h
@@ -3542,7 +3603,7 @@ EXTRA_DIST += lib/mountlist.h
 
 ## begin gnulib module mpsort
 
-lib_libgnu_a_SOURCES += lib/mpsort.c
+lib_libcoreutils_a_SOURCES += lib/mpsort.c
 
 EXTRA_DIST += lib/mpsort.h
 
@@ -3551,7 +3612,7 @@ EXTRA_DIST += lib/mpsort.h
 ## begin gnulib module msvc-inval
 
 if GL_COND_OBJ_MSVC_INVAL
-lib_libgnu_a_SOURCES += lib/msvc-inval.c
+lib_libcoreutils_a_SOURCES += lib/msvc-inval.c
 endif
 
 EXTRA_DIST += lib/msvc-inval.h
@@ -3561,7 +3622,7 @@ EXTRA_DIST += lib/msvc-inval.h
 ## begin gnulib module msvc-nothrow
 
 if GL_COND_OBJ_MSVC_NOTHROW
-lib_libgnu_a_SOURCES += lib/msvc-nothrow.c
+lib_libcoreutils_a_SOURCES += lib/msvc-nothrow.c
 endif
 
 EXTRA_DIST += lib/msvc-nothrow.h
@@ -3571,7 +3632,7 @@ EXTRA_DIST += lib/msvc-nothrow.h
 ## begin gnulib module nanosleep
 
 if GL_COND_OBJ_NANOSLEEP
-lib_libgnu_a_SOURCES += lib/nanosleep.c
+lib_libcoreutils_a_SOURCES += lib/nanosleep.c
 endif
 
 ## end   gnulib module nanosleep
@@ -3642,10 +3703,10 @@ EXTRA_DIST += lib/netinet_in.in.h
 ## begin gnulib module nl_langinfo
 
 if GL_COND_OBJ_NL_LANGINFO
-lib_libgnu_a_SOURCES += lib/nl_langinfo.c
+lib_libcoreutils_a_SOURCES += lib/nl_langinfo.c
 endif
 if GL_COND_OBJ_NL_LANGINFO_LOCK
-lib_libgnu_a_SOURCES += lib/nl_langinfo-lock.c
+lib_libcoreutils_a_SOURCES += lib/nl_langinfo-lock.c
 endif
 
 EXTRA_DIST += lib/windows-initguard.h
@@ -3654,7 +3715,7 @@ EXTRA_DIST += lib/windows-initguard.h
 
 ## begin gnulib module nproc
 
-lib_libgnu_a_SOURCES += lib/nproc.c
+lib_libcoreutils_a_SOURCES += lib/nproc.c
 
 EXTRA_DIST += lib/nproc.h
 
@@ -3662,7 +3723,7 @@ EXTRA_DIST += lib/nproc.h
 
 ## begin gnulib module nstrftime
 
-lib_libgnu_a_SOURCES += lib/nstrftime.c
+lib_libcoreutils_a_SOURCES += lib/nstrftime.c
 
 EXTRA_DIST += lib/strftime.h
 
@@ -3688,7 +3749,7 @@ endif
 MOSTLYCLEANFILES += lib/obstack.h lib/obstack.h-t
 
 if GL_COND_OBJ_OBSTACK
-lib_libgnu_a_SOURCES += lib/obstack.c
+lib_libcoreutils_a_SOURCES += lib/obstack.c
 endif
 
 EXTRA_DIST += lib/obstack.in.h
@@ -3698,7 +3759,7 @@ EXTRA_DIST += lib/obstack.in.h
 ## begin gnulib module open
 
 if GL_COND_OBJ_OPEN
-lib_libgnu_a_SOURCES += lib/open.c
+lib_libcoreutils_a_SOURCES += lib/open.c
 endif
 
 ## end   gnulib module open
@@ -3706,14 +3767,14 @@ endif
 ## begin gnulib module openat
 
 if GL_COND_OBJ_OPENAT
-lib_libgnu_a_SOURCES += lib/openat.c
+lib_libcoreutils_a_SOURCES += lib/openat.c
 endif
 
 ## end   gnulib module openat
 
 ## begin gnulib module openat-die
 
-lib_libgnu_a_SOURCES += lib/openat-die.c
+lib_libcoreutils_a_SOURCES += lib/openat-die.c
 
 ## end   gnulib module openat-die
 
@@ -3726,7 +3787,7 @@ EXTRA_DIST += lib/openat.h
 
 ## begin gnulib module openat-safer
 
-lib_libgnu_a_SOURCES += lib/openat-safer.c
+lib_libcoreutils_a_SOURCES += lib/openat-safer.c
 
 EXTRA_DIST += lib/fcntl--.h lib/fcntl-safer.h
 
@@ -3735,7 +3796,7 @@ EXTRA_DIST += lib/fcntl--.h lib/fcntl-safer.h
 ## begin gnulib module opendir
 
 if GL_COND_OBJ_OPENDIR
-lib_libgnu_a_SOURCES += lib/opendir.c
+lib_libcoreutils_a_SOURCES += lib/opendir.c
 endif
 
 EXTRA_DIST += lib/dirent-private.h
@@ -3744,7 +3805,7 @@ EXTRA_DIST += lib/dirent-private.h
 
 ## begin gnulib module opendirat
 
-lib_libgnu_a_SOURCES += lib/opendirat.c
+lib_libcoreutils_a_SOURCES += lib/opendirat.c
 
 EXTRA_DIST += lib/opendirat.h
 
@@ -3788,7 +3849,7 @@ lib/parse-datetime.c: lib/parse-datetime.y
        @{ test -f $(top_srcdir)/lib/parse-datetime.c && test ! $(top_srcdir)/lib/parse-datetime.c -ot $(top_srcdir)/lib/parse-datetime.y; } || $(MAKE) generate-parse-datetime
 lib/parse-datetime-gen.h: lib/parse-datetime.c
        @{ test -f $(top_srcdir)/lib/parse-datetime-gen.h && test ! $(top_srcdir)/lib/parse-datetime-gen.h -ot $(top_srcdir)/lib/parse-datetime.c; } || $(MAKE) generate-parse-datetime
-lib_libgnu_a_SOURCES += lib/parse-datetime.y
+lib_libcoreutils_a_SOURCES += lib/parse-datetime.y
 BUILT_SOURCES += lib/parse-datetime.c lib/parse-datetime-gen.h
 MOSTLYCLEANFILES += lib/parse-datetime.tab.c lib/parse-datetime.tab.h lib/parse-datetime.c-tmp lib/parse-datetime-gen.h-tmp
 MAINTAINERCLEANFILES += lib/parse-datetime.c lib/parse-datetime-gen.h
@@ -3807,7 +3868,7 @@ EXTRA_DIST += lib/pathmax.h
 
 ## begin gnulib module physmem
 
-lib_libgnu_a_SOURCES += lib/physmem.c
+lib_libcoreutils_a_SOURCES += lib/physmem.c
 
 EXTRA_DIST += lib/physmem.h
 
@@ -3816,14 +3877,14 @@ EXTRA_DIST += lib/physmem.h
 ## begin gnulib module pipe-posix
 
 if GL_COND_OBJ_PIPE
-lib_libgnu_a_SOURCES += lib/pipe.c
+lib_libcoreutils_a_SOURCES += lib/pipe.c
 endif
 
 ## end   gnulib module pipe-posix
 
 ## begin gnulib module pipe2
 
-lib_libgnu_a_SOURCES += lib/pipe2.c
+lib_libcoreutils_a_SOURCES += lib/pipe2.c
 
 ## end   gnulib module pipe2
 
@@ -3846,14 +3907,14 @@ lib_libgnu_a_SOURCES += lib/pipe2.c
 ## begin gnulib module posix_memalign
 
 if GL_COND_OBJ_POSIX_MEMALIGN
-lib_libgnu_a_SOURCES += lib/posix_memalign.c
+lib_libcoreutils_a_SOURCES += lib/posix_memalign.c
 endif
 
 ## end   gnulib module posix_memalign
 
 ## begin gnulib module posixtm
 
-lib_libgnu_a_SOURCES += lib/posixtm.c
+lib_libcoreutils_a_SOURCES += lib/posixtm.c
 
 EXTRA_DIST += lib/posixtm.h
 
@@ -3861,7 +3922,7 @@ EXTRA_DIST += lib/posixtm.h
 
 ## begin gnulib module posixver
 
-lib_libgnu_a_SOURCES += lib/posixver.c
+lib_libcoreutils_a_SOURCES += lib/posixver.c
 
 EXTRA_DIST += lib/posixver.h
 
@@ -3869,7 +3930,7 @@ EXTRA_DIST += lib/posixver.h
 
 ## begin gnulib module printf-frexp
 
-lib_libgnu_a_SOURCES += lib/printf-frexp.c
+lib_libcoreutils_a_SOURCES += lib/printf-frexp.c
 
 EXTRA_DIST += lib/printf-frexp.h
 
@@ -3877,17 +3938,17 @@ EXTRA_DIST += lib/printf-frexp.h
 
 ## begin gnulib module printf-frexpl
 
-lib_libgnu_a_SOURCES += lib/printf-frexpl.c
+lib_libcoreutils_a_SOURCES += lib/printf-frexpl.c
 
 EXTRA_DIST += lib/printf-frexp.c lib/printf-frexpl.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/printf-frexp.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/printf-frexp.c
 
 ## end   gnulib module printf-frexpl
 
 ## begin gnulib module priv-set
 
-lib_libgnu_a_SOURCES += lib/priv-set.c
+lib_libcoreutils_a_SOURCES += lib/priv-set.c
 
 EXTRA_DIST += lib/priv-set.h
 
@@ -3895,20 +3956,20 @@ EXTRA_DIST += lib/priv-set.h
 
 ## begin gnulib module progname
 
-lib_libgnu_a_SOURCES += lib/progname.h lib/progname.c
+lib_libcoreutils_a_SOURCES += lib/progname.h lib/progname.c
 
 ## end   gnulib module progname
 
 ## begin gnulib module propername-lite
 
-lib_libgnu_a_SOURCES += lib/propername-lite.c lib/propername.h
+lib_libcoreutils_a_SOURCES += lib/propername-lite.c lib/propername.h
 
 ## end   gnulib module propername-lite
 
 ## begin gnulib module pselect
 
 if GL_COND_OBJ_PSELECT
-lib_libgnu_a_SOURCES += lib/pselect.c
+lib_libcoreutils_a_SOURCES += lib/pselect.c
 endif
 
 ## end   gnulib module pselect
@@ -3916,7 +3977,7 @@ endif
 ## begin gnulib module pthread-cond
 
 if GL_COND_OBJ_PTHREAD_COND
-lib_libgnu_a_SOURCES += lib/pthread-cond.c
+lib_libcoreutils_a_SOURCES += lib/pthread-cond.c
 endif
 
 ## end   gnulib module pthread-cond
@@ -4074,7 +4135,7 @@ EXTRA_DIST += lib/pthread.in.h
 ## begin gnulib module pthread-mutex
 
 if GL_COND_OBJ_PTHREAD_MUTEX
-lib_libgnu_a_SOURCES += lib/pthread-mutex.c
+lib_libcoreutils_a_SOURCES += lib/pthread-mutex.c
 endif
 
 ## end   gnulib module pthread-mutex
@@ -4082,7 +4143,7 @@ endif
 ## begin gnulib module pthread-thread
 
 if GL_COND_OBJ_PTHREAD_THREAD
-lib_libgnu_a_SOURCES += lib/pthread-thread.c
+lib_libcoreutils_a_SOURCES += lib/pthread-thread.c
 endif
 
 ## end   gnulib module pthread-thread
@@ -4090,7 +4151,7 @@ endif
 ## begin gnulib module pthread_mutex_timedlock
 
 if GL_COND_OBJ_PTHREAD_MUTEX_TIMEDLOCK
-lib_libgnu_a_SOURCES += lib/pthread_mutex_timedlock.c
+lib_libcoreutils_a_SOURCES += lib/pthread_mutex_timedlock.c
 endif
 
 ## end   gnulib module pthread_mutex_timedlock
@@ -4098,7 +4159,7 @@ endif
 ## begin gnulib module pthread_sigmask
 
 if GL_COND_OBJ_PTHREAD_SIGMASK
-lib_libgnu_a_SOURCES += lib/pthread_sigmask.c
+lib_libcoreutils_a_SOURCES += lib/pthread_sigmask.c
 endif
 
 ## end   gnulib module pthread_sigmask
@@ -4106,30 +4167,30 @@ endif
 ## begin gnulib module putenv
 
 if GL_COND_OBJ_PUTENV
-lib_libgnu_a_SOURCES += lib/putenv.c
+lib_libcoreutils_a_SOURCES += lib/putenv.c
 endif
 
 ## end   gnulib module putenv
 
 ## begin gnulib module qcopy-acl
 
-lib_libgnu_a_SOURCES += lib/qcopy-acl.c
+lib_libcoreutils_a_SOURCES += lib/qcopy-acl.c
 
 ## end   gnulib module qcopy-acl
 
 ## begin gnulib module qset-acl
 
-lib_libgnu_a_SOURCES += lib/qset-acl.c
+lib_libcoreutils_a_SOURCES += lib/qset-acl.c
 
 ## end   gnulib module qset-acl
 
 ## begin gnulib module qsort_r
 
 if GL_COND_OBJ_QSORT
-lib_libgnu_a_SOURCES += lib/qsort.c
+lib_libcoreutils_a_SOURCES += lib/qsort.c
 endif
 if GL_COND_OBJ_QSORT_R
-lib_libgnu_a_SOURCES += lib/qsort_r.c
+lib_libcoreutils_a_SOURCES += lib/qsort_r.c
 endif
 
 ## end   gnulib module qsort_r
@@ -4143,7 +4204,7 @@ EXTRA_DIST += lib/quote.h
 
 ## begin gnulib module quotearg
 
-lib_libgnu_a_SOURCES += lib/quotearg.c
+lib_libcoreutils_a_SOURCES += lib/quotearg.c
 
 EXTRA_DIST += lib/quote.h lib/quotearg.h
 
@@ -4152,15 +4213,33 @@ EXTRA_DIST += lib/quote.h lib/quotearg.h
 ## begin gnulib module raise
 
 if GL_COND_OBJ_RAISE
-lib_libgnu_a_SOURCES += lib/raise.c
+lib_libcoreutils_a_SOURCES += lib/raise.c
 endif
 
 ## end   gnulib module raise
 
+## begin gnulib module randint
+
+lib_libcoreutils_a_SOURCES += lib/randint.c lib/randint.h
+
+## end   gnulib module randint
+
+## begin gnulib module randperm
+
+lib_libcoreutils_a_SOURCES += lib/randperm.c lib/randperm.h
+
+## end   gnulib module randperm
+
+## begin gnulib module randread
+
+lib_libcoreutils_a_SOURCES += lib/randread.c lib/randread.h lib/rand-isaac.c lib/rand-isaac.h
+
+## end   gnulib module randread
+
 ## begin gnulib module rawmemchr
 
 if GL_COND_OBJ_RAWMEMCHR
-lib_libgnu_a_SOURCES += lib/rawmemchr.c
+lib_libcoreutils_a_SOURCES += lib/rawmemchr.c
 endif
 
 EXTRA_DIST += lib/rawmemchr.valgrind
@@ -4170,14 +4249,14 @@ EXTRA_DIST += lib/rawmemchr.valgrind
 ## begin gnulib module read
 
 if GL_COND_OBJ_READ
-lib_libgnu_a_SOURCES += lib/read.c
+lib_libcoreutils_a_SOURCES += lib/read.c
 endif
 
 ## end   gnulib module read
 
 ## begin gnulib module read-file
 
-lib_libgnu_a_SOURCES += lib/read-file.c
+lib_libcoreutils_a_SOURCES += lib/read-file.c
 
 EXTRA_DIST += lib/read-file.h
 
@@ -4186,7 +4265,7 @@ EXTRA_DIST += lib/read-file.h
 ## begin gnulib module readdir
 
 if GL_COND_OBJ_READDIR
-lib_libgnu_a_SOURCES += lib/readdir.c
+lib_libcoreutils_a_SOURCES += lib/readdir.c
 endif
 
 EXTRA_DIST += lib/dirent-private.h
@@ -4196,7 +4275,7 @@ EXTRA_DIST += lib/dirent-private.h
 ## begin gnulib module readlink
 
 if GL_COND_OBJ_READLINK
-lib_libgnu_a_SOURCES += lib/readlink.c
+lib_libcoreutils_a_SOURCES += lib/readlink.c
 endif
 
 ## end   gnulib module readlink
@@ -4204,18 +4283,18 @@ endif
 ## begin gnulib module readlinkat
 
 if GL_COND_OBJ_READLINKAT
-lib_libgnu_a_SOURCES += lib/readlinkat.c
+lib_libcoreutils_a_SOURCES += lib/readlinkat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module readlinkat
 
 ## begin gnulib module readtokens
 
-lib_libgnu_a_SOURCES += lib/readtokens.c
+lib_libcoreutils_a_SOURCES += lib/readtokens.c
 
 EXTRA_DIST += lib/readtokens.h
 
@@ -4223,13 +4302,13 @@ EXTRA_DIST += lib/readtokens.h
 
 ## begin gnulib module readtokens0
 
-lib_libgnu_a_SOURCES += lib/readtokens0.h lib/readtokens0.c
+lib_libcoreutils_a_SOURCES += lib/readtokens0.h lib/readtokens0.c
 
 ## end   gnulib module readtokens0
 
 ## begin gnulib module readutmp
 
-lib_libgnu_a_SOURCES += lib/readutmp.c
+lib_libcoreutils_a_SOURCES += lib/readutmp.c
 
 EXTRA_DIST += lib/boot-time-aux.h lib/readutmp.h
 
@@ -4240,7 +4319,7 @@ EXTRA_DIST += lib/boot-time-aux.h lib/readutmp.h
 
 EXTRA_DIST += lib/realloc.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/realloc.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/realloc.c
 
 ## end   gnulib module realloc-gnu
 
@@ -4249,14 +4328,14 @@ EXTRA_lib_libgnu_a_SOURCES += lib/realloc.c
 
 EXTRA_DIST += lib/realloc.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/realloc.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/realloc.c
 
 ## end   gnulib module realloc-posix
 
 ## begin gnulib module reallocarray
 
 if GL_COND_OBJ_REALLOCARRAY
-lib_libgnu_a_SOURCES += lib/reallocarray.c
+lib_libcoreutils_a_SOURCES += lib/reallocarray.c
 endif
 
 ## end   gnulib module reallocarray
@@ -4264,19 +4343,19 @@ endif
 ## begin gnulib module regex
 
 if GL_COND_OBJ_REGEX
-lib_libgnu_a_SOURCES += lib/regex.c
+lib_libcoreutils_a_SOURCES += lib/regex.c
 endif
 
 EXTRA_DIST += lib/regcomp.c lib/regex.h lib/regex_internal.c lib/regex_internal.h lib/regexec.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/regcomp.c lib/regex_internal.c lib/regexec.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/regcomp.c lib/regex_internal.c lib/regexec.c
 
 ## end   gnulib module regex
 
 ## begin gnulib module remove
 
 if GL_COND_OBJ_REMOVE
-lib_libgnu_a_SOURCES += lib/remove.c
+lib_libcoreutils_a_SOURCES += lib/remove.c
 endif
 
 ## end   gnulib module remove
@@ -4284,7 +4363,7 @@ endif
 ## begin gnulib module rename
 
 if GL_COND_OBJ_RENAME
-lib_libgnu_a_SOURCES += lib/rename.c
+lib_libcoreutils_a_SOURCES += lib/rename.c
 endif
 
 ## end   gnulib module rename
@@ -4292,29 +4371,29 @@ endif
 ## begin gnulib module renameat
 
 if GL_COND_OBJ_RENAMEAT
-lib_libgnu_a_SOURCES += lib/renameat.c
+lib_libcoreutils_a_SOURCES += lib/renameat.c
 endif
 
 EXTRA_DIST += lib/at-func2.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func2.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func2.c
 
 ## end   gnulib module renameat
 
 ## begin gnulib module renameatu
 
-lib_libgnu_a_SOURCES += lib/renameatu.c
+lib_libcoreutils_a_SOURCES += lib/renameatu.c
 
 EXTRA_DIST += lib/at-func2.c lib/renameatu.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func2.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func2.c
 
 ## end   gnulib module renameatu
 
 ## begin gnulib module rewinddir
 
 if GL_COND_OBJ_REWINDDIR
-lib_libgnu_a_SOURCES += lib/rewinddir.c
+lib_libcoreutils_a_SOURCES += lib/rewinddir.c
 endif
 
 EXTRA_DIST += lib/dirent-private.h
@@ -4324,11 +4403,17 @@ EXTRA_DIST += lib/dirent-private.h
 ## begin gnulib module rmdir
 
 if GL_COND_OBJ_RMDIR
-lib_libgnu_a_SOURCES += lib/rmdir.c
+lib_libcoreutils_a_SOURCES += lib/rmdir.c
 endif
 
 ## end   gnulib module rmdir
 
+## begin gnulib module root-dev-ino
+
+lib_libcoreutils_a_SOURCES += lib/root-dev-ino.c lib/root-dev-ino.h
+
+## end   gnulib module root-dev-ino
+
 ## begin gnulib module root-uid
 
 
@@ -4339,14 +4424,14 @@ EXTRA_DIST += lib/root-uid.h
 ## begin gnulib module rpmatch
 
 if GL_COND_OBJ_RPMATCH
-lib_libgnu_a_SOURCES += lib/rpmatch.c
+lib_libcoreutils_a_SOURCES += lib/rpmatch.c
 endif
 
 ## end   gnulib module rpmatch
 
 ## begin gnulib module safe-read
 
-lib_libgnu_a_SOURCES += lib/safe-read.c
+lib_libcoreutils_a_SOURCES += lib/safe-read.c
 
 EXTRA_DIST += lib/safe-read.h lib/sys-limits.h
 
@@ -4354,17 +4439,17 @@ EXTRA_DIST += lib/safe-read.h lib/sys-limits.h
 
 ## begin gnulib module safe-write
 
-lib_libgnu_a_SOURCES += lib/safe-write.c
+lib_libcoreutils_a_SOURCES += lib/safe-write.c
 
 EXTRA_DIST += lib/safe-read.c lib/safe-write.h lib/sys-limits.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/safe-read.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/safe-read.c
 
 ## end   gnulib module safe-write
 
 ## begin gnulib module same
 
-lib_libgnu_a_SOURCES += lib/same.c
+lib_libcoreutils_a_SOURCES += lib/same.c
 
 EXTRA_DIST += lib/same.h
 
@@ -4372,13 +4457,13 @@ EXTRA_DIST += lib/same.h
 
 ## begin gnulib module same-inode
 
-lib_libgnu_a_SOURCES += lib/same-inode.h lib/same-inode.c
+lib_libcoreutils_a_SOURCES += lib/same-inode.h lib/same-inode.c
 
 ## end   gnulib module same-inode
 
 ## begin gnulib module save-cwd
 
-lib_libgnu_a_SOURCES += lib/save-cwd.c
+lib_libcoreutils_a_SOURCES += lib/save-cwd.c
 
 EXTRA_DIST += lib/save-cwd.h
 
@@ -4386,7 +4471,7 @@ EXTRA_DIST += lib/save-cwd.h
 
 ## begin gnulib module savedir
 
-lib_libgnu_a_SOURCES += lib/savedir.c
+lib_libcoreutils_a_SOURCES += lib/savedir.c
 
 EXTRA_DIST += lib/savedir.h
 
@@ -4394,7 +4479,7 @@ EXTRA_DIST += lib/savedir.h
 
 ## begin gnulib module savewd
 
-lib_libgnu_a_SOURCES += lib/savewd.h lib/savewd.c
+lib_libcoreutils_a_SOURCES += lib/savewd.h lib/savewd.c
 
 ## end   gnulib module savewd
 
@@ -4431,7 +4516,7 @@ EXTRA_DIST += lib/sched.in.h
 ## begin gnulib module secure_getenv
 
 if GL_COND_OBJ_SECURE_GETENV
-lib_libgnu_a_SOURCES += lib/secure_getenv.c
+lib_libcoreutils_a_SOURCES += lib/secure_getenv.c
 endif
 
 ## end   gnulib module secure_getenv
@@ -4439,18 +4524,18 @@ endif
 ## begin gnulib module select
 
 if GL_COND_OBJ_SELECT
-lib_libgnu_a_SOURCES += lib/select.c
+lib_libcoreutils_a_SOURCES += lib/select.c
 endif
 
 ## end   gnulib module select
 
 ## begin gnulib module selinux-at
 
-lib_libgnu_a_SOURCES += lib/selinux-at.h lib/selinux-at.c
+lib_libcoreutils_a_SOURCES += lib/selinux-at.h lib/selinux-at.c
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module selinux-at
 
@@ -4497,25 +4582,25 @@ MOSTLYCLEANFILES += lib/selinux/label.h lib/selinux/label.h-t
 MOSTLYCLEANDIRS += lib/selinux
 
 if GL_COND_OBJ_GETFILECON
-lib_libgnu_a_SOURCES += lib/getfilecon.c
+lib_libcoreutils_a_SOURCES += lib/getfilecon.c
 endif
-lib_libgnu_a_SOURCES += lib/se-context.in.h lib/se-label.in.h lib/se-selinux.in.h    lib/se-context.c lib/se-label.c lib/se-selinux.c
+lib_libcoreutils_a_SOURCES += lib/se-context.in.h lib/se-label.in.h lib/se-selinux.in.h    lib/se-context.c lib/se-label.c lib/se-selinux.c
 
 ## end   gnulib module selinux-h
 
 ## begin gnulib module setenv
 
 if GL_COND_OBJ_SETENV
-lib_libgnu_a_SOURCES += lib/setenv.c
+lib_libcoreutils_a_SOURCES += lib/setenv.c
 endif
 
 ## end   gnulib module setenv
 
 ## begin gnulib module setlocale-null
 
-lib_libgnu_a_SOURCES += lib/setlocale_null.c
+lib_libcoreutils_a_SOURCES += lib/setlocale_null.c
 if GL_COND_OBJ_SETLOCALE_LOCK
-lib_libgnu_a_SOURCES += lib/setlocale-lock.c
+lib_libcoreutils_a_SOURCES += lib/setlocale-lock.c
 endif
 
 EXTRA_DIST += lib/setlocale_null.h lib/windows-initguard.h
@@ -4524,14 +4609,14 @@ EXTRA_DIST += lib/setlocale_null.h lib/windows-initguard.h
 
 ## begin gnulib module settime
 
-lib_libgnu_a_SOURCES += lib/settime.c
+lib_libcoreutils_a_SOURCES += lib/settime.c
 
 ## end   gnulib module settime
 
 ## begin gnulib module sig2str
 
 if GL_COND_OBJ_SIG2STR
-lib_libgnu_a_SOURCES += lib/sig2str.c
+lib_libcoreutils_a_SOURCES += lib/sig2str.c
 endif
 
 EXTRA_DIST += lib/sig2str.h
@@ -4541,9 +4626,9 @@ EXTRA_DIST += lib/sig2str.h
 ## begin gnulib module sigaction
 
 if GL_COND_OBJ_SIGACTION
-lib_libgnu_a_SOURCES += lib/sigaction.c
+lib_libcoreutils_a_SOURCES += lib/sigaction.c
 endif
-lib_libgnu_a_SOURCES += lib/sig-handler.c
+lib_libcoreutils_a_SOURCES += lib/sig-handler.c
 
 EXTRA_DIST += lib/sig-handler.h
 
@@ -4593,7 +4678,7 @@ EXTRA_DIST += lib/signal.in.h
 ## begin gnulib module signbit
 
 if GL_COND_OBJ_SIGNBIT3
-lib_libgnu_a_SOURCES += lib/signbitf.c lib/signbitd.c lib/signbitl.c
+lib_libcoreutils_a_SOURCES += lib/signbitf.c lib/signbitd.c lib/signbitl.c
 endif
 
 EXTRA_DIST += lib/float+.h
@@ -4603,17 +4688,31 @@ EXTRA_DIST += lib/float+.h
 ## begin gnulib module sigprocmask
 
 if GL_COND_OBJ_SIGPROCMASK
-lib_libgnu_a_SOURCES += lib/sigprocmask.c
+lib_libcoreutils_a_SOURCES += lib/sigprocmask.c
 endif
 
 ## end   gnulib module sigprocmask
 
 ## begin gnulib module size_max
 
-lib_libgnu_a_SOURCES += lib/size_max.h
+lib_libcoreutils_a_SOURCES += lib/size_max.h
 
 ## end   gnulib module size_max
 
+## begin gnulib module skipchars
+
+lib_libcoreutils_a_SOURCES += lib/skipchars.c
+
+EXTRA_DIST += lib/skipchars.h
+
+## end   gnulib module skipchars
+
+## begin gnulib module smack
+
+lib_libcoreutils_a_SOURCES += lib/smack.h
+
+## end   gnulib module smack
+
 ## begin gnulib module snippet/_Noreturn
 
 # Because this Makefile snippet defines a variable used by other
@@ -4667,13 +4766,13 @@ EXTRA_DIST += lib/warn-on-use.h
 
 EXTRA_DIST += lib/snprintf.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/snprintf.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/snprintf.c
 
 ## end   gnulib module snprintf
 
 ## begin gnulib module sockets
 
-lib_libgnu_a_SOURCES += lib/sockets.h lib/sockets.c
+lib_libcoreutils_a_SOURCES += lib/sockets.h lib/sockets.c
 
 EXTRA_DIST += lib/w32sock.h
 
@@ -4682,12 +4781,12 @@ EXTRA_DIST += lib/w32sock.h
 ## begin gnulib module stat
 
 if GL_COND_OBJ_STAT
-lib_libgnu_a_SOURCES += lib/stat.c
+lib_libcoreutils_a_SOURCES += lib/stat.c
 endif
 
 EXTRA_DIST += lib/stat-w32.c lib/stat-w32.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/stat-w32.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/stat-w32.c
 
 ## end   gnulib module stat
 
@@ -4707,7 +4806,7 @@ EXTRA_DIST += lib/stat-size.h
 
 ## begin gnulib module stat-time
 
-lib_libgnu_a_SOURCES += lib/stat-time.c
+lib_libcoreutils_a_SOURCES += lib/stat-time.c
 
 EXTRA_DIST += lib/stat-time.h
 
@@ -4981,10 +5080,10 @@ lib/stdio.h: lib/stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NON
 MOSTLYCLEANFILES += lib/stdio.h lib/stdio.h-t1 lib/stdio.h-t2 lib/stdio.h-t3
 
 if GL_COND_OBJ_STDIO_READ
-lib_libgnu_a_SOURCES += lib/stdio-read.c
+lib_libcoreutils_a_SOURCES += lib/stdio-read.c
 endif
 if GL_COND_OBJ_STDIO_WRITE
-lib_libgnu_a_SOURCES += lib/stdio-write.c
+lib_libcoreutils_a_SOURCES += lib/stdio-write.c
 endif
 
 EXTRA_DIST += lib/stdio.in.h
@@ -5162,7 +5261,7 @@ EXTRA_DIST += lib/stdlib.in.h
 
 ## begin gnulib module stdlib-safer
 
-lib_libgnu_a_SOURCES += lib/mkstemp-safer.c
+lib_libcoreutils_a_SOURCES += lib/mkstemp-safer.c
 
 EXTRA_DIST += lib/stdlib--.h lib/stdlib-safer.h
 
@@ -5171,7 +5270,7 @@ EXTRA_DIST += lib/stdlib--.h lib/stdlib-safer.h
 ## begin gnulib module stpcpy
 
 if GL_COND_OBJ_STPCPY
-lib_libgnu_a_SOURCES += lib/stpcpy.c
+lib_libcoreutils_a_SOURCES += lib/stpcpy.c
 endif
 
 ## end   gnulib module stpcpy
@@ -5179,7 +5278,7 @@ endif
 ## begin gnulib module strdup-posix
 
 if GL_COND_OBJ_STRDUP
-lib_libgnu_a_SOURCES += lib/strdup.c
+lib_libcoreutils_a_SOURCES += lib/strdup.c
 endif
 
 ## end   gnulib module strdup-posix
@@ -5194,7 +5293,7 @@ EXTRA_DIST += lib/streq.h
 ## begin gnulib module strerror
 
 if GL_COND_OBJ_STRERROR
-lib_libgnu_a_SOURCES += lib/strerror.c
+lib_libcoreutils_a_SOURCES += lib/strerror.c
 endif
 
 ## end   gnulib module strerror
@@ -5202,7 +5301,7 @@ endif
 ## begin gnulib module strerror-override
 
 if GL_COND_OBJ_STRERROR_OVERRIDE
-lib_libgnu_a_SOURCES += lib/strerror-override.c
+lib_libcoreutils_a_SOURCES += lib/strerror-override.c
 endif
 
 EXTRA_DIST += lib/strerror-override.h
@@ -5332,21 +5431,29 @@ EXTRA_DIST += lib/string.in.h
 ## begin gnulib module strnlen
 
 if GL_COND_OBJ_STRNLEN
-lib_libgnu_a_SOURCES += lib/strnlen.c
+lib_libcoreutils_a_SOURCES += lib/strnlen.c
 endif
 
 ## end   gnulib module strnlen
 
 ## begin gnulib module strnlen1
 
-lib_libgnu_a_SOURCES += lib/strnlen1.h lib/strnlen1.c
+lib_libcoreutils_a_SOURCES += lib/strnlen1.h lib/strnlen1.c
 
 ## end   gnulib module strnlen1
 
+## begin gnulib module strnumcmp
+
+lib_libcoreutils_a_SOURCES += lib/strintcmp.c lib/strnumcmp.c lib/strnumcmp.h
+
+EXTRA_DIST += lib/strnumcmp-in.h
+
+## end   gnulib module strnumcmp
+
 ## begin gnulib module strsignal
 
 if GL_COND_OBJ_STRSIGNAL
-lib_libgnu_a_SOURCES += lib/strsignal.c
+lib_libcoreutils_a_SOURCES += lib/strsignal.c
 endif
 
 EXTRA_DIST += lib/siglist.h
@@ -5358,58 +5465,78 @@ EXTRA_DIST += lib/siglist.h
 
 EXTRA_DIST += lib/str-two-way.h lib/strstr.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/strstr.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/strstr.c
 
 ## end   gnulib module strstr-simple
 
+## begin gnulib module strtod
+
+if GL_COND_OBJ_STRTOD
+lib_libcoreutils_a_SOURCES += lib/strtod.c
+endif
+
+## end   gnulib module strtod
+
 ## begin gnulib module strtoimax
 
 if GL_COND_OBJ_STRTOIMAX
-lib_libgnu_a_SOURCES += lib/strtoimax.c
+lib_libcoreutils_a_SOURCES += lib/strtoimax.c
 endif
 
 ## end   gnulib module strtoimax
 
+## begin gnulib module strtold
+
+if GL_COND_OBJ_STRTOLD
+lib_libcoreutils_a_SOURCES += lib/strtold.c
+endif
+
+EXTRA_DIST += lib/strtod.c
+
+EXTRA_lib_libcoreutils_a_SOURCES += lib/strtod.c
+
+## end   gnulib module strtold
+
 ## begin gnulib module strtoll
 
 if GL_COND_OBJ_STRTOLL
-lib_libgnu_a_SOURCES += lib/strtoll.c
+lib_libcoreutils_a_SOURCES += lib/strtoll.c
 endif
 
 EXTRA_DIST += lib/strtol.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/strtol.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/strtol.c
 
 ## end   gnulib module strtoll
 
 ## begin gnulib module strtoull
 
 if GL_COND_OBJ_STRTOULL
-lib_libgnu_a_SOURCES += lib/strtoull.c
+lib_libcoreutils_a_SOURCES += lib/strtoull.c
 endif
 
 EXTRA_DIST += lib/strtol.c lib/strtoul.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/strtol.c lib/strtoul.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/strtol.c lib/strtoul.c
 
 ## end   gnulib module strtoull
 
 ## begin gnulib module strtoumax
 
 if GL_COND_OBJ_STRTOUMAX
-lib_libgnu_a_SOURCES += lib/strtoumax.c
+lib_libcoreutils_a_SOURCES += lib/strtoumax.c
 endif
 
 EXTRA_DIST += lib/strtoimax.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/strtoimax.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/strtoimax.c
 
 ## end   gnulib module strtoumax
 
 ## begin gnulib module symlink
 
 if GL_COND_OBJ_SYMLINK
-lib_libgnu_a_SOURCES += lib/symlink.c
+lib_libcoreutils_a_SOURCES += lib/symlink.c
 endif
 
 ## end   gnulib module symlink
@@ -5417,12 +5544,12 @@ endif
 ## begin gnulib module symlinkat
 
 if GL_COND_OBJ_SYMLINKAT
-lib_libgnu_a_SOURCES += lib/symlinkat.c
+lib_libcoreutils_a_SOURCES += lib/symlinkat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module symlinkat
 
@@ -5550,7 +5677,7 @@ EXTRA_DIST += lib/sys_select.in.h
 ## begin gnulib module sys_socket
 
 BUILT_SOURCES += lib/sys/socket.h
-lib_libgnu_a_SOURCES += lib/sys_socket.c
+lib_libcoreutils_a_SOURCES += lib/sys_socket.c
 
 # We need the following in order to create <sys/socket.h> when the system
 # doesn't have one that works with the given compiler.
@@ -5805,9 +5932,15 @@ EXTRA_DIST += lib/sys_wait.in.h
 
 ## end   gnulib module sys_wait
 
+## begin gnulib module targetdir
+
+lib_libcoreutils_a_SOURCES += lib/targetdir.c lib/targetdir.h
+
+## end   gnulib module targetdir
+
 ## begin gnulib module tempname
 
-lib_libgnu_a_SOURCES += lib/tempname.c
+lib_libcoreutils_a_SOURCES += lib/tempname.c
 
 EXTRA_DIST += lib/tempname.h
 
@@ -5842,14 +5975,14 @@ EXTRA_DIST += lib/termios.in.h
 
 ## begin gnulib module threadlib
 
-lib_libgnu_a_SOURCES += lib/glthread/threadlib.c
+lib_libcoreutils_a_SOURCES += lib/glthread/threadlib.c
 
 ## end   gnulib module threadlib
 
 ## begin gnulib module time
 
 if GL_COND_OBJ_TIME
-lib_libgnu_a_SOURCES += lib/time.c
+lib_libcoreutils_a_SOURCES += lib/time.c
 endif
 
 ## end   gnulib module time
@@ -5920,7 +6053,7 @@ EXTRA_DIST += lib/time.in.h
 ## begin gnulib module time_r
 
 if GL_COND_OBJ_TIME_R
-lib_libgnu_a_SOURCES += lib/time_r.c
+lib_libcoreutils_a_SOURCES += lib/time_r.c
 endif
 
 ## end   gnulib module time_r
@@ -5928,7 +6061,7 @@ endif
 ## begin gnulib module time_rz
 
 if GL_COND_OBJ_TIME_RZ
-lib_libgnu_a_SOURCES += lib/time_rz.c
+lib_libcoreutils_a_SOURCES += lib/time_rz.c
 endif
 
 EXTRA_DIST += lib/time-internal.h
@@ -5938,7 +6071,7 @@ EXTRA_DIST += lib/time-internal.h
 ## begin gnulib module timegm
 
 if GL_COND_OBJ_TIMEGM
-lib_libgnu_a_SOURCES += lib/timegm.c
+lib_libcoreutils_a_SOURCES += lib/timegm.c
 endif
 
 EXTRA_DIST += lib/mktime-internal.h
@@ -5947,7 +6080,7 @@ EXTRA_DIST += lib/mktime-internal.h
 
 ## begin gnulib module timespec
 
-lib_libgnu_a_SOURCES += lib/timespec.c
+lib_libcoreutils_a_SOURCES += lib/timespec.c
 
 EXTRA_DIST += lib/timespec.h
 
@@ -5955,27 +6088,27 @@ EXTRA_DIST += lib/timespec.h
 
 ## begin gnulib module tls
 
-lib_libgnu_a_SOURCES += lib/glthread/tls.h lib/glthread/tls.c
+lib_libcoreutils_a_SOURCES += lib/glthread/tls.h lib/glthread/tls.c
 
 ## end   gnulib module tls
 
 ## begin gnulib module tmpdir
 
-lib_libgnu_a_SOURCES += lib/tmpdir.h lib/tmpdir.c
+lib_libcoreutils_a_SOURCES += lib/tmpdir.h lib/tmpdir.c
 
 ## end   gnulib module tmpdir
 
 ## begin gnulib module tzset
 
 if GL_COND_OBJ_TZSET
-lib_libgnu_a_SOURCES += lib/tzset.c
+lib_libcoreutils_a_SOURCES += lib/tzset.c
 endif
 
 ## end   gnulib module tzset
 
 ## begin gnulib module u64
 
-lib_libgnu_a_SOURCES += lib/u64.c
+lib_libcoreutils_a_SOURCES += lib/u64.c
 
 EXTRA_DIST += lib/u64.h
 
@@ -6065,7 +6198,7 @@ EXTRA_DIST += lib/uchar.in.h
 ## begin gnulib module uname
 
 if GL_COND_OBJ_UNAME
-lib_libgnu_a_SOURCES += lib/uname.c
+lib_libcoreutils_a_SOURCES += lib/uname.c
 endif
 
 ## end   gnulib module uname
@@ -6091,7 +6224,7 @@ EXTRA_DIST += lib/unicase.in.h
 ## begin gnulib module unicase/tolower
 
 if LIBUNISTRING_COMPILE_UNICASE_TOLOWER
-lib_libgnu_a_SOURCES += lib/unicase/tolower.c
+lib_libcoreutils_a_SOURCES += lib/unicase/tolower.c
 endif
 
 EXTRA_DIST += lib/unicase/simple-mapping.h lib/unicase/tolower.h
@@ -6100,7 +6233,7 @@ EXTRA_DIST += lib/unicase/simple-mapping.h lib/unicase/tolower.h
 
 ## begin gnulib module unicodeio
 
-lib_libgnu_a_SOURCES += lib/unicodeio.h lib/unicodeio.c
+lib_libcoreutils_a_SOURCES += lib/unicodeio.h lib/unicodeio.c
 
 ## end   gnulib module unicodeio
 
@@ -6261,7 +6394,7 @@ EXTRA_DIST += lib/unictype.in.h
 ## begin gnulib module unictype/ctype-alnum
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_ALNUM
-lib_libgnu_a_SOURCES += lib/unictype/ctype_alnum.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_alnum.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_alnum.h
@@ -6271,7 +6404,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_alnum.h
 ## begin gnulib module unictype/ctype-alpha
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_ALPHA
-lib_libgnu_a_SOURCES += lib/unictype/ctype_alpha.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_alpha.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_alpha.h
@@ -6281,7 +6414,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_alpha.h
 ## begin gnulib module unictype/ctype-blank
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_BLANK
-lib_libgnu_a_SOURCES += lib/unictype/ctype_blank.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_blank.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_blank.h
@@ -6291,7 +6424,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_blank.h
 ## begin gnulib module unictype/ctype-cntrl
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_CNTRL
-lib_libgnu_a_SOURCES += lib/unictype/ctype_cntrl.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_cntrl.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_cntrl.h
@@ -6301,7 +6434,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_cntrl.h
 ## begin gnulib module unictype/ctype-digit
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_DIGIT
-lib_libgnu_a_SOURCES += lib/unictype/ctype_digit.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_digit.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_digit.h
@@ -6311,7 +6444,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_digit.h
 ## begin gnulib module unictype/ctype-graph
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_GRAPH
-lib_libgnu_a_SOURCES += lib/unictype/ctype_graph.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_graph.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_graph.h
@@ -6321,7 +6454,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_graph.h
 ## begin gnulib module unictype/ctype-lower
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_LOWER
-lib_libgnu_a_SOURCES += lib/unictype/ctype_lower.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_lower.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_lower.h
@@ -6331,7 +6464,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_lower.h
 ## begin gnulib module unictype/ctype-print
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_PRINT
-lib_libgnu_a_SOURCES += lib/unictype/ctype_print.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_print.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_print.h
@@ -6341,7 +6474,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_print.h
 ## begin gnulib module unictype/ctype-punct
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_PUNCT
-lib_libgnu_a_SOURCES += lib/unictype/ctype_punct.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_punct.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_punct.h
@@ -6351,7 +6484,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_punct.h
 ## begin gnulib module unictype/ctype-space
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_SPACE
-lib_libgnu_a_SOURCES += lib/unictype/ctype_space.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_space.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_space.h
@@ -6361,7 +6494,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_space.h
 ## begin gnulib module unictype/ctype-upper
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_UPPER
-lib_libgnu_a_SOURCES += lib/unictype/ctype_upper.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_upper.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_upper.h
@@ -6371,7 +6504,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_upper.h
 ## begin gnulib module unictype/ctype-xdigit
 
 if LIBUNISTRING_COMPILE_UNICTYPE_CTYPE_XDIGIT
-lib_libgnu_a_SOURCES += lib/unictype/ctype_xdigit.c
+lib_libcoreutils_a_SOURCES += lib/unictype/ctype_xdigit.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/unictype/ctype_xdigit.h
@@ -6401,7 +6534,7 @@ EXTRA_DIST += lib/uninorm.in.h
 ## begin gnulib module unistd
 
 BUILT_SOURCES += lib/unistd.h
-lib_libgnu_a_SOURCES += lib/unistd.c
+lib_libcoreutils_a_SOURCES += lib/unistd.c
 
 # We need the following in order to create an empty placeholder for
 # <unistd.h> when the system doesn't have one.
@@ -6619,7 +6752,7 @@ EXTRA_DIST += lib/unistd.in.h
 
 ## begin gnulib module unistd-safer
 
-lib_libgnu_a_SOURCES += lib/dup-safer.c lib/fd-safer.c lib/pipe-safer.c
+lib_libcoreutils_a_SOURCES += lib/dup-safer.c lib/fd-safer.c lib/pipe-safer.c
 
 EXTRA_DIST += lib/unistd--.h lib/unistd-safer.h
 
@@ -6642,7 +6775,7 @@ EXTRA_DIST += lib/unistr.in.h
 ## begin gnulib module unistr/u32-chr
 
 if LIBUNISTRING_COMPILE_UNISTR_U32_CHR
-lib_libgnu_a_SOURCES += lib/unistr/u32-chr.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u32-chr.c
 endif
 
 ## end   gnulib module unistr/u32-chr
@@ -6650,7 +6783,7 @@ endif
 ## begin gnulib module unistr/u32-cpy
 
 if LIBUNISTRING_COMPILE_UNISTR_U32_CPY
-lib_libgnu_a_SOURCES += lib/unistr/u32-cpy.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u32-cpy.c
 endif
 
 EXTRA_DIST += lib/unistr/u-cpy.h
@@ -6660,7 +6793,7 @@ EXTRA_DIST += lib/unistr/u-cpy.h
 ## begin gnulib module unistr/u32-pcpy
 
 if LIBUNISTRING_COMPILE_UNISTR_U32_PCPY
-lib_libgnu_a_SOURCES += lib/unistr/u32-pcpy.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u32-pcpy.c
 endif
 
 EXTRA_DIST += lib/unistr/u-pcpy.h
@@ -6670,7 +6803,7 @@ EXTRA_DIST += lib/unistr/u-pcpy.h
 ## begin gnulib module unistr/u32-strcat
 
 if LIBUNISTRING_COMPILE_UNISTR_U32_STRCAT
-lib_libgnu_a_SOURCES += lib/unistr/u32-strcat.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u32-strcat.c
 endif
 
 EXTRA_DIST += lib/unistr/u-strcat.h
@@ -6680,7 +6813,7 @@ EXTRA_DIST += lib/unistr/u-strcat.h
 ## begin gnulib module unistr/u32-strlen
 
 if LIBUNISTRING_COMPILE_UNISTR_U32_STRLEN
-lib_libgnu_a_SOURCES += lib/unistr/u32-strlen.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u32-strlen.c
 endif
 
 EXTRA_DIST += lib/unistr/u-strlen.h
@@ -6690,7 +6823,7 @@ EXTRA_DIST += lib/unistr/u-strlen.h
 ## begin gnulib module unistr/u8-mbtoucr
 
 if LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR
-lib_libgnu_a_SOURCES += lib/unistr/u8-mbtoucr.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u8-mbtoucr.c
 endif
 
 ## end   gnulib module unistr/u8-mbtoucr
@@ -6698,7 +6831,7 @@ endif
 ## begin gnulib module unistr/u8-uctomb
 
 if LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB
-lib_libgnu_a_SOURCES += lib/unistr/u8-uctomb.c lib/unistr/u8-uctomb-aux.c
+lib_libcoreutils_a_SOURCES += lib/unistr/u8-uctomb.c lib/unistr/u8-uctomb-aux.c
 endif
 
 ## end   gnulib module unistr/u8-uctomb
@@ -6734,7 +6867,7 @@ EXTRA_DIST += lib/localcharset.h lib/uniwidth.in.h
 ## begin gnulib module uniwidth/width
 
 if LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH
-lib_libgnu_a_SOURCES += lib/uniwidth/width.c
+lib_libcoreutils_a_SOURCES += lib/uniwidth/width.c
 endif
 
 EXTRA_DIST += lib/unictype/bitmap.h lib/uniwidth/cjk.h lib/uniwidth/width0.h lib/uniwidth/width2.h
@@ -6744,7 +6877,7 @@ EXTRA_DIST += lib/unictype/bitmap.h lib/uniwidth/cjk.h lib/uniwidth/width0.h lib
 ## begin gnulib module unlink
 
 if GL_COND_OBJ_UNLINK
-lib_libgnu_a_SOURCES += lib/unlink.c
+lib_libcoreutils_a_SOURCES += lib/unlink.c
 endif
 
 ## end   gnulib module unlink
@@ -6752,18 +6885,18 @@ endif
 ## begin gnulib module unlinkat
 
 if GL_COND_OBJ_UNLINKAT
-lib_libgnu_a_SOURCES += lib/unlinkat.c
+lib_libcoreutils_a_SOURCES += lib/unlinkat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module unlinkat
 
 ## begin gnulib module unlinkdir
 
-lib_libgnu_a_SOURCES += lib/unlinkdir.c
+lib_libcoreutils_a_SOURCES += lib/unlinkdir.c
 
 EXTRA_DIST += lib/unlinkdir.h
 
@@ -6779,7 +6912,7 @@ EXTRA_DIST += lib/unlocked-io.h
 ## begin gnulib module unsetenv
 
 if GL_COND_OBJ_UNSETENV
-lib_libgnu_a_SOURCES += lib/unsetenv.c
+lib_libcoreutils_a_SOURCES += lib/unsetenv.c
 endif
 
 ## end   gnulib module unsetenv
@@ -6800,7 +6933,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free
 
 ## begin gnulib module userspec
 
-lib_libgnu_a_SOURCES += lib/userspec.c
+lib_libcoreutils_a_SOURCES += lib/userspec.c
 
 EXTRA_DIST += lib/userspec.h
 
@@ -6809,7 +6942,7 @@ EXTRA_DIST += lib/userspec.h
 ## begin gnulib module utime
 
 if GL_COND_OBJ_UTIME
-lib_libgnu_a_SOURCES += lib/utime.c
+lib_libcoreutils_a_SOURCES += lib/utime.c
 endif
 
 ## end   gnulib module utime
@@ -6846,7 +6979,7 @@ EXTRA_DIST += lib/utime.in.h
 
 ## begin gnulib module utimecmp
 
-lib_libgnu_a_SOURCES += lib/utimecmp.c
+lib_libcoreutils_a_SOURCES += lib/utimecmp.c
 
 EXTRA_DIST += lib/utimecmp.h
 
@@ -6854,7 +6987,7 @@ EXTRA_DIST += lib/utimecmp.h
 
 ## begin gnulib module utimens
 
-lib_libgnu_a_SOURCES += lib/utimens.c
+lib_libcoreutils_a_SOURCES += lib/utimens.c
 
 EXTRA_DIST += lib/utimens.h
 
@@ -6863,12 +6996,12 @@ EXTRA_DIST += lib/utimens.h
 ## begin gnulib module utimensat
 
 if GL_COND_OBJ_UTIMENSAT
-lib_libgnu_a_SOURCES += lib/utimensat.c
+lib_libcoreutils_a_SOURCES += lib/utimensat.c
 endif
 
 EXTRA_DIST += lib/at-func.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/at-func.c
 
 ## end   gnulib module utimensat
 
@@ -6877,7 +7010,7 @@ EXTRA_lib_libgnu_a_SOURCES += lib/at-func.c
 
 EXTRA_DIST += lib/asnprintf.c lib/float+.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h lib/vasnprintf.c lib/vasnprintf.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/asnprintf.c lib/printf-args.c lib/printf-parse.c lib/vasnprintf.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/asnprintf.c lib/printf-args.c lib/printf-parse.c lib/vasnprintf.c
 
 ## end   gnulib module vasnprintf
 
@@ -6886,7 +7019,7 @@ EXTRA_lib_libgnu_a_SOURCES += lib/asnprintf.c lib/printf-args.c lib/printf-parse
 
 EXTRA_DIST += lib/asprintf.c lib/vasprintf.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/asprintf.c lib/vasprintf.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/asprintf.c lib/vasprintf.c
 
 ## end   gnulib module vasprintf
 
@@ -6906,19 +7039,19 @@ EXTRA_DIST += lib/verify.h
 
 ## begin gnulib module verror
 
-lib_libgnu_a_SOURCES += lib/verror.h lib/verror.c
+lib_libcoreutils_a_SOURCES += lib/verror.h lib/verror.c
 
 ## end   gnulib module verror
 
 ## begin gnulib module version-etc
 
-lib_libgnu_a_SOURCES += lib/version-etc.h lib/version-etc.c
+lib_libcoreutils_a_SOURCES += lib/version-etc.h lib/version-etc.c
 
 ## end   gnulib module version-etc
 
 ## begin gnulib module version-etc-fsf
 
-lib_libgnu_a_SOURCES += lib/version-etc-fsf.c
+lib_libcoreutils_a_SOURCES += lib/version-etc-fsf.c
 
 ## end   gnulib module version-etc-fsf
 
@@ -6927,7 +7060,7 @@ lib_libgnu_a_SOURCES += lib/version-etc-fsf.c
 
 EXTRA_DIST += lib/vfprintf.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/vfprintf.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/vfprintf.c
 
 ## end   gnulib module vfprintf-posix
 
@@ -6936,7 +7069,7 @@ EXTRA_lib_libgnu_a_SOURCES += lib/vfprintf.c
 
 EXTRA_DIST += lib/vprintf.c
 
-EXTRA_lib_libgnu_a_SOURCES += lib/vprintf.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/vprintf.c
 
 ## end   gnulib module vprintf-posix
 
@@ -7086,7 +7219,7 @@ EXTRA_DIST += lib/wchar.in.h
 ## begin gnulib module wcrtomb
 
 if GL_COND_OBJ_WCRTOMB
-lib_libgnu_a_SOURCES += lib/wcrtomb.c
+lib_libcoreutils_a_SOURCES += lib/wcrtomb.c
 endif
 
 ## end   gnulib module wcrtomb
@@ -7094,7 +7227,7 @@ endif
 ## begin gnulib module wctype
 
 if GL_COND_OBJ_WCTYPE
-lib_libgnu_a_SOURCES += lib/wctype.c
+lib_libcoreutils_a_SOURCES += lib/wctype.c
 endif
 
 EXTRA_DIST += lib/wctype-impl.h
@@ -7104,7 +7237,7 @@ EXTRA_DIST += lib/wctype-impl.h
 ## begin gnulib module wctype-h
 
 BUILT_SOURCES += lib/wctype.h
-lib_libgnu_a_SOURCES += lib/wctype-h.c
+lib_libcoreutils_a_SOURCES += lib/wctype-h.c
 
 # We need the following in order to create <wctype.h> when the system
 # doesn't have one that works with the given compiler.
@@ -7154,7 +7287,7 @@ EXTRA_DIST += lib/wctype.in.h
 ## begin gnulib module wcwidth
 
 if GL_COND_OBJ_WCWIDTH
-lib_libgnu_a_SOURCES += lib/wcwidth.c
+lib_libcoreutils_a_SOURCES += lib/wcwidth.c
 endif
 
 ## end   gnulib module wcwidth
@@ -7162,7 +7295,7 @@ endif
 ## begin gnulib module windows-cond
 
 if GL_COND_OBJ_WINDOWS_COND
-lib_libgnu_a_SOURCES += lib/windows-cond.c
+lib_libcoreutils_a_SOURCES += lib/windows-cond.c
 endif
 
 EXTRA_DIST += lib/windows-cond.h lib/windows-initguard.h
@@ -7172,7 +7305,7 @@ EXTRA_DIST += lib/windows-cond.h lib/windows-initguard.h
 ## begin gnulib module windows-mutex
 
 if GL_COND_OBJ_WINDOWS_MUTEX
-lib_libgnu_a_SOURCES += lib/windows-mutex.c
+lib_libcoreutils_a_SOURCES += lib/windows-mutex.c
 endif
 
 EXTRA_DIST += lib/windows-initguard.h lib/windows-mutex.h
@@ -7182,7 +7315,7 @@ EXTRA_DIST += lib/windows-initguard.h lib/windows-mutex.h
 ## begin gnulib module windows-once
 
 if GL_COND_OBJ_WINDOWS_ONCE
-lib_libgnu_a_SOURCES += lib/windows-once.c
+lib_libcoreutils_a_SOURCES += lib/windows-once.c
 endif
 
 EXTRA_DIST += lib/windows-once.h
@@ -7192,7 +7325,7 @@ EXTRA_DIST += lib/windows-once.h
 ## begin gnulib module windows-recmutex
 
 if GL_COND_OBJ_WINDOWS_RECMUTEX
-lib_libgnu_a_SOURCES += lib/windows-recmutex.c
+lib_libcoreutils_a_SOURCES += lib/windows-recmutex.c
 endif
 
 EXTRA_DIST += lib/windows-initguard.h lib/windows-recmutex.h
@@ -7202,7 +7335,7 @@ EXTRA_DIST += lib/windows-initguard.h lib/windows-recmutex.h
 ## begin gnulib module windows-rwlock
 
 if GL_COND_OBJ_WINDOWS_RWLOCK
-lib_libgnu_a_SOURCES += lib/windows-rwlock.c
+lib_libcoreutils_a_SOURCES += lib/windows-rwlock.c
 endif
 
 EXTRA_DIST += lib/windows-initguard.h lib/windows-rwlock.h
@@ -7212,7 +7345,7 @@ EXTRA_DIST += lib/windows-initguard.h lib/windows-rwlock.h
 ## begin gnulib module windows-thread
 
 if GL_COND_OBJ_WINDOWS_THREAD
-lib_libgnu_a_SOURCES += lib/windows-thread.c
+lib_libcoreutils_a_SOURCES += lib/windows-thread.c
 endif
 
 EXTRA_DIST += lib/windows-thread.h
@@ -7222,7 +7355,7 @@ EXTRA_DIST += lib/windows-thread.h
 ## begin gnulib module windows-timedmutex
 
 if GL_COND_OBJ_WINDOWS_TIMEDMUTEX
-lib_libgnu_a_SOURCES += lib/windows-timedmutex.c
+lib_libcoreutils_a_SOURCES += lib/windows-timedmutex.c
 endif
 
 EXTRA_DIST += lib/windows-initguard.h lib/windows-timedmutex.h
@@ -7232,7 +7365,7 @@ EXTRA_DIST += lib/windows-initguard.h lib/windows-timedmutex.h
 ## begin gnulib module windows-timedrecmutex
 
 if GL_COND_OBJ_WINDOWS_TIMEDRECMUTEX
-lib_libgnu_a_SOURCES += lib/windows-timedrecmutex.c
+lib_libcoreutils_a_SOURCES += lib/windows-timedrecmutex.c
 endif
 
 EXTRA_DIST += lib/windows-initguard.h lib/windows-timedrecmutex.h
@@ -7242,7 +7375,7 @@ EXTRA_DIST += lib/windows-initguard.h lib/windows-timedrecmutex.h
 ## begin gnulib module windows-tls
 
 if GL_COND_OBJ_WINDOWS_TLS
-lib_libgnu_a_SOURCES += lib/windows-tls.c
+lib_libcoreutils_a_SOURCES += lib/windows-tls.c
 endif
 
 EXTRA_DIST += lib/windows-tls.h
@@ -7252,7 +7385,7 @@ EXTRA_DIST += lib/windows-tls.h
 ## begin gnulib module wmemchr
 
 if GL_COND_OBJ_WMEMCHR
-lib_libgnu_a_SOURCES += lib/wmemchr.c
+lib_libcoreutils_a_SOURCES += lib/wmemchr.c
 endif
 
 EXTRA_DIST += lib/wmemchr-impl.h
@@ -7262,7 +7395,7 @@ EXTRA_DIST += lib/wmemchr-impl.h
 ## begin gnulib module wmempcpy
 
 if GL_COND_OBJ_WMEMPCPY
-lib_libgnu_a_SOURCES += lib/wmempcpy.c
+lib_libcoreutils_a_SOURCES += lib/wmempcpy.c
 endif
 
 ## end   gnulib module wmempcpy
@@ -7270,14 +7403,14 @@ endif
 ## begin gnulib module write
 
 if GL_COND_OBJ_WRITE
-lib_libgnu_a_SOURCES += lib/write.c
+lib_libcoreutils_a_SOURCES += lib/write.c
 endif
 
 ## end   gnulib module write
 
 ## begin gnulib module write-any-file
 
-lib_libgnu_a_SOURCES += lib/write-any-file.c
+lib_libcoreutils_a_SOURCES += lib/write-any-file.c
 
 EXTRA_DIST += lib/write-any-file.h
 
@@ -7285,13 +7418,13 @@ EXTRA_DIST += lib/write-any-file.h
 
 ## begin gnulib module xalignalloc
 
-lib_libgnu_a_SOURCES += lib/xalignalloc.c
+lib_libcoreutils_a_SOURCES += lib/xalignalloc.c
 
 ## end   gnulib module xalignalloc
 
 ## begin gnulib module xalloc
 
-lib_libgnu_a_SOURCES += lib/xmalloc.c
+lib_libcoreutils_a_SOURCES += lib/xmalloc.c
 
 EXTRA_DIST += lib/xalloc.h
 
@@ -7299,7 +7432,7 @@ EXTRA_DIST += lib/xalloc.h
 
 ## begin gnulib module xalloc-die
 
-lib_libgnu_a_SOURCES += lib/xalloc-die.c
+lib_libcoreutils_a_SOURCES += lib/xalloc-die.c
 
 EXTRA_DIST += lib/xalloc.h
 
@@ -7314,13 +7447,29 @@ EXTRA_DIST += lib/xalloc-oversized.h
 
 ## begin gnulib module xbinary-io
 
-lib_libgnu_a_SOURCES += lib/xbinary-io.h lib/xbinary-io.c
+lib_libcoreutils_a_SOURCES += lib/xbinary-io.h lib/xbinary-io.c
 
 ## end   gnulib module xbinary-io
 
+## begin gnulib module xdectoint
+
+lib_libcoreutils_a_SOURCES += lib/xdectoimax.c lib/xdectoumax.c
+
+EXTRA_DIST += lib/xdectoint.c lib/xdectoint.h
+
+EXTRA_lib_libcoreutils_a_SOURCES += lib/xdectoint.c
+
+## end   gnulib module xdectoint
+
+## begin gnulib module xfts
+
+lib_libcoreutils_a_SOURCES += lib/xfts.c lib/xfts.h
+
+## end   gnulib module xfts
+
 ## begin gnulib module xgetcwd
 
-lib_libgnu_a_SOURCES += lib/xgetcwd.c
+lib_libcoreutils_a_SOURCES += lib/xgetcwd.c
 
 EXTRA_DIST += lib/xgetcwd.h
 
@@ -7328,13 +7477,13 @@ EXTRA_DIST += lib/xgetcwd.h
 
 ## begin gnulib module xgetgroups
 
-lib_libgnu_a_SOURCES += lib/xgetgroups.c
+lib_libcoreutils_a_SOURCES += lib/xgetgroups.c
 
 ## end   gnulib module xgetgroups
 
 ## begin gnulib module xgethostname
 
-lib_libgnu_a_SOURCES += lib/xgethostname.h lib/xgethostname.c
+lib_libcoreutils_a_SOURCES += lib/xgethostname.h lib/xgethostname.c
 
 EXTRA_DIST += lib/xgetaname-impl.h
 
@@ -7342,13 +7491,13 @@ EXTRA_DIST += lib/xgetaname-impl.h
 
 ## begin gnulib module xmemcoll
 
-lib_libgnu_a_SOURCES += lib/xmemcoll.h lib/xmemcoll.c
+lib_libcoreutils_a_SOURCES += lib/xmemcoll.h lib/xmemcoll.c
 
 ## end   gnulib module xmemcoll
 
 ## begin gnulib module xnanosleep
 
-lib_libgnu_a_SOURCES += lib/xnanosleep.c
+lib_libcoreutils_a_SOURCES += lib/xnanosleep.c
 
 EXTRA_DIST += lib/xnanosleep.h
 
@@ -7356,13 +7505,13 @@ EXTRA_DIST += lib/xnanosleep.h
 
 ## begin gnulib module xprintf
 
-lib_libgnu_a_SOURCES += lib/xprintf.h lib/xprintf.c
+lib_libcoreutils_a_SOURCES += lib/xprintf.h lib/xprintf.c
 
 ## end   gnulib module xprintf
 
 ## begin gnulib module xreadlink
 
-lib_libgnu_a_SOURCES += lib/xreadlink.c
+lib_libcoreutils_a_SOURCES += lib/xreadlink.c
 
 EXTRA_DIST += lib/xreadlink.h
 
@@ -7370,13 +7519,13 @@ EXTRA_DIST += lib/xreadlink.h
 
 ## begin gnulib module xsize
 
-lib_libgnu_a_SOURCES += lib/xsize.h lib/xsize.c
+lib_libcoreutils_a_SOURCES += lib/xsize.h lib/xsize.c
 
 ## end   gnulib module xsize
 
 ## begin gnulib module xstrtod
 
-lib_libgnu_a_SOURCES += lib/xstrtod.c
+lib_libcoreutils_a_SOURCES += lib/xstrtod.c
 
 EXTRA_DIST += lib/xstrtod.h
 
@@ -7384,13 +7533,13 @@ EXTRA_DIST += lib/xstrtod.h
 
 ## begin gnulib module xstrtoimax
 
-lib_libgnu_a_SOURCES += lib/xstrtoimax.c
+lib_libcoreutils_a_SOURCES += lib/xstrtoimax.c
 
 ## end   gnulib module xstrtoimax
 
 ## begin gnulib module xstrtol
 
-lib_libgnu_a_SOURCES += lib/xstrtol.c lib/xstrtoul.c
+lib_libcoreutils_a_SOURCES += lib/xstrtol.c lib/xstrtoul.c
 
 EXTRA_DIST += lib/xstrtol.h
 
@@ -7398,7 +7547,7 @@ EXTRA_DIST += lib/xstrtol.h
 
 ## begin gnulib module xstrtol-error
 
-lib_libgnu_a_SOURCES += lib/xstrtol-error.c
+lib_libcoreutils_a_SOURCES += lib/xstrtol-error.c
 
 EXTRA_DIST += lib/xstrtol-error.h
 
@@ -7406,23 +7555,23 @@ EXTRA_DIST += lib/xstrtol-error.h
 
 ## begin gnulib module xstrtold
 
-lib_libgnu_a_SOURCES += lib/xstrtold.c
+lib_libcoreutils_a_SOURCES += lib/xstrtold.c
 
 EXTRA_DIST += lib/xstrtod.c lib/xstrtod.h
 
-EXTRA_lib_libgnu_a_SOURCES += lib/xstrtod.c
+EXTRA_lib_libcoreutils_a_SOURCES += lib/xstrtod.c
 
 ## end   gnulib module xstrtold
 
 ## begin gnulib module xstrtoumax
 
-lib_libgnu_a_SOURCES += lib/xstrtoumax.c
+lib_libcoreutils_a_SOURCES += lib/xstrtoumax.c
 
 ## end   gnulib module xstrtoumax
 
 ## begin gnulib module xvasprintf
 
-lib_libgnu_a_SOURCES += lib/xvasprintf.h lib/xvasprintf.c lib/xasprintf.c
+lib_libcoreutils_a_SOURCES += lib/xvasprintf.h lib/xvasprintf.c lib/xasprintf.c
 
 EXTRA_DIST += lib/xalloc.h
 
@@ -7430,7 +7579,7 @@ EXTRA_DIST += lib/xalloc.h
 
 ## begin gnulib module yesno
 
-lib_libgnu_a_SOURCES += lib/yesno.c
+lib_libcoreutils_a_SOURCES += lib/yesno.c
 
 EXTRA_DIST += lib/yesno.h
 
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/heap.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/heap.c
new file mode 100644 (file)
index 0000000..6c3cb71
--- /dev/null
@@ -0,0 +1,151 @@
+/* Barebones heap implementation supporting only insert and pop.
+
+   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Full implementation: GDSL (http://gna.org/projects/gdsl/) by Nicolas
+   Darnis <ndarnis@free.fr>. */
+
+#include <config.h>
+
+#include "heap.h"
+#include "stdlib--.h"
+#include "xalloc.h"
+
+static int heap_default_compare (void const *, void const *);
+static size_t heapify_down (void **, size_t, size_t,
+                            int (*) (void const *, void const *));
+static void heapify_up (void **, size_t,
+                        int (*) (void const *, void const *));
+
+struct heap
+{
+  void **array;     /* array[0] is not used */
+  size_t capacity;  /* Array size */
+  size_t count;     /* Used as index to last element. Also is num of items. */
+  int (*compare) (void const *, void const *);
+};
+
+/* Allocate memory for the heap. */
+
+struct heap *
+heap_alloc (int (*compare) (void const *, void const *), size_t n_reserve)
+{
+  struct heap *heap = xmalloc (sizeof *heap);
+
+  if (n_reserve == 0)
+    n_reserve = 1;
+
+  heap->array = xnmalloc (n_reserve, sizeof *(heap->array));
+
+  heap->array[0] = nullptr;
+  heap->capacity = n_reserve;
+  heap->count = 0;
+  heap->compare = compare ? compare : heap_default_compare;
+
+  return heap;
+}
+
+
+static int
+heap_default_compare (void const *a, void const *b)
+{
+  return 0;
+}
+
+
+void
+heap_free (struct heap *heap)
+{
+  free (heap->array);
+  free (heap);
+}
+
+/* Insert element into heap. */
+
+int
+heap_insert (struct heap *heap, void *item)
+{
+  if (heap->capacity - 1 <= heap->count)
+    heap->array = x2nrealloc (heap->array, &heap->capacity,
+                              sizeof *(heap->array));
+
+  heap->array[++heap->count] = item;
+  heapify_up (heap->array, heap->count, heap->compare);
+
+  return 0;
+}
+
+/* Pop top element off heap. */
+
+void *
+heap_remove_top (struct heap *heap)
+{
+  void *top;
+
+  if (heap->count == 0)
+    return nullptr;
+
+  top = heap->array[1];
+  heap->array[1] = heap->array[heap->count--];
+  heapify_down (heap->array, heap->count, 1, heap->compare);
+
+  return top;
+}
+
+/* Move element down into appropriate position in heap. */
+
+static size_t
+heapify_down (void **array, size_t count, size_t initial,
+              int (*compare) (void const *, void const *))
+{
+  void *element = array[initial];
+
+  size_t parent = initial;
+  while (parent <= count / 2)
+    {
+      size_t child = 2 * parent;
+
+      if (child < count && compare (array[child], array[child + 1]) < 0)
+        child++;
+
+      if (compare (array[child], element) <= 0)
+        break;
+
+      array[parent] = array[child];
+      parent = child;
+    }
+
+  array[parent] = element;
+  return parent;
+}
+
+/* Move element up into appropriate position in heap. */
+
+static void
+heapify_up (void **array, size_t count,
+            int (*compare) (void const *, void const *))
+{
+  size_t k = count;
+  void *new_element = array[k];
+
+  while (k != 1 && compare (array[k / 2], new_element) <= 0)
+    {
+      array[k] = array[k / 2];
+      k /= 2;
+    }
+
+  array[k] = new_element;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/heap.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/heap.h
new file mode 100644 (file)
index 0000000..9ae9308
--- /dev/null
@@ -0,0 +1,32 @@
+/* Barebones heap implementation supporting only insert and pop.
+
+   Copyright (C) 2010-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Full implementation: GDSL (http://gna.org/projects/gdsl/) by Nicolas
+   Darnis <ndarnis@free.fr>. Adapted by Gene Auyeung. */
+
+#include <stddef.h>
+
+struct heap;
+
+void heap_free (struct heap *) _GL_ATTRIBUTE_NONNULL ();
+
+struct heap *heap_alloc (int (*) (void const *, void const *), size_t)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (heap_free, 1)
+  _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+int heap_insert (struct heap *heap, void *item) _GL_ATTRIBUTE_NONNULL ();
+void *heap_remove_top (struct heap *heap) _GL_ATTRIBUTE_NONNULL ();
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/malloc/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/malloc/.gitignore
deleted file mode 100644 (file)
index 90729ed..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/dynarray-skeleton.c
-/dynarray.h
-/dynarray_at_failure.c
-/dynarray_emplace_enlarge.c
-/dynarray_finalize.c
-/dynarray_resize.c
-/dynarray_resize_clear.c
-/scratch_buffer.h
-/scratch_buffer_grow.c
-/scratch_buffer_grow_preserve.c
-/scratch_buffer_set_array_size.c
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/rand-isaac.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/rand-isaac.c
new file mode 100644 (file)
index 0000000..fe4cecf
--- /dev/null
@@ -0,0 +1,273 @@
+/* Bob Jenkins's cryptographic random number generators, ISAAC and ISAAC64.
+
+   Copyright (C) 1999-2023 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Colin Plumb.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+   Written by Colin Plumb and Paul Eggert.  */
+
+/*
+ * --------------------------------------------------------------------
+ * We need a source of random numbers for some data.
+ * Cryptographically secure is desirable, but it's not life-or-death
+ * so I can be a little bit experimental in the choice of RNGs here.
+ *
+ * This generator is based somewhat on RC4, but has analysis
+ * <https://burtleburtle.net/bob/rand/isaacafa.html>
+ * pointing to it actually being better.  I like it because it's nice
+ * and fast, and because the author did good work analyzing it.
+ * --------------------------------------------------------------------
+ */
+#include <config.h>
+
+#include "rand-isaac.h"
+
+#include <limits.h>
+#include <string.h>
+
+/* If the platform supports unaligned access,
+   then don't have -fsanitize=undefined warn about it.  */
+#undef ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED
+#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) \
+    || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
+# define ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED /* empty */
+#else
+# define ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED \
+  __attribute__ ((__no_sanitize_undefined__))
+#endif
+
+/* A if 32-bit ISAAC, B if 64-bit.  This is a macro, not an inline
+   function, to prevent undefined behavior if the unused argument
+   shifts by more than a word width.  */
+#define IF32(a, b) (ISAAC_BITS == 32 ? (a) : (b))
+
+/* Discard bits outside the desired range.  On typical machines, any
+   decent compiler should optimize this function call away to nothing.
+   But machines with pad bits in integers may need to do more work.  */
+static inline isaac_word
+just (isaac_word a)
+{
+  isaac_word desired_bits = ((isaac_word) 1 << 1 << (ISAAC_BITS - 1)) - 1;
+  return a & desired_bits;
+}
+
+/* The index operation.  */
+static inline isaac_word
+ind (isaac_word const *m, isaac_word x)
+{
+  if (sizeof *m * CHAR_BIT == ISAAC_BITS)
+    {
+      /* The typical case, where words are exactly the right size.
+         Optimize this to a mask, an addition, and an indirect
+         load.  */
+      void const *void_m = m;
+      char const *base_p = void_m;
+      void const *word_p = base_p + (x & ((ISAAC_WORDS - 1) * sizeof *m));
+      isaac_word const *p = word_p;
+      return *p;
+    }
+  else
+    {
+      /* Atypical machines need more work.  */
+      return m[(x / (ISAAC_BITS / CHAR_BIT)) & (ISAAC_WORDS - 1)];
+    }
+}
+
+/* Use and update *S to generate random data to fill RESULT.  */
+void ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED
+isaac_refill (struct isaac_state *s, isaac_word result[ISAAC_WORDS])
+{
+  /* Caches of S->a and S->b.  */
+  isaac_word a = s->a;
+  isaac_word b = s->b + (++s->c);
+
+  /* Pointers into state array and into result.  */
+  isaac_word *m = s->m;
+  isaac_word *r = result;
+
+  enum { HALF = ISAAC_WORDS / 2 };
+
+  /* The central step.  S->m is the whole state array, while M is a
+     pointer to the current word.  OFF is the offset from M to the
+     word ISAAC_WORDS/2 words away in the SM array, i.e., +/-
+     ISAAC_WORDS/2.  A and B are state variables, and R the result.
+     This updates A, B, M[I], and R[I].  */
+  #define ISAAC_STEP(i, off, mix)                             \
+    {                                                         \
+      isaac_word x, y;                                        \
+      a = (IF32 (a, 0) ^ (mix)) + m[off + (i)];               \
+      x = m[i];                                               \
+      m[i] = y = ind (s->m, x) + a + b;                       \
+      r[i] = b = just (ind (s->m, y >> ISAAC_WORDS_LOG) + x); \
+    }
+
+  do
+    {
+      ISAAC_STEP (0, HALF, IF32 (      a  << 13, ~ (a ^ (a << 21))));
+      ISAAC_STEP (1, HALF, IF32 (just (a) >>  6, a ^ (just (a) >>  5)));
+      ISAAC_STEP (2, HALF, IF32 (      a  <<  2, a ^ (      a  << 12)));
+      ISAAC_STEP (3, HALF, IF32 (just (a) >> 16, a ^ (just (a) >> 33)));
+      r += 4;
+    }
+  while ((m += 4) < s->m + HALF);
+
+  do
+    {
+      ISAAC_STEP (0, -HALF, IF32 (      a  << 13, ~ (a ^ (a << 21))));
+      ISAAC_STEP (1, -HALF, IF32 (just (a) >>  6, a ^ (just (a) >>  5)));
+      ISAAC_STEP (2, -HALF, IF32 (      a  <<  2, a ^ (      a  << 12)));
+      ISAAC_STEP (3, -HALF, IF32 (just (a) >> 16, a ^ (just (a) >> 33)));
+      r += 4;
+    }
+  while ((m += 4) < s->m + ISAAC_WORDS);
+
+  s->a = a;
+  s->b = b;
+}
+
+/*
+ * The basic seed-scrambling step for initialization, based on Bob
+ * Jenkins' 256-bit hash.
+ */
+#if ISAAC_BITS == 32
+ #define mix(a, b, c, d, e, f, g, h)       \
+    {                                      \
+              a ^=       b  << 11; d += a; \
+      b += c; b ^= just (c) >>  2; e += b; \
+      c += d; c ^=       d  <<  8; f += c; \
+      d += e; d ^= just (e) >> 16; g += d; \
+      e += f; e ^=       f  << 10; h += e; \
+      f += g; f ^= just (g) >>  4; a += f; \
+      g += h; g ^=       h  <<  8; b += g; \
+      h += a; h ^= just (a) >>  9; c += h; \
+      a += b;                              \
+    }
+#else
+ #define mix(a, b, c, d, e, f, g, h)       \
+    {                                      \
+      a -= e; f ^= just (h) >>  9; h += a; \
+      b -= f; g ^=       a  <<  9; a += b; \
+      c -= g; h ^= just (b) >> 23; b += c; \
+      d -= h; a ^=       c  << 15; c += d; \
+      e -= a; b ^= just (d) >> 14; d += e; \
+      f -= b; c ^=       e  << 20; e += f; \
+      g -= c; d ^= just (f) >> 17; f += g; \
+      h -= d; e ^=       g  << 14; g += h; \
+    }
+#endif
+
+
+/* The basic ISAAC initialization pass.  */
+#define ISAAC_MIX(s, a, b, c, d, e, f, g, h, seed) \
+  {                                                \
+    int i;                                         \
+                                                   \
+    for (i = 0; i < ISAAC_WORDS; i += 8)           \
+      {                                            \
+        a += seed[i];                              \
+        b += seed[i + 1];                          \
+        c += seed[i + 2];                          \
+        d += seed[i + 3];                          \
+        e += seed[i + 4];                          \
+        f += seed[i + 5];                          \
+        g += seed[i + 6];                          \
+        h += seed[i + 7];                          \
+        mix (a, b, c, d, e, f, g, h);              \
+        s->m[i] = a;                               \
+        s->m[i + 1] = b;                           \
+        s->m[i + 2] = c;                           \
+        s->m[i + 3] = d;                           \
+        s->m[i + 4] = e;                           \
+        s->m[i + 5] = f;                           \
+        s->m[i + 6] = g;                           \
+        s->m[i + 7] = h;                           \
+      }                                            \
+  }
+
+#if 0 /* Provided for reference only; not used in this code */
+/*
+ * Initialize the ISAAC RNG with the given seed material.
+ * Its size MUST be a multiple of ISAAC_BYTES, and may be
+ * stored in the s->m array.
+ *
+ * This is a generalization of the original ISAAC initialization code
+ * to support larger seed sizes.  For seed sizes of 0 and ISAAC_BYTES,
+ * it is identical.
+ */
+static void
+isaac_init (struct isaac_state *s, isaac_word const *seed, size_t seedsize)
+{
+  isaac_word a, b, c, d, e, f, g, h;
+
+  a = b = c = d = e = f = g = h =          /* the golden ratio */
+    IF32 (UINT32_C (0x9e3779b9), UINT64_C (0x9e3779b97f4a7c13));
+  for (int i = 0; i < 4; i++)              /* scramble it */
+    mix (a, b, c, d, e, f, g, h);
+  s->a = s->b = s->c = 0;
+
+  if (seedsize)
+    {
+      /* First pass (as in reference ISAAC code) */
+      ISAAC_MIX (s, a, b, c, d, e, f, g, h, seed);
+      /* Second and subsequent passes (extension to ISAAC) */
+      while (seedsize -= ISAAC_BYTES)
+        {
+          seed += ISAAC_WORDS;
+          for (i = 0; i < ISAAC_WORDS; i++)
+            s->m[i] += seed[i];
+          ISAAC_MIX (s, a, b, c, d, e, f, g, h, s->m);
+        }
+    }
+  else
+    {
+      /* The no seed case (as in reference ISAAC code) */
+      for (i = 0; i < ISAAC_WORDS; i++)
+        s->m[i] = 0;
+    }
+
+  /* Final pass */
+  ISAAC_MIX (s, a, b, c, d, e, f, g, h, s->m);
+}
+#endif
+
+/* Initialize *S to a somewhat-random value, derived from a seed
+   stored in S->m.  */
+void
+isaac_seed (struct isaac_state *s)
+{
+  isaac_word a = IF32 (UINT32_C (0x1367df5a), UINT64_C (0x647c4677a2884b7c));
+  isaac_word b = IF32 (UINT32_C (0x95d90059), UINT64_C (0xb9f8b322c73ac862));
+  isaac_word c = IF32 (UINT32_C (0xc3163e4b), UINT64_C (0x8c0ea5053d4712a0));
+  isaac_word d = IF32 (UINT32_C (0x0f421ad8), UINT64_C (0xb29b2e824a595524));
+  isaac_word e = IF32 (UINT32_C (0xd92a4a78), UINT64_C (0x82f053db8355e0ce));
+  isaac_word f = IF32 (UINT32_C (0xa51a3c49), UINT64_C (0x48fe4a0fa5a09315));
+  isaac_word g = IF32 (UINT32_C (0xc4efea1b), UINT64_C (0xae985bf2cbfc89ed));
+  isaac_word h = IF32 (UINT32_C (0x30609119), UINT64_C (0x98f5704f6c44c0ab));
+
+#if 0
+  /* The initialization of a through h is a precomputed form of: */
+  a = b = c = d = e = f = g = h =          /* the golden ratio */
+    IF32 (UINT32_C (0x9e3779b9), UINT64_C (0x9e3779b97f4a7c13));
+  for (int i = 0; i < 4; i++)              /* scramble it */
+    mix (a, b, c, d, e, f, g, h);
+#endif
+
+  /* Mix S->m so that every part of the seed affects every part of the
+     state.  */
+  ISAAC_MIX (s, a, b, c, d, e, f, g, h, s->m);
+  ISAAC_MIX (s, a, b, c, d, e, f, g, h, s->m);
+
+  s->a = s->b = s->c = 0;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/rand-isaac.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/rand-isaac.h
new file mode 100644 (file)
index 0000000..9857666
--- /dev/null
@@ -0,0 +1,66 @@
+/* Bob Jenkins's cryptographic random number generators, ISAAC and ISAAC64.
+
+   Copyright (C) 1999-2023 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Colin Plumb.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+   Written by Colin Plumb and Paul Eggert.  */
+
+#ifndef _GL_RAND_ISAAC_H
+#define _GL_RAND_ISAAC_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+/* Log base 2 of the number of useful bits in an ISAAC word.  It must
+   be either 5 or 6.  By default, this uses a value that should be
+   faster for this architecture.  */
+#ifndef ISAAC_BITS_LOG
+ #if SIZE_MAX >> 31 >> 31 < 3 /* SIZE_MAX < 2**64 - 1 */
+  #define ISAAC_BITS_LOG 5
+ #else
+  #define ISAAC_BITS_LOG 6
+ #endif
+#endif
+
+/* The number of bits in an ISAAC word.  */
+#define ISAAC_BITS (1 << ISAAC_BITS_LOG)
+
+#if ISAAC_BITS == 32
+  typedef uint_least32_t isaac_word;
+#else
+  typedef uint_least64_t isaac_word;
+#endif
+
+/* Size of the state tables to use.  ISAAC_WORDS_LOG should be at least 3,
+   and smaller values give less security.  */
+#define ISAAC_WORDS_LOG 8
+#define ISAAC_WORDS (1 << ISAAC_WORDS_LOG)
+#define ISAAC_BYTES (ISAAC_WORDS * sizeof (isaac_word))
+
+/* State variables for the random number generator.  The M member
+   should be seeded with nonce data before calling isaac_seed.  The
+   other members are private.  */
+struct isaac_state
+  {
+    isaac_word m[ISAAC_WORDS]; /* Main state array */
+    isaac_word a, b, c;                /* Extra variables */
+  };
+
+void isaac_seed (struct isaac_state *) _GL_ATTRIBUTE_NONNULL ();
+void isaac_refill (struct isaac_state *, isaac_word[ISAAC_WORDS])
+  _GL_ATTRIBUTE_NONNULL ();
+
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randint.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randint.c
new file mode 100644 (file)
index 0000000..fd5f7c3
--- /dev/null
@@ -0,0 +1,216 @@
+/* Generate random integers.
+
+   Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "randint.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#if TEST
+# include <inttypes.h>
+# include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+  randint i;
+  randint n = strtoumax (argv[1], nullptr, 10);
+  randint choices = strtoumax (argv[2], nullptr, 10);
+  char const *name = argv[3];
+  struct randint_source *ints = randint_all_new (name, SIZE_MAX);
+
+  for (i = 0; i < n; i++)
+    printf ("%ju\n", randint_choose (ints, choices));
+
+  return (randint_all_free (ints) == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
+}
+#endif
+
+
+#include "xalloc.h"
+
+/* A source of random data for generating random integers.  */
+struct randint_source
+{
+  /* The source of random bytes.  */
+  struct randread_source *source;
+
+  /* RANDNUM is a buffered random integer, whose information has not
+     yet been delivered to the caller.  It is uniformly distributed in
+     the range 0 <= RANDNUM <= RANDMAX.  If RANDMAX is zero, then
+     RANDNUM must be zero (and in some sense it is not really
+     "random").  */
+  randint randnum;
+  randint randmax;
+};
+
+/* Create a new randint_source from SOURCE.  */
+
+struct randint_source *
+randint_new (struct randread_source *source)
+{
+  struct randint_source *s = xmalloc (sizeof *s);
+  s->source = source;
+  s->randnum = s->randmax = 0;
+  return s;
+}
+
+/* Create a new randint_source by creating a randread_source from
+   NAME and ESTIMATED_BYTES.  Return nullptr (setting errno) if
+   unsuccessful.  */
+
+struct randint_source *
+randint_all_new (char const *name, size_t bytes_bound)
+{
+  struct randread_source *source = randread_new (name, bytes_bound);
+  return (source ? randint_new (source) : nullptr);
+}
+
+/* Return the random data source of *S.  */
+
+struct randread_source *
+randint_get_source (struct randint_source const *s)
+{
+  return s->source;
+}
+
+/* HUGE_BYTES is true on hosts hosts where randint and unsigned char
+   have the same width and where shifting by the word size therefore
+   has undefined behavior.  */
+enum { HUGE_BYTES = RANDINT_MAX == UCHAR_MAX };
+
+/* Return X shifted left by CHAR_BIT bits.  */
+static inline randint shift_left (randint x)
+{
+  return HUGE_BYTES ? 0 : x << CHAR_BIT;
+}
+
+
+/* Consume random data from *S to generate a random number in the range
+   0 .. GENMAX.  */
+
+randint
+randint_genmax (struct randint_source *s, randint genmax)
+{
+  struct randread_source *source = s->source;
+  randint randnum = s->randnum;
+  randint randmax = s->randmax;
+  randint choices = genmax + 1;
+
+  while (1)
+    {
+      if (randmax < genmax)
+        {
+          /* Calculate how many input bytes will be needed, and read
+             the bytes.  */
+
+          size_t i = 0;
+          randint rmax = randmax;
+          unsigned char buf[sizeof randnum];
+
+          do
+            {
+              rmax = shift_left (rmax) + UCHAR_MAX;
+              i++;
+            }
+          while (rmax < genmax);
+
+          randread (source, buf, i);
+
+          /* Increase RANDMAX by appending random bytes to RANDNUM and
+             UCHAR_MAX to RANDMAX until RANDMAX is no less than
+             GENMAX.  This may lose up to CHAR_BIT bits of information
+             if (HUGE_BYTES ? 0 : RANDINT_MAX >> CHAR_BIT) < GENMAX,
+             but it is not worth the programming hassle of saving
+             these bits since GENMAX is rarely that large in practice.  */
+
+          i = 0;
+
+          do
+            {
+              randnum = shift_left (randnum) + buf[i];
+              randmax = shift_left (randmax) + UCHAR_MAX;
+              i++;
+            }
+          while (randmax < genmax);
+        }
+
+      if (randmax == genmax)
+        {
+          s->randnum = s->randmax = 0;
+          return randnum;
+        }
+      else
+        {
+          /* GENMAX < RANDMAX, so attempt to generate a random number
+             by taking RANDNUM modulo GENMAX+1.  This will choose
+             fairly so long as RANDNUM falls within an integral
+             multiple of GENMAX+1; otherwise, LAST_USABLE_CHOICE < RANDNUM,
+             so discard this attempt and try again.
+
+             Since GENMAX cannot be RANDINT_MAX, CHOICES cannot be
+             zero and there is no need to worry about dividing by
+             zero.  */
+
+          randint excess_choices = randmax - genmax;
+          randint unusable_choices = excess_choices % choices;
+          randint last_usable_choice = randmax - unusable_choices;
+          randint reduced_randnum = randnum % choices;
+
+          if (randnum <= last_usable_choice)
+            {
+              s->randnum = randnum / choices;
+              s->randmax = excess_choices / choices;
+              return reduced_randnum;
+            }
+
+          /* Retry, but retain the randomness from the fact that RANDNUM fell
+             into the range LAST_USABLE_CHOICE+1 .. RANDMAX.  */
+          randnum = reduced_randnum;
+          randmax = unusable_choices - 1;
+        }
+    }
+}
+
+/* Clear *S so that it no longer contains undelivered random data.  */
+
+void
+randint_free (struct randint_source *s)
+{
+  explicit_bzero (s, sizeof *s);
+  free (s);
+}
+
+/* Likewise, but also clear the underlying randread object.  Return
+   0 if successful, -1 (setting errno) otherwise.  */
+
+int
+randint_all_free (struct randint_source *s)
+{
+  int r = randread_free (s->source);
+  int e = errno;
+  randint_free (s);
+  errno = e;
+  return r;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randint.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randint.h
new file mode 100644 (file)
index 0000000..1c774cf
--- /dev/null
@@ -0,0 +1,55 @@
+/* Generate random integers.
+
+   Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#ifndef RANDINT_H
+
+# define RANDINT_H 1
+
+# include <stdint.h>
+
+# include "randread.h"
+
+/* An unsigned integer type, used for random integers, and its maximum
+   value.  */
+typedef uintmax_t randint;
+# define RANDINT_MAX UINTMAX_MAX
+
+struct randint_source;
+
+void randint_free (struct randint_source *) _GL_ATTRIBUTE_NONNULL ();
+int randint_all_free (struct randint_source *) _GL_ATTRIBUTE_NONNULL ();
+struct randint_source *randint_new (struct randread_source *)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (randint_free, 1)
+  _GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_RETURNS_NONNULL;
+struct randint_source *randint_all_new (char const *, size_t)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (randint_all_free, 1);
+struct randread_source *randint_get_source (struct randint_source const *)
+  _GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_PURE;
+randint randint_genmax (struct randint_source *, randint genmax)
+  _GL_ATTRIBUTE_NONNULL ();
+
+/* Consume random data from *S to generate a random number in the range
+   0 .. CHOICES-1.  CHOICES must be nonzero.  */
+static inline randint
+randint_choose (struct randint_source *s, randint choices)
+{
+  return randint_genmax (s, choices - 1);
+}
+
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randperm.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randperm.c
new file mode 100644 (file)
index 0000000..d71f2cd
--- /dev/null
@@ -0,0 +1,242 @@
+/* Generate random permutations.
+
+   Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "randperm.h"
+
+#include <limits.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "attribute.h"
+#include "count-leading-zeros.h"
+#include "hash.h"
+#include "xalloc.h"
+
+/* Return the floor of the log base 2 of N.  If N is zero, return -1.  */
+
+ATTRIBUTE_CONST static int
+floor_lg (size_t n)
+{
+  static_assert (SIZE_WIDTH <= ULLONG_WIDTH);
+  return (n == 0 ? -1
+          : SIZE_WIDTH <= UINT_WIDTH
+          ? UINT_WIDTH - 1 - count_leading_zeros (n)
+          : SIZE_WIDTH <= ULONG_WIDTH
+          ? ULONG_WIDTH - 1 - count_leading_zeros_l (n)
+          : ULLONG_WIDTH - 1 - count_leading_zeros_ll (n));
+}
+
+/* Return an upper bound on the number of random bytes needed to
+   generate the first H elements of a random permutation of N
+   elements.  H must not exceed N.  */
+
+size_t
+randperm_bound (size_t h, size_t n)
+{
+  /* Upper bound on number of bits needed to generate the first number
+     of the permutation.  */
+  uintmax_t lg_n = floor_lg (n) + 1;
+
+  /* Upper bound on number of bits needed to generated the first H elements.  */
+  uintmax_t ar = lg_n * h;
+
+  /* Convert the bit count to a byte count.  */
+  size_t bound = (ar + CHAR_BIT - 1) / CHAR_BIT;
+
+  return bound;
+}
+
+/* Swap elements I and J in array V.  */
+
+static void
+swap (size_t *v, size_t i, size_t j)
+{
+  size_t t = v[i];
+  v[i] = v[j];
+  v[j] = t;
+}
+
+/* Structures and functions for a sparse_map abstract data type that's
+   used to effectively swap elements I and J in array V like swap(),
+   but in a more memory efficient manner (when the number of permutations
+   performed is significantly less than the size of the input).  */
+
+struct sparse_ent_
+{
+   size_t index;
+   size_t val;
+};
+
+static size_t
+sparse_hash_ (void const *x, size_t table_size)
+{
+  struct sparse_ent_ const *ent = x;
+  return ent->index % table_size;
+}
+
+static bool
+sparse_cmp_ (void const *x, void const *y)
+{
+  struct sparse_ent_ const *ent1 = x;
+  struct sparse_ent_ const *ent2 = y;
+  return ent1->index == ent2->index;
+}
+
+typedef Hash_table sparse_map;
+
+/* Initialize the structure for the sparse map,
+   when a best guess as to the number of entries
+   specified with SIZE_HINT.  */
+
+static sparse_map *
+sparse_new (size_t size_hint)
+{
+  return hash_initialize (size_hint, nullptr, sparse_hash_, sparse_cmp_, free);
+}
+
+/* Swap the values for I and J.  If a value is not already present
+   then assume it's equal to the index.  Update the value for
+   index I in array V.  */
+
+static void
+sparse_swap (sparse_map *sv, size_t *v, size_t i, size_t j)
+{
+  struct sparse_ent_ *v1 = hash_remove (sv, &(struct sparse_ent_) {i,0});
+  struct sparse_ent_ *v2 = hash_remove (sv, &(struct sparse_ent_) {j,0});
+
+  /* FIXME: reduce the frequency of these mallocs.  */
+  if (!v1)
+    {
+      v1 = xmalloc (sizeof *v1);
+      v1->index = v1->val = i;
+    }
+  if (!v2)
+    {
+      v2 = xmalloc (sizeof *v2);
+      v2->index = v2->val = j;
+    }
+
+  size_t t = v1->val;
+  v1->val = v2->val;
+  v2->val = t;
+  if (!hash_insert (sv, v1))
+    xalloc_die ();
+  if (!hash_insert (sv, v2))
+    xalloc_die ();
+
+  v[i] = v1->val;
+}
+
+static void
+sparse_free (sparse_map *sv)
+{
+  hash_free (sv);
+}
+
+
+/* From R, allocate and return a malloc'd array of the first H elements
+   of a random permutation of N elements.  H must not exceed N.
+   Return nullptr if H is zero.  */
+
+size_t *
+randperm_new (struct randint_source *r, size_t h, size_t n)
+{
+  size_t *v;
+
+  switch (h)
+    {
+    case 0:
+      v = nullptr;
+      break;
+
+    case 1:
+      v = xmalloc (sizeof *v);
+      v[0] = randint_choose (r, n);
+      break;
+
+    default:
+      {
+        /* The algorithm is essentially the same in both
+           the sparse and non sparse case.  In the sparse case we use
+           a hash to implement sparse storage for the set of n numbers
+           we're shuffling.  When to use the sparse method was
+           determined with the help of this script:
+
+           #!/bin/sh
+           for n in $(seq 2 32); do
+             for h in $(seq 2 32); do
+               test $h -gt $n && continue
+               for s in o n; do
+                 test $s = o && shuf=shuf || shuf=./shuf
+                 num=$(env time -f "$s:${h},${n} = %e,%M" \
+                       $shuf -i0-$((2**$n-2)) -n$((2**$h-2)) | wc -l)
+                 test $num = $((2**$h-2)) || echo "$s:${h},${n} = failed" >&2
+               done
+             done
+           done
+
+           This showed that if sparseness = n/h, then:
+
+           sparseness = 128 => .125 mem used, and about same speed
+           sparseness =  64 => .25  mem used, but 1.5 times slower
+           sparseness =  32 => .5   mem used, but 2 times slower
+
+           Also the memory usage was only significant when n > 128Ki
+        */
+        bool sparse = (n >= (128 * 1024)) && (n / h >= 32);
+
+        size_t i;
+        sparse_map *sv;
+
+        if (sparse)
+          {
+            sv = sparse_new (h * 2);
+            if (sv == nullptr)
+              xalloc_die ();
+            v = xnmalloc (h, sizeof *v);
+          }
+        else
+          {
+            sv = nullptr; /* To placate GCC's -Wuninitialized.  */
+            v = xnmalloc (n, sizeof *v);
+            for (i = 0; i < n; i++)
+              v[i] = i;
+          }
+
+        for (i = 0; i < h; i++)
+          {
+            size_t j = i + randint_choose (r, n - i);
+            if (sparse)
+              sparse_swap (sv, v, i, j);
+            else
+              swap (v, i, j);
+          }
+
+        if (sparse)
+          sparse_free (sv);
+        else
+          v = xnrealloc (v, h, sizeof *v);
+      }
+      break;
+    }
+
+  return v;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randperm.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randperm.h
new file mode 100644 (file)
index 0000000..b7efbeb
--- /dev/null
@@ -0,0 +1,6 @@
+#include "randint.h"
+#include <stddef.h>
+#include <stdlib.h>
+size_t randperm_bound (size_t, size_t) _GL_ATTRIBUTE_CONST;
+size_t *randperm_new (struct randint_source *, size_t, size_t)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randread.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randread.c
new file mode 100644 (file)
index 0000000..fdeb79d
--- /dev/null
@@ -0,0 +1,319 @@
+/* Generate buffers of random data.
+
+   Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+/* FIXME: Improve performance by adding support for the RDRAND machine
+   instruction if available (e.g., Ivy Bridge processors).  */
+
+#include <config.h>
+
+#include "randread.h"
+
+#include <errno.h>
+#include <error.h>
+#include <exitfail.h>
+#include <fcntl.h>
+#include <quote.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/random.h>
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+#include "assure.h"
+#include "minmax.h"
+#include "rand-isaac.h"
+#include "stdio-safer.h"
+#include "unlocked-io.h"
+#include "xalloc.h"
+
+#if _STRING_ARCH_unaligned || _STRING_INLINE_unaligned
+# define POINTER_IS_ALIGNED(ptr, type) true
+#else
+# define POINTER_IS_ALIGNED(ptr, type) ((size_t) (ptr) % alignof (type) == 0)
+#endif
+
+/* The maximum buffer size used for reads of random data.  Using the
+   value 2 * ISAAC_BYTES makes this the largest power of two that
+   would not otherwise cause struct randread_source to grow.  */
+#define RANDREAD_BUFFER_SIZE (2 * ISAAC_BYTES)
+
+/* A source of random data for generating random buffers.  */
+struct randread_source
+{
+  /* Stream to read random bytes from.  If null, the current
+     implementation uses an internal PRNG (ISAAC).  */
+  FILE *source;
+
+  /* Function to call, and its argument, if there is an input error or
+     end of file when reading from the stream; errno is nonzero if
+     there was an error.  If this function returns, it should fix the
+     problem before returning.  The default handler assumes that
+     handler_arg is the file name of the source.  */
+  void (*handler) (void const *);
+  void const *handler_arg;
+
+  /* The buffer for SOURCE.  It's kept here to simplify storage
+     allocation and to make it easier to clear out buffered random
+     data.  */
+  union
+  {
+    /* The stream buffer, if SOURCE is not null.  */
+    char c[RANDREAD_BUFFER_SIZE];
+
+    /* The buffered ISAAC pseudorandom buffer, if SOURCE is null.  */
+    struct isaac
+    {
+      /* The number of bytes that are buffered at the end of data.b.  */
+      size_t buffered;
+
+      /* State of the ISAAC generator.  */
+      struct isaac_state state;
+
+      /* Up to a buffer's worth of pseudorandom data.  */
+      union
+      {
+        isaac_word w[ISAAC_WORDS];
+        unsigned char b[ISAAC_BYTES];
+      } data;
+    } isaac;
+  } buf;
+};
+
+
+/* The default error handler.  */
+
+static void
+randread_error (void const *file_name)
+{
+  affirm (exit_failure);
+  error (exit_failure, errno,
+         errno == 0 ? _("%s: end of file") : _("%s: read error"),
+         quote (file_name));
+}
+
+/* Simply return a new randread_source object with the default error
+   handler.  */
+
+static struct randread_source *
+simple_new (FILE *source, void const *handler_arg)
+{
+  struct randread_source *s = xmalloc (sizeof *s);
+  s->source = source;
+  s->handler = randread_error;
+  s->handler_arg = handler_arg;
+  return s;
+}
+
+/* Put a nonce value into BUFFER, with size BUFSIZE.
+   Return true on success, false (setting errno) on failure.  */
+
+static bool
+get_nonce (void *buffer, size_t bufsize)
+{
+  char *buf = buffer, *buflim = buf + bufsize;
+  while (buf < buflim)
+    {
+#if defined __sun
+# define MAX_GETRANDOM 1024
+#else
+# define MAX_GETRANDOM SIZE_MAX
+#endif
+      size_t max_bytes = MIN (buflim - buf, MAX_GETRANDOM);
+      ssize_t nbytes = getrandom (buf, max_bytes, 0);
+      if (0 <= nbytes)
+        buf += nbytes;
+      else if (errno != EINTR)
+        return false;
+    }
+  return true;
+}
+
+/* Body of randread_free, broken out to pacify gcc -Wmismatched-dealloc.  */
+
+static int
+randread_free_body (struct randread_source *s)
+{
+  FILE *source = s->source;
+  explicit_bzero (s, sizeof *s);
+  free (s);
+  return source ? fclose (source) : 0;
+}
+
+/* Create and initialize a random data source from NAME, or use a
+   reasonable default source if NAME is null.  BYTES_BOUND is an upper
+   bound on the number of bytes that will be needed.  If zero, it is a
+   hard bound; otherwise it is just an estimate.
+
+   If NAME is not null, NAME is saved for use as the argument of the
+   default handler.  Unless a non-default handler is used, NAME's
+   lifetime should be at least that of the returned value.
+
+   Return nullptr (setting errno) on failure.  */
+
+struct randread_source *
+randread_new (char const *name, size_t bytes_bound)
+{
+  if (bytes_bound == 0)
+    return simple_new (nullptr, nullptr);
+  else
+    {
+      FILE *source = nullptr;
+      struct randread_source *s;
+
+      if (name)
+        if (! (source = fopen_safer (name, "rb")))
+          return nullptr;
+
+      s = simple_new (source, name);
+
+      if (source)
+        setvbuf (source, s->buf.c, _IOFBF, MIN (sizeof s->buf.c, bytes_bound));
+      else
+        {
+          s->buf.isaac.buffered = 0;
+          if (! get_nonce (s->buf.isaac.state.m,
+                           MIN (sizeof s->buf.isaac.state.m, bytes_bound)))
+            {
+              int e = errno;
+              randread_free_body (s);
+              errno = e;
+              return nullptr;
+            }
+          isaac_seed (&s->buf.isaac.state);
+        }
+
+      return s;
+    }
+}
+
+
+/* Set S's handler and its argument.  HANDLER (HANDLER_ARG) is called
+   when there is a read error or end of file from the random data
+   source; errno is nonzero if there was an error.  If HANDLER
+   returns, it should fix the problem before returning.  The default
+   handler assumes that handler_arg is the file name of the source; it
+   does not return.  */
+
+void
+randread_set_handler (struct randread_source *s, void (*handler) (void const *))
+{
+  s->handler = handler;
+}
+
+void
+randread_set_handler_arg (struct randread_source *s, void const *handler_arg)
+{
+  s->handler_arg = handler_arg;
+}
+
+
+/* Place SIZE random bytes into the buffer beginning at P, using
+   the stream in S.  */
+
+static void
+readsource (struct randread_source *s, unsigned char *p, size_t size)
+{
+  while (true)
+    {
+      size_t inbytes = fread (p, sizeof *p, size, s->source);
+      int fread_errno = errno;
+      p += inbytes;
+      size -= inbytes;
+      if (size == 0)
+        break;
+      errno = (ferror (s->source) ? fread_errno : 0);
+      s->handler (s->handler_arg);
+    }
+}
+
+
+/* Place SIZE pseudorandom bytes into the buffer beginning at P, using
+   the buffered ISAAC generator in ISAAC.  */
+
+static void
+readisaac (struct isaac *isaac, void *p, size_t size)
+{
+  size_t inbytes = isaac->buffered;
+
+  while (true)
+    {
+      char *char_p = p;
+
+      if (size <= inbytes)
+        {
+          memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, size);
+          isaac->buffered = inbytes - size;
+          return;
+        }
+
+      memcpy (p, isaac->data.b + ISAAC_BYTES - inbytes, inbytes);
+      p = char_p + inbytes;
+      size -= inbytes;
+
+      /* If P is aligned, write to *P directly to avoid the overhead
+         of copying from the buffer.  */
+      if (POINTER_IS_ALIGNED (p, isaac_word))
+        {
+          isaac_word *wp = p;
+          while (ISAAC_BYTES <= size)
+            {
+              isaac_refill (&isaac->state, wp);
+              wp += ISAAC_WORDS;
+              size -= ISAAC_BYTES;
+              if (size == 0)
+                {
+                  isaac->buffered = 0;
+                  return;
+                }
+            }
+          p = wp;
+        }
+
+      isaac_refill (&isaac->state, isaac->data.w);
+      inbytes = ISAAC_BYTES;
+    }
+}
+
+
+/* Consume random data from *S to generate a random buffer BUF of size
+   SIZE.  */
+
+void
+randread (struct randread_source *s, void *buf, size_t size)
+{
+  if (s->source)
+    readsource (s, buf, size);
+  else
+    readisaac (&s->buf.isaac, buf, size);
+}
+
+
+/* Clear *S so that it no longer contains undelivered random data, and
+   deallocate any system resources associated with *S.  Return 0 if
+   successful, a negative number (setting errno) if not (this is rare,
+   but can occur in theory if there is an input error).  */
+
+int
+randread_free (struct randread_source *s)
+{
+  return randread_free_body (s);
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randread.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/randread.h
new file mode 100644 (file)
index 0000000..9bd1303
--- /dev/null
@@ -0,0 +1,37 @@
+/* Generate buffers of random data.
+
+   Copyright (C) 2006-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#ifndef RANDREAD_H
+# define RANDREAD_H 1
+
+# include <stddef.h>
+
+struct randread_source;
+
+int randread_free (struct randread_source *) _GL_ATTRIBUTE_NONNULL ();
+struct randread_source *randread_new (char const *, size_t)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (randread_free, 1);
+void randread (struct randread_source *, void *, size_t)
+  _GL_ATTRIBUTE_NONNULL ();
+void randread_set_handler (struct randread_source *, void (*) (void const *))
+  _GL_ATTRIBUTE_NONNULL ();
+void randread_set_handler_arg (struct randread_source *, void const *)
+  _GL_ATTRIBUTE_NONNULL ((1));
+
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/root-dev-ino.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/root-dev-ino.c
new file mode 100644 (file)
index 0000000..b158c27
--- /dev/null
@@ -0,0 +1,37 @@
+/* root-dev-ino.c -- get the device and inode numbers for '/'.
+   Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering. */
+
+#include <config.h>
+
+#include "root-dev-ino.h"
+
+#include <stdlib.h>
+
+/* Call lstat to get the device and inode numbers for '/'.
+   Upon failure, return nullptr.  Otherwise, set the members of
+   *ROOT_D_I accordingly and return ROOT_D_I.  */
+struct dev_ino *
+get_root_dev_ino (struct dev_ino *root_d_i)
+{
+  struct stat statbuf;
+  if (lstat ("/", &statbuf))
+    return nullptr;
+  root_d_i->st_ino = statbuf.st_ino;
+  root_d_i->st_dev = statbuf.st_dev;
+  return root_d_i;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/root-dev-ino.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/root-dev-ino.h
new file mode 100644 (file)
index 0000000..41ea4dc
--- /dev/null
@@ -0,0 +1,47 @@
+/* Root device and inode number checking.
+
+   Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef ROOT_DEV_INO_H
+# define ROOT_DEV_INO_H 1
+
+# include "dev-ino.h"
+# include "same-inode.h"
+
+struct dev_ino *
+get_root_dev_ino (struct dev_ino *root_d_i) _GL_ATTRIBUTE_NONNULL ();
+
+/* These macros are common to the programs that support the
+   --preserve-root and --no-preserve-root options.  */
+
+# define ROOT_DEV_INO_CHECK(Root_dev_ino, Dir_statbuf) \
+    (Root_dev_ino && PSAME_INODE (Dir_statbuf, Root_dev_ino))
+
+# define ROOT_DEV_INO_WARN(Dirname)                                    \
+  do                                                                   \
+    {                                                                  \
+      if (STREQ (Dirname, "/"))                                                \
+        error (0, 0, _("it is dangerous to operate recursively on %s"),        \
+               quoteaf (Dirname));                                     \
+      else                                                             \
+        error (0, 0,                                                   \
+               _("it is dangerous to operate recursively on %s (same as %s)"), \
+               quoteaf_n (0, Dirname), quoteaf_n (1, "/"));            \
+      error (0, 0, _("use --no-preserve-root to override this failsafe")); \
+    }                                                                  \
+  while (0)
+
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/skipchars.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/skipchars.c
new file mode 100644 (file)
index 0000000..827c89d
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define SKIPCHARS_INLINE _GL_EXTERN_INLINE
+#include <skipchars.h>
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/skipchars.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/skipchars.h
new file mode 100644 (file)
index 0000000..baa9eab
--- /dev/null
@@ -0,0 +1,56 @@
+/* Skipping sequences of characters satisfying a predicate
+
+   Copyright 2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include "mcel.h"
+
+_GL_INLINE_HEADER_BEGIN
+#ifndef SKIPCHARS_INLINE
+# define SKIPCHARS_INLINE _GL_INLINE
+#endif
+
+/* Return the address just past the leading sequence of possibly
+   multi-byte characters or encoding errors G in STR that satisfy
+   PREDICATE (G) if OK is true, or that do not satisfy the predicate
+   call if OK is false.  */
+
+SKIPCHARS_INLINE char *
+skip_str_matching (char const *str, bool (*predicate) (mcel_t), bool ok)
+{
+  char const *s = str;
+  for (mcel_t g; *s && predicate (g = mcel_scanz (s)) == ok;
+       s += g.len)
+    continue;
+  return (char *) s;
+}
+
+/* Return the address just past the leading sequence of possibly
+   multi-byte characters or encoding errors G in BUF (which ends at LIM)
+   that satisfy PREDICATE (G) if OK is true, or that do not satisfy
+   the predicate call if OK is false.  */
+
+SKIPCHARS_INLINE char *
+skip_buf_matching (char const *buf, char const *lim,
+                   bool (*predicate) (mcel_t), bool ok)
+{
+  char const *s = buf;
+  for (mcel_t g; s < lim && predicate (g = mcel_scan (s, lim)) == ok;
+       s += g.len)
+    continue;
+  return (char *) s;
+}
+
+_GL_INLINE_HEADER_END
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/smack.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/smack.h
new file mode 100644 (file)
index 0000000..0c85849
--- /dev/null
@@ -0,0 +1,44 @@
+/* Include and determine availability of smack routines
+   Copyright (C) 2013-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Here we replace or wrap the most common smack functions used by coreutils.
+   Others will need to be protected by HAVE_SMACK.  */
+
+#ifdef HAVE_SMACK
+# include <sys/smack.h>
+#else
+static inline ssize_t
+smack_new_label_from_self (char **label)
+{
+  return -1;
+}
+
+static inline int
+smack_set_label_for_self (char const *label)
+{
+  return -1;
+}
+#endif
+
+static inline bool
+is_smack_enabled (void)
+{
+#ifdef HAVE_SMACK
+  return smack_smackfs_path () != nullptr;
+#else
+  return false;
+#endif
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strintcmp.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strintcmp.c
new file mode 100644 (file)
index 0000000..35b2e6b
--- /dev/null
@@ -0,0 +1,34 @@
+/* Compare integer strings.
+
+   Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "strnumcmp-in.h"
+
+#include <limits.h>
+
+/* Compare strings A and B as integers without explicitly converting
+   them to machine numbers, to avoid overflow problems and perhaps
+   improve performance.  */
+
+int
+strintcmp (char const *a, char const *b)
+{
+  return numcompare (a, b, CHAR_MAX + 1, CHAR_MAX + 1);
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp-in.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp-in.h
new file mode 100644 (file)
index 0000000..3a69db7
--- /dev/null
@@ -0,0 +1,244 @@
+/* Compare numeric strings.  This is an internal include file.
+
+   Copyright (C) 1988-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Mike Haertel.  */
+
+#ifndef STRNUMCMP_IN_H
+# define STRNUMCMP_IN_H 1
+
+# include "strnumcmp.h"
+
+# include <stddef.h>
+
+# define NEGATION_SIGN   '-'
+# define NUMERIC_ZERO    '0'
+
+/* ISDIGIT differs from isdigit, as follows:
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
+   - It's typically faster.
+   POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
+   isdigit unless it's important to use the locale's definition
+   of 'digit' even when the host does not conform to POSIX.  */
+# define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+
+/* Compare strings A and B containing decimal fractions < 1.
+   DECIMAL_POINT is the decimal point.  Each string
+   should begin with a decimal point followed immediately by the digits
+   of the fraction.  Strings not of this form are treated as zero.  */
+
+/* The goal here, is to take two numbers a and b... compare these
+   in parallel.  Instead of converting each, and then comparing the
+   outcome.  Most likely stopping the comparison before the conversion
+   is complete.  The algorithm used, in the old "sort" utility:
+
+   Algorithm: fraccompare
+   Action   : compare two decimal fractions
+   accepts  : char *a, char *b
+   returns  : -1 if a<b, 0 if a=b, 1 if a>b.
+   implement:
+
+   if *a == decimal_point AND *b == decimal_point
+     find first character different in a and b.
+     if both are digits, return the difference *a - *b.
+     if *a is a digit
+       skip past zeros
+       if digit return 1, else 0
+     if *b is a digit
+       skip past zeros
+       if digit return -1, else 0
+   if *a is a decimal_point
+     skip past decimal_point and zeros
+     if digit return 1, else 0
+   if *b is a decimal_point
+     skip past decimal_point and zeros
+     if digit return -1, else 0
+   return 0 */
+
+static inline int _GL_ATTRIBUTE_PURE
+fraccompare (char const *a, char const *b, char decimal_point)
+{
+  if (*a == decimal_point && *b == decimal_point)
+    {
+      while (*++a == *++b)
+        if (! ISDIGIT (*a))
+          return 0;
+      if (ISDIGIT (*a) && ISDIGIT (*b))
+        return *a - *b;
+      if (ISDIGIT (*a))
+        goto a_trailing_nonzero;
+      if (ISDIGIT (*b))
+        goto b_trailing_nonzero;
+      return 0;
+    }
+  else if (*a++ == decimal_point)
+    {
+    a_trailing_nonzero:
+      while (*a == NUMERIC_ZERO)
+        a++;
+      return ISDIGIT (*a);
+    }
+  else if (*b++ == decimal_point)
+    {
+    b_trailing_nonzero:
+      while (*b == NUMERIC_ZERO)
+        b++;
+      return - ISDIGIT (*b);
+    }
+  return 0;
+}
+
+/* Compare strings A and B as numbers without explicitly converting
+   them to machine numbers, to avoid overflow problems and perhaps
+   improve performance.  DECIMAL_POINT is the decimal point and
+   THOUSANDS_SEP the thousands separator.  A DECIMAL_POINT outside
+   'char' range causes comparisons to act as if there is no decimal point
+   character, and likewise for THOUSANDS_SEP.  */
+
+static inline int _GL_ATTRIBUTE_PURE
+numcompare (char const *a, char const *b,
+            int decimal_point, int thousands_sep)
+{
+  char tmpa = *a;
+  char tmpb = *b;
+  int tmp;
+  size_t log_a;
+  size_t log_b;
+
+  if (tmpa == NEGATION_SIGN)
+    {
+      do
+        tmpa = *++a;
+      while (tmpa == NUMERIC_ZERO || tmpa == thousands_sep);
+      if (tmpb != NEGATION_SIGN)
+        {
+          if (tmpa == decimal_point)
+            do
+              tmpa = *++a;
+            while (tmpa == NUMERIC_ZERO);
+          if (ISDIGIT (tmpa))
+            return -1;
+          while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep)
+            tmpb = *++b;
+          if (tmpb == decimal_point)
+            do
+              tmpb = *++b;
+            while (tmpb == NUMERIC_ZERO);
+          return - ISDIGIT (tmpb);
+        }
+      do
+        tmpb = *++b;
+      while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep);
+
+      while (tmpa == tmpb && ISDIGIT (tmpa))
+        {
+          do
+            tmpa = *++a;
+          while (tmpa == thousands_sep);
+          do
+            tmpb = *++b;
+          while (tmpb == thousands_sep);
+        }
+
+      if ((tmpa == decimal_point && !ISDIGIT (tmpb))
+          || (tmpb == decimal_point && !ISDIGIT (tmpa)))
+        return fraccompare (b, a, decimal_point);
+
+      tmp = tmpb - tmpa;
+
+      for (log_a = 0; ISDIGIT (tmpa); ++log_a)
+        do
+          tmpa = *++a;
+        while (tmpa == thousands_sep);
+
+      for (log_b = 0; ISDIGIT (tmpb); ++log_b)
+        do
+          tmpb = *++b;
+        while (tmpb == thousands_sep);
+
+      if (log_a != log_b)
+        return log_a < log_b ? 1 : -1;
+
+      if (!log_a)
+        return 0;
+
+      return tmp;
+    }
+  else if (tmpb == NEGATION_SIGN)
+    {
+      do
+        tmpb = *++b;
+      while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep);
+      if (tmpb == decimal_point)
+        do
+          tmpb = *++b;
+        while (tmpb == NUMERIC_ZERO);
+      if (ISDIGIT (tmpb))
+        return 1;
+      while (tmpa == NUMERIC_ZERO || tmpa == thousands_sep)
+        tmpa = *++a;
+      if (tmpa == decimal_point)
+        do
+          tmpa = *++a;
+        while (tmpa == NUMERIC_ZERO);
+      return ISDIGIT (tmpa);
+    }
+  else
+    {
+      while (tmpa == NUMERIC_ZERO || tmpa == thousands_sep)
+        tmpa = *++a;
+      while (tmpb == NUMERIC_ZERO || tmpb == thousands_sep)
+        tmpb = *++b;
+
+      while (tmpa == tmpb && ISDIGIT (tmpa))
+        {
+          do
+            tmpa = *++a;
+          while (tmpa == thousands_sep);
+          do
+            tmpb = *++b;
+          while (tmpb == thousands_sep);
+        }
+
+      if ((tmpa == decimal_point && !ISDIGIT (tmpb))
+          || (tmpb == decimal_point && !ISDIGIT (tmpa)))
+        return fraccompare (a, b, decimal_point);
+
+      tmp = tmpa - tmpb;
+
+      for (log_a = 0; ISDIGIT (tmpa); ++log_a)
+        do
+          tmpa = *++a;
+        while (tmpa == thousands_sep);
+
+      for (log_b = 0; ISDIGIT (tmpb); ++log_b)
+        do
+          tmpb = *++b;
+        while (tmpb == thousands_sep);
+
+      if (log_a != log_b)
+        return log_a < log_b ? -1 : 1;
+
+      if (!log_a)
+        return 0;
+
+      return tmp;
+    }
+}
+
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp.c
new file mode 100644 (file)
index 0000000..282091f
--- /dev/null
@@ -0,0 +1,31 @@
+/* Compare numeric strings.
+
+   Copyright (C) 2005-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "strnumcmp-in.h"
+
+/* Externally-visible name for numcompare.  */
+
+int
+strnumcmp (char const *a, char const *b,
+           int decimal_point, int thousands_sep)
+{
+  return numcompare (a, b, decimal_point, thousands_sep);
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strnumcmp.h
new file mode 100644 (file)
index 0000000..f6a02b2
--- /dev/null
@@ -0,0 +1,4 @@
+int strintcmp (char const *, char const *)
+  _GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_PURE;
+int strnumcmp (char const *, char const *, int, int)
+  _GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_PURE;
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strtod.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strtod.c
new file mode 100644 (file)
index 0000000..c744d2f
--- /dev/null
@@ -0,0 +1,485 @@
+/* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2024 Free Software
+   Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#if ! defined USE_LONG_DOUBLE
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <ctype.h>      /* isspace() */
+#include <errno.h>
+#include <float.h>      /* {DBL,LDBL}_{MIN,MAX} */
+#include <limits.h>     /* LONG_{MIN,MAX} */
+#include <locale.h>     /* localeconv() */
+#include <math.h>       /* NAN */
+#include <stdio.h>      /* sprintf() */
+#include <string.h>     /* strdup() */
+#if HAVE_NL_LANGINFO
+# include <langinfo.h>
+#endif
+
+#include "c-ctype.h"
+
+#undef MIN
+#undef MAX
+#ifdef USE_LONG_DOUBLE
+# define STRTOD strtold
+# define LDEXP ldexpl
+# if defined __hpux && defined __hppa
+   /* We cannot call strtold on HP-UX/hppa, because its return type is a struct,
+      not a 'long double'.  */
+#  define HAVE_UNDERLYING_STRTOD 0
+# elif STRTOLD_HAS_UNDERFLOW_BUG
+   /* strtold would not set errno=ERANGE upon underflow.  */
+#  define HAVE_UNDERLYING_STRTOD 0
+# else
+#  define HAVE_UNDERLYING_STRTOD HAVE_STRTOLD
+# endif
+# define DOUBLE long double
+# define MIN LDBL_MIN
+# define MAX LDBL_MAX
+# define L_(literal) literal##L
+#else
+# define STRTOD strtod
+# define LDEXP ldexp
+# define HAVE_UNDERLYING_STRTOD 1
+# define DOUBLE double
+# define MIN DBL_MIN
+# define MAX DBL_MAX
+# define L_(literal) literal
+#endif
+
+#if (defined USE_LONG_DOUBLE ? HAVE_LDEXPM_IN_LIBC : HAVE_LDEXP_IN_LIBC)
+# define USE_LDEXP 1
+#else
+# define USE_LDEXP 0
+#endif
+
+/* Return true if C is a space in the current locale, avoiding
+   problems with signed char and isspace.  */
+static bool
+locale_isspace (char c)
+{
+  unsigned char uc = c;
+  return isspace (uc) != 0;
+}
+
+/* Determine the decimal-point character according to the current locale.  */
+static char
+decimal_point_char (void)
+{
+  const char *point;
+  /* Determine it in a multithread-safe way.  We know nl_langinfo is
+     multithread-safe on glibc systems and Mac OS X systems, but is not required
+     to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
+     localeconv() is rarely multithread-safe.  */
+#if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
+  point = nl_langinfo (RADIXCHAR);
+#elif 1
+  char pointbuf[5];
+  sprintf (pointbuf, "%#.0f", 1.0);
+  point = &pointbuf[1];
+#else
+  point = localeconv () -> decimal_point;
+#endif
+  /* The decimal point is always a single byte: either '.' or ','.  */
+  return (point[0] != '\0' ? point[0] : '.');
+}
+
+#if !USE_LDEXP
+ #undef LDEXP
+ #define LDEXP dummy_ldexp
+ /* A dummy definition that will never be invoked.  */
+ static DOUBLE LDEXP (_GL_UNUSED DOUBLE x, _GL_UNUSED int exponent)
+ {
+   abort ();
+   return L_(0.0);
+ }
+#endif
+
+/* Return X * BASE**EXPONENT.  Return an extreme value and set errno
+   to ERANGE if underflow or overflow occurs.  */
+static DOUBLE
+scale_radix_exp (DOUBLE x, int radix, long int exponent)
+{
+  /* If RADIX == 10, this code is neither precise nor fast; it is
+     merely a straightforward and relatively portable approximation.
+     If N == 2, this code is precise on a radix-2 implementation,
+     albeit perhaps not fast if ldexp is not in libc.  */
+
+  long int e = exponent;
+
+  if (USE_LDEXP && radix == 2)
+    return LDEXP (x, e < INT_MIN ? INT_MIN : INT_MAX < e ? INT_MAX : e);
+  else
+    {
+      DOUBLE r = x;
+
+      if (r != 0)
+        {
+          if (e < 0)
+            {
+              while (e++ != 0)
+                {
+                  r /= radix;
+                  if (r == 0 && x != 0)
+                    {
+                      errno = ERANGE;
+                      break;
+                    }
+                }
+            }
+          else
+            {
+              while (e-- != 0)
+                {
+                  if (r < -MAX / radix)
+                    {
+                      errno = ERANGE;
+                      return -HUGE_VAL;
+                    }
+                  else if (MAX / radix < r)
+                    {
+                      errno = ERANGE;
+                      return HUGE_VAL;
+                    }
+                  else
+                    r *= radix;
+                }
+            }
+        }
+
+      return r;
+    }
+}
+
+/* Parse a number at NPTR; this is a bit like strtol (NPTR, ENDPTR)
+   except there are no leading spaces or signs or "0x", and ENDPTR is
+   nonnull.  The number uses a base BASE (either 10 or 16) fraction, a
+   radix RADIX (either 10 or 2) exponent, and exponent character
+   EXPCHAR.  BASE is RADIX**RADIX_MULTIPLIER.  */
+static DOUBLE
+parse_number (const char *nptr,
+              int base, int radix, int radix_multiplier, char radixchar,
+              char expchar,
+              char **endptr)
+{
+  const char *s = nptr;
+  const char *digits_start;
+  const char *digits_end;
+  const char *radixchar_ptr;
+  long int exponent;
+  DOUBLE num;
+
+  /* First, determine the start and end of the digit sequence.  */
+  digits_start = s;
+  radixchar_ptr = NULL;
+  for (;; ++s)
+    {
+      if (base == 16 ? c_isxdigit (*s) : c_isdigit (*s))
+        ;
+      else if (radixchar_ptr == NULL && *s == radixchar)
+        {
+          /* Record that we have found the decimal point.  */
+          radixchar_ptr = s;
+        }
+      else
+        /* Any other character terminates the digit sequence.  */
+        break;
+    }
+  digits_end = s;
+  /* Now radixchar_ptr == NULL or
+     digits_start <= radixchar_ptr < digits_end.  */
+
+  if (false)
+    { /* Unoptimized.  */
+      exponent =
+        (radixchar_ptr != NULL
+         ? - (long int) (digits_end - radixchar_ptr - 1)
+         : 0);
+    }
+  else
+    { /* Remove trailing zero digits.  This reduces rounding errors for
+         inputs such as 1.0000000000 or 10000000000e-10.  */
+      while (digits_end > digits_start)
+        {
+          if (digits_end - 1 == radixchar_ptr || *(digits_end - 1) == '0')
+            digits_end--;
+          else
+            break;
+        }
+      exponent =
+        (radixchar_ptr != NULL
+         ? (digits_end > radixchar_ptr
+            ? - (long int) (digits_end - radixchar_ptr - 1)
+            : (long int) (radixchar_ptr - digits_end))
+         : (long int) (s - digits_end));
+    }
+
+  /* Then, convert the digit sequence to a number.  */
+  {
+    const char *dp;
+    num = 0;
+    for (dp = digits_start; dp < digits_end; dp++)
+      if (dp != radixchar_ptr)
+        {
+          int digit;
+
+          /* Make sure that multiplication by BASE will not overflow.  */
+          if (!(num <= MAX / base))
+            {
+              /* The value of the digit and all subsequent digits don't matter,
+                 since we have already gotten as many digits as can be
+                 represented in a 'DOUBLE'.  This doesn't necessarily mean that
+                 the result will overflow: The exponent may reduce it to within
+                 range.  */
+              exponent +=
+                (digits_end - dp)
+                - (radixchar_ptr >= dp && radixchar_ptr < digits_end ? 1 : 0);
+              break;
+            }
+
+          /* Eat the next digit.  */
+          if (c_isdigit (*dp))
+            digit = *dp - '0';
+          else if (base == 16 && c_isxdigit (*dp))
+            digit = c_tolower (*dp) - ('a' - 10);
+          else
+            abort ();
+          num = num * base + digit;
+        }
+  }
+
+  exponent = exponent * radix_multiplier;
+
+  /* Finally, parse the exponent.  */
+  if (c_tolower (*s) == expchar && ! locale_isspace (s[1]))
+    {
+      /* Add any given exponent to the implicit one.  */
+      int saved_errno = errno;
+      char *end;
+      long int value = strtol (s + 1, &end, 10);
+      errno = saved_errno;
+
+      if (s + 1 != end)
+        {
+          /* Skip past the exponent, and add in the implicit exponent,
+             resulting in an extreme value on overflow.  */
+          s = end;
+          exponent =
+            (exponent < 0
+             ? (value < LONG_MIN - exponent ? LONG_MIN : exponent + value)
+             : (LONG_MAX - exponent < value ? LONG_MAX : exponent + value));
+        }
+    }
+
+  *endptr = (char *) s;
+  return scale_radix_exp (num, radix, exponent);
+}
+
+/* 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 -MIN * MIN does not work when cross-compiling
+   to PowerPC on Mac OS X 10.5.  */
+static DOUBLE
+minus_zero (void)
+{
+#if defined __hpux || defined __sgi || defined __ICC
+  return -MIN * MIN;
+#else
+  return -0.0;
+#endif
+}
+
+/* Convert NPTR to a DOUBLE.  If ENDPTR is not NULL, a pointer to the
+   character after the last one used in the number is put in *ENDPTR.  */
+DOUBLE
+STRTOD (const char *nptr, char **endptr)
+#if HAVE_UNDERLYING_STRTOD
+# ifdef USE_LONG_DOUBLE
+#  undef strtold
+# else
+#  undef strtod
+# endif
+#else
+# undef STRTOD
+# define STRTOD(NPTR,ENDPTR) \
+   parse_number (NPTR, 10, 10, 1, radixchar, 'e', ENDPTR)
+#endif
+/* From here on, STRTOD refers to the underlying implementation.  It needs
+   to handle only finite unsigned decimal numbers with non-null ENDPTR.  */
+{
+  char radixchar;
+  bool negative = false;
+
+  /* The number so far.  */
+  DOUBLE num;
+
+  const char *s = nptr;
+  const char *end;
+  char *endbuf;
+  int saved_errno = errno;
+
+  radixchar = decimal_point_char ();
+
+  /* Eat whitespace.  */
+  while (locale_isspace (*s))
+    ++s;
+
+  /* Get the sign.  */
+  negative = *s == '-';
+  if (*s == '-' || *s == '+')
+    ++s;
+
+  num = STRTOD (s, &endbuf);
+  end = endbuf;
+
+  if (c_isdigit (s[*s == radixchar]))
+    {
+      /* If a hex float was converted incorrectly, do it ourselves.
+         If the string starts with "0x" but does not contain digits,
+         consume the "0" ourselves.  If a hex float is followed by a
+         'p' but no exponent, then adjust the end pointer.  */
+      if (*s == '0' && c_tolower (s[1]) == 'x')
+        {
+          if (! c_isxdigit (s[2 + (s[2] == radixchar)]))
+            {
+              end = s + 1;
+
+              /* strtod() on z/OS returns ERANGE for "0x".  */
+              errno = saved_errno;
+            }
+          else if (end <= s + 2)
+            {
+              num = parse_number (s + 2, 16, 2, 4, radixchar, 'p', &endbuf);
+              end = endbuf;
+            }
+          else
+            {
+              const char *p = s + 2;
+              while (p < end && c_tolower (*p) != 'p')
+                p++;
+              if (p < end && ! c_isdigit (p[1 + (p[1] == '-' || p[1] == '+')]))
+                {
+                  char *dup = strdup (s);
+                  errno = saved_errno;
+                  if (!dup)
+                    {
+                      /* Not really our day, is it.  Rounding errors are
+                         better than outright failure.  */
+                      num =
+                        parse_number (s + 2, 16, 2, 4, radixchar, 'p', &endbuf);
+                    }
+                  else
+                    {
+                      dup[p - s] = '\0';
+                      num = STRTOD (dup, &endbuf);
+                      saved_errno = errno;
+                      free (dup);
+                      errno = saved_errno;
+                    }
+                  end = p;
+                }
+            }
+        }
+      else
+        {
+          /* If "1e 1" was misparsed as 10.0 instead of 1.0, re-do the
+             underlying STRTOD on a copy of the original string
+             truncated to avoid the bug.  */
+          const char *e = s + 1;
+          while (e < end && c_tolower (*e) != 'e')
+            e++;
+          if (e < end && ! c_isdigit (e[1 + (e[1] == '-' || e[1] == '+')]))
+            {
+              char *dup = strdup (s);
+              errno = saved_errno;
+              if (!dup)
+                {
+                  /* Not really our day, is it.  Rounding errors are
+                     better than outright failure.  */
+                  num = parse_number (s, 10, 10, 1, radixchar, 'e', &endbuf);
+                }
+              else
+                {
+                  dup[e - s] = '\0';
+                  num = STRTOD (dup, &endbuf);
+                  saved_errno = errno;
+                  free (dup);
+                  errno = saved_errno;
+                }
+              end = e;
+            }
+        }
+
+      s = end;
+    }
+
+  /* Check for infinities and NaNs.  */
+  else if (c_tolower (*s) == 'i'
+           && c_tolower (s[1]) == 'n'
+           && c_tolower (s[2]) == 'f')
+    {
+      s += 3;
+      if (c_tolower (*s) == 'i'
+          && c_tolower (s[1]) == 'n'
+          && c_tolower (s[2]) == 'i'
+          && c_tolower (s[3]) == 't'
+          && c_tolower (s[4]) == 'y')
+        s += 5;
+      num = HUGE_VAL;
+      errno = saved_errno;
+    }
+  else if (c_tolower (*s) == 'n'
+           && c_tolower (s[1]) == 'a'
+           && c_tolower (s[2]) == 'n')
+    {
+      s += 3;
+      if (*s == '(')
+        {
+          const char *p = s + 1;
+          while (c_isalnum (*p))
+            p++;
+          if (*p == ')')
+            s = p + 1;
+        }
+
+      /* If the underlying implementation misparsed the NaN, assume
+         its result is incorrect, and return a NaN.  Normally it's
+         better to use the underlying implementation's result, since a
+         nice implementation populates the bits of the NaN according
+         to interpreting n-char-sequence as a hexadecimal number.  */
+      if (s != end || num == num)
+        num = NAN;
+      errno = saved_errno;
+    }
+  else
+    {
+      /* No conversion could be performed.  */
+      errno = EINVAL;
+      s = nptr;
+    }
+
+  if (endptr != NULL)
+    *endptr = (char *) s;
+  /* Special case -0.0, since at least ICC miscompiles negation.  We
+     can't use copysign(), as that drags in -lm on some platforms.  */
+  if (!num && negative)
+    return minus_zero ();
+  return negative ? -num : num;
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strtold.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/strtold.c
new file mode 100644 (file)
index 0000000..6e8581a
--- /dev/null
@@ -0,0 +1,37 @@
+/* Convert string to 'long double'.
+   Copyright (C) 2019-2024 Free Software Foundation, Inc.
+
+   This file is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation, either version 3 of the
+   License, or (at your option) any later version.
+
+   This file 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+
+/* Specification.  */
+# include <stdlib.h>
+
+long double
+strtold (const char *str, char **endp)
+{
+  return strtod (str, endp);
+}
+
+#else
+
+# define USE_LONG_DOUBLE
+# include "strtod.c"
+
+#endif
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/targetdir.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/targetdir.c
new file mode 100644 (file)
index 0000000..e593dd1
--- /dev/null
@@ -0,0 +1,118 @@
+/* Target directory operands for coreutils
+
+   Copyright 2004-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#define TARGETDIR_INLINE _GL_EXTERN_INLINE
+#include <targetdir.h>
+
+#include <attribute.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#ifdef O_PATH
+enum { O_PATHSEARCH = O_PATH };
+#else
+enum { O_PATHSEARCH = O_SEARCH };
+#endif
+
+/* Must F designate the working directory?  */
+
+ATTRIBUTE_PURE static bool
+must_be_working_directory (char const *f)
+{
+  /* Return true for ".", "./.", ".///./", etc.  */
+  while (*f++ == '.')
+    {
+      if (*f != '/')
+        return !*f;
+      while (*++f == '/')
+        continue;
+      if (!*f)
+        return true;
+    }
+  return false;
+}
+
+/* Return a file descriptor open to FILE, for use in openat.
+   As an optimization, return AT_FDCWD if FILE must be the working directory.
+   As a side effect, possibly set *ST to the file's status.
+   Fail and set errno if FILE is not a directory.
+   On failure return -2 if AT_FDCWD is -1, -1 otherwise.  */
+
+int
+target_directory_operand (char const *file, struct stat *st)
+{
+  if (must_be_working_directory (file))
+    return AT_FDCWD;
+
+  int fd = -1;
+  int try_to_open = 1;
+  int stat_result;
+
+  /* On old systems without O_DIRECTORY, like Solaris 10, check with
+     stat first lest we try to open a fifo for example and hang.  */
+  if (!O_DIRECTORY)
+    {
+      stat_result = stat (file, st);
+      if (stat_result == 0)
+        {
+          try_to_open = S_ISDIR (st->st_mode);
+          errno = ENOTDIR;
+        }
+      else
+        {
+          /* On EOVERFLOW failure, give up on checking, as there is no
+             easy way to check.  This should be rare.  */
+          try_to_open = errno == EOVERFLOW;
+        }
+    }
+
+  if (try_to_open)
+    {
+      fd = open (file, O_PATHSEARCH | O_DIRECTORY);
+
+      /* On platforms lacking O_PATH, using O_SEARCH | O_DIRECTORY to
+         open an overly-protected non-directory can fail with either
+         EACCES or ENOTDIR.  Prefer ENOTDIR as it makes for better
+         diagnostics.  */
+      if (O_PATHSEARCH == O_SEARCH && fd < 0 && errno == EACCES)
+        errno = (((O_DIRECTORY ? stat (file, st) : stat_result) == 0
+                  && !S_ISDIR (st->st_mode))
+                 ? ENOTDIR : EACCES);
+    }
+
+  if (!O_DIRECTORY && 0 <= fd)
+    {
+      /* On old systems like Solaris 10 double check type,
+         to ensure we've opened a directory.  */
+      int err;
+      if (fstat (fd, st) == 0
+          ? !S_ISDIR (st->st_mode) && (err = ENOTDIR, true)
+          : (err = errno) != EOVERFLOW)
+        {
+          close (fd);
+          errno = err;
+          fd = -1;
+        }
+    }
+
+  return fd - (AT_FDCWD == -1 && fd < 0);
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/targetdir.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/targetdir.h
new file mode 100644 (file)
index 0000000..1f9c835
--- /dev/null
@@ -0,0 +1,43 @@
+/* Target directory operands for coreutils
+
+   Copyright 2022-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+# error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef TARGETDIR_INLINE
+# define TARGETDIR_INLINE _GL_INLINE
+#endif
+
+/* Return a file descriptor open to FILE, for use in openat.
+   As an optimization, return AT_FDCWD if FILE must be the working directory.
+   As a side effect, possibly set *ST to the file's status.
+   Fail and set errno if FILE is not a directory.
+   On failure return -2 if AT_FDCWD is -1, -1 otherwise.  */
+extern int target_directory_operand (char const *file, struct stat *st);
+
+/* Return true if FD represents success for target_directory_operand.  */
+TARGETDIR_INLINE _GL_ATTRIBUTE_PURE bool
+target_dirfd_valid (int fd)
+{
+  return fd != -1 - (AT_FDCWD == -1);
+}
+
+_GL_INLINE_HEADER_END
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unicase/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unicase/.gitignore
deleted file mode 100644 (file)
index ec75a5e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/simple-mapping.h
-/tolower.c
-/tolower.h
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unictype/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unictype/.gitignore
deleted file mode 100644 (file)
index 0ac9456..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/bitmap.h
-/ctype_alnum.c
-/ctype_alnum.h
-/ctype_alpha.c
-/ctype_alpha.h
-/ctype_blank.c
-/ctype_blank.h
-/ctype_cntrl.c
-/ctype_cntrl.h
-/ctype_digit.c
-/ctype_digit.h
-/ctype_graph.c
-/ctype_graph.h
-/ctype_lower.c
-/ctype_lower.h
-/ctype_print.c
-/ctype_print.h
-/ctype_punct.c
-/ctype_punct.h
-/ctype_space.c
-/ctype_space.h
-/ctype_upper.c
-/ctype_upper.h
-/ctype_xdigit.c
-/ctype_xdigit.h
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unistr/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/unistr/.gitignore
deleted file mode 100644 (file)
index c98ca4c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/u-cpy.h
-/u-pcpy.h
-/u-strcat.h
-/u-strlen.h
-/u32-chr.c
-/u32-cpy.c
-/u32-pcpy.c
-/u32-strcat.c
-/u32-strlen.c
-/u8-mbtoucr.c
-/u8-uctomb-aux.c
-/u8-uctomb.c
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/uniwidth/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/uniwidth/.gitignore
deleted file mode 100644 (file)
index ba2320c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/cjk.h
-/width.c
-/width0.h
-/width2.h
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoimax.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoimax.c
new file mode 100644 (file)
index 0000000..d4bb18f
--- /dev/null
@@ -0,0 +1,6 @@
+#define __xdectoint xdectoimax
+#define __xnumtoint xnumtoimax
+#define __xdectoint_t intmax_t
+#define __xstrtol xstrtoimax
+#define __xdectoint_signed 1
+#include "xdectoint.c"
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoint.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoint.c
new file mode 100644 (file)
index 0000000..061a08c
--- /dev/null
@@ -0,0 +1,88 @@
+/* Convert decimal strings with bounds checking and exit on error.
+
+   Copyright (C) 2014-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "xdectoint.h"
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "error.h"
+#include "quote.h"
+#include "xstrtol.h"
+
+/* Parse numeric string N_STR of base BASE, and return the value.
+   Exit on parse error or if MIN or MAX are exceeded.
+   Strings can have multiplicative SUFFIXES if specified.
+   ERR is printed along with N_STR on error.  */
+
+__xdectoint_t
+__xnumtoint (char const *n_str, int base, __xdectoint_t min, __xdectoint_t max,
+             char const *suffixes, char const *err, int err_exit)
+{
+  strtol_error s_err;
+
+  __xdectoint_t tnum;
+  s_err = __xstrtol (n_str, nullptr, base, &tnum, suffixes);
+
+  if (s_err == LONGINT_OK)
+    {
+      if (tnum < min || max < tnum)
+        {
+          s_err = LONGINT_OVERFLOW;
+          /* Use have the INT range as a heuristic to distinguish
+             type overflow rather than other min/max limits.  */
+          if (tnum > INT_MAX / 2)
+            errno = EOVERFLOW;
+#if __xdectoint_signed
+          else if (tnum < INT_MIN / 2)
+            errno = EOVERFLOW;
+#endif
+          else
+            errno = ERANGE;
+        }
+    }
+  else if (s_err == LONGINT_OVERFLOW)
+    errno = EOVERFLOW;
+  else if (s_err == LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW)
+    errno = 0; /* Don't show ERANGE errors for invalid numbers.  */
+
+  if (s_err != LONGINT_OK)
+    {
+      /* EINVAL error message is redundant in this context.  */
+      error (err_exit ? err_exit : EXIT_FAILURE, errno == EINVAL ? 0 : errno,
+             "%s: %s", err, quote (n_str));
+      unreachable ();
+    }
+
+  return tnum;
+}
+
+/* Parse decimal string N_STR, and return the value.
+   Exit on parse error or if MIN or MAX are exceeded.
+   Strings can have multiplicative SUFFIXES if specified.
+   ERR is printed along with N_STR on error.  */
+
+__xdectoint_t
+__xdectoint (char const *n_str, __xdectoint_t min, __xdectoint_t max,
+             char const *suffixes, char const *err, int err_exit)
+{
+  return __xnumtoint (n_str, 10, min, max, suffixes, err, err_exit);
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoint.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoint.h
new file mode 100644 (file)
index 0000000..bc91933
--- /dev/null
@@ -0,0 +1,38 @@
+/* Convert decimal strings with bounds checking and exit on error.
+
+   Copyright (C) 2014-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef XDECTOINT_H_
+# define XDECTOINT_H_ 1
+
+# include <inttypes.h>
+
+# define _DECLARE_XDECTOINT(name, type) \
+  type name (char const *n_str, type min, type max, \
+             char const *suffixes, char const *err, int err_exit) \
+    _GL_ATTRIBUTE_NONNULL ((1, 5));
+# define _DECLARE_XNUMTOINT(name, type) \
+  type name (char const *n_str, int base, type min, type max, \
+             char const *suffixes, char const *err, int err_exit) \
+    _GL_ATTRIBUTE_NONNULL ((1, 6));
+
+_DECLARE_XDECTOINT (xdectoimax, intmax_t)
+_DECLARE_XDECTOINT (xdectoumax, uintmax_t)
+
+_DECLARE_XNUMTOINT (xnumtoimax, intmax_t)
+_DECLARE_XNUMTOINT (xnumtoumax, uintmax_t)
+
+#endif  /* not XDECTOINT_H_ */
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoumax.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xdectoumax.c
new file mode 100644 (file)
index 0000000..412ddf9
--- /dev/null
@@ -0,0 +1,6 @@
+#define __xdectoint xdectoumax
+#define __xnumtoint xnumtoumax
+#define __xdectoint_t uintmax_t
+#define __xstrtol xstrtoumax
+#define __xdectoint_signed 0
+#include "xdectoint.c"
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xfts.c b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xfts.c
new file mode 100644 (file)
index 0000000..3cb7761
--- /dev/null
@@ -0,0 +1,64 @@
+/* xfts.c -- a wrapper for fts_open
+
+   Copyright (C) 2003-2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <errno.h>
+
+#include "assure.h"
+#include "xalloc.h"
+#include "xfts.h"
+
+/* Fail with a proper diagnostic if fts_open fails.  */
+
+FTS *
+xfts_open (char * const *argv, int options,
+           int (*compar) (const FTSENT **, const FTSENT **))
+{
+  FTS *fts = fts_open (argv, options | FTS_CWDFD, compar);
+  if (fts == nullptr)
+    {
+      /* This can fail in two ways: out of memory or with errno==EINVAL,
+         which indicates it was called with invalid bit_flags.  */
+      affirm (errno != EINVAL);
+      xalloc_die ();
+    }
+
+  return fts;
+}
+
+/* When fts_read returns FTS_DC to indicate a directory cycle,
+   it may or may not indicate a real problem.  When a program like
+   chgrp performs a recursive traversal that requires traversing
+   symbolic links, it is *not* a problem.  However, when invoked
+   with "-P -R", it deserves a warning.  The fts_options member
+   records the options that control this aspect of fts's behavior,
+   so test that.  */
+bool
+cycle_warning_required (FTS const *fts, FTSENT const *ent)
+{
+#define ISSET(Fts,Opt) ((Fts)->fts_options & (Opt))
+  /* When dereferencing no symlinks, or when dereferencing only
+     those listed on the command line and we're not processing
+     a command-line argument, then a cycle is a serious problem. */
+  return ((ISSET (fts, FTS_PHYSICAL) && !ISSET (fts, FTS_COMFOLLOW))
+          || (ISSET (fts, FTS_PHYSICAL) && ISSET (fts, FTS_COMFOLLOW)
+              && ent->fts_level != FTS_ROOTLEVEL));
+}
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xfts.h b/gnulib-tool-tests/import-tests/test-coreutils-1.result/lib/xfts.h
new file mode 100644 (file)
index 0000000..dd40ad2
--- /dev/null
@@ -0,0 +1,11 @@
+#include "fts_.h"
+
+FTS *
+xfts_open (char * const *, int options,
+           int (*) (const FTSENT **, const FTSENT **))
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (fts_close, 1)
+  _GL_ATTRIBUTE_NONNULL ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+bool
+cycle_warning_required (FTS const *fts, FTSENT const *ent)
+  _GL_ATTRIBUTE_NONNULL () _GL_ATTRIBUTE_PURE;
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/.gitignore b/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/.gitignore
deleted file mode 100644 (file)
index 1b90d2c..0000000
+++ /dev/null
@@ -1,442 +0,0 @@
-/00gnulib.m4
-/__inline.m4
-/absolute-header.m4
-/access.m4
-/acl.m4
-/af_alg.m4
-/alignalloc.m4
-/alloca.m4
-/arpa_inet_h.m4
-/assert.m4
-/assert_h.m4
-/atoll.m4
-/autobuild.m4
-/backupfile.m4
-/base32.m4
-/base64.m4
-/bison.m4
-/btowc.m4
-/build-to-host.m4
-/builtin-expect.m4
-/byteswap.m4
-/c-bool.m4
-/c32rtomb.m4
-/calloc.m4
-/canon-host.m4
-/canonicalize.m4
-/chdir-long.m4
-/chmod.m4
-/chown.m4
-/clock_time.m4
-/close.m4
-/closedir.m4
-/codeset.m4
-/config-h.m4
-/configmake.m4
-/copy-file-range.m4
-/creat.m4
-/ctype_h.m4
-/cycle-check.m4
-/d-ino.m4
-/d-type.m4
-/dirent-safer.m4
-/dirent_h.m4
-/dirfd.m4
-/double-slash-root.m4
-/dup.m4
-/dup2.m4
-/eealloc.m4
-/environ.m4
-/errno_h.m4
-/error.m4
-/error_h.m4
-/euidaccess.m4
-/explicit_bzero.m4
-/exponentd.m4
-/exponentf.m4
-/exponentl.m4
-/extensions.m4
-/extern-inline.m4
-/faccessat.m4
-/fchdir.m4
-/fchmodat.m4
-/fchownat.m4
-/fclose.m4
-/fcntl-o.m4
-/fcntl-safer.m4
-/fcntl.m4
-/fcntl_h.m4
-/fdatasync.m4
-/fdopen.m4
-/fdopendir.m4
-/fflush.m4
-/fileblocks.m4
-/filemode.m4
-/filenamecat.m4
-/flexmember.m4
-/float_h.m4
-/fnmatch.m4
-/fnmatch_h.m4
-/fopen.m4
-/fpending.m4
-/fpieee.m4
-/fpurge.m4
-/freadahead.m4
-/freading.m4
-/freadptr.m4
-/freadseek.m4
-/free.m4
-/freopen.m4
-/frexp.m4
-/frexpl.m4
-/fseek.m4
-/fseeko.m4
-/fseterr.m4
-/fstat.m4
-/fstatat.m4
-/fstypename.m4
-/fsusage.m4
-/fsync.m4
-/ftell.m4
-/ftello.m4
-/ftruncate.m4
-/fts.m4
-/futimens.m4
-/getaddrinfo.m4
-/getcwd-abort-bug.m4
-/getcwd-path-max.m4
-/getcwd.m4
-/getdelim.m4
-/getdtablesize.m4
-/getgroups.m4
-/gethostname.m4
-/gethrxtime.m4
-/getline.m4
-/getloadavg.m4
-/getlogin.m4
-/getndelim2.m4
-/getopt.m4
-/getpagesize.m4
-/getprogname.m4
-/getrandom.m4
-/getrusage.m4
-/gettime.m4
-/gettimeofday.m4
-/getugroups.m4
-/gl-openssl.m4
-/gnulib-common.m4
-/gnulib-comp.m4
-/gnulib-tool.m4
-/group-member.m4
-/host-cpu-c-abi.m4
-/host-os.m4
-/hostent.m4
-/human.m4
-/i-ring.m4
-/iconv.m4
-/iconv_h.m4
-/iconv_open.m4
-/idcache.m4
-/include_next.m4
-/inet_ntop.m4
-/inet_pton.m4
-/inline.m4
-/intl-thread-locale.m4
-/intlmacosx.m4
-/intmax_t.m4
-/inttostr.m4
-/inttypes.m4
-/inttypes_h.m4
-/ioctl.m4
-/isapipe.m4
-/isatty.m4
-/isblank.m4
-/isnand.m4
-/isnanf.m4
-/isnanl.m4
-/iswblank.m4
-/iswctype.m4
-/iswdigit.m4
-/iswpunct.m4
-/iswxdigit.m4
-/jm-winsz1.m4
-/jm-winsz2.m4
-/langinfo_h.m4
-/largefile.m4
-/lchmod.m4
-/lchown.m4
-/lcmessage.m4
-/ldexpl.m4
-/lib-ignore.m4
-/lib-ld.m4
-/lib-link.m4
-/lib-prefix.m4
-/libgmp.m4
-/libunistring-base.m4
-/limits-h.m4
-/link-follow.m4
-/link.m4
-/linkat.m4
-/localcharset.m4
-/locale-fr.m4
-/locale-ja.m4
-/locale-tr.m4
-/locale-zh.m4
-/locale_h.m4
-/localeconv.m4
-/localename.m4
-/lock.m4
-/lseek.m4
-/lstat.m4
-/malloc.m4
-/malloca.m4
-/manywarnings-c++.m4
-/manywarnings.m4
-/math_h.m4
-/mbrlen.m4
-/mbrtoc32.m4
-/mbrtowc.m4
-/mbsinit.m4
-/mbslen.m4
-/mbsrtowcs.m4
-/mbstate_t.m4
-/mbswidth.m4
-/mbtowc.m4
-/md5.m4
-/memcasecmp.m4
-/memchr.m4
-/memcoll.m4
-/mempcpy.m4
-/memrchr.m4
-/memset_explicit.m4
-/mgetgroups.m4
-/minmax.m4
-/mkancesdirs.m4
-/mkdir-p.m4
-/mkdir.m4
-/mkdirat.m4
-/mkfifo.m4
-/mkfifoat.m4
-/mknod.m4
-/mkostemp.m4
-/mkstemp.m4
-/mktime.m4
-/mmap-anon.m4
-/mode_t.m4
-/modechange.m4
-/mountlist.m4
-/mpsort.m4
-/msvc-inval.m4
-/msvc-nothrow.m4
-/multiarch.m4
-/musl.m4
-/nan-mips.m4
-/nanosleep.m4
-/netdb_h.m4
-/netinet_in_h.m4
-/nl_langinfo.m4
-/nocrash.m4
-/nproc.m4
-/nstrftime.m4
-/nullptr.m4
-/obstack.m4
-/off_t.m4
-/open-cloexec.m4
-/open-slash.m4
-/open.m4
-/openat.m4
-/opendir.m4
-/parse-datetime.m4
-/pathmax.m4
-/perl.m4
-/perror.m4
-/physmem.m4
-/pid_t.m4
-/pipe.m4
-/pipe2.m4
-/posix-shell.m4
-/posix_memalign.m4
-/posixtm.m4
-/posixver.m4
-/printf-frexp.m4
-/printf-frexpl.m4
-/printf.m4
-/priv-set.m4
-/pselect.m4
-/pthread-cond.m4
-/pthread-mutex.m4
-/pthread-thread.m4
-/pthread_h.m4
-/pthread_mutex_timedlock.m4
-/pthread_rwlock_rdlock.m4
-/pthread_sigmask.m4
-/putenv.m4
-/qsort_r.m4
-/quote.m4
-/quotearg.m4
-/raise.m4
-/random.m4
-/random_r.m4
-/rawmemchr.m4
-/read-file.m4
-/read.m4
-/readdir.m4
-/readlink.m4
-/readlinkat.m4
-/readtokens.m4
-/readutmp.m4
-/realloc.m4
-/reallocarray.m4
-/regex.m4
-/remove.m4
-/rename.m4
-/renameat.m4
-/rewinddir.m4
-/rmdir.m4
-/rpmatch.m4
-/safe-read.m4
-/safe-write.m4
-/same.m4
-/save-cwd.m4
-/savedir.m4
-/savewd.m4
-/sched_h.m4
-/sched_yield.m4
-/secure_getenv.m4
-/select.m4
-/selinux-context-h.m4
-/selinux-label-h.m4
-/selinux-selinux-h.m4
-/semaphore.m4
-/servent.m4
-/setenv.m4
-/setlocale.m4
-/setlocale_null.m4
-/settime.m4
-/sha1.m4
-/sha256.m4
-/sha512.m4
-/sig2str.m4
-/sigaction.m4
-/signal_h.m4
-/signalblocking.m4
-/signbit.m4
-/size_max.m4
-/sleep.m4
-/sm3.m4
-/snan.m4
-/snprintf.m4
-/socketlib.m4
-/sockets.m4
-/socklen.m4
-/sockpfaf.m4
-/ssize_t.m4
-/stat-size.m4
-/stat-time.m4
-/stat.m4
-/std-gnu11.m4
-/stdalign.m4
-/stdarg.m4
-/stddef_h.m4
-/stdint.m4
-/stdint_h.m4
-/stdio_h.m4
-/stdlib_h.m4
-/stpcpy.m4
-/strdup.m4
-/strerror.m4
-/strerror_r.m4
-/string_h.m4
-/strnlen.m4
-/strsignal.m4
-/strstr.m4
-/strtoimax.m4
-/strtoll.m4
-/strtoull.m4
-/strtoumax.m4
-/symlink.m4
-/symlinkat.m4
-/sys_ioctl_h.m4
-/sys_random_h.m4
-/sys_resource_h.m4
-/sys_select_h.m4
-/sys_socket_h.m4
-/sys_stat_h.m4
-/sys_time_h.m4
-/sys_types_h.m4
-/sys_uio_h.m4
-/sys_utsname_h.m4
-/sys_wait_h.m4
-/systemd.m4
-/tempname.m4
-/termios_h.m4
-/thread.m4
-/threadlib.m4
-/time.m4
-/time_h.m4
-/time_r.m4
-/time_rz.m4
-/timegm.m4
-/timer_time.m4
-/timespec.m4
-/tls.m4
-/tm_gmtoff.m4
-/tmpdir.m4
-/tmpfile.m4
-/tzset.m4
-/uchar_h.m4
-/uname.m4
-/ungetc.m4
-/unicase_h.m4
-/unicodeio.m4
-/unictype_h.m4
-/uninorm_h.m4
-/unistd-safer.m4
-/unistd_h.m4
-/unlink-busy.m4
-/unlink.m4
-/unlinkat.m4
-/unlinkdir.m4
-/unlocked-io.m4
-/userspec.m4
-/usleep.m4
-/utime.m4
-/utime_h.m4
-/utimecmp.m4
-/utimens.m4
-/utimensat.m4
-/utimes.m4
-/vararrays.m4
-/vasnprintf.m4
-/vasprintf-posix.m4
-/vasprintf.m4
-/version-etc.m4
-/vfprintf-posix.m4
-/visibility.m4
-/vprintf-posix.m4
-/warn-on-use.m4
-/warnings.m4
-/wchar_h.m4
-/wchar_t.m4
-/wcrtomb.m4
-/wctob.m4
-/wctomb.m4
-/wctype.m4
-/wctype_h.m4
-/wcwidth.m4
-/wint_t.m4
-/wmemchr.m4
-/wmempcpy.m4
-/write-any-file.m4
-/write.m4
-/xalloc.m4
-/xattr.m4
-/xgetcwd.m4
-/xnanosleep.m4
-/xsize.m4
-/xstrtod.m4
-/xstrtol.m4
-/xvasprintf.m4
-/yesno.m4
-/yield.m4
-/zzgnulib.m4
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/c-strtod.m4 b/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/c-strtod.m4
new file mode 100644 (file)
index 0000000..aa53958
--- /dev/null
@@ -0,0 +1,54 @@
+# c-strtod.m4 serial 19.1
+
+# Copyright (C) 2004-2006, 2009-2024 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.
+
+# Written by Paul Eggert.
+
+dnl Prerequisites of lib/c-strtod.c.
+AC_DEFUN([gl_C_STRTOD],
+[
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([gt_FUNC_USELOCALE])
+  gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
+
+  AC_CHECK_HEADERS_ONCE([xlocale.h])
+  dnl We can't use AC_CHECK_FUNC here, because strtod_l() is defined as a
+  dnl static inline function when compiling for Android 7.1 or older.
+  AC_CACHE_CHECK([for strtod_l], [gl_cv_func_strtod_l],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stdlib.h>
+            #include <locale.h>
+            #if HAVE_XLOCALE_H
+            # include <xlocale.h>
+            #endif
+            locale_t loc;
+          ]],
+          [[char *end;
+            return strtod_l("0",&end,loc) < 0.0;
+          ]])
+       ],
+       [gl_cv_func_strtod_l=yes],
+       [gl_cv_func_strtod_l=no])
+    ])
+  if test $gl_cv_func_strtod_l = yes; then
+    HAVE_STRTOD_L=1
+  else
+    HAVE_STRTOD_L=0
+  fi
+  AC_DEFINE_UNQUOTED([HAVE_STRTOD_L], [$HAVE_STRTOD_L],
+    [Define to 1 if the system has the 'strtod_l' function.])
+])
+
+dnl Prerequisites of lib/c-strtold.c.
+AC_DEFUN([gl_C_STRTOLD],
+[
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([gt_FUNC_USELOCALE])
+  gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
+
+  gl_CHECK_FUNCS_ANDROID([strtold_l], [[#include <stdlib.h>]])
+])
index 292ac031aebca986c95532f2673d988948e534b9..26e058a8a111d362c74b7e709acfc0f57fe80aab 100644 (file)
@@ -28,7 +28,8 @@
 
 # Specification in the form of a command-line invocation:
 # gnulib-tool --import \
-#  --lib=libgnu \
+#  --local-dir=gl \
+#  --lib=libcoreutils \
 #  --source-base=lib \
 #  --m4-base=m4 \
 #  --doc-base=doc \
 #  yesno
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
-gl_LOCAL_DIR([])
+gl_LOCAL_DIR([gl])
 gl_MODULES([
   acl
   alignalloc
@@ -624,7 +625,7 @@ gl_PO_BASE([])
 gl_DOC_BASE([doc])
 gl_TESTS_BASE([gnulib-tests])
 gl_WITH_TESTS
-gl_LIB([libgnu])
+gl_LIB([libcoreutils])
 gl_MAKEFILE_NAME([gnulib.mk])
 gl_AUTOMAKE_SUBDIR
 gl_MACRO_PREFIX([gl])
index 378eadf45313b7bef0f4efce55892906d62281f6..d90363d7eb010c10bab8c59ef6496e9a7962687a 100644 (file)
@@ -104,6 +104,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module btoc32-tests:
   # Code from module btowc:
   # Code from module btowc-tests:
+  # Code from module buffer-lcm:
   # Code from module builtin-expect:
   # Code from module byteswap:
   # Code from module byteswap-tests:
@@ -115,6 +116,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module c-strcaseeq:
   # Code from module c-strcasestr:
   # Code from module c-strcasestr-tests:
+  # Code from module c-strtod:
+  # Code from module c-strtold:
   # Code from module c32_apply_type_test:
   # Code from module c32_apply_type_test-tests:
   # Code from module c32_get_type_test:
@@ -167,6 +170,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module chown:
   # Code from module chown-tests:
   # Code from module chownat:
+  # Code from module cl-strtod:
+  # Code from module cl-strtold:
   # Code from module clock-time:
   # Code from module cloexec:
   # Code from module cloexec-tests:
@@ -250,6 +255,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module extern-inline:
   # Code from module faccessat:
   # Code from module faccessat-tests:
+  # Code from module fadvise:
+  # Code from module fadvise-tests:
   # Code from module fchdir:
   # Code from module fchdir-tests:
   # Code from module fchmodat:
@@ -265,6 +272,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module fcntl-safer-tests:
   # Code from module fcntl-tests:
   # Code from module fd-hook:
+  # Code from module fd-reopen:
   # Code from module fd-safer-flag:
   # Code from module fdatasync:
   # Code from module fdatasync-tests:
@@ -422,6 +430,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module hash-triple:
   # Code from module hash-triple-simple:
   # Code from module havelib:
+  # Code from module heap:
   # Code from module host-os:
   # Code from module hostent:
   # Code from module human:
@@ -667,10 +676,14 @@ AC_DEFUN([gl_EARLY],
   # Code from module quotearg-simple-tests:
   # Code from module raise:
   # Code from module raise-tests:
+  # Code from module randint:
   # Code from module random:
   # Code from module random-tests:
   # Code from module random_r:
   # Code from module random_r-tests:
+  # Code from module randperm:
+  # Code from module randread:
+  # Code from module randread-tests:
   # Code from module rawmemchr:
   # Code from module rawmemchr-tests:
   # Code from module read:
@@ -705,6 +718,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module rewinddir:
   # Code from module rmdir:
   # Code from module rmdir-tests:
+  # Code from module root-dev-ino:
   # Code from module root-uid:
   # Code from module rpmatch:
   # Code from module safe-read:
@@ -744,8 +758,10 @@ AC_DEFUN([gl_EARLY],
   # Code from module sigprocmask:
   # Code from module sigprocmask-tests:
   # Code from module size_max:
+  # Code from module skipchars:
   # Code from module sleep:
   # Code from module sleep-tests:
+  # Code from module smack:
   # Code from module snan:
   # Code from module snippet/_Noreturn:
   # Code from module snippet/arg-nonnull:
@@ -798,11 +814,16 @@ AC_DEFUN([gl_EARLY],
   # Code from module strnlen:
   # Code from module strnlen-tests:
   # Code from module strnlen1:
+  # Code from module strnumcmp:
   # Code from module strsignal:
   # Code from module strsignal-tests:
   # Code from module strstr-simple:
+  # Code from module strtod:
+  # Code from module strtod-tests:
   # Code from module strtoimax:
   # Code from module strtoimax-tests:
+  # Code from module strtold:
+  # Code from module strtold-tests:
   # Code from module strtoll:
   # Code from module strtoll-tests:
   # Code from module strtoull:
@@ -835,6 +856,7 @@ AC_DEFUN([gl_EARLY],
   # Code from module sys_utsname-tests:
   # Code from module sys_wait:
   # Code from module sys_wait-tests:
+  # Code from module targetdir:
   # Code from module tempname:
   # Code from module termios:
   # Code from module termios-tests:
@@ -1006,6 +1028,8 @@ AC_DEFUN([gl_EARLY],
   # Code from module xalloc-die-tests:
   # Code from module xalloc-oversized:
   # Code from module xbinary-io:
+  # Code from module xdectoint:
+  # Code from module xfts:
   # Code from module xgetcwd:
   # Code from module xgetgroups:
   # Code from module xgethostname:
@@ -1093,6 +1117,8 @@ AC_DEFUN([gl_INIT],
   gl_BYTESWAP
   gl_CONDITIONAL_HEADER([byteswap.h])
   AC_PROG_MKDIR_P
+  gl_C_STRTOD
+  gl_C_STRTOLD
   gl_UCHAR_MODULE_INDICATOR([c32_apply_type_test])
   gl_UCHAR_MODULE_INDICATOR([c32_get_type_test])
   AC_REQUIRE([gl_UCHAR_H])
@@ -1217,6 +1243,8 @@ AC_DEFUN([gl_INIT],
                  [test $REPLACE_CHOWN = 1 && test $ac_cv_func_fchown = no])
   gl_UNISTD_MODULE_INDICATOR([chown])
   gl_MODULE_INDICATOR([chownat]) dnl for lib/openat.h
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([AC_C_RESTRICT])
   gl_CLOCK_TIME
   gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
   gl_FUNC_CLOSE
@@ -1311,6 +1339,7 @@ AC_DEFUN([gl_INIT],
   ])
   gl_MODULE_INDICATOR([faccessat])
   gl_UNISTD_MODULE_INDICATOR([faccessat])
+  AC_CHECK_FUNCS_ONCE([posix_fadvise])
   gl_FUNC_FCHDIR
   gl_CONDITIONAL([GL_COND_OBJ_FCHDIR],
                  [test $HAVE_FCHDIR = 0 || test $REPLACE_FCHDIR = 1])
@@ -2238,6 +2267,26 @@ AC_DEFUN([gl_INIT],
   ])
   gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
   gl_SIZE_MAX
+  # Check whether libsmack is available
+  LIB_SMACK=
+  AC_ARG_ENABLE([libsmack],
+    AS_HELP_STRING([--disable-libsmack], [disable libsmack support]))
+  if test "X$enable_libsmack" != "Xno"; then
+    AC_CHECK_LIB([smack], [smack_new_label_from_self],
+      [AC_CHECK_LIB([smack], [smack_new_label_from_path],
+        [AC_CHECK_HEADER([sys/smack.h],
+          [LIB_SMACK=-lsmack
+           AC_DEFINE([HAVE_SMACK], [1], [libsmack usability])]
+        )])])
+    if test "X$LIB_SMACK" = "X"; then
+      if test "X$enable_libsmack" = "Xyes"; then
+        AC_MSG_ERROR([libsmack library was not found or not usable])
+      fi
+    fi
+  else
+    AC_MSG_WARN([libsmack support disabled by user])
+  fi
+  AC_SUBST([LIB_SMACK])
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
   gl_MODULE_INDICATOR([snprintf])
@@ -2357,6 +2406,13 @@ AC_DEFUN([gl_INIT],
     AC_LIBOBJ([strstr])
   fi
   gl_STRING_MODULE_INDICATOR([strstr])
+  gl_FUNC_STRTOD
+  gl_CONDITIONAL([GL_COND_OBJ_STRTOD],
+                 [test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1])
+  AM_COND_IF([GL_COND_OBJ_STRTOD], [
+    gl_PREREQ_STRTOD
+  ])
+  gl_STDLIB_MODULE_INDICATOR([strtod])
   gl_FUNC_STRTOIMAX
   gl_CONDITIONAL([GL_COND_OBJ_STRTOIMAX],
                  [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1])
@@ -2364,6 +2420,13 @@ AC_DEFUN([gl_INIT],
     gl_PREREQ_STRTOIMAX
   ])
   gl_INTTYPES_MODULE_INDICATOR([strtoimax])
+  gl_FUNC_STRTOLD
+  gl_CONDITIONAL([GL_COND_OBJ_STRTOLD],
+                 [test $HAVE_STRTOLD = 0 || test $REPLACE_STRTOLD = 1])
+  AM_COND_IF([GL_COND_OBJ_STRTOLD], [
+    gl_PREREQ_STRTOLD
+  ])
+  gl_STDLIB_MODULE_INDICATOR([strtold])
   gl_FUNC_STRTOLL
   gl_CONDITIONAL([GL_COND_OBJ_STRTOLL],
                  [test $HAVE_STRTOLL = 0 || test $REPLACE_STRTOLL = 1])
@@ -3026,6 +3089,10 @@ changequote([, ])dnl
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
+  gt_LOCALE_FR
+  gt_LOCALE_FR_UTF8
+  gt_LOCALE_FR
+  gt_LOCALE_FR_UTF8
   AC_CHECK_FUNCS_ONCE([shutdown])
   gl_THREAD
   AC_CHECK_HEADERS([sys/single_threaded.h])
@@ -3118,10 +3185,10 @@ changequote([, ])dnl
     AC_SUBST([gltests_LIBOBJDEPS], [$gltests_libobjdeps])
   ])
   AC_REQUIRE([gl_CC_GNULIB_WARNINGS])
-  LIBGNU_LIBDEPS="$gl_libdeps"
-  AC_SUBST([LIBGNU_LIBDEPS])
-  LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
-  AC_SUBST([LIBGNU_LTLIBDEPS])
+  LIBCOREUTILS_LIBDEPS="$gl_libdeps"
+  AC_SUBST([LIBCOREUTILS_LIBDEPS])
+  LIBCOREUTILS_LTLIBDEPS="$gl_ltlibdeps"
+  AC_SUBST([LIBCOREUTILS_LTLIBDEPS])
   LIBTESTS_LIBDEPS="$gltests_libdeps"
   AC_SUBST([LIBTESTS_LIBDEPS])
 ])
@@ -3251,6 +3318,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/boot-time-aux.h
   lib/btoc32.c
   lib/btowc.c
+  lib/buffer-lcm.c
+  lib/buffer-lcm.h
   lib/byteswap.in.h
   lib/c++defs.h
   lib/c-ctype.c
@@ -3260,6 +3329,9 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/c-strcasecmp.c
   lib/c-strcaseeq.h
   lib/c-strncasecmp.c
+  lib/c-strtod.c
+  lib/c-strtod.h
+  lib/c-strtold.c
   lib/c32_apply_type_test.c
   lib/c32_get_type_test.c
   lib/c32is-impl.h
@@ -3292,6 +3364,9 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/chmodat.c
   lib/chown.c
   lib/chownat.c
+  lib/cl-strtod.c
+  lib/cl-strtod.h
+  lib/cl-strtold.c
   lib/cloexec.c
   lib/cloexec.h
   lib/close-stream.c
@@ -3341,6 +3416,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/exitfail.h
   lib/explicit_bzero.c
   lib/faccessat.c
+  lib/fadvise.c
+  lib/fadvise.h
   lib/fchdir.c
   lib/fchmodat.c
   lib/fchown-stub.c
@@ -3352,6 +3429,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/fcntl.in.h
   lib/fd-hook.c
   lib/fd-hook.h
+  lib/fd-reopen.c
+  lib/fd-reopen.h
   lib/fd-safer-flag.c
   lib/fd-safer.c
   lib/fdatasync.c
@@ -3475,6 +3554,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/hash-triple.h
   lib/hash.c
   lib/hash.h
+  lib/heap.c
+  lib/heap.h
   lib/human.c
   lib/human.h
   lib/i-ring.c
@@ -3695,6 +3776,14 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/quotearg.c
   lib/quotearg.h
   lib/raise.c
+  lib/rand-isaac.c
+  lib/rand-isaac.h
+  lib/randint.c
+  lib/randint.h
+  lib/randperm.c
+  lib/randperm.h
+  lib/randread.c
+  lib/randread.h
   lib/rawmemchr.c
   lib/rawmemchr.valgrind
   lib/read-file.c
@@ -3724,6 +3813,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/renameatu.h
   lib/rewinddir.c
   lib/rmdir.c
+  lib/root-dev-ino.c
+  lib/root-dev-ino.h
   lib/root-uid.h
   lib/rpmatch.c
   lib/safe-read.c
@@ -3780,9 +3871,12 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/signbitl.c
   lib/sigprocmask.c
   lib/size_max.h
+  lib/skipchars.c
+  lib/skipchars.h
   lib/sm3-stream.c
   lib/sm3.c
   lib/sm3.h
+  lib/smack.h
   lib/snprintf.c
   lib/sockets.c
   lib/sockets.h
@@ -3815,14 +3909,20 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/strerror.c
   lib/strftime.h
   lib/string.in.h
+  lib/strintcmp.c
   lib/stripslash.c
   lib/strnlen.c
   lib/strnlen1.c
   lib/strnlen1.h
+  lib/strnumcmp-in.h
+  lib/strnumcmp.c
+  lib/strnumcmp.h
   lib/strsignal.c
   lib/strstr.c
+  lib/strtod.c
   lib/strtoimax.c
   lib/strtol.c
+  lib/strtold.c
   lib/strtoll.c
   lib/strtoul.c
   lib/strtoull.c
@@ -3842,6 +3942,8 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/sys_uio.in.h
   lib/sys_utsname.in.h
   lib/sys_wait.in.h
+  lib/targetdir.c
+  lib/targetdir.h
   lib/tempname.c
   lib/tempname.h
   lib/termios.in.h
@@ -3985,6 +4087,12 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/xasprintf.c
   lib/xbinary-io.c
   lib/xbinary-io.h
+  lib/xdectoimax.c
+  lib/xdectoint.c
+  lib/xdectoint.h
+  lib/xdectoumax.c
+  lib/xfts.c
+  lib/xfts.h
   lib/xgetaname-impl.h
   lib/xgetcwd.c
   lib/xgetcwd.h
@@ -4040,6 +4148,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/builtin-expect.m4
   m4/byteswap.m4
   m4/c-bool.m4
+  m4/c-strtod.m4
   m4/c32rtomb.m4
   m4/calloc.m4
   m4/canon-host.m4
@@ -4184,6 +4293,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/lchmod.m4
   m4/lchown.m4
   m4/lcmessage.m4
+  m4/ldexp.m4
   m4/ldexpl.m4
   m4/lib-ignore.m4
   m4/lib-ld.m4
@@ -4368,7 +4478,9 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/strnlen.m4
   m4/strsignal.m4
   m4/strstr.m4
+  m4/strtod.m4
   m4/strtoimax.m4
+  m4/strtold.m4
   m4/strtoll.m4
   m4/strtoull.m4
   m4/strtoumax.m4
@@ -4599,6 +4711,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-exclude8.sh
   tests/test-explicit_bzero.c
   tests/test-faccessat.c
+  tests/test-fadvise.c
   tests/test-fchdir.c
   tests/test-fchmodat.c
   tests/test-fchownat.c
@@ -4884,6 +4997,7 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-quotearg-simple.c
   tests/test-quotearg.h
   tests/test-raise.c
+  tests/test-rand-isaac.c
   tests/test-random-mt.c
   tests/test-random.c
   tests/test-random_r.c
@@ -4955,7 +5069,13 @@ AC_DEFUN([gl_FILE_LIST], [
   tests/test-string.c
   tests/test-strnlen.c
   tests/test-strsignal.c
+  tests/test-strtod.c
+  tests/test-strtod1.c
+  tests/test-strtod1.sh
   tests/test-strtoimax.c
+  tests/test-strtold.c
+  tests/test-strtold1.c
+  tests/test-strtold1.sh
   tests/test-strtoll.c
   tests/test-strtoull.c
   tests/test-strtoumax.c
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/ldexp.m4 b/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/ldexp.m4
new file mode 100644 (file)
index 0000000..cfa9894
--- /dev/null
@@ -0,0 +1,104 @@
+# ldexp.m4 serial 2
+dnl Copyright (C) 2010-2024 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_LDEXP],
+[
+  AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_ISNAND]) dnl for ISNAND_LIBM
+
+  AC_REQUIRE([gl_CHECK_LDEXP_NO_LIBM])
+  LDEXP_LIBM=
+  if test $gl_cv_func_ldexp_no_libm = no; then
+    AC_CACHE_CHECK([whether ldexp() can be used with libm],
+      [gl_cv_func_ldexp_in_libm],
+      [
+        save_LIBS="$LIBS"
+        LIBS="$LIBS -lm"
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES
+                             # define __NO_MATH_INLINES 1 /* for glibc */
+                             #endif
+                             #include <math.h>
+                             double (*funcptr) (double, int) = ldexp;
+                             double x;]],
+                           [[return ldexp (x, -1) > 0;]])],
+          [gl_cv_func_ldexp_in_libm=yes],
+          [gl_cv_func_ldexp_in_libm=no])
+        LIBS="$save_LIBS"
+      ])
+    if test $gl_cv_func_ldexp_in_libm = yes; then
+      LDEXP_LIBM=-lm
+    fi
+  fi
+
+  save_LIBS="$LIBS"
+  LIBS="$LIBS $LDEXP_LIBM"
+  gl_FUNC_LDEXP_WORKS
+  LIBS="$save_LIBS"
+  case "$gl_cv_func_ldexp_works" in
+    *yes) ;;
+    *) REPLACE_LDEXP=1 ;;
+  esac
+
+  if test $REPLACE_LDEXP = 1; then
+    dnl Find libraries needed to link lib/ldexp.c.
+    LDEXP_LIBM="$ISNAND_LIBM"
+  fi
+  AC_SUBST([LDEXP_LIBM])
+])
+
+dnl Test whether ldexp() can be used without linking with libm.
+dnl Set gl_cv_func_ldexp_no_libm to 'yes' or 'no' accordingly.
+AC_DEFUN([gl_CHECK_LDEXP_NO_LIBM],
+[
+  AC_CACHE_CHECK([whether ldexp() can be used without linking with libm],
+    [gl_cv_func_ldexp_no_libm],
+    [
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([[#ifndef __NO_MATH_INLINES
+                           # define __NO_MATH_INLINES 1 /* for glibc */
+                           #endif
+                           #include <math.h>
+                           double (*funcptr) (double, int) = ldexp;
+                           double x;]],
+                         [[return ldexp (x, -1) > 0;]])],
+        [gl_cv_func_ldexp_no_libm=yes],
+        [gl_cv_func_ldexp_no_libm=no])
+    ])
+])
+
+dnl Test whether ldexp() works (this fails on OpenBSD 7.3/mips64).
+AC_DEFUN([gl_FUNC_LDEXP_WORKS],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CACHE_CHECK([whether ldexp works], [gl_cv_func_ldexp_works],
+    [
+      AC_RUN_IFELSE(
+        [AC_LANG_SOURCE([[
+#include <math.h>
+int main()
+{
+  int result = 0;
+  {
+    volatile double x = 1.9269695883136991774e-308;
+    volatile double y = ldexp (x, 0);
+    if (y != x)
+      result |= 1;
+  }
+  return result;
+}]])],
+        [gl_cv_func_ldexp_works=yes],
+        [gl_cv_func_ldexp_works=no],
+        [case "$host_os" in
+           openbsd*)          gl_cv_func_ldexp_works="guessing no" ;;
+                              # Guess yes on native Windows.
+           mingw* | windows*) gl_cv_func_ldexp_works="guessing yes" ;;
+           *)                 gl_cv_func_ldexp_works="guessing yes" ;;
+         esac
+        ])
+    ])
+])
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/strtod.m4 b/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/strtod.m4
new file mode 100644 (file)
index 0000000..a5c20f3
--- /dev/null
@@ -0,0 +1,144 @@
+# strtod.m4 serial 29
+dnl Copyright (C) 2002-2003, 2006-2024 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_STRTOD],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  m4_ifdef([gl_FUNC_STRTOD_OBSOLETE], [
+    dnl Test whether strtod is declared.
+    dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess
+    dnl when cross-compiling.
+    dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the
+    dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro.
+    AC_CHECK_DECLS_ONCE([strtod])
+    if test $ac_cv_have_decl_strtod != yes; then
+      HAVE_STRTOD=0
+    fi
+  ])
+  if test $HAVE_STRTOD = 1; then
+    AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works],
+      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#include <math.h>
+#include <errno.h>
+/* Compare two numbers with ==.
+   This is a separate function because IRIX 6.5 "cc -O" miscompiles an
+   'x == x' test.  */
+static int
+numeric_equal (double x, double y)
+{
+  return x == y;
+}
+]], [[
+  int result = 0;
+  {
+    /* In some old versions of Linux (2000 or before), strtod mis-parses
+       strings with leading '+'.  */
+    const char *string = " +69";
+    char *term;
+    double value = strtod (string, &term);
+    if (value != 69 || term != (string + 4))
+      result |= 1;
+  }
+  {
+    /* Under Solaris 2.4, strtod returns the wrong value for the
+       terminating character under some conditions.  */
+    const char *string = "NaN";
+    char *term;
+    strtod (string, &term);
+    if (term != string && *(term - 1) == 0)
+      result |= 2;
+  }
+  {
+    /* Older glibc and Cygwin mis-parse "-0x".  */
+    const char *string = "-0x";
+    char *term;
+    double value = strtod (string, &term);
+    double zero = 0.0;
+    if (1.0 / value != -1.0 / zero || term != (string + 2))
+      result |= 4;
+  }
+  {
+    /* Many platforms do not parse hex floats.  */
+    const char *string = "0XaP+1";
+    char *term;
+    double value = strtod (string, &term);
+    if (value != 20.0 || term != (string + 6))
+      result |= 8;
+  }
+  {
+    /* Many platforms do not parse infinities.  HP-UX 11.31 parses inf,
+       but mistakenly sets errno.  */
+    const char *string = "inf";
+    char *term;
+    double value;
+    errno = 0;
+    value = strtod (string, &term);
+    if (value != HUGE_VAL || term != (string + 3) || errno)
+      result |= 16;
+  }
+  {
+    /* glibc 2.7 and cygwin 1.5.24 misparse "nan()".  */
+    const char *string = "nan()";
+    char *term;
+    double value = strtod (string, &term);
+    if (numeric_equal (value, value) || term != (string + 5))
+      result |= 32;
+  }
+  {
+    /* darwin 10.6.1 misparses "nan(".  */
+    const char *string = "nan(";
+    char *term;
+    double value = strtod (string, &term);
+    if (numeric_equal (value, value) || term != (string + 3))
+      result |= 64;
+  }
+  return result;
+]])],
+        [gl_cv_func_strtod_works=yes],
+        [gl_cv_func_strtod_works=no],
+        [dnl The last known bugs in glibc strtod(), as of this writing,
+         dnl were fixed in version 2.8
+         AC_EGREP_CPP([Lucky user],
+           [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
+  Lucky user
+ #endif
+#endif
+           ],
+           [gl_cv_func_strtod_works="guessing yes"],
+           [case "$host_os" in
+                                  # Guess yes on musl systems.
+              *-musl* | midipix*) gl_cv_func_strtod_works="guessing yes" ;;
+                                  # Guess yes on native Windows.
+              mingw* | windows*)  gl_cv_func_strtod_works="guessing yes" ;;
+              *)                  gl_cv_func_strtod_works="$gl_cross_guess_normal" ;;
+            esac
+           ])
+        ])
+      ])
+    case "$gl_cv_func_strtod_works" in
+      *yes) ;;
+      *)
+        REPLACE_STRTOD=1
+        ;;
+    esac
+  fi
+])
+
+# Prerequisites of lib/strtod.c.
+AC_DEFUN([gl_PREREQ_STRTOD], [
+  AC_REQUIRE([gl_CHECK_LDEXP_NO_LIBM])
+  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
+  gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
+])
diff --git a/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/strtold.m4 b/gnulib-tool-tests/import-tests/test-coreutils-1.result/m4/strtold.m4
new file mode 100644 (file)
index 0000000..32e3f40
--- /dev/null
@@ -0,0 +1,149 @@
+# strtold.m4 serial 9
+dnl Copyright (C) 2002-2003, 2006-2024 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_STRTOLD],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_FUNCS_ONCE([strtold])
+  if test $ac_cv_func_strtold != yes; then
+    HAVE_STRTOLD=0
+  else
+    AC_CACHE_CHECK([whether strtold obeys POSIX], [gl_cv_func_strtold_works],
+      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#include <math.h>
+#include <errno.h>
+/* Compare two numbers with ==.
+   This is a separate function because IRIX 6.5 "cc -O" miscompiles an
+   'x == x' test.  */
+static int
+numeric_equal (long double x, long double y)
+{
+  return x == y;
+}
+]], [[
+  int result = 0;
+  {
+    /* Under Solaris 2.4, strtod returns the wrong value for the
+       terminating character under some conditions.  */
+    const char *string = "NaN";
+    char *term;
+    strtold (string, &term);
+    if (term != string && *(term - 1) == 0)
+      result |= 1;
+  }
+  {
+    /* Older glibc and Cygwin mis-parse "-0x".  */
+    const char *string = "-0x";
+    char *term;
+    long double value = strtold (string, &term);
+    long double zero = 0.0L;
+    if (1.0L / value != -1.0L / zero || term != (string + 2))
+      result |= 2;
+  }
+  {
+    /* IRIX 6.5, mingw do not parse hex floats.  */
+    const char *string = "0XaP+1";
+    char *term;
+    long double value = strtold (string, &term);
+    if (value != 20.0L || term != (string + 6))
+      result |= 4;
+  }
+  {
+    /* IRIX 6.5 does not parse infinities.  HP-UX 11.31/ia64 parses inf,
+       but mistakenly sets errno.  */
+    const char *string = "inf";
+    char *term;
+    long double value;
+    errno = 0;
+    value = strtold (string, &term);
+    if (value != HUGE_VAL || term != (string + 3) || errno)
+      result |= 8;
+  }
+  {
+    /* glibc-2.3.2, IRIX 6.5, mingw, Haiku misparse "nan()".  */
+    const char *string = "nan()";
+    char *term;
+    long double value = strtold (string, &term);
+    if (numeric_equal (value, value) || term != (string + 5))
+      result |= 16;
+  }
+  {
+    /* Mac OS X 10.5, IRIX 6.5 misparse "nan(".  */
+    const char *string = "nan(";
+    char *term;
+    long double value = strtold (string, &term);
+    if (numeric_equal (value, value) || term != (string + 3))
+      result |= 32;
+  }
+  {
+    /* In Cygwin 2.9, strtold does not set errno upon underflow.  */
+    const char *string = "1E-100000";
+    char *term;
+    long double value;
+    errno = 0;
+    value = strtold (string, &term);
+    if (term != (string + 9) || (value == 0.0L && errno != ERANGE))
+      result |= 64;
+  }
+  return result;
+]])],
+        [gl_cv_func_strtold_works=yes],
+        [if expr $? '>=' 64 >/dev/null; then
+           gl_cv_func_strtold_works="no (underflow problem)"
+         else
+           gl_cv_func_strtold_works=no
+         fi
+        ],
+        [dnl The last known bugs in glibc strtold(), as of this writing,
+         dnl were fixed in version 2.8
+         AC_EGREP_CPP([Lucky user],
+           [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
+  Lucky user
+ #endif
+#endif
+           ],
+           [gl_cv_func_strtold_works="guessing yes"],
+           [case "$host_os" in
+                                  # Guess yes on musl systems.
+              *-musl* | midipix*) gl_cv_func_strtold_works="guessing yes" ;;
+                                  # Guess 'no (underflow problem)' on Cygwin.
+              cygwin*)            gl_cv_func_strtold_works="guessing no (underflow problem)" ;;
+              *)                  gl_cv_func_strtold_works="$gl_cross_guess_normal" ;;
+            esac
+           ])
+        ])
+      ])
+    case "$gl_cv_func_strtold_works" in
+      *yes) ;;
+      *)
+        REPLACE_STRTOLD=1
+        case "$gl_cv_func_strtold_works" in
+          *"no (underflow problem)")
+            AC_DEFINE([STRTOLD_HAS_UNDERFLOW_BUG], [1],
+              [Define to 1 if strtold does not set errno upon underflow.])
+            ;;
+        esac
+        ;;
+    esac
+  fi
+])
+
+# Prerequisites of lib/strtold.c.
+AC_DEFUN([gl_PREREQ_STRTOLD], [
+  AC_REQUIRE([gl_CHECK_LDEXPL_NO_LIBM])
+  if test $gl_cv_func_ldexpl_no_libm = yes; then
+    AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
+      [Define if the ldexpl function is available in libc.])
+  fi
+  gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
+])
index 23c1bc031da18609a491b8e860b9949c364ea293..47882bb93f31a1cf9761d9cfefc59df41183b0f1 100755 (executable)
@@ -1,6 +1,20 @@
 #!/bin/sh
 . ../init.sh
-do_import_test coreutils-20240101 . "--tests-base=gnulib-tests --with-tests --makefile-name=gnulib.mk --automake-subdir --import `echo '
+do_import_test coreutils-20240101 . "`echo '
+  --no-changelog
+  --aux-dir=build-aux
+  --doc-base=doc
+  --lib=libcoreutils
+  --m4-base=m4/
+  --source-base=lib/
+  --tests-base=tests
+  --local-dir=gl
+
+  --tests-base=gnulib-tests
+  --with-tests
+  --makefile-name=gnulib.mk
+  --automake-subdir
+  --import
   --avoid=canonicalize-lgpl
   --avoid=dummy
   --avoid=mbuiter